/* === SITE HEADER (global) === */
:root {
    --site-header-height: 76px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--site-header-height);
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-header--home {
    background: transparent;
    border-bottom: 1px solid transparent;
}

.site-header--home.is-scrolled,
.site-header--solid {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 32px rgba(0, 14, 52, 0.12);
}

.site-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.site-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-header-brand .custom-logo-link,
.site-header-brand .custom-logo-link img {
    max-width: 72px;
    width: auto;
    height: auto;
    display: block;
}

.site-header-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-header-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.site-header-nav {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.site-header-nav .nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header-nav .nav-menu > li {
    margin: 0;
}

.site-header-nav .nav-menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-tertiary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
}

.site-header-nav .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.site-header-nav .nav-menu .current-menu-item > a,
.site-header-nav .nav-menu .current_page_item > a {
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
}

.site-header-nav .nav-menu .current-menu-item > a::after,
.site-header-nav .nav-menu .current_page_item > a::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-secondary);
}

.site-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.header-auth-guest {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-family: var(--font-tertiary);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.header-btn:hover {
    transform: translateY(-1px);
}

.header-btn--ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    background: transparent;
}

.header-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.header-btn--primary {
    color: #0a1a4a;
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    box-shadow: 0 4px 14px rgba(76, 255, 0, 0.28);
}

.header-btn--primary:hover {
    box-shadow: 0 8px 20px rgba(76, 255, 0, 0.35);
}

.header-auth-user {
    position: relative;
}

.header-user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 12px 4px 4px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-family: var(--font-tertiary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-user-menu-btn:hover,
.header-auth-user.is-open .header-user-menu-btn {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #d9e0f5;
    flex-shrink: 0;
}

.header-user-menu-btn .fa-chevron-down {
    font-size: 0.75rem;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.header-auth-user.is-open .header-user-menu-btn .fa-chevron-down {
    transform: rotate(180deg);
}

.header-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0, 67, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 14, 52, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.header-auth-user.is-open .header-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-user-dropdown a,
.header-user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-tertiary);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.header-user-dropdown a:hover,
.header-user-dropdown button:hover {
    background: rgba(0, 67, 255, 0.06);
}

.header-user-dropdown button {
    color: #b42318;
}

/* Drawer mobile */
.site-header-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 14, 52, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}

.site-header-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.site-header-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 88vw);
    height: 100vh;
    background: #fff;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: -12px 0 40px rgba(0, 14, 52, 0.18);
}

.site-header-drawer.is-open {
    transform: translateX(0);
}

.site-header-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.site-header-drawer-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(0, 67, 255, 0.08);
    color: var(--color-primary);
    font-size: 1.1rem;
    cursor: pointer;
}

.site-header-drawer .nav-menu--mobile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header-drawer .nav-menu--mobile a {
    display: block;
    padding: 14px 12px;
    border-radius: 12px;
    color: var(--color-primary);
    font-family: var(--font-tertiary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.site-header-drawer .nav-menu--mobile a:hover,
.site-header-drawer .nav-menu--mobile .current-menu-item > a,
.site-header-drawer .nav-menu--mobile .current_page_item > a {
    background: rgba(0, 67, 255, 0.08);
}

.site-header-drawer-auth {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 67, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-header-drawer-auth .header-btn {
    width: 100%;
}

.site-header-drawer-auth .header-btn--ghost {
    color: var(--color-primary);
    border-color: rgba(0, 67, 255, 0.25);
}

.site-header-drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 67, 255, 0.06);
    margin-bottom: 8px;
}

.site-header-drawer-user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-green);
}

.site-header-drawer-user-name {
    font-family: var(--font-tertiary);
    font-weight: 700;
    color: var(--color-primary);
}

body.site-header-drawer-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    :root {
        --site-header-height: 68px;
    }

    .site-header-inner {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 14px;
    }

    .site-header-brand {
        width: 100%;
        justify-content: space-between;
    }

    .site-header-nav {
        display: none;
    }

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

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

    .site-header-brand .custom-logo-link img {
        max-width: 58px;
    }
}

@media (min-width: 901px) {
    .site-header-drawer,
    .site-header-overlay {
        display: none !important;
    }
}
