/* ========== Site Header ========== */
:root {
    --header-navy: var(--brand-primary, #001e3c);
    --header-gold: var(--brand-accent, #c59d5f);
    --header-gold-hover: var(--brand-accent-hover, #b08a4f);
    --header-overlay-height: 5rem;
}

.site-header {
    width: 100%;
    z-index: 50;
}

.site-header__container {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .site-header__container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .site-header__container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ----- Solid (inner pages) ----- */
.site-header--solid {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid #e7e9f3;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dark .site-header--solid {
    background: var(--background-dark, #101322);
    border-bottom-color: #2a2e3b;
}

/* ----- Overlay (home page) ----- */
.is-home-page .site-header--overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: linear-gradient(
        180deg,
        rgba(0, 20, 45, 0.92) 0%,
        rgba(0, 20, 45, 0.72) 45%,
        rgba(0, 20, 45, 0.28) 75%,
        transparent 100%
    );
    border-bottom: none;
    box-shadow: none;
}

/* ----- Main bar: logo | menu | actions ----- */
.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 4.5rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.site-header__logo-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 0 0 auto;
    min-width: 0;
    max-width: min(210px, 38vw);
}

@media (min-width: 1280px) {
    .site-header__logo-link {
        max-width: 200px;
    }
}

.site-header__logo {
    height: 3.25rem;
    width: auto;
    max-width: min(210px, 52vw);
    object-fit: contain;
    transition: transform 0.2s ease;
}

@media (min-width: 640px) {
    .site-header__logo {
        height: 3.75rem;
        max-width: none;
        width: 200px;
    }
}

.site-header__logo-link:hover .site-header__logo {
    transform: scale(1.03);
}

.site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
    min-width: 0;
}

/* Customer notifications */
.site-header__notifications{position:relative;flex:0 0 auto}
.site-header__notification-btn{position:relative;display:grid;place-items:center;width:40px;height:40px;border:1px solid #dfe6ee;border-radius:9px;background:#fff;color:var(--header-navy);cursor:pointer;transition:background .2s,border-color .2s,transform .2s}
.site-header__notification-btn:hover{transform:translateY(-1px);background:#f8fafc;border-color:#cbd6e2}
.site-header__notification-btn>.material-symbols-outlined{font-size:21px}
.site-header__notification-btn>b{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border:2px solid #fff;border-radius:999px;background:#e5484d;color:#fff;font-size:9px;line-height:1}
.site-header--overlay .site-header__notification-btn{border-color:rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff}
.site-header__notification-menu{position:absolute;top:calc(100% + 10px);right:0;z-index:100;width:min(390px,calc(100vw - 28px));overflow:hidden;border:1px solid #dfe6ee;border-radius:14px;background:#fff;color:#14213d;box-shadow:0 18px 45px rgba(15,35,60,.2)}
.site-header__notification-menu[hidden]{display:none}
.site-header__notification-menu>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #edf1f5}
.site-header__notification-menu>header>div{display:flex;align-items:center;gap:8px}
.site-header__notification-menu>header strong{color:var(--header-navy);font-size:14px}
.site-header__notification-menu>header span{padding:3px 6px;border-radius:999px;background:#fff0f0;color:#d33d43;font-size:8px;font-weight:800}
.site-header__notification-menu>header button{border:0;background:none;color:#168b3b;font-size:10px;font-weight:800;cursor:pointer}
.site-header__notification-list{max-height:390px;overflow-y:auto}
.site-header__notification-item{position:relative;display:grid;grid-template-columns:40px minmax(0,1fr) 8px;gap:10px;padding:13px 14px;border-bottom:1px solid #edf1f5;color:#334155;transition:background .2s}
.site-header__notification-item:hover{background:#f8fafc}
.site-header__notification-item.is-unread{background:#f3fbf5}
.site-header__notification-item.is-unread:hover{background:#eaf7ed}
.site-header__notification-item>i{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:#eaf3fd;color:#1668a8;font-style:normal}
.site-header__notification-item:nth-child(3n+2)>i{background:#f1eaff;color:#7448c8}
.site-header__notification-item:nth-child(3n)>i{background:#e5f8ee;color:#168b5b}
.site-header__notification-item>i span{font-size:20px}
.site-header__notification-item>span{display:flex;min-width:0;flex-direction:column}
.site-header__notification-item strong{overflow:hidden;color:#243247;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.site-header__notification-item small{display:-webkit-box;margin-top:3px;overflow:hidden;color:#68778b;font-size:9px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.site-header__notification-item time{margin-top:5px;color:#9aa6b6;font-size:8px}
.site-header__notification-item>b{align-self:start;width:7px;height:7px;margin-top:4px;border-radius:50%;background:#13b744}
.site-header__notification-empty{display:flex;align-items:center;flex-direction:column;padding:34px 20px;text-align:center}
.site-header__notification-empty>.material-symbols-outlined{margin-bottom:8px;color:#aab5c2;font-size:34px}
.site-header__notification-empty strong{color:#435167;font-size:12px}
.site-header__notification-empty small{margin-top:4px;color:#8794a6;font-size:9px}
.site-header__notification-menu>footer{padding:8px;background:#f8fafc}
.site-header__notification-menu>footer a{display:flex;align-items:center;justify-content:center;height:36px;border-radius:7px;background:#fff;color:var(--header-navy);font-size:10px;font-weight:800;box-shadow:0 2px 8px rgba(15,35,60,.06)}

@media(max-width:767px){
    .site-header__notification-btn{width:38px;height:38px}
    .site-header__notification-menu{position:fixed;top:72px;right:14px;left:14px;width:auto}
}

@media (min-width: 640px) {
    .site-header__actions {
        gap: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .site-header__actions {
        gap: 1rem;
    }
}

/* Auth buttons (login / register) */
.site-header__auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 2.5rem;
    padding: 0 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.site-header__auth-btn-icon {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

.site-header__auth-btn-icon--img {
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
    border-radius: 0.25rem;
}

.site-header__auth-btn-label {
    line-height: 1.2;
}

.site-header__auth-btn--outline {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.site-header__auth-btn--outline:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.site-header--solid .site-header__auth-btn--outline {
    background: rgba(0, 30, 60, 0.06);
    border-color: rgba(0, 30, 60, 0.18);
    color: var(--header-navy, #001e3c);
}

.site-header--solid .site-header__auth-btn--outline:hover {
    background: rgba(0, 30, 60, 0.1);
    border-color: rgba(0, 30, 60, 0.28);
}

.site-header__auth-btn--primary {
    background: var(--header-gold, #c59d5f);
    border-color: var(--header-gold, #c59d5f);
    color: #fff;
    box-shadow: 0 2px 8px rgb(197 157 95 / 0.35);
}

.site-header__auth-btn--primary:hover {
    background: #b08a4f;
    border-color: #b08a4f;
}

.site-header--solid .site-header__auth-btn--primary {
    background: var(--header-navy, #001e3c);
    border-color: var(--header-navy, #001e3c);
    box-shadow: 0 2px 8px rgb(0 30 60 / 0.2);
}

.site-header--solid .site-header__auth-btn--primary:hover {
    background: #002a54;
    border-color: #002a54;
}

/* Account buttons */
.site-header__account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-header--overlay .site-header__account-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
}

.site-header--overlay .site-header__account-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.site-header--solid .site-header__account-btn {
    background: var(--header-navy, #001e3c);
    border: 1px solid transparent;
    color: #fff;
}

.site-header--solid .site-header__account-btn:hover {
    background: #002a54;
}

.site-header__account-btn--ghost {
    background: rgba(0, 30, 60, 0.08);
    border: 1px solid rgba(0, 30, 60, 0.15);
    color: var(--header-navy);
}

.site-header--overlay .site-header__account-btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* ----- Navigation (center column) ----- */
.site-header__nav-row {
    display: none;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 0.5rem;
}

@media (min-width: 1024px) {
    .site-header__nav-row {
        display: flex !important;
    }
}

.site-header__nav-item {
    position: relative;
}

/* Keep hover alive while moving from label into the panel */
.site-header__nav-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.75rem;
    z-index: 59;
}

.site-header__nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    max-width: 100%;
    overflow: visible;
}

@media (min-width: 1280px) {
    .site-header__nav {
        gap: 0.125rem;
    }
}

.site-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 0.25rem;
    transition: color 0.2s ease, background 0.2s ease;
}

@media (min-width: 1280px) {
    .site-header__nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        letter-spacing: 0.06em;
    }
}

/* Overlay nav */
.site-header--overlay .site-header__nav-link {
    color: rgba(255, 255, 255, 0.88);
}

.site-header--overlay .site-header__nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.site-header--overlay .site-header__nav-link.is-active {
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--header-gold);
}

/* Solid nav */
.site-header--solid .site-header__nav-link {
    color: #334155;
}

.dark .site-header--solid .site-header__nav-link {
    color: #cbd5e1;
}

.site-header--solid .site-header__nav-link:hover {
    color: var(--header-navy);
    background: rgba(0, 30, 60, 0.05);
}

.site-header--solid .site-header__nav-link.is-active {
    color: var(--header-navy);
    font-weight: 700;
    box-shadow: inset 0 -2px 0 var(--header-gold);
}

.dark .site-header--solid .site-header__nav-link.is-active {
    color: #fff;
}

/* Click-open dropdowns (account menus) */
.site-header #userMenu,
.site-header #authMenu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    min-width: 14rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e7e9f3;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 60;
}

.dark .site-header #userMenu,
.dark .site-header #authMenu {
    background: #1a1d2d;
    border-color: #2a2e3f;
}

.site-header #userMenu.hidden,
.site-header #authMenu.hidden {
    display: none;
}

/* Hover dropdowns (nav menus) */
.site-header__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    padding-top: 0.5rem; /* invisible bridge — no hover gap */
    min-width: 12rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 60;
}

.site-header__dropdown > div {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e7e9f3;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.dark .site-header__dropdown > div {
    background: #1a1d2d;
    border-color: #2a2e3f;
}

.site-header__nav-item:hover > .site-header__dropdown,
.site-header__nav-item:focus-within > .site-header__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow: visible;
}

/* Nested flyout (e.g. Tour ghép đoàn → departures) */
.site-header__submenu {
    position: relative;
}

.site-header__submenu::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 0.75rem;
    z-index: 69;
}

.site-header__dropdown--flyout {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 0;
    padding-top: 0;
    padding-left: 0.5rem; /* horizontal bridge to flyout */
    background: transparent;
    border: 0;
    box-shadow: none;
    z-index: 70;
}

.site-header__dropdown--flyout > div {
    min-width: 12rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e7e9f3;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.dark .site-header__dropdown--flyout > div {
    background: #1a1d2d;
    border-color: #2a2e3f;
}

.site-header__submenu:hover > .site-header__dropdown--flyout,
.site-header__submenu:focus-within > .site-header__dropdown--flyout {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.site-header__dropdown-link {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #0f172a;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Account menu: keep icons optically centered with labels */
.site-header #userMenu .site-header__dropdown-link,
.site-header #userMenu #logoutForm button {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    line-height: 1.25;
}

.site-header #userMenu .site-header__dropdown-link .material-symbols-outlined,
.site-header #userMenu #logoutForm .material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.site-header #userMenu .site-header__dropdown-link > span:last-child,
.site-header #userMenu #logoutForm button > span:last-child {
    line-height: 1.25;
}

.site-header__dropdown-link--parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.site-header__submenu:hover > .site-header__dropdown-link--parent,
.site-header__submenu:focus-within > .site-header__dropdown-link--parent {
    background: #f8fafc;
    color: var(--header-navy);
}

.site-header__dropdown-link:hover {
    background: #f8fafc;
    color: var(--header-navy);
}

.site-header__dropdown-link.is-active {
    color: var(--header-navy);
    font-weight: 600;
}

.dark .site-header__dropdown-link {
    color: #e2e8f0;
}

.dark .site-header__dropdown-link:hover {
    background: #2a2e3f;
    color: #fff;
}

/* Locale switcher overlay variant */
.locale-switcher--overlay .locale-switcher__btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.locale-switcher--overlay .locale-switcher__btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.locale-switcher--overlay .locale-switcher__btn .material-symbols-outlined {
    color: rgba(255, 255, 255, 0.8);
}

/* Home page: hero extends under header */
.is-home-page .home-hero {
    margin-top: 0;
    padding-top: var(--header-overlay-height);
}
