/* =========================================================================
   HEADER V2 - TEST STYLES
   Two genuinely separate, independent full-width sections:
     1. .header-v2__topbar  - the top utility bar (always visible)
     2. .header-v2__mainbar - logo + hamburger + main nav
   Kept as plain top-level siblings rather than nested inside one shared
   wrapper - that's what makes the spacing/padding behave predictably at
   every breakpoint, instead of fighting negative margins to cancel out
   a parent's padding.
   Everything scoped under #nav-area-v2 / .header-v2 so nothing here
   touches or clashes with the live #nav-area rules in site.min.css / dave.css.
   ========================================================================= */

#nav-area-v2.header-v2 {
    --hv2-primary: var(--primary-colour, #0d478a);
    --hv2-secondary: var(--secondary-colour, #c9a24b);
    --hv2-gold: #c69a3f; /* matches rgb(198,154,63) used throughout the homepage */
    --hv2-text: #16233b;
    --hv2-border: rgba(13, 71, 138, 0.12);

    /* The two child sections below carry their own backgrounds - this
       outer element is just a wrapper, no padding of its own. */
    padding: 0;
    margin: 0;
}

@media (min-width: 992px) {
    /* This wrapper's own box "disappears" - topbar and mainbar become
       direct children of <body> instead. That's the actual fix for
       sticky not working at all: position:sticky is bounded by the
       height of its own PARENT, and this wrapper (containing only the
       ~150px-tall topbar+mainbar) was nowhere near tall enough to give
       the mainbar any real room to stick - it would immediately un-stick
       the moment you scrolled past this tiny box. With display:contents,
       the mainbar's effective parent becomes the full-height page, so it
       can stick properly all the way down. */
    #nav-area-v2.header-v2 {
        display: contents;
    }
}

/* =========================================================================
   SECTION 1 - Top utility bar (always visible, full width)
   ========================================================================= */
.header-v2__topbar {
    width: 100%;
    border-bottom: 1px solid rgba(13, 71, 138, .08);
}
@media (min-width: 992px) {
    .header-v2__topbar { background-color: #f4f4f4; }
}
.header-v2__topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    box-sizing: border-box;
}
.header-v2__topnav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
}
.header-v2__topnav li { flex-shrink: 0; }
.header-v2__topnav .nav-link,
.header-v2__topnav a {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;
    /* Forced with !important - the live theme's own .nav-item a{color:#fff}
       rule (site.min.css) was winning the cascade against this class. */
    color: var(--hv2-text) !important;
    padding: 6px 12px;
    display: inline-flex !important;
    align-items: center;
    text-transform: none !important;
    white-space: nowrap !important;
    border-radius: 999px;
    background: rgba(13, 71, 138, 0.08);
    border: 1px solid rgba(13, 71, 138, 0.1);
    transition: color .2s ease, background-color .2s ease, font-size .3s ease;
}
.header-v2__topnav .nav-link:hover,
.header-v2__topnav a:hover {
    color: var(--hv2-primary) !important;
    background: rgba(13, 71, 138, 0.14);
    border-color: rgba(13, 71, 138, 0.22);
}
.header-v2__topnav i { font-size: .8rem; }
/* Person/account icon - gold */
.header-v2__topnav .item-icon { color: var(--hv2-gold) !important; }

.header-v2__phone {
    order: 99; /* always last / right-most in the utility row */
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    font-size: .85rem;
    font-weight: 700;
    color: var(--hv2-primary) !important;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(13, 71, 138, 0.08);
    border: 1px solid rgba(13, 71, 138, 0.1);
    transition: font-size .3s ease;
}
.header-v2__phone i { margin-right: 8px; font-size: .85rem; color: var(--hv2-gold); }

/* Desktop search pill - hidden on mobile/tablet, shown again (styled
   differently) in the mobile media query below */
