site-header {
    display: block;
    position: relative;
    z-index: 99999;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto !important;
    box-sizing: border-box !important;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: transparent;
    z-index: 10000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: -1;
    transition: var(--transition);
}

header.scrolled::before {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

body.has-dark-hero header:not(.scrolled)::before {
    background: rgba(0, 10, 30, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.has-dark-hero header:not(.scrolled) {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.has-dark-hero header:not(.scrolled) .logo-img {
    filter: brightness(0) invert(1);
}

@media (min-width: 1025px) {
    body.has-dark-hero header:not(.scrolled) #site-nav > ul > li > a {
        color: rgba(255, 255, 255, 0.9);
    }

    body.has-dark-hero header:not(.scrolled) .has-dropdown::after {
        color: rgba(255, 255, 255, 0.7);
    }
}

body.has-dark-hero header:not(.scrolled) .hamburger span {
    background-color: #ffffff;
}

header.scrolled {
    height: 70px;
}

.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    gap: 1.2rem;
    flex-wrap: nowrap;
}

nav ul li a {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

nav ul li a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    position: relative; /* CRITICAL: Enables z-index stacking */
    z-index: 10005;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition);
}

header.scrolled .hamburger span {
    background-color: var(--text-color);
}

.hamburger.is-active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* =============================================
   MOBILE NAV  (≤1024px)
   ============================================= */
@media (max-width: 1024px) {

    /* Hamburger button */
    .hamburger {
        display: flex;
        pointer-events: auto !important;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 20000;
        cursor: pointer;
    }

    /* Full-screen slide-in overlay */
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        display: block;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 15000;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    nav.active {
        transform: translateX(0);
    }

    /* Top-level list */
    nav > ul {
        display: block !important;
        list-style: none;
        margin: 0;
        padding: 80px 0 60px;
        width: 100%;
    }

    /* Each top-level item */
    nav > ul > li {
        display: block !important;
        width: 100%;
        border-bottom: 1px solid rgba(0, 41, 136, 0.08);
    }

    nav > ul > li:first-child {
        border-top: 1px solid rgba(0, 41, 136, 0.08);
    }

    /* All top-level links — flex row to push indicator right */
    nav > ul > li > a {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
        font-size: 1rem;
        font-weight: 700;
        color: #1a1a2e;
        letter-spacing: 0.04em;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }

    /* Hide the desktop underline hover pseudo */
    nav ul li a::after {
        display: none !important;
    }

    /* Dropdown parent li — reset to block, no flex weirdness */
    .has-dropdown {
        display: block !important;
        position: static !important;
        align-items: unset !important;
    }

    /* Hide desktop ▼ indicator */
    .has-dropdown::after {
        display: none !important;
    }

    /* Mobile arrow indicator - must reset all desktop ::after hover underline styles */
    .has-dropdown > a::after {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        content: '\25bc' !important; /* Down-pointing triangle ▼ */
        font-size: 0.75rem;
        line-height: 1;
        color: #1a1a2e;
        flex-shrink: 0;
        opacity: 0.5;
        position: static !important;
        transform: none !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        transition: transform 0.3s ease !important;
    }

    .has-dropdown.is-open > a::after {
        transform: rotate(180deg) !important;
    }

    /* Sub-menu: smooth accordion */
    .dropdown-menu {
        display: block !important;
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        border-radius: 0;
        background: #f4f6fb;
        padding: 0 !important;
        margin: 0;
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }

    .has-dropdown.is-open > .dropdown-menu {
        opacity: 1;
        max-height: 350px;
    }

    /* Sub-menu list items */
    .dropdown-menu li {
        display: block !important;
        list-style: none;
        width: 100%;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .dropdown-menu li a {
        display: block !important;
        padding: 13px 24px 13px 40px !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        color: #002988 !important;
        text-decoration: none;
        border: none !important;
        background: none !important;
        opacity: 0.85;
        letter-spacing: 0.02em;
        width: 100%;
        box-sizing: border-box;
    }

    .dropdown-menu li a::after,
    .dropdown-menu li a::before {
        display: none !important;
    }
}

/* =============================================
   DESKTOP NAV  (>1024px)
   ============================================= */
@media (min-width: 1025px) {

    .has-dropdown {
        position: relative;
        display: flex;
        align-items: center;
    }

    .has-dropdown::after {
        content: '▼';
        font-size: 0.6rem;
        margin-left: 5px;
        opacity: 0.6;
        transition: var(--transition);
    }

    .has-dropdown:hover::after {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        background: #fff;
        min-width: 220px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        list-style: none;
        padding: 15px 0;
        transition: all 0.3s ease;
        border-radius: 8px;
        z-index: 11000;
        display: block;
        width: max-content;
        white-space: nowrap;
    }

    .has-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .dropdown-menu li {
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .dropdown-menu li a {
        padding: 12px 25px !important;
        display: block !important;
        width: auto;
        color: var(--smhc-navy);
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

    .dropdown-menu li a:hover {
        background-color: var(--smhc-blue-light);
        color: var(--smhc-navy);
    }

    .dropdown-menu li a::after {
        display: none;
    }
}
