/**
 * Unity canonical public header — the only stylesheet with authority over it.
 *
 * Unity owns branding, spacing, typography, breakpoints. accessible-menu 4.4.0
 * owns dropdown state (am-open / am-closed / am-transitioning).
 *
 * Every selector is scoped under .ua-site-header so page stylesheets cannot
 * reposition or resize the header, and header rules cannot leak into content.
 */

.ua-site-header {
    --ua-navy: #0b1426;
    --ua-gold: #c9a84c;
    --ua-gold-line: rgba(201, 168, 76, 0.28);
    --ua-text: #e8e5df;
    --ua-muted: rgba(230, 226, 218, 0.68);
    --ua-utility-h: 54px;
    --ua-bar-h: 82px;

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1035;
    width: 100%;
    background: var(--ua-navy);
    border-bottom: 1px solid var(--ua-gold-line);
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ua-site-header *,
.ua-site-header *::before,
.ua-site-header *::after {
    box-sizing: border-box;
}

/* Total header height — consumed by page templates that offset fixed chrome. */
:root {
    --ua-header-h: 136px;
}

/* ── Utility strip ─────────────────────────────────────────────────────── */

.ua-site-header .ua-header-utility {
    --ua-utility-gap: clamp(18px, 2.2vw, 28px);
    position: static;
    min-height: var(--ua-utility-h);
    background: linear-gradient(90deg, #182232 0%, #243248 48%, #182232 100%);
    border-bottom: 1px solid rgba(201, 168, 76, 0.38);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ua-site-header .ua-header-utility-inner {
    /* Same frame as logo + login (.ua-header-inner). Strip bg stays full-bleed. */
    width: min(100% - 32px, 1440px);
    margin-inline: auto;
    min-height: var(--ua-utility-h);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: var(--ua-utility-gap);
    padding-block: 8px;
    padding-inline: 0;
}

.ua-site-header .ua-utility-tagline {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #f5f3ef;
    -webkit-font-smoothing: antialiased;
}

.ua-site-header .ua-utility-tagline-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ua-site-header .ua-utility-tagline .ua-utility-sep {
    color: var(--ua-gold);
    font-weight: 500;
    opacity: 0.92;
}

.ua-site-header .ua-utility-tagline .ua-utility-emphasis {
    font-weight: 600;
    color: #ffffff;
}

.ua-site-header .ua-utility-contact {
    display: contents;
}

.ua-site-header .ua-utility-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #f5f3ef;
    white-space: nowrap;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
}

.ua-site-header .ua-utility-link:hover {
    color: #e2c97e;
}

.ua-site-header .ua-utility-icon {
    display: block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

/* ── Header bar ────────────────────────────────────────────────────────── */

.ua-site-header .ua-header-inner {
    width: min(100% - 32px, 1440px);
    min-height: var(--ua-bar-h);
    margin-inline: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(12px, 1.6vw, 28px);
}

.ua-site-header .ua-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.ua-site-header .ua-brand img {
    display: block;
    width: clamp(150px, 13vw, 190px);
    max-height: 76px;
    height: auto;
    object-fit: contain;
}

.ua-site-header .ua-nav {
    position: static;
    min-width: 0;
}

.ua-site-header .ua-main-menu,
.ua-site-header .ua-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ua-site-header .ua-main-menu {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: clamp(7px, 0.9vw, 16px);
}

.ua-site-header .ua-main-menu > li {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
}

.ua-site-header .ua-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 0;
    font-size: 16.25px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--ua-text);
    white-space: nowrap;
    text-decoration: none;
}

.ua-site-header .ua-nav-link:hover,
.ua-site-header .ua-nav-link:focus-visible {
    color: var(--ua-gold);
}

.ua-site-header .ua-nav-icon {
    display: inline-flex;
    align-items: center;
    flex: 0 0 17.6px;
}

.ua-site-header .ua-nav-icon img {
    display: block;
    width: 17.6px;
    height: 17.6px;
}

.ua-site-header .ua-top-link {
    display: flex;
    align-items: center;
    gap: 1px;
}

.ua-site-header .ua-submenu-toggle {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    min-height: 36px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--ua-text);
    cursor: pointer;
}

.ua-site-header .ua-submenu-toggle:hover,
.ua-site-header .ua-submenu-toggle:focus-visible {
    color: var(--ua-gold);
}

.ua-site-header .ua-caret {
    display: block;
    width: 7px;
    height: 7px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.18s ease;
}

.ua-site-header .ua-submenu-toggle[aria-expanded="true"] .ua-caret {
    transform: translateY(1px) rotate(225deg);
}

/* ── Dropdown panel ───────────────────────────────────────────────────────
 * Anchored directly against the parent hit area — no margin, no pointer gap.
 */

.ua-site-header .ua-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 460px;
    max-width: calc(100vw - 32px);
    padding: 18px 18px 16px;
    background: var(--ua-navy);
    border: 1px solid var(--ua-gold-line);
    border-top: 2px solid var(--ua-gold);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    column-count: 2;
    column-gap: 22px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    /* visibility flips discretely after the fade so Safari/WebKit never reports
       a half-open panel, and pointer travel never crosses a hidden gap. */
    transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms;
}

.ua-site-header .ua-submenu[data-ua-columns="3"] {
    width: 660px;
    column-count: 3;
}

/* Later items open leftward so wide panels stay inside the viewport. */
.ua-site-header .ua-main-menu > .ua-has-submenu:nth-child(n + 4) > .ua-submenu {
    left: auto;
    right: 0;
}

.ua-site-header .ua-submenu.am-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 0s;
}

.ua-site-header .ua-submenu.am-closed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* A group is one column on desktop and one collapsed disclosure below 1180px. */
.ua-site-header .ua-submenu-group {
    break-inside: avoid;
    break-before: column;
}

.ua-site-header .ua-submenu-group:first-child {
    break-before: avoid;
}

.ua-site-header .ua-submenu-subtoggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0 0 8px;
    padding: 0 0 9px;
    border: 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.22);
    background: transparent;
    font: inherit;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    line-height: 1.3;
    text-align: left;
    text-transform: uppercase;
    color: var(--ua-gold);
    cursor: pointer;
}

.ua-site-header .ua-submenu-subtoggle .ua-caret {
    flex: 0 0 auto;
}

.ua-site-header .ua-submenu-subtoggle[aria-expanded="true"] .ua-caret {
    transform: translateY(1px) rotate(225deg);
}

/* Desktop: every group stays open as a column. The library still toggles
 * am-closed on siblings; these rules keep the links painted either way. */
@media (min-width: 1181px) {
    .ua-site-header .ua-submenu.am-open > .ua-submenu-group > .ua-submenu {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        column-count: 1;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .ua-site-header .ua-submenu-subtoggle .ua-caret {
        display: none;
    }
}

.ua-site-header .ua-submenu-item {
    break-inside: avoid;
}

.ua-site-header .ua-submenu-link {
    display: block;
    padding: 5px 0;
    font-size: 0.83rem;
    line-height: 1.3;
    color: var(--ua-muted);
    border-bottom: 1px solid rgba(201, 168, 76, 0.24);
    text-decoration: none;
    transition: color 0.15s ease, padding-left 0.12s ease;
}

.ua-site-header .ua-submenu-link:hover,
.ua-site-header .ua-submenu-link:focus-visible {
    color: var(--ua-gold);
    padding-left: 5px;
}

/* ── Actions (login / account) ─────────────────────────────────────────── */

.ua-site-header .ua-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    justify-self: end;
}

.ua-site-header .ua-nav-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 4.8px;
    padding: 5.6px 12px;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ua-site-header .ua-nav-login-btn i {
    font-size: 0.98rem;
    opacity: 0.9;
}

.ua-site-header .ua-nav-login-btn:hover,
.ua-site-header .ua-nav-login-btn:focus-visible {
    border-color: rgba(201, 168, 76, 0.6);
    background: rgba(201, 168, 76, 0.08);
}

