.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(249, 249, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(196, 197, 213, 0.6);
}

.site-header__inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header__logo {
    flex: 0 0 auto;
}

.site-header__nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    margin: 0;
}

.site-header__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-left: auto;
}

.site-header__menu {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-header__menu > li {
    position: relative;
}

.site-header__menu > .menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.site-header__menu > .menu-item-has-children > a::after {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
    opacity: 0.7;
}

.site-header__menu > .menu-item-has-children::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.5rem;
}

.site-header__menu a {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.site-header__menu a:hover,
.site-header__menu .current-menu-item > a,
.site-header__menu .current-menu-ancestor > a,
.site-header__menu .current-menu-parent > a {
    color: var(--color-navy);
    font-weight: 700;
}

.site-header__menu > .current-menu-item > a,
.site-header__menu > .current-menu-ancestor > a,
.site-header__menu > .current-menu-parent > a {
    border-bottom: 3px solid var(--color-navy);
    padding-bottom: 0.2rem;
}

.site-header__menu .sub-menu {
    display: block;
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    min-width: 232px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    background: #fff;
    border: 1px solid #e6ebf4;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 32, 104, 0.1);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.site-header__menu > .menu-item-has-children:last-child > .sub-menu {
    left: auto;
    right: 0;
}

.site-header__menu .menu-item-has-children:hover > .sub-menu,
.site-header__menu .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.site-header__menu .menu-item-has-children:hover > a,
.site-header__menu .menu-item-has-children:focus-within > a {
    color: var(--color-navy);
}

.site-header__menu .sub-menu a {
    display: block;
    padding: 0.62rem 0.8rem;
    border: 0;
    border-radius: 9px;
    color: var(--color-navy);
    font-weight: 500;
}

.site-header__menu .sub-menu .current-menu-item > a,
.site-header__menu .sub-menu a:hover {
    color: var(--color-navy);
    background: #eef3ff;
    font-weight: 600;
}

.site-header__logo img {
    height: 52px;
    width: auto;
    display: block;
}

.site-header__search {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 0.15rem;
}

.site-header__search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-navy);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-header__search-toggle:hover,
.site-header__search.is-open .site-header__search-toggle {
    background: rgba(0, 32, 104, 0.06);
}

.site-header__search-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 70;
    width: min(340px, calc(100vw - 2rem));
    padding: 0.55rem;
    border: 1px solid rgba(0, 32, 104, 0.12);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(0, 32, 104, 0.12);
}

.site-header__search-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.site-header__search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--color-navy);
    background: #f8f9fc;
}

.site-header__search-form input[type="search"]:focus {
    outline: 2px solid rgba(0, 32, 104, 0.25);
    outline-offset: 1px;
    background: #fff;
}

.site-header__search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--color-navy);
    color: #fff;
    cursor: pointer;
    flex: 0 0 auto;
}

.site-header__search-submit:hover {
    filter: brightness(1.08);
}

.site-header__cta {
    padding: 0.65rem 1.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: none;
    white-space: nowrap;
}

.site-header__cta--signup {
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.site-header__user {
    display: inline-flex;
    align-items: stretch;
    min-height: 42px;
    border: 1px solid rgba(0, 32, 104, 0.14);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 32, 104, 0.04);
    overflow: hidden;
}

.site-header__user--portal {
    border-color: rgba(0, 32, 104, 0.18);
    background: linear-gradient(180deg, #fff 0%, #f7f8fc 100%);
}

.site-header__account {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    max-width: 11.5rem;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    color: var(--color-navy);
    text-decoration: none;
    transition: background 0.15s ease;
}

.site-header__account:hover {
    background: rgba(0, 32, 104, 0.04);
    color: var(--color-navy);
}

.site-header__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: #e8ecf4;
    border: 1.5px solid rgba(0, 32, 104, 0.12);
}

.site-header__avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 32, 104, 0.1);
    color: var(--color-navy);
    font-size: 0.75rem;
    font-weight: 700;
}

.site-header__account-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
    gap: 0.08rem;
}

.site-header__account-kicker {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8b93a7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-header__account-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-header__user-sep {
    width: 1px;
    margin: 0.45rem 0;
    background: rgba(0, 32, 104, 0.12);
    flex: 0 0 auto;
}

.site-header__logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.9rem 0 0.75rem;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-header__logout:hover {
    background: rgba(180, 35, 24, 0.06);
    color: #b42318;
}

.site-header__logout svg {
    flex: 0 0 auto;
}

.site-header__drawer-actions {
    display: none;
}

.site-header__toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    padding: 0;
    margin-left: auto;
    cursor: pointer;
}

.site-header__toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-navy);
}

@media (max-width: 1200px) {
    .site-header__menu {
        gap: 0.85rem;
    }

    .site-header__menu a {
        font-size: 0.82rem;
    }

    .site-header__cta {
        padding: 0.55rem 0.95rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 980px) {
    .site-header__inner {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0.25rem;
    }

    .site-header__toggle {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        margin-left: 0;
        justify-self: start;
    }

    .site-header__logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .site-header__logo img {
        height: 40px;
    }

    .site-header__actions {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
        justify-self: end;
    }

    .site-header__search-toggle {
        width: 44px;
        height: 44px;
    }

    .site-header__search-panel {
        position: fixed;
        top: 4.75rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    .site-header__search-form input[type="search"] {
        min-height: 44px;
    }

    .site-header__cta,
    .site-header__user {
        display: none;
    }

    .site-header__nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 40;
        max-height: calc(100dvh - 5.5rem);
        overflow-y: auto;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        display: none;
        margin: 0;
        padding: 0.5rem 1.25rem 1.25rem;
        justify-self: stretch;
        -webkit-overflow-scrolling: touch;
    }

    .site-header__nav.is-open {
        display: block;
    }

    .site-header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-header__menu > li > a,
    .site-header__menu .sub-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .site-header__menu > .current-menu-item > a,
    .site-header__menu > .current-menu-ancestor > a,
    .site-header__menu > .current-menu-parent > a {
        border-bottom: 0;
        padding: 0 0.85rem;
        border-radius: 10px;
        background: #eef3ff;
        box-shadow: inset 3px 0 0 var(--color-navy);
    }

    .site-header__menu .sub-menu .current-menu-item > a {
        border-radius: 8px;
        background: #eef3ff;
        font-weight: 600;
    }

    .site-header__drawer-actions {
        display: grid;
        gap: 0.65rem;
        margin-top: 0.75rem;
        padding-top: 0.85rem;
        border-top: 1px solid #e6ebf4;
    }

    .site-header__drawer-actions .akaiito-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .site-header__menu > .menu-item-has-children::before {
        display: none;
    }

    .site-header__menu .sub-menu {
        position: static;
        display: none;
        min-width: 0;
        margin-top: 0.25rem;
        padding: 0.25rem 0 0.25rem 0.35rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    .site-header__menu .menu-item-has-children.is-open > .sub-menu {
        display: block;
    }

    .site-header__cta {
        padding: 0.55rem 0.85rem;
        font-size: 0.7rem;
    }

    .site-header__account {
        max-width: 8.5rem;
    }

    .site-header__avatar {
        width: 28px;
        height: 28px;
    }

    .site-header__logout span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .site-header__logout {
        padding: 0 0.75rem;
    }
}