.header-v2__search {
    display: flex;
    align-items: center;
    background: #f3f5f8;
    border-radius: 999px;
    padding: 2px 4px 2px 14px;
    flex: 0 1 170px;
    order: 50;
    transition: box-shadow .2s ease, background-color .2s ease;
}
@media (min-width: 992px) {
    .header-v2__search {
        border: 1px solid #c4972a;
        padding: 4px 4px 4px 14px;
    }
}
.header-v2__search:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px var(--hv2-primary) inset;
}
.header-v2__search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: .85rem;
    width: 100%;
    height: 22px;
    padding: 0;
    color: var(--hv2-text) !important;
    transition: font-size .3s ease;
}
.header-v2__search-btn {
    border: none;
    background: var(--hv2-gold);
    color: #fff !important;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
}

i.fa-solid.fa-chevron-right.megamenu-i {
    position: absolute;
    right: 18%;
}

/* =========================================================================
   SECTION 2 - Main bar: logo, hamburger toggle, main navigation
   ========================================================================= */
#body .navbar {
    background-color: #ffffff;
}
.header-v2__mainbar {
    width: 100%;
    background: #ffffff;
}
@media (min-width: 992px) {
    .header-v2__mainbar {
        position: sticky;
        top: 0;
        z-index: 3;
    }
}
.header-v2__bar {
    position: relative; /* containing block for the full-width mega-menu below */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0px 20px;
    box-sizing: border-box;
    transition: padding .3s ease;
}

/* ---------- Logo ---------- */
.header-v2__brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
.header-v2__logo-stack {
    position: relative;
    display: inline-block;
    height: 60px;
    transition: height .35s ease;
}
.header-v2__brand img.nav-logo-v2 {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: auto;
    transition: opacity .35s ease;
}
/* Crossfade instead of an instant display:none/block swap - both logos are
   always in the DOM, stacked on top of each other, and only opacity moves. */
.header-v2__brand .logo-white { opacity: 0; }
.header-v2__brand .logo-blue  { opacity: 1; }

/* ---------- Toggler ---------- */
.header-v2__toggler {
    border: none;
    box-shadow: none !important;
    padding: 0 .4rem;
    flex: 0 0 auto;
    /* dave.css has a leftover rule, .navbar-toggler{order:1} - our button
       reuses that Bootstrap class name, which was silently reordering it.
       No longer needed now that topbar/mainbar are separate sections, but
       kept as a defensive reset. */
    order: 0 !important;
}
/* Gold hamburger icon instead of the theme's default white/dark one */
.header-v2__toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23c69a3f' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ---------- Main nav (desktop row) ---------- */
.header-v2__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.header-v2__nav .nav-link {
    font-size: 1rem;
    font-weight: 700;
    text-transform: capitalize !important;
    letter-spacing: .02em;
    color: var(--hv2-text) !important;
    padding: .4rem .7rem;
    white-space: nowrap;
    transition: color .2s ease, font-size .3s ease;
}
.header-v2__nav .nav-link:hover,
.header-v2__nav .show > .nav-link { color: var(--hv2-primary) !important; }

/* Invisible hover "bridge": extends the top-level <li>'s hoverable area
   down past the header's own bottom padding, so moving the mouse from the
   link down into the dropdown never crosses a dead zone with nothing
   hoverable underneath it (which is what was closing the menu unless you
   moved fast). Padding extends the hit-box; the matching negative margin
   cancels it back out visually, so nothing shifts on screen. */
.header-v2__nav > li.nav-item {
    padding-bottom: 30px;
    margin-bottom: -30px;
}

/* =========================================================================
   Dropdown / mega-menu - opens on plain CSS :hover at desktop widths.
   The navwalker already sets data-bs-popper="static" on the dropdown,
   which tells Bootstrap NOT to use Popper.js for positioning it - so this
   is genuinely just CSS, no JavaScript involved in showing/hiding it.
   ========================================================================= */
.header-v2 .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    border: none;
    border-radius: 18px !important;
    box-shadow: 0 25px 50px -15px rgba(15, 23, 42, .3);
    padding: 0;
    background: #ffffff;
    /* Positioned relative to .header-v2__bar (its nearest positioned
       ancestor), not the narrow <li> - spans the full header width instead
       of shrinking to fit just the link. Forced with !important since an
       existing rule elsewhere was pinning top to a fixed 80px. top:70%
       (rather than 100%) pulls the panel up to overlap the lower part of
       the bar itself, shrinking the gap the mouse has to cross before
       reaching it - combined with the padding-bottom/margin-bottom hover
       bridge on the <li> above, this closes the remaining "have to move
       fast or it disappears" issue. */
    position: absolute !important;
    top: 70% !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 10px !important;
}
@media (min-width: 992px) {
    .header-v2__nav > li.nav-item:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}
