/*-- ================================================================
     NOBO NAVBAR — Complete Fixed Version
     ✓ Dynamic Blade menus (your original @foreach loops)
     ✓ Recent search history (localStorage)
     ✓ Responsive dropdown accordion FIXED
     ✓ Both bars fixed on scroll
     ================================================================ --*/


/* ── FIXED HEADER ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

body {
    padding-top: 112px;
}

/* ══════════════════════════════
   SEARCH BAR
══════════════════════════════ */
.top-search-bar {
    background: var(--navy);
    height: 46px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.top-search-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Search wrapper — relative so dropdown sits below it */
.search-wrap {
    flex: 1;
    max-width: 520px;
    position: relative;
}

.search-group {
    display: flex;
    align-items: center;
    height: 32px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 6px;
    overflow: visible;
    /* allow dropdown to escape */
    transition: border-color .2s, box-shadow .2s;
    position: relative;
    z-index: 2;
}

/* When input focused AND has recent searches, show rounded-top only */
.search-wrap.has-results .search-group {
    border-radius: 6px 6px 0 0;
    border-bottom-color: rgba(255, 255, 255, .06);
    box-shadow: none;
}

.search-group:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, .22);
    background: rgba(255, 255, 255, .1);
}

.search-wrap.has-results .search-group:focus-within {
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: none;
}

/* Inner input row */
.search-input-row {
    display: flex;
    align-items: center;
    width: 100%;
    height: 32px;
    overflow: hidden;
    border-radius: 6px;
}

.search-input-row input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 12px;
    height: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, .9);
    caret-color: var(--blue);
    min-width: 0;
}

.search-input-row input::placeholder {
    color: rgba(255, 255, 255, .28);
}

#topSearchBtn {
    height: 32px;
    padding: 0 14px;
    background: var(--blue);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .02em;
    transition: background .15s;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 0 5px 5px 0;
}

#topSearchBtn:hover {
    background: var(--blue2);
}

/* ── Recent Search Dropdown ── */
.search-history-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a2840;
    border: 1px solid var(--blue);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.search-wrap.has-results .search-history-dropdown {
    display: block;
}

.search-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 4px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .3);
}

.search-history-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 107, 0, .8);
    padding: 2px 4px;
    border-radius: 3px;
    transition: color .15s;
}

.search-history-clear:hover {
    color: var(--orange);
}

.search-history-list {
    list-style: none;
    padding: 4px 8px 8px;
}

.search-history-list li a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    transition: background .12s, color .12s;
    cursor: pointer;
}

.search-history-list li a:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.search-history-list li a svg {
    opacity: .4;
    flex-shrink: 0;
}

.search-history-list li a:hover svg {
    opacity: .7;
}

.search-history-list li a .del-btn {
    margin-left: auto;
    opacity: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .1);
    flex-shrink: 0;
    transition: opacity .15s, background .15s;
}

.search-history-list li a:hover .del-btn {
    opacity: 1;
}

.search-history-list li a .del-btn:hover {
    background: rgba(220, 53, 69, .3);
}

.search-history-empty {
    padding: 10px 12px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, .25);
    text-align: center;
}

/* Promo */
.search-promo {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, .32);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.search-promo strong {
    color: var(--orange);
    font-weight: 600;
}

@media(max-width: 768px) {
    .search-promo {
        display: none;
    }
}

@media(max-width: 500px) {
    .top-search-container {
        padding: 0 16px;
    }

    .search-wrap {
        max-width: none;
    }
}

/* ══════════════════════════════
   NAVBAR
══════════════════════════════ */
.navbar {
    height: 66px;
    background: #fff;
    border-bottom: 1px solid var(--gray200);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 32px;
    flex-shrink: 0;
    transition: opacity .15s;
}

.nav-logo:hover {
    opacity: .85;
}

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

.logo-text {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.03em;
}

.logo-text em {
    color: var(--blue);
    font-style: normal;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

/* ── DESKTOP: hover-based dropdowns ── */
@media(min-width: 961px) {

    .m-section {
        display: none;
    }

    /* hide mobile labels on desktop */

    .dropdown {
        position: relative;
    }

    .dropdown-trigger {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 7px 12px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        color: var(--gray800);
        text-decoration: none;
        cursor: pointer;
        white-space: nowrap;
        border: none;
        background: none;
        font-family: 'Inter', sans-serif;
        transition: color .15s, background .15s;
        position: relative;
    }

    .dropdown-trigger svg.chevron {
        opacity: .4;
        transition: transform .2s, opacity .15s;
        flex-shrink: 0;
    }

    .dropdown-trigger::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--blue);
        border-radius: 2px 2px 0 0;
        transform: translateX(-50%);
        transition: width .2s;
    }

    .dropdown:hover .dropdown-trigger {
        color: var(--blue);
        background: rgba(24, 119, 242, .06);
    }

    .dropdown:hover .dropdown-trigger::after {
        width: calc(100% - 16px);
    }

    .dropdown:hover .dropdown-trigger svg.chevron {
        transform: rotate(180deg);
        opacity: .85;
    }

    /* Panel */
    .dropdown-menu {
        position: absolute;
        top: calc(100% + 5px);
        left: 50%;
        transform: translateX(-50%) translateY(6px);
        min-width: 228px;
        background: #fff;
        border: 1px solid var(--gray200);
        border-radius: 12px;
        padding: 6px;
        list-style: none;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .17s ease, transform .17s ease, visibility .17s;
        z-index: 500;
    }

    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 9px;
        height: 9px;
        background: #fff;
        border-left: 1px solid var(--gray200);
        border-top: 1px solid var(--gray200);
    }

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

    .dropdown-menu li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 13.5px;
        font-weight: 400;
        color: var(--gray600);
        text-decoration: none;
        transition: background .12s, color .12s, padding-left .15s;
    }

    .dropdown-menu li a:hover {
        background: rgba(24, 119, 242, .06);
        color: var(--blue);
        padding-left: 14px;
    }

    .d-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
        background: var(--gray100);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gray400);
        flex-shrink: 0;
        transition: background .12s, color .12s;
    }

    .dropdown-menu li a:hover .d-icon {
        background: rgba(24, 119, 242, .1);
        color: var(--blue);
    }

    .sep-row {
        border-top: 1px solid var(--gray100);
        margin-top: 4px;
        padding-top: 4px;
    }

    .sep-row a {
        color: var(--blue) !important;
        font-weight: 600 !important;
        font-size: 13px !important;
    }

    .sep-row-arrow {
        margin-left: auto;
        opacity: .45;
        transition: opacity .12s, transform .18s;
    }

    .sep-row a:hover .sep-row-arrow {
        opacity: 1;
        transform: translateX(3px);
    }

    /* Plain links */
    .nav-links>a {
        padding: 7px 12px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        color: var(--gray800);
        text-decoration: none;
        transition: color .15s, background .15s;
        white-space: nowrap;
    }

    .nav-links>a:hover {
        color: var(--orange);
        background: rgba(255, 107, 0, .06);
    }
}

/* ── NAV ACTIONS ── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray600);
    border: none;
    background: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.nav-icon-btn:hover {
    background: var(--gray100);
    color: var(--gray800);
}

.nav-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 16px;
    height: 16px;
    background: var(--orange);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 107, 0, .4);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--gray200);
    margin: 0 4px;
}

/* Hamburger */
.hamburger {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4.5px;
    transition: background .15s;
}

.hamburger:hover {
    background: var(--gray100);
}

.hamburger span {
    display: block;
    height: 1.8px;
    background: var(--gray600);
    border-radius: 2px;
    transition: transform .28s cubic-bezier(.23, 1, .32, 1), opacity .2s, width .2s;
}

.hamburger span:nth-child(1) {
    width: 18px;
}

.hamburger span:nth-child(2) {
    width: 12px;
}

.hamburger span:nth-child(3) {
    width: 18px;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(6.3px) rotate(45deg);
    width: 18px;
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-6.3px) rotate(-45deg);
}

