/* Courtesywide Adventures — Azari-style public header and navigation.
   Uses Courtesywide's configured green/brown colours and deliberately avoids
   the previous mega-menu / full-width mobile navigation implementation. */

.cw-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255,255,255,.985);
    border-bottom: 1px solid var(--border, #e4eaf1);
    box-shadow: 0 1px 0 rgba(15,39,66,.02);
    backdrop-filter: blur(12px);
}

.cw-header-inner {
    min-height: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.cw-site-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.cw-site-logo img {
    width: auto;
    max-width: 170px;
    height: 58px;
    object-fit: contain;
    object-position: left center;
}

.cw-site-logo-fallback {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--navy, #0f2742);
}

.cw-site-logo-fallback svg { color: var(--primary); }

/* Desktop: simple Azari-style dropdowns — no mega menus. */
.cw-desktop-nav {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: clamp(10px, 1.25vw, 22px);
    min-width: 0;
    height: 100%;
}

.cw-desktop-nav > a,
.cw-nav-parent {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 100%;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--navy, #0f2742);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cw-desktop-nav > a::after,
.cw-nav-parent::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .18s ease;
}

.cw-desktop-nav > a:hover,
.cw-desktop-nav > a.active,
.cw-nav-item:hover > .cw-nav-parent,
.cw-nav-item:focus-within > .cw-nav-parent,
.cw-nav-item.active > .cw-nav-parent {
    color: var(--secondary-dark, var(--secondary));
}

.cw-desktop-nav > a:hover::after,
.cw-desktop-nav > a.active::after,
.cw-nav-item:hover > .cw-nav-parent::after,
.cw-nav-item:focus-within > .cw-nav-parent::after,
.cw-nav-item.active > .cw-nav-parent::after {
    transform: scaleX(1);
}

.cw-nav-parent svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
    transition: transform .18s ease;
}

.cw-nav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.cw-nav-item:hover .cw-nav-parent svg,
.cw-nav-item:focus-within .cw-nav-parent svg {
    transform: rotate(180deg);
}

.cw-nav-submenu {
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    z-index: 1020;
    width: 255px;
    padding: 7px;
    border: 1px solid var(--border, #e4eaf1);
    border-top: 2px solid var(--primary);
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15,39,66,.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 9px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.cw-nav-item:hover > .cw-nav-submenu,
.cw-nav-item:focus-within > .cw-nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.cw-nav-submenu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border, #e4eaf1);
    color: var(--text, #334155);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.cw-nav-submenu a:last-child { border-bottom: 0; }
.cw-nav-submenu a:hover { color: var(--secondary-dark, var(--secondary)); background: color-mix(in srgb, var(--primary) 6%, #fff); }
.cw-nav-submenu a svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--primary); }

.cw-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.cw-account-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--navy, #0f2742);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .025em;
    white-space: nowrap;
}

.cw-account-link svg { width: 17px; height: 17px; color: var(--secondary); }

.cw-header-quote,
.cw-mobile-plan {
    border: 0;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.cw-header-quote {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 12px;
    white-space: nowrap;
}

.cw-header-quote:hover,
.cw-mobile-plan:hover { background: var(--primary-dark, var(--primary)); }
.cw-header-quote svg { width: 15px; height: 15px; }

.cw-mobile-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--navy, #0f2742);
    cursor: pointer;
}

.cw-mobile-nav-toggle svg { width: 24px; height: 24px; }

/* Scrim and drawer mirror Azari's proportions and movement. */
.cw-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(22,12,9,.56);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.cw-nav-scrim.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cw-mobile-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 9999;
    width: min(390px, 92vw);
    height: 100dvh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-left: 1px solid var(--border, #e4eaf1);
    box-shadow: -18px 0 42px rgba(18,15,13,.18);
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
}

.cw-mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

body.cw-nav-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.cw-mobile-nav-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--secondary) 18%, var(--border, #e4eaf1));
}

.cw-mobile-nav-logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.cw-mobile-nav-logo img {
    width: 118px;
    max-width: 118px;
    height: 64px;
    object-fit: contain;
    object-position: left center;
}

.cw-mobile-nav-logo strong {
    color: var(--navy, #0f2742);
    font-size: 15px;
}

.cw-mobile-nav-close {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--secondary) 8%, #fff);
    color: var(--secondary-dark, var(--secondary));
    cursor: pointer;
}

.cw-mobile-nav-close svg { width: 19px; height: 19px; }

.cw-mobile-nav-links {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin: 8px 0 16px;
}

.cw-mobile-nav-links > a,
.cw-mobile-nav-parent {
    width: 100%;
    min-height: 49px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 3px;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--secondary) 17%, var(--border, #e4eaf1));
    background: #fff;
    color: #262626;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: .035em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.cw-mobile-nav-links > a:hover,
.cw-mobile-nav-links > a.active,
.cw-mobile-nav-group.active > .cw-mobile-nav-parent,
.cw-mobile-nav-parent:hover {
    color: var(--secondary-dark, var(--secondary));
}

.cw-mobile-nav-links > a > svg,
.cw-mobile-nav-parent > svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--primary);
    transition: transform .18s ease;
}

.cw-mobile-nav-parent[aria-expanded="true"] > svg { transform: rotate(180deg); }

.cw-mobile-submenu {
    display: none;
    padding: 5px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--secondary) 17%, var(--border, #e4eaf1));
    background: color-mix(in srgb, var(--primary) 4%, #fff);
}

.cw-mobile-submenu.open { display: block; }

.cw-mobile-submenu a {
    display: block;
    padding: 9px 5px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--muted, #64748b);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.35;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.cw-mobile-submenu a:last-child { border-bottom: 0; }
.cw-mobile-submenu a:first-child { color: var(--secondary-dark, var(--secondary)); font-weight: 650; }
.cw-mobile-submenu a:hover { color: var(--secondary-dark, var(--secondary)); }

.cw-mobile-nav-contact {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding: 16px 0;
}

.cw-mobile-nav-contact a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted, #64748b);
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cw-mobile-nav-contact svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--primary);
}

.cw-mobile-plan {
    flex: 0 0 auto;
    width: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 7px;
    font-size: 12px;
    letter-spacing: .015em;
}

.cw-mobile-plan svg { width: 16px; height: 16px; }

/* Match Azari: drawer replaces desktop navigation before items can collide. */
@media (max-width: 1200px) {
    .site-topbar { display: none !important; }

    .cw-header-inner {
        width: calc(100% - 28px) !important;
        max-width: none !important;
        min-height: 68px;
        height: 68px;
        gap: 12px;
    }

    .cw-desktop-nav,
    .cw-account-link,
    .cw-header-quote { display: none !important; }

    .cw-mobile-nav-toggle {
        display: inline-grid !important;
        place-items: center;
        margin-left: auto;
    }

    .cw-site-logo img {
        width: auto;
        max-width: min(160px, calc(100vw - 94px));
        height: 58px;
    }
}

@media (max-width: 430px) {
    .cw-header-inner { width: calc(100% - 22px) !important; }
    .cw-site-logo img { max-width: 145px; height: 54px; }
    .cw-mobile-nav { width: min(390px, 92vw); }
}

@media (prefers-reduced-motion: reduce) {
    .cw-nav-scrim,
    .cw-mobile-nav,
    .cw-nav-submenu,
    .cw-mobile-nav-parent > svg { transition-duration: .01ms !important; }
}
