/*------------------------------------------------------------------
    MODERN 2-ROW HEADER
    Inspired by Star City Games - Row 1: Logo/Search/Actions, Row 2: Nav
-------------------------------------------------------------------*/

/* ==================== HEADER CONTAINER ==================== */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #0d0d0d 0%, #111111 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    min-width: 320px;
    /* Smart scroll behavior */
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modern-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

/* Header hidden state - slides up out of view */
.modern-header.header-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

/* Header visible state - ensure it's shown */
.modern-header.header-visible {
    transform: translateY(0);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .modern-header {
        transition: none !important;
        transform: none !important;
    }

    .modern-header.header-hidden {
        display: none; /* Instantly hide instead of animate */
    }
}

/* ==================== ROW 1: LOGO, SEARCH, CART, LOGIN ==================== */
.header-top-row {
    background: linear-gradient(180deg, #0d0d0d 0%, #111111 100%);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(46, 204, 113, 0.15);
}

.header-top-row .container-fluid {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Logo */
.modern-brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    text-decoration: none;
    margin: 0 !important;
    padding: 0;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    height: 50px;
    width: 60px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    color: #2ecc71;
    font-family: var(--font-display);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 400;
    font-family: var(--font-brand-title);
    letter-spacing: 0.1em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #2ecc71;
}

.brand-subtitle {
    font-size: 0.625rem;
    font-weight: 400;
    font-family: var(--font-brand-subtitle);
    letter-spacing: 0.2em;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-top: 0.125rem;
}

.modern-brand:hover .brand-title {
    color: #27ae60;
}

/* Mobile Search Toggle Button (Hidden on Desktop) */
.mobile-search-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #2ecc71;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.mobile-search-toggle:hover {
    color: #27ae60;
    transform: scale(1.1);
}

.mobile-search-toggle:focus {
    outline: none;
}

/* Mobile Toggler (Hidden on Desktop) */
.mobile-toggler {
    display: none;
}

/* Search Bar - Main */
.header-search-main {
    flex: 1 1 auto;
    max-width: 100%;
}

.header-search-main .search-input-wrapper {
    position: relative;
    width: 100%;
}

.header-search-main input[type="text"] {
    width: 100%;
    height: 42px;
    padding: 0.5rem 3rem 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 21px;
    color: #ffffff;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.header-search-main input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.header-search-main input[type="text"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.header-search-main .search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #2ecc71;
    font-size: 1.125rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-search-main .search-btn:hover {
    color: #27ae60;
    transform: translateY(-50%) scale(1.1);
}

/* Search Actions (Advanced Search & Sell to us) - Desktop Right Side */
.search-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

/* Search Exact Name Checkbox - Desktop */
.search-exact-checkbox {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.search-exact-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.search-exact-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(46, 204, 113, 0.4);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-exact-checkbox input[type="checkbox"]:hover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.search-exact-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
}

.search-exact-checkbox input[type="checkbox"]:checked::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.search-exact-checkbox span {
    color: #bdc3c7;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.search-exact-checkbox label:hover span {
    color: #2ecc71;
}

/* Search Exact Name Checkbox - Mobile (Hidden on Desktop) */
.search-exact-checkbox-mobile {
    display: none;
    margin-top: 0.75rem;
}

.search-exact-checkbox-mobile label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.search-exact-checkbox-mobile input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(46, 204, 113, 0.4);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-exact-checkbox-mobile input[type="checkbox"]:hover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.search-exact-checkbox-mobile input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
}

.search-exact-checkbox-mobile input[type="checkbox"]:checked::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
}

.search-exact-checkbox-mobile span {
    color: #bdc3c7;
    font-size: 0.9375rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.search-exact-checkbox-mobile label:hover span {
    color: #2ecc71;
}

.search-actions .search-link {
    color: #bdc3c7;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.search-actions .search-link:hover {
    color: #2ecc71;
}

.search-actions .sell-to-us-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    white-space: nowrap;
}

.search-actions .sell-to-us-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
    transform: translateY(-2px);
}

/* User Actions (Cart, Login) */
.header-user-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-actions .action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3c7;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.header-user-actions .action-link i {
    font-size: 1.75rem;
    transition: color 0.2s ease;
}

.header-user-actions .action-link:hover {
    color: #2ecc71;
}

.header-user-actions .action-link:hover i {
    color: #2ecc71;
}

.header-user-actions #cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

.header-user-actions .action-dropdown .dropdown-menu {
    background: #1a1a1a;
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0.375rem;
    min-width: 180px;
    margin-top: 0.5rem;
}

