/**
 * Mega Menu Styles for "SN PHM"
 * Theme: Flatsome Child
 * All selectors scoped strictly to .vst-mega-* or body.vst-has-mega-menu
 */

/* ==========================================================================
   DESKTOP STYLES (Breakpoint: min-width 769px matching Max Mega Menu)
   ========================================================================== */
@media (min-width: 769px) {

    /* 1. Suppress the old Max Mega Menu default dropdown when our custom mega menu is active.
          !important is required here to override Max Mega Menu's high-specificity ID selectors. */
    body.vst-has-mega-menu #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item-44250 > ul.mega-sub-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* 2. Highlight "SN PHM" navbar item while the mega menu is open */
    body.vst-has-mega-menu #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item-44250.vst-item-active > a.mega-menu-link {
        background-color: rgba(255, 255, 255, 0.18);
        color: #ffffff;
        position: relative;
    }

    /* 3. The Full-Width Mega Menu Panel */
    .vst-mega-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 99999;
        box-sizing: border-box;

        /* Smooth slide & fade transition */
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                    visibility 0.2s;
        pointer-events: none;
    }

    .vst-mega-panel.vst-mega-open {
        display: block !important;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* 4. Inner Container */
    .vst-mega-panel .vst-mega-container {
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 36px 40px 42px 40px;
        box-sizing: border-box;
    }

    /* 5. 6 Equal Columns Side by Side */
    .vst-mega-panel .vst-mega-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 20px;
        align-items: start;
    }

    /* 6. Individual Column & Thin Vertical Dividers */
    .vst-mega-panel .vst-mega-col {
        display: flex;
        flex-direction: column;
        border-right: 1px solid #ECECEC;
        padding-right: 16px;
        min-width: 0;
    }

    .vst-mega-panel .vst-mega-col:last-child {
        border-right: none;
        padding-right: 0;
    }

    /* 7. Column Heading */
    .vst-mega-panel .vst-mega-col-heading {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: #0B6FB8;
        transition: opacity 0.2s ease;
        margin-bottom: 2px;
    }

    .vst-mega-panel .vst-mega-col-heading:hover {
        opacity: 0.85;
    }

    .vst-mega-panel .vst-mega-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #0B6FB8;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .vst-mega-panel .vst-mega-icon svg {
        display: block;
        stroke: #0B6FB8;
    }

    .vst-mega-panel .vst-mega-title {
        font-family: inherit;
        font-size: 13.5px;
        font-weight: 700;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        color: #0B6FB8;
        line-height: 1.35;
        white-space: normal;
        word-break: break-word;
    }

    /* 8. Short Blue Underline */
    .vst-mega-panel .vst-mega-underline {
        display: block;
        width: 32px;
        height: 2px;
        background-color: #0B6FB8;
        margin: 8px 0 14px 0;
        border-radius: 1px;
    }

    /* 9. Sub-Item List */
    .vst-mega-panel .vst-mega-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .vst-mega-panel .vst-mega-list li {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .vst-mega-panel .vst-mega-list a {
        display: flex;
        align-items: center;
        font-size: 13px;
        color: #4A4A4A;
        line-height: 1.45;
        padding: 6px 0;
        text-decoration: none;
        transition: color 0.15s ease, transform 0.15s ease;
        white-space: normal;
        word-break: break-word;
    }

    /* Hover arrow  effect */
    .vst-mega-panel .vst-mega-list a::before {
        content: "";
        display: inline-block;
        opacity: 0;
        width: 0;
        margin-right: 0;
        color: #0B6FB8;
        font-weight: 700;
        font-size: 14px;
        line-height: 1;
        transition: all 0.15s ease;
    }

    .vst-mega-panel .vst-mega-list a:hover {
        color: #0B6FB8;
        transform: translateX(3px);
    }

    .vst-mega-panel .vst-mega-list a:hover::before {
        opacity: 1;
        width: 7px;
        margin-right: 5px;
    }
}

/* ==========================================================================
   MOBILE & TABLET STYLES (Breakpoint: max-width 768px matching Max Mega Menu)
   ========================================================================== */
@media (max-width: 768px) {
    /* Hide the custom mega menu completely on mobile/tablet.
       !important is required here to ensure no desktop inline or panel styles reveal it on small screens. */
    .vst-mega-panel {
        display: none !important;
    }
}
