/* ==========================================================================
   HEADER-RESPONSIVE.CSS
   Dedicated responsive styles for the Header and Hamburger Navigation Menu
   Keep this file separate for quick identification and easy maintenance.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL CONTAINER RULES
   -------------------------------------------------------------------------- */
header {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

header .wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. DESKTOP BASELINE (Screen widths >= 1024px)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1024px) {
    #nav-icon {
        display: none !important;
    }

    .desktop-menu-wrap {
        flex: 1;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding-left: 40px;
    }

    .desktop-menu-wrap ul.menu-list {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .desktop-menu-wrap ul.menu-list li {
        display: inline-block !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .desktop-menu-wrap ul.menu-list li a {
        display: inline-block !important;
        padding: 24px 16px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #636467 !important;
        font-family: 'Poppins', sans-serif !important;
        text-decoration: none !important;
        transition: color 0.2s ease !important;
    }

    .desktop-menu-wrap ul.menu-list li a:hover,
    .desktop-menu-wrap ul.menu-list li a.active {
        color: #636467 !important;
    }

    /* Hide mobile drawer on desktop */
    .menu-wrap,
    .menu-backdrop {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   3. TABLET & MOBILE (< 1024px): HAMBURGER DRAWER SETUP
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1023px) {

    /* Hide desktop inline menu on mobile */
    .desktop-menu-wrap {
        display: none !important;
    }

    /* --- Main Header Bar --- */
    .header-wrap {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .logo {
        max-width: 140px;
        display: inline-block;
        z-index: 100;
    }

    .logo img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    /* --- Hamburger Icon (#nav-icon) --- */
    #nav-icon {
        display: block !important;
        position: relative !important;
        right: 0 !important;
        top: 0 !important;
        width: 32px !important;
        height: 22px !important;
        cursor: pointer !important;
        z-index: 1000002 !important;
        padding: 10px 6px !important;
        box-sizing: content-box !important;
        border-radius: 4px;
        outline: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    #nav-icon:focus-visible {
        outline: 2px solid #fecc00;
        outline-offset: 2px;
    }

    #nav-icon span {
        display: block;
        position: absolute;
        height: 3px;
        width: 50%;
        background: #fecc00;
        opacity: 1;
        transform: rotate(0deg);
        transition: all 0.25s ease-in-out;
        border-radius: 2px;
    }

    #nav-icon span:nth-child(even) {
        left: 50%;
        border-radius: 0 2px 2px 0;
    }

    #nav-icon span:nth-child(odd) {
        left: 0;
        border-radius: 2px 0 0 2px;
    }

    #nav-icon span:nth-child(1),
    #nav-icon span:nth-child(2) {
        top: 10px;
    }

    #nav-icon span:nth-child(3),
    #nav-icon span:nth-child(4) {
        top: 19px;
    }

    #nav-icon span:nth-child(5),
    #nav-icon span:nth-child(6) {
        top: 28px;
    }

    /* Hamburger Animation to 'X' */
    #nav-icon.open span:nth-child(1),
    #nav-icon.open span:nth-child(6) {
        transform: rotate(45deg);
    }

    #nav-icon.open span:nth-child(2),
    #nav-icon.open span:nth-child(5) {
        transform: rotate(-45deg);
    }

    #nav-icon.open span:nth-child(1) {
        left: 5px;
        top: 15px;
    }

    #nav-icon.open span:nth-child(2) {
        left: calc(50% - 5px);
        top: 15px;
    }

    #nav-icon.open span:nth-child(3) {
        left: -50%;
        opacity: 0;
    }

    #nav-icon.open span:nth-child(4) {
        left: 100%;
        opacity: 0;
    }

    #nav-icon.open span:nth-child(5) {
        left: 5px;
        top: 23px;
    }

    #nav-icon.open span:nth-child(6) {
        left: calc(50% - 5px);
        top: 23px;
    }

    /* --- Mobile Slide-Out Drawer (.menu-wrap) --- */
    .menu-wrap {
        position: fixed !important;
        top: 0 !important;
        right: -340px !important;
        width: 310px !important;
        max-width: 88vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #ffffff !important;
        z-index: 1000001 !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        box-shadow: -6px 0 25px rgba(0, 0, 0, 0.25) !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
        overscroll-behavior-y: contain !important;
        overscroll-behavior-x: none !important;
        box-sizing: border-box !important;
    }

    /* Prevent any child element from exceeding drawer width */
    .menu-wrap,
    .menu-wrap * {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .menu-wrap.active {
        right: 0 !important;
    }

    /* --- Backdrop Blur Overlay --- */
    .menu-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(10, 22, 40, 0.55) !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
        z-index: 1000000 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease !important;
    }

    .menu-backdrop.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body.mobile-menu-open {
        overflow: hidden !important;
    }

    /* --- Drawer Top Header Bar --- */
    .mobile-drawer-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 14px 18px !important;
        background: #fecc00 !important;
        border-bottom: 2px solid #e0b400 !important;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .mobile-drawer-header .drawer-title {
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 700;
        color: #1a1f2e;
        letter-spacing: 0.5px;
    }

    .drawer-close-btn {
        background: transparent;
        border: none;
        font-size: 26px;
        line-height: 1;
        color: #1a1f2e;
        cursor: pointer;
        padding: 2px 8px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .drawer-close-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }

    /* --- Drawer Search Bar --- */
    .mobile-drawer-search {
        padding: 12px 16px;
        background: #fbfbfb;
        border-bottom: 1px solid #eee;
    }

    .mobile-drawer-search form {
        display: flex;
        width: 100%;
        position: relative;
    }

    .mobile-drawer-search input[type="text"] {
        flex: 1;
        height: 38px;
        border: 1px solid #ddd;
        border-radius: 5px 0 0 5px;
        padding: 0 12px;
        font-size: 13px;
        background: #fff;
        outline: none;
        box-sizing: border-box;
    }

    .mobile-drawer-search input[type="text"]:focus {
        border-color: #fecc00;
    }

    .mobile-drawer-search button[type="submit"] {
        width: 42px;
        height: 38px;
        background: #0a1628;
        color: #fecc00;
        border: none;
        border-radius: 0 5px 5px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-sizing: border-box;
    }

    /* --- Main Nav Links in Drawer --- */
    .menu-wrap ul.menu-list {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 6px 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .menu-wrap ul.menu-list li {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #f0f2f5 !important;
    }

    .menu-wrap ul.menu-list li a {
        display: flex !important;
        align-items: center !important;
        padding: 12px 20px !important;
        font-size: 14.5px !important;
        font-weight: 500 !important;
        color: #2b303a !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        font-family: 'Poppins', sans-serif !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .menu-wrap ul.menu-list li a:hover,
    .menu-wrap ul.menu-list li a:focus,
    .menu-wrap ul.menu-list li a.active {
        color: #fecc00 !important;
        background: #fffdf2 !important;
        padding-left: 26px !important;
        font-weight: 600 !important;
    }

    .menu-wrap ul.menu-list li a::after {
        display: none !important;
    }

    /* Subtle custom vertical scrollbar */
    .menu-wrap::-webkit-scrollbar {
        width: 5px;
    }

    .menu-wrap::-webkit-scrollbar-thumb {
        background: #fecc00;
        border-radius: 4px;
    }

    .menu-wrap::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    /* --- Section Titles in Drawer --- */
    .mobile-drawer-section-title {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: #8c96a8;
        padding: 14px 20px 6px;
        background: #f7f8fa;
        border-top: 1px solid #edeef2;
    }

    /* --- Account & Quick Links in Drawer --- */
    .mobile-drawer-links {
        display: flex;
        flex-direction: column;
        padding: 4px 0;
        background: #fff;
    }

    .mobile-drawer-links .drawer-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
        font-size: 13.5px;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f6f7f9;
        transition: background 0.15s ease;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .mobile-drawer-links .drawer-link:hover {
        background: #f7f9fc;
        color: #0056b3;
    }

    .mobile-drawer-links .drawer-link i {
        font-size: 14px;
        color: #6c757d;
        width: 18px;
        text-align: center;
    }

    /* --- Contact Details in Drawer --- */
    .mobile-drawer-contact {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 10px 20px 24px;
        background: #fafbfc;
        border-top: 1px solid #eee;
    }

    .mobile-drawer-contact a {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #495057;
        text-decoration: none;
        word-break: break-all;
    }

    .mobile-drawer-contact a i {
        color: #d4a000;
        width: 16px;
    }
}

/* --------------------------------------------------------------------------
   4. COMPACT MOBILE & 320x256 SCREENS (<= 768px down to 320px)
   --------------------------------------------------------------------------
   The top header (.header-top) is COMPLETELY HIDDEN,
   and ALL content (Search, User action links, Contact details) is
   housed cleanly inside the hamburger menu drawer!
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {

    /* HIDE THE TOP YELLOW BAR ON MOBILE */
    .header-top {
        display: none !important;
    }

    /* Keep container padding matching the compact mobile header */
    .container {
        padding-top: 65px !important;
    }

    /* Ensure header sits compact and clean at the top */
    header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    }

    .header-wrap {
        padding: 8px 0 !important;
        min-height: 52px !important;
    }

    .logo {
        max-width: 125px !important;
    }

    /* Accessibility Button: Positioned safely at the bottom right on mobile */
    /* .acc-toggle-btn {
        position: fixed !important;
        top: auto !important;
        bottom: 80px !important;
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
        z-index: 9999 !important;
    } */

    .acc-toggle-btn {
        position: fixed !important;
        top: 0px !important;
        bottom: 82px !important;
        right: 66px !important;
        /* left: 19px; */
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
        z-index: 9999 !important;
    }

    .acc-close-btn {
        width: 25px;
        height: 25px;
    }

    .acc-reset-btn {
        padding: 8px;
        font-size: 10px;
    }
}

/* --------------------------------------------------------------------------
   5. ULTRA-COMPACT / 320px and Below (e.g. 320x256, 280px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 360px) {

    .container {
        padding-top: 60px !important;
    }

    .logo {
        max-width: 110px !important;
    }

    #nav-icon {
        width: 28px !important;
        height: 20px !important;
    }

    .menu-wrap {
        width: 270px !important;
        max-width: 90vw !important;
    }

    .acc-toggle-btn {
        width: 42px !important;
        height: 42px !important;
        font-size: 18px !important;
        top: 0px !important;
        right: 65px !important;
    }

    #accPanel {
        position: fixed;
        right: 1px;
        width: 316px;
        bottom: 4px;
        max-height: 97vh;
    }


}