/* Bootstrap's own click-toggled .show class still works too - it's what
   mobile relies on, via the collapse/dropdown click behaviour below. */
.header-v2 .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* =========================================================================
   Mega-menu panel design - gold-accented, modern look.
   A lot of these are !important to guarantee they win against the theme's
   existing megamenu CSS while testing; fold into the real stylesheet and
   drop the !importants once the design is signed off.
   ========================================================================= */
.header-v2 .megamenu > li.nav-item {
    display: flex !important;
    align-items: stretch;
    gap: 40px;
    width: 100%;
    list-style: none;
    padding: 36px 44px !important;
}
.header-v2 .megamenu .megamenu-flex {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
/* flex-wrap forced to nowrap - the theme's own dave.css sets .megamenu li
   to flex-wrap:wrap with col-1 defaulting to flex:0 1 100% (only widened
   above 992px), which combined with min-width:auto's default let the link
   columns' content refuse to shrink and wrap the ad card onto its own row
   below. Forcing nowrap + min-width:0 on both columns stops that. */
.header-v2 .megamenu > li.nav-item { flex-wrap: nowrap !important; }
.header-v2 .megamenu .col-1 {
    flex: 0 1 62% !important;
    min-width: 0;
}
.header-v2 .megamenu .col-2 {
    flex: 0 1 38% !important;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: rgb(247, 243, 236);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}
.header-v2 .col-2:hover {
    box-shadow: 0 16px 32px rgba(198, 154, 63, .22);
    transform: translateY(-2px);
}
.header-v2 .megamenu-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: .06em;
    text-transform: uppercase !important;
    color: var(--hv2-text) !important;
    margin: 0 0 14px !important;
}
.header-v2 .megamenu-hr {
    border: none !important;
    height: 3px !important;
    background: var(--hv2-gold) !important;
    width: 44px;
    margin: 0 0 22px !important;
    opacity: 1 !important;
    border-radius: 2px;
}
.header-v2 .cols-3 {
    list-style: none;
    margin: 0 0 8px !important;
    padding: 0 !important;
    columns: 3;
    column-gap: 28px;
}
.header-v2 .col-item { break-inside: avoid; }
.header-v2 .col-item a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100% !important; /* the theme's own CSS sets width:80% here,
                                which left the hover highlight (and the
                                arrow inside it) stopping short of the
                                column's true right edge */
    padding: 9px 10px !important;
    margin: 0 -10px;
    font-size: .86rem !important;
    font-weight: 600 !important;
    color: var(--hv2-text) !important;
    text-decoration: none;
    border-radius: 8px;
    transition: color .2s ease, background-color .2s ease;
}
.header-v2 .col-item a:hover {
    color: var(--hv2-gold) !important;
    background: rgba(198, 154, 63, .1);
}
.header-v2 .megamenu-i {
    font-size: .68rem;
    color: var(--hv2-gold);
    opacity: 0;
    transition: opacity .2s ease;
}
.header-v2 .col-item a:hover .megamenu-i {
    opacity: 1;
}
.header-v2 .megamenu .btn.megamenu-a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--hv2-gold) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: .8rem !important;
    letter-spacing: .04em;
    text-transform: uppercase !important;
    padding: 11px 26px !important;
    border-radius: 999px !important;
    text-decoration: none;
    border: none;
    transition: background-color .2s ease, transform .15s ease;
}
.header-v2 .megamenu .btn.megamenu-a:hover {
    background: #a9812f !important;
    transform: translateY(-1px);
    color: #ffffff !important;
}
.header-v2 .col-2 > a {
    display: block;
    flex: 1 1 auto;
    min-height: 140px;
    overflow: hidden;
}
.header-v2 .col-2 > a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin-top: 0 !important; /* dave.css sets margin-top:55px on this exact element */
}
.header-v2 .megamenu-text {
    padding: 20px 22px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 12px;
    flex: 0 0 auto;
}
.header-v2 .megamenu-text-con h5 {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: var(--hv2-text) !important;
    margin: 0 0 4px !important;
}
.header-v2 .megamenu-text-con p {
    font-size: .83rem !important;
    color: rgba(22, 35, 59, .65) !important;
    margin: 0 !important;
}
.header-v2 .megamenu-text .btn.megamenu-a { align-self: flex-start; }

@media (min-width: 992px) {
    /* Live-tested fix - the theme's own nested rule was still winning here. */
    .header-v2 .megamenu li .col-1 ul li.col-item a {
        position: relative !important;
    }
}

/* =========================================================================
   Sticky "glass" state - desktop only. On mobile the header just stays
   in normal flow with a constant appearance - no scroll-triggered blur,
   colour change, logo swap, or text shrink.
   ========================================================================= */
@media (min-width: 992px) {
    #nav-area-v2.header-v2.scrolled .header-v2__mainbar {
        background: color-mix(in srgb, var(--hv2-primary) 55%, transparent);
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        box-shadow: 0 8px 30px -12px rgba(0, 0, 0, .35);
    }
    #nav-area-v2.header-v2.scrolled .header-v2__bar {
        padding: 0px 20px;
    }
    #nav-area-v2.header-v2.scrolled .header-v2__nav .nav-link {
        color: #ffffff !important;
    }
    #nav-area-v2.header-v2.scrolled .header-v2__logo-stack { height: 52px; }
    #nav-area-v2.header-v2.scrolled .header-v2__brand .logo-white { opacity: 1; }
    #nav-area-v2.header-v2.scrolled .header-v2__brand .logo-blue  { opacity: 0; }
    #nav-area-v2.header-v2.scrolled .header-v2__nav .nav-link { font-size: .86rem; }
}

/* =========================================================================
   Responsive - tablet / mobile
   ========================================================================= */
