/* ============================================================ 
   GOLD STANDARD RESPONSIVE OVERRIDES - V3
   Resolution for 'Hidden on Load' vs 'Show on Scroll' issues
   ============================================================ */

/* 1. FORCE IMMEDIATE VISIBILITY ON LOAD (Globals) */
.top-header,
.navigation,
.nav-brand,
.logo,
.logo img,
.nav-brand img {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    z-index: 999999 !important;
    /* Ensure they are above any stuck overlays */
}

/* 2. MOBILE RESPONSIVE FIXES (0px to 991px) */
@media screen and (max-width: 991px) {

    /* Reveal the mobile header on load (Override legacy hiding) */
    #sexy-menu,
    .sexy-menu-container,
    .sexy-menu-overlay {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Keep bottom navigation visible on mobile */
    .hide-menu {
        display: flex !important;
        /* Ensure bottom bar is flex on mobile */
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999999 !important;
    }

    /* Let wrapper naturally expand to fit the logo preventing bleed out */
    .top-wraper {
        height: auto !important;
        min-height: 94px !important;
    }

    .top-header {
        position: relative !important;
        background: #fff !important;
        width: 100% !important;
        padding-bottom: 8px !important;
        /* Gentle padding below the logo text */
        height: auto !important;
    }

    .top-container {
        display: block !important;
        height: auto !important;
    }

    .navigation {
        display: table !important;
        width: 100% !important;
        height: auto !important;
        text-align: center !important;
    }

    .nav-brand {
        display: table-cell !important;
        text-align: left !important;
        width: 400px !important;
        /* Forces layout to behave like live site */
        vertical-align: middle !important;
    }

    .logo {
        display: block !important;
        width: auto !important;
        position: relative !important;
        margin: 0 auto !important;
    }

    .logo img,
    .nav-brand img {
        display: block !important;
        margin: 0 auto !important;
        margin-top: 4px !important;
        width: 100px !important;
        /* Slightly shrunk down per user request to fix bleed */
        height: auto !important;
        position: relative !important;
        top: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure top nav and logo disappear on scroll per user request */
    .sexy-menu.detached .nav-brand,
    .cbp-af-header-shrink .nav-brand,
    .sexy-menu.detached .logo img,
    .cbp-af-header-shrink .logo img {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .sexy-menu.detached .top-header,
    .cbp-af-header-shrink .top-header {
        background: transparent !important;
        height: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Ensure the sidebar starts CLOSED and doesn't cover the screen on load */
    .navigation-portrait .nav-menus-wrapper {
        width: 300px !important;
        left: -350px !important;
        display: block !important;
        visibility: visible !important;
        background-color: #1f0f1f !important;
        transition: left 0.4s ease !important;
        z-index: 9999999 !important;
        /* Higher than header */
    }

    .navigation-portrait .nav-menus-wrapper.nav-menus-wrapper-open {
        left: 0 !important;
    }

    /* Polish Bottom Navigation */
    .hide-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        background: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.1) !important;
        border-top: 1px solid #ddd !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 999999 !important;
    }

    /* Force all bottom nav elements into perfectly equal flex blocks */
    .hide-menu a {
        position: relative !important;
        /* Negates legacy position: absolute on .nav-toggle */
        right: auto !important;
        top: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 1 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        height: 100% !important;
    }

    .hide-menu a.nav-toggle {
        width: auto !important;
        /* Negates strict legacy width constraint */
    }
}

/* 3. DESKTOP RESPONSIVE POLISH (992px+) */
@media screen and (min-width: 992px) {
    /* Reduce desktop logo size per user request & clear legacy negative margins */
    .logo img, .nav-brand img {
        width: 130px !important; /* Scaled down for laptop view */
        height: auto !important;
        margin-top: 0 !important; /* Critical: Resets the buggy -70px margin from active.css */
        margin-bottom: 0 !important;
        padding: 0 !important;
        position: relative !important;
        top: 0 !important;
    }

    .logo {
        margin: 0 !important;
        padding: 0 !important;
        top: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Modern Flexbox alignment for perfect desktop link flow */
    .navigation {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        flex-wrap: nowrap !important; /* Never wrap the header */
    }

    /* Prevent logo container from taking 1400px width and vertically center it */
    .nav-brand {
        display: flex !important;
        width: auto !important;
        flex: 0 0 auto !important; /* Never grow, never shrink, stay exact logo width */
        margin: 0 !important;
        padding-left: 15px !important;
        align-items: center !important;
        position: relative !important;
        top: -12px !important; /* Shift logo visually higher to balance the empty space above it */
    }
    
    .cbp-af-header-shrink .nav-brand,
    .sexy-menu.detached .nav-brand {
        top: 0 !important; /* Reset shift when scrolling */
    }

    .nav-menus-wrapper {
        display: flex !important;
        flex: 1 1 auto !important; /* Take remaining space */
        width: auto !important;
        justify-content: flex-end !important; /* Push links firmly to the right */
    }

    .navigation .nav-menu {
        display: flex !important;
        flex-wrap: nowrap !important; /* RESERVATIONS fix: forcefully prevent new line wraps */
        justify-content: flex-end !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navigation .nav-menu>li {
        display: inline-block !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    .navigation .nav-menu>li>a {
        padding: 22px 10px !important;
        font-size: 13.5px !important;
        display: inline-block !important; /* Stop table-cell bleeding */
        height: auto !important;
        white-space: nowrap !important;
    }

    /* Ensure visibility and perfect sizes on scroll-shrink */
    .cbp-af-header-shrink .navigation .nav-menu>li>a,
    .sexy-menu.detached .navigation .nav-menu>li>a {
        padding: 12px 8px !important;
        font-size: 11.5px !important;
        white-space: nowrap !important;
    }
}