.header-user-actions .dropdown-item {
    color: #bdc3c7;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.625rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.header-user-actions .dropdown-item:hover {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
}

/* ==================== ROW 2: NAVIGATION LINKS ==================== */
.gh-navbar {
    background-color: transparent !important;
    padding: 0.5rem 0;
}

.gh-navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.navbar-collapse {
    flex-grow: 0;
}

#navbars-host {
    margin: 0 auto !important;
}

#navbars-host .navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

#navbars-host .navbar-nav.navbar-right {
    margin-right: auto !important;
}

#navbars-host .navbar-nav .nav-link i.fas {
    font-size: 1.25rem !important;
}

.navbar-nav {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

/* User Actions - Cart & Login (Now in Top Row) */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.navbar-left .nav-link {
    color: #bdc3c7 !important;
    font-family: var(--font-primary);
    font-size: 0.875rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem !important;
    margin: 0;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-left .nav-link:hover {
    color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.08);
}

.navbar-left .nav-cart i,
.navbar-left .nav-wishlist i {
    font-size: 1.25rem;
}

.navbar-left .nav-wishlist:hover {
    color: #e74c3c !important;
}

.navbar-left .nav-login {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.navbar-left .nav-login:hover {
    background: rgba(46, 204, 113, 0.25);
    border-color: #2ecc71;
}

/* Cart Badge */
#cart-badge-nav {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    display: none;
}

#cart-badge-nav.has-items {
    display: block;
}

/* Wishlist Badge */
#wishlist-badge-nav {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    display: none;
}

#wishlist-badge-nav.has-items {
    display: block;
}

.navbar-left .nav-dropdown {
    position: relative;
}


.navbar-left .dropdown-menu {
    background: #1a1a1a;
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0.375rem;
    min-width: 180px;
    margin-top: 0.25rem;
    z-index: 1060 !important; /* Higher than Bootstrap modal (1050) */
}

/* Show dropdown when Bootstrap adds the 'show' class */
.navbar-left .dropdown-menu.show {
    display: block;
}

.navbar-left .dropdown-item {
    color: #ffffff !important; /* Bright white for readability */
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.625rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.navbar-left .dropdown-item:hover {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71 !important;
}

.navbar-nav .nav-link {
    color: #bdc3c7 !important;
    font-family: var(--font-primary);
    font-size: 0.875rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1.25rem !important;
    margin: 0 0.125rem;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
}

.navbar-nav .nav-link::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 2px;
    background: #2ecc71;
    transition: transform 0.25s ease;
}

.navbar-nav .nav-link:hover {
    color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.08);
}

.navbar-nav .nav-link:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.navbar-nav .nav-link.active {
    color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.12);
}

.navbar-nav .nav-link.active::before {
    transform: translateX(-50%) scaleX(1);
}

/* Dropdown Menus - Desktop Hover */
.navbar-nav .dropdown-menu {
    background: #1a1a1a;
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 0.375rem;
    margin-top: 0;
    min-width: 200px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* Dropdown hover - simple and universal */
.navbar-nav .nav-item.dropdown {
    position: relative;
}

/* Desktop: Show dropdown on hover */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

.navbar-nav .dropdown-item {
    color: #ffffff !important; /* Bright white for maximum readability */
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.625rem 1rem;
    border-radius: 0;
    transition: all 0.2s ease;
    margin: 0.125rem 0;
}

.navbar-nav .dropdown-menu > li:hover {
    background-color: unset !important;
}
.navbar-nav .dropdown-item:hover {
    background: linear-gradient(
        90deg,
        rgba(46, 204, 113, 0.25),
        rgba(46, 204, 113, 0.15)
    ) !important;
    /* background-color: rgba(46, 204, 113, 0.12) !important; */
    color: #2ecc71 !important; /* Green text on hover for contrast */
    padding-left: 1.25rem;
    box-shadow: inset 3px 0 0 #2ecc71; /* Green accent bar */
    font-weight: 600; /* Slightly bolder on hover */
}

/* Nested submenus (second level) */
.navbar-nav .dropdown-menu .dropdown-menu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    margin-left: -0.25rem;
}

.navbar-nav .dropdown-item.has-submenu {
    position: relative;
}

.navbar-nav .dropdown-item.has-submenu::after {
    content: "\f054"; /* Font Awesome right arrow */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 1rem;
    opacity: 0.6;
}

/* Desktop: Nested submenu hover */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu li:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }

    .navbar-nav .dropdown-menu li.has-submenu {
        position: relative;
    }
}