@media (max-width: 991px) {
    ul#destinations,
    ul#holidays {
        background: white !important;
    }

    /* ---------- Top bar: gold background on mobile/tablet, horizontally
       scrollable so the (reduced) item set never has to wrap ---------- */
    .header-v2__topbar {
        background: var(--hv2-gold);
        border-bottom: none;
    }
    .header-v2__topbar-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 10px 15px;
        justify-content: flex-start;
    }
    .header-v2__topbar-inner::-webkit-scrollbar { display: none; }

    /* Reduced set: search / phone / My Account / Logout only. "FAQs" (or
       anything else from the secondary menu) and "Agent Login" are hidden
       here - Blog is already excluded from this list entirely. */
    .header-v2__topnav-secondary,
    .header-v2__topnav .mobile-none {
        display: none !important;
    }

    /* White text/pills for contrast against the gold background - and all
       given the exact same height/padding/font-size, so FAQs/My Account/
       Logout/phone/search all read as one uniform row of same-sized
       buttons rather than slightly different sizes. */
    .header-v2__topnav .nav-link,
    .header-v2__topnav a,
    .header-v2__phone {
        box-sizing: border-box;
        height: 36px;
        font-size: .8rem;
        padding: 0 14px;
        flex-shrink: 0;
    }
    .header-v2__topnav .nav-link,
    .header-v2__topnav a {
        color: #ffffff !important;
        background: rgba(255, 255, 255, .18);
        border-color: rgba(255, 255, 255, .3);
    }
    .header-v2__topnav .nav-link:hover,
    .header-v2__topnav a:hover {
        color: #ffffff !important;
        background: rgba(255, 255, 255, .3);
    }
    .header-v2__phone {
        color: #ffffff !important;
        background: rgba(255, 255, 255, .18);
        border-color: rgba(255, 255, 255, .3);
    }

    /* Search now shows on mobile too (previously desktop-only) - same 36px
       height as the pills above, so it lines up with the rest of the row */
    .header-v2__search {
        display: flex !important;
        box-sizing: border-box;
        height: 36px;
        flex-shrink: 0;
        flex-basis: 150px;
        background: rgba(255, 255, 255, .92);
    }
    .header-v2__search-input { color: var(--hv2-text) !important; }
    .header-v2__search-input::placeholder { color: rgba(22, 35, 59, .55); }
    .header-v2__search-btn { background: var(--hv2-text); }

    /* ---------- Main bar: logo + toggler ----------
       Logo shrunk down and bar padding tightened - the full 68px desktop
       logo plus its own vertical padding was creating a tall row with a
       lot of unused space above/below, and made the logo and toggler read
       as misaligned since they weren't sized close to each other. */
    .header-v2__bar {
        flex-wrap: wrap;
        padding: 10px 15px;
        align-items: center;
    }
    .header-v2__logo-stack { height: 42px; }
    .header-v2__toggler { display: flex; align-items: center; }

    #menu-primary-v2 {
        flex-basis: 100%;
        max-height: 70vh;
        overflow-y: auto;
    }
    /* Custom scrollbar, since content taller than 70vh needs one - thin
       and gold-accented rather than the default OS grey bar. */
    #menu-primary-v2 {
        scrollbar-width: thin;
        scrollbar-color: var(--hv2-gold) transparent;
    }
    #menu-primary-v2::-webkit-scrollbar { width: 6px; }
    #menu-primary-v2::-webkit-scrollbar-track { background: transparent; }
    #menu-primary-v2::-webkit-scrollbar-thumb {
        background-color: var(--hv2-gold);
        border-radius: 999px;
    }

    .header-v2__nav {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        width: 100%;
        padding: 6px 4px 16px;
    }
    /* Equal, consistent spacing for every top-level item - plain links and
       the Destinations/Holidays dropdown-toggles alike, same box model. */
    .header-v2__nav .nav-link {
        box-sizing: border-box;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.05rem .5rem;
        font-size: .95rem;
    }

    /* Dropdown-toggle caret: gold chevron inside a white circle badge,
       replacing Bootstrap's plain default triangle - a clearer visual
       cue that this specific item expands. */
    .header-v2__nav .dropdown-toggle::after {
        content: '';
        display: inline-block;
        width: 30px;
        height: 30px;
        border: none !important;
        border-radius: 50%;
        background-color: #ffffff;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23c69a3f' d='M4 6l4 4 4-4z'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 13px 13px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
        flex-shrink: 0;
        transition: transform .2s ease;
    }
    .header-v2__nav .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }

    /* Mega-menu becomes a static, single-column accordion under the link -
       toggled open via Bootstrap's own click/.show behaviour, no extra
       positioning needed since it's no longer floating over the page.
       Background is transparent - it just blends straight into the
       cream panel behind it, rather than being a slightly-different
       shade sitting on top of it. */
    .header-v2 .dropdown-menu {
        position: static !important;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        border-radius: 0;
        background: transparent !important;
        margin: 4px 0 14px !important;
        padding: 0 !important;
    }
    .header-v2 .dropdown-menu.show { display: block; }

    .header-v2 .megamenu > li.nav-item {
        flex-direction: column !important;
        gap: 24px;
        padding: 22px 18px !important;
        border-bottom: none;
    }
    .header-v2 .megamenu .col-1,
    .header-v2 .megamenu .col-2 { flex: none; width: 100%; }
    .header-v2 .megamenu-title {
        font-size: .92rem !important;
        margin: 0 0 12px !important;
    }
    .header-v2 .megamenu-hr { margin: 0 0 18px !important; }
    .header-v2 .cols-3 { columns: 1 !important; margin: 0 0 4px !important; }
    .header-v2 .col-item a {
        font-size: .88rem !important;
        padding: 13px 10px !important;
    }
    .header-v2 .col-2 { border-radius: 12px; }
    .header-v2 .col-2 > a { min-height: 150px; }
    .header-v2 .megamenu .btn.megamenu-a,
    .header-v2 .megamenu-text .btn.megamenu-a {
        width: 100% !important;
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .header-v2__topnav .mobile-none { display: none; }
    .header-v2__topnav .nav-link,
    .header-v2__topnav a { font-size: .66rem; padding: 3px 6px; }
    .header-v2__brand img.nav-logo-v2 { height: 40px; }
}