.ua-site-header .ua-account-nav-btn {
    max-width: min(48vw, 11.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Collapse controller ──────────────────────────────────────────────── */

.ua-site-header .ua-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ua-site-header .ua-menu-toggle:hover,
.ua-site-header .ua-menu-toggle:focus-visible {
    border-color: #e2c97e;
}

.ua-site-header .ua-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
}

.ua-site-header .ua-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ua-site-header .ua-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.ua-site-header .ua-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.ua-site-header :focus-visible {
    outline: 2px solid #e2c97e;
    outline-offset: 2px;
}

/* ── Compact desktop: 1180 → 1320 shrinks type and gaps before collision ── */

@media (min-width: 1181px) and (max-width: 1320px) {
    .ua-site-header .ua-nav-link {
        font-size: 15px;
    }

    .ua-site-header .ua-brand img {
        width: clamp(150px, 12vw, 170px);
    }
}

/* ── Collapsed navigation ──────────────────────────────────────────────── */

@media (max-width: 1180px) {
    :root {
        --ua-header-h: 131px;
    }

    .ua-site-header {
        --ua-bar-h: 77px;
    }

    .ua-site-header .ua-header-inner {
        min-height: var(--ua-bar-h);
        gap: 12px;
    }

    .ua-site-header .ua-brand img {
        width: clamp(150px, 34vw, 202px);
        max-height: 53px;
    }

    .ua-site-header .ua-nav {
        justify-self: end;
    }

    .ua-site-header .ua-menu-toggle {
        display: inline-flex;
    }

    .ua-site-header .ua-main-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        max-height: calc(100dvh - var(--ua-header-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 8px 20px 24px;
        background: var(--ua-navy);
        border-top: 1px solid var(--ua-gold-line);
        box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
    }

    html.ua-js .ua-site-header .ua-main-menu.am-closed {
        display: none;
    }

    .ua-site-header .ua-main-menu.am-open {
        display: flex;
    }

    .ua-site-header .ua-main-menu > li {
        position: static;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .ua-site-header .ua-main-menu > li > .ua-nav-link,
    .ua-site-header .ua-top-link {
        width: 100%;
    }

    .ua-site-header .ua-top-link > .ua-nav-link {
        flex: 1 1 auto;
    }

    .ua-site-header .ua-nav-link {
        gap: 14px;
        padding: 15px 4px;
        font-size: 1.02rem;
        font-weight: 600;
    }

    .ua-site-header .ua-nav-icon,
    .ua-site-header .ua-nav-icon img {
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
    }

    .ua-site-header .ua-submenu-toggle {
        width: 48px;
        height: 48px;
        min-width: 48px;
        flex: 0 0 48px;
    }

    .ua-site-header .ua-submenu,
    .ua-site-header .ua-main-menu > .ua-has-submenu:nth-child(n + 4) > .ua-submenu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        max-width: none;
        column-count: 1;
        padding: 2px 0 10px 18px;
        background: rgba(255, 255, 255, 0.03);
        border: 0;
        border-left: 3px solid var(--ua-gold);
        border-radius: 0;
        box-shadow: none;
        transform: none;
        transition: none;
    }

    html.ua-js .ua-site-header .ua-submenu.am-closed {
        display: none;
    }

    .ua-site-header .ua-submenu.am-open {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .ua-site-header .ua-submenu-link {
        padding: 11px 0;
        font-size: 0.92rem;
        white-space: normal;
        border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    }

    .ua-site-header .ua-submenu-group {
        break-before: auto;
    }

    .ua-site-header .ua-submenu-subtoggle {
        margin: 0;
        padding: 13px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 0.67rem;
        letter-spacing: 0.14em;
    }

    .ua-site-header .ua-submenu .ua-submenu {
        padding: 0 0 8px 12px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
}

/* Root navigation always visible on wide viewports, regardless of the
 * collapse controller's stored state. */
@media (min-width: 1181px) {
    .ua-site-header .ua-main-menu,
    .ua-site-header .ua-main-menu.am-open,
    .ua-site-header .ua-main-menu.am-closed {
        display: flex;
    }
}

/* ── Mobile utility strip: phone + email only (desktop unchanged) ─────── */

@media (max-width: 767.98px) {
    .ua-site-header {
        --ua-utility-h: 68px;
    }

    :root {
        --ua-header-h: calc(var(--ua-utility-h) + var(--ua-bar-h, 77px));
    }

    .ua-site-header .ua-utility-tagline {
        display: none !important;
    }

    .ua-site-header .ua-header-utility-inner {
        width: min(100% - 24px, 1440px);
        padding-inline: max(0px, env(safe-area-inset-left, 0px)) max(0px, env(safe-area-inset-right, 0px));
        padding-block: 8px;
        min-height: var(--ua-utility-h);
        justify-content: stretch;
        gap: clamp(8px, 2.5vw, 12px);
    }

    .ua-site-header .ua-utility-contact {
        display: flex !important;
        flex: 1 1 100%;
        width: 100%;
        align-items: stretch;
        justify-content: space-between;
        gap: clamp(8px, 2.5vw, 12px);
    }

    .ua-site-header .ua-utility-link {
        flex: 1 1 0;
        min-width: 0;
        max-width: 100%;
        justify-content: center;
        font-size: clamp(11px, 2.85vw, 13px);
        font-weight: 500;
        line-height: 1.25;
        gap: 6px;
        min-height: 44px;
        padding-inline: clamp(4px, 1.5vw, 8px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-tap-highlight-color: rgba(201, 168, 76, 0.28);
    }

    .ua-site-header .ua-utility-link span {
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }

    .ua-site-header .ua-utility-link .ua-utility-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    /* ~15% larger than collapsed-nav defaults (150–202px / 53px cap) */
    .ua-site-header .ua-brand img {
        width: clamp(173px, 39vw, 232px);
        max-height: 61px;
    }
}

/* ── Narrow phones ────────────────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .ua-site-header .ua-header-inner {
        width: min(100% - 24px, 1440px);
    }

    .ua-site-header .ua-header-utility-inner {
        width: min(100% - 24px, 1440px);
        padding-inline: 0;
    }
}

@media (max-width: 400px) {
    .ua-site-header {
        --ua-bar-h: 68px;
    }

    :root {
        --ua-header-h: calc(var(--ua-utility-h, 68px) + var(--ua-bar-h));
    }

    .ua-site-header .ua-header-inner {
        gap: 8px;
    }

    .ua-site-header .ua-brand img {
        width: clamp(124px, 37vw, 173px);
        max-height: 51px;
    }

    .ua-site-header .ua-nav-login-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .ua-site-header .ua-menu-toggle {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ua-site-header .ua-submenu,
    .ua-site-header .ua-caret,
    .ua-site-header .ua-menu-toggle span {
        transition: none;
    }
}