/* ══════════════════════════════
   MOBILE DRAWER
══════════════════════════════ */
@media(max-width: 960px) {

    body {
        padding-top: 112px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 112px;
        right: 0;
        bottom: 0;
        width: min(300px, 84vw);
        background: #fff;
        border-left: 1px solid var(--gray200);
        box-shadow: -4px 0 24px rgba(0, 0, 0, .1);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 14px 32px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform .27s cubic-bezier(.23, 1, .32, 1);
        visibility: hidden;
        z-index: 900;
    }

    .nav-links.open {
        transform: translateX(0);
        visibility: visible;
    }

    /* Section labels */
    .m-section {
        display: block;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--gray400);
        padding: 14px 8px 5px;
    }

    /* Dropdown trigger — full width pill */
    .dropdown {
        width: 100%;
        margin-bottom: 2px;
    }

    .dropdown-trigger {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        color: var(--gray800);
        background: var(--gray50);
        border: 1px solid transparent;
        cursor: pointer;
        font-family: 'Inter', sans-serif;
        transition: background .15s, color .15s, border-color .15s;
        text-decoration: none;
        position: static;
        /* remove ::after positioning issues */
    }

    /* Chevron in mobile trigger */
    .dropdown-trigger svg.chevron {
        opacity: .4;
        transition: transform .25s, opacity .15s;
        flex-shrink: 0;
    }

    .dropdown-trigger::after {
        display: none !important;
    }

    /* kill underline bar */

    /* Open state */
    .dropdown.open>.dropdown-trigger {
        color: var(--blue);
        background: rgba(24, 119, 242, .07);
        border-color: rgba(24, 119, 242, .15);
    }

    .dropdown.open>.dropdown-trigger svg.chevron {
        transform: rotate(180deg);
        opacity: .85;
    }

    /* Dropdown menu — inline accordion
       ONLY use display:none/block. No opacity/visibility/transform clashes. */
    .dropdown>.dropdown-menu {
        display: none !important;
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        box-shadow: none;
        border: 1px solid var(--gray100);
        border-radius: 8px;
        background: var(--gray50);
        margin: 4px 0 6px;
        padding: 5px;
        list-style: none;
        transition: none;
    }

    .dropdown-menu::before {
        display: none !important;
    }

    .dropdown.open>.dropdown-menu {
        display: block !important;
    }

    /* Menu items in mobile */
    .dropdown-menu li a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        border-radius: 8px;
        font-size: 13.5px;
        font-weight: 400;
        color: var(--gray600);
        text-decoration: none;
        transition: background .12s, color .12s;
    }

    .dropdown-menu li a:hover {
        background: rgba(24, 119, 242, .06);
        color: var(--blue);
    }

    .d-icon {
        width: 28px;
        height: 28px;
        border-radius: 7px;
        background: var(--gray100);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gray400);
        flex-shrink: 0;
    }

    .dropdown-menu li a:hover .d-icon {
        background: rgba(24, 119, 242, .1);
        color: var(--blue);
    }

    .sep-row {
        border-top: 1px solid var(--gray100);
        margin-top: 4px;
        padding-top: 4px;
    }

    .sep-row a {
        color: var(--blue) !important;
        font-weight: 600 !important;
        font-size: 13px !important;
    }

    .sep-row-arrow {
        margin-left: auto;
        opacity: .45;
    }

    /* Plain nav links */
    .nav-links>a {
        display: block;
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        background: var(--gray50);
        border: 1px solid transparent;
        margin-bottom: 2px;
        color: var(--gray800);
        text-decoration: none;
        transition: background .15s;
    }

    .nav-links>a:hover {
        background: var(--gray100);
        color: var(--gray800);
    }
}

/* Backdrop */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 112px;
    background: rgba(0, 0, 0, .28);
    backdrop-filter: blur(1px);
    z-index: 800;
}

.nav-backdrop.show {
    display: block;
}

@media(max-width: 480px) {
    body {
        padding-top: 102px;
    }

    .nav-container {
        padding: 0 16px;
    }

    .navbar {
        height: 56px;
    }

    .top-search-bar {
        height: 46px;
    }

    .nav-backdrop {
        top: 102px;
    }

    .nav-links {
        top: 102px;
    }
}