/* ==================== MOBILE HAMBURGER ==================== */
.modern-toggler {
    border: none;
    padding: 0.5rem;
    background: transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modern-toggler:hover {
    background: rgba(46, 204, 113, 0.1);
}

.modern-toggler:focus {
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.3);
    outline: none;
}

.toggler-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: #2ecc71;
    border-radius: 2px;
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* Hamburger Animation */
.modern-toggler.collapsed .toggler-icon {
    transform: none;
    opacity: 1;
}

.modern-toggler:not(.collapsed) .toggler-icon:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.modern-toggler:not(.collapsed) .toggler-icon:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.modern-toggler:not(.collapsed) .toggler-icon:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==================== BODY PADDING ==================== */
body {
    padding-top: 130px; /* Account for 2-row header */
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 991px) {
    /* Mobile: Use hover to expand dropdowns */
    .navbar-nav .dropdown-menu {
        display: none;
        opacity: 0;
        visibility: hidden;
        background: unset !important;
    }

    /* Show dropdown on hover on mobile too */
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu,
    .navbar-nav .dropdown-menu li:hover > .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        background: unset !important;
    }

    body {
        padding-top: 65px; /* Reduced - only Row 1 on mobile */
    }

    .header-top-row {
        padding: 0.5rem 0;
    }

    .header-top-row .container-fluid {
        gap: 0.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
        position: relative;
    }

    .brand-logo {
        height: 40px;
        width: 48px;
    }

    .brand-title {
        font-size: 1rem;
        font-family: var(--font-brand-title);
        font-weight: 400;
    }

    .brand-subtitle {
        font-size: 0.5rem;
        font-family: var(--font-brand-subtitle);
        font-weight: 400;
    }

    /* Show mobile search toggle button */
    .mobile-search-toggle {
        display: block;
        margin-left: auto;
    }

    /* Show hamburger beside logo */
    .mobile-toggler {
        display: block;
        margin-left: 0.5rem;
    }

    /* Hide search actions on mobile */
    .search-actions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%);
        border-bottom: 1px solid rgba(46, 204, 113, 0.15);
        padding: 1rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        z-index: 997;
        display: none;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0;
    }

    .header-search-main.active + .search-actions {
        display: flex;
    }

    /* Mobile: Stack search actions vertically */
    .search-exact-checkbox {
        width: 100%;
        justify-content: flex-start;
    }

    .search-actions .search-link,
    .search-actions .sell-to-us-btn {
        width: 100%;
        text-align: center;
        display: block;
    }

    /* Hide search bar by default on mobile */
    .header-search-main {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%);
        border-bottom: 1px solid rgba(46, 204, 113, 0.15);
        padding: 1rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        z-index: 998;
        display: none;
    }

    .header-search-main.active {
        display: block;
        animation: slideDownNavbar 0.25s ease-out;
    }

    .header-search-main input[type="text"] {
        height: 42px;
        font-size: 0.9375rem;
    }

    /* Show mobile checkbox, hide desktop checkbox */
    .search-exact-checkbox-mobile {
        display: block;
    }

    .search-exact-checkbox {
        display: none !important;
    }

    /* Hide Row 2 navbar on mobile */
    .gh-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 0;
        overflow: visible;
        padding: 0 !important;
        background: transparent !important;
        z-index: 995;
    }

    .gh-navbar .container-fluid {
        position: relative;
        height: 0;
        padding: 0;
    }

    /* User actions stay visible on mobile (now in top row) */
    .navbar-left {
        display: flex;
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    .navbar-left .nav-link {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.625rem !important;
    }

    .navbar-left .nav-cart i {
        font-size: 1.125rem;
    }

    /* Navigation Links Dropdown (inside hamburger) */
    .navbar-collapse {
        position: fixed;
        top: 65px !important;
        left: 0;
        right: 0;
        width: 100%;
        background: linear-gradient(180deg, #0f0f0f 0%, #151515 100%);
        border: 1px solid rgba(46, 204, 113, 0.15);
        border-top: none;
        border-radius: 0 0 8px 8px;
        padding: 0.75rem 1rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        max-height: calc(100vh - 65px);
        overflow-y: auto;
        z-index: 995;
    }

    /* Ensure positioning stays correct during collapse transition */
    .navbar-collapse.collapsing {
        position: fixed !important;
        top: 65px !important;
        left: 0;
        right: 0;
        width: 100%;
        transition: height 0.25s ease;
    }

    .navbar-nav {
        padding: 0.25rem 0;
        flex-direction: column;
        width: 100%;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        font-size: 0.9375rem !important;
        padding: 0.75rem 1rem !important;
        margin: 0.125rem 0;
        border-left: 3px solid transparent;
        border-radius: 0 4px 4px 0;
        width: 100%;
        display: block;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        border-left-color: #2ecc71;
        background: rgba(46, 204, 113, 0.12);
    }

    /* Active dropdown toggle on mobile */
    .navbar-nav .nav-link.dropdown-toggle.active-dropdown {
        background: rgba(46, 204, 113, 0.15);
        border-left-color: #2ecc71;
        color: #ffffff !important;
    }

    .navbar-nav .nav-link::before {
        display: none;
    }

    .navbar-nav .dropdown-menu {
        background: rgba(26, 26, 26, 0.8);
        border: none;
        border-left: 2px solid rgba(46, 204, 113, 0.3);
        border-radius: 0 4px 4px 0;
        margin-left: 0.75rem;
        margin-top: 0.375rem;
        box-shadow: none;
        position: static;
        width: calc(100% - 0.75rem);
    }

    .navbar-nav .dropdown-item {
        width: 100%;
        color: #ffffff !important; /* Bright white for mobile readability */
    }

    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:active {
        color: #2ecc71 !important; /* Green on hover/active */
        background: linear-gradient(
            90deg,
            rgba(46, 204, 113, 0.25),
            rgba(46, 204, 113, 0.15)
        ) !important;
        font-weight: 600;
    }

    /* Ensure all text in dropdown items has consistent color on mobile */
    .navbar-nav .dropdown-menu a,
    .navbar-nav .dropdown-menu span {
        color: #ffffff !important;
    }

    .navbar-nav .dropdown-menu a:hover,
    .navbar-nav .dropdown-menu a:active {
        color: #2ecc71 !important;
        background: linear-gradient(
            90deg,
            rgba(46, 204, 113, 0.25),
            rgba(46, 204, 113, 0.15)
        );
        font-weight: 600;
    }

    /* Nested submenus on mobile - stack and indent */
    .navbar-nav .dropdown-menu .dropdown-menu {
        position: static;
        margin-left: 1rem;
        margin-top: 0.25rem;
        border-left: 2px solid rgba(46, 204, 113, 0.2);
        width: calc(100% - 1rem);
        background: rgba(10, 10, 10, 0.9);
    }

    .navbar-nav .dropdown-item.has-submenu::after {
        content: "\f078"; /* Font Awesome down arrow for mobile */
        right: 0.5rem;
        transition: transform 0.2s ease;
    }

    /* Active dropdown state on mobile */
    .navbar-nav .dropdown-item.active-dropdown {
        background: rgba(46, 204, 113, 0.15);
        color: #ffffff !important;
    }

    .navbar-nav .dropdown-item.active-dropdown.has-submenu::after {
        transform: rotate(180deg); /* Flip arrow when open */
    }

    /* Custom scrollbar */
    .navbar-collapse::-webkit-scrollbar {
        width: 4px;
    }

    .navbar-collapse::-webkit-scrollbar-track {
        background: rgba(46, 204, 113, 0.05);
    }

    .navbar-collapse::-webkit-scrollbar-thumb {
        background: #2ecc71;
        border-radius: 10px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 65px;
    }

    .header-top-row .container-fluid {
        gap: 0.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .brand-container {
        gap: 0.5rem;
    }

    .brand-logo {
        height: 35px;
        width: 42px;
    }

    .brand-title {
        font-size: 0.875rem;
        font-family: var(--font-brand-title);
        font-weight: 400;
    }

    .brand-subtitle {
        font-size: 0.45rem;
        font-family: var(--font-brand-subtitle);
        font-weight: 400;
    }

    .header-search-main input[type="text"] {
        height: 36px;
        font-size: 0.8125rem;
        padding-left: 0.75rem;
    }

    .header-user-actions .action-link i {
        font-size: 1.375rem;
    }

    /* Compact user actions on small mobile */
    .navbar-left .nav-login span {
        display: none; /* Hide "LOGIN" text on very small screens */
    }

    .navbar-left .nav-login::before {
        content: "\f2bd"; /* Font Awesome user icon */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        font-size: 1.125rem;
    }

    .navbar-left .nav-link {
        padding: 0.375rem !important;
        min-width: auto;
    }
}

/* ==================== PERFORMANCE & ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    .modern-header,
    .brand-logo,
    .brand-text,
    .nav-link,
    .toggler-icon {
        transition: none !important;
    }
}

/* ==================== SMOOTH ANIMATIONS ==================== */
@keyframes slideDownNavbar {
    from {
        opacity: 1;
    }
    to {
        opacity: 1;
    }
}

.navbar-collapse.show {
    animation: slideDownNavbar 0.25s ease-out;
}
