/* Site header & navigation — v3 */
.site-header {
    background: #fff;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 1px 0 rgba(var(--primary-rgb), 0.06);
}
.site-header.is-scrolled {
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.1);
}

.site-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0;
    min-height: var(--header-height, 4.25rem);
}

.site-header .logo {
    flex: 0 0 auto;
    order: 1;
}
.site-header .brand-logo-header {
    height: 46px;
    width: auto;
    display: block;
}

.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    order: 3;
}

.site-header .main-nav {
    flex: 1 1 auto;
    order: 2;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.site-header .header-flash-cards-btn {
    order: 2;
    flex-shrink: 0;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.35);
    white-space: nowrap;
}
.site-header .header-flash-cards-btn.is-active {
    filter: brightness(0.95);
    outline: 2px solid rgba(var(--primary-rgb), 0.35);
    outline-offset: 2px;
}

.site-header .nav-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 12px;
    max-width: 100%;
}

.site-header .nav-list li {
    margin: 0;
    padding: 0;
}

.site-header .nav-link {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    line-height: 1.3;
    transition: background 0.15s, color 0.15s;
}

.site-header .nav-link:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark);
}

.site-header .nav-link.is-active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 1px 4px rgba(var(--primary-rgb), 0.12);
}

.site-header .nav-link-featured {
    background: var(--primary);
    color: #fff !important;
}
.site-header .nav-link-featured:hover {
    background: var(--primary-dark);
    filter: none;
}
.site-header .nav-link-featured.is-active {
    box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.35);
}

.site-header .menu-toggle {
    display: none;
}

.site-header .header-actions .btn-sm {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
}

.site-header .lang-switch {
    display: inline-flex;
    padding: 2px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
}
.site-header .lang-switch-btn {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.45rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
}
.site-header .lang-switch-btn.is-active {
    background: #fff;
    color: var(--primary-dark);
}

.site-header .cart-btn {
    padding: 0.35rem;
    color: var(--text);
}

/* Desktop */
@media (min-width: 992px) {
    .site-header .main-nav {
        display: flex !important;
        position: static !important;
        width: auto !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .site-header .nav-list {
        flex-direction: row !important;
        width: auto !important;
    }
    .site-header .menu-toggle {
        display: none !important;
    }
}

/* Mobile & tablet */
@media (max-width: 991px) {
    .site-header .header-inner {
        flex-wrap: wrap;
    }
    .site-header .logo {
        order: 1;
    }
    .site-header .header-flash-cards-btn {
        order: 2;
    }
    .site-header .header-actions {
        order: 3;
        margin-inline-start: auto;
    }
    .site-header .main-nav {
        order: 4;
        flex: 1 0 100%;
        display: none;
        justify-content: stretch;
    }
    .site-header .main-nav.open {
        display: flex;
    }
    .site-header .nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        border-radius: var(--radius-md);
        padding: 0.5rem;
    }
    .site-header .nav-link {
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    .site-header .nav-list li:has(.nav-link-featured) {
        order: -1;
    }
    .site-header .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
    }
    .site-header .menu-toggle span {
        width: 22px;
        height: 2px;
        background: var(--text);
        transition: transform 0.2s, opacity 0.2s;
    }
    .site-header .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .site-header .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    .site-header .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    body.nav-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .site-header .header-btn-register,
    .site-header .header-btn-admin .header-btn-label {
        display: none;
    }
    .site-header .header-flash-cards-label {
        display: none;
    }
}

html[dir="ltr"] .site-header .header-inner {
    direction: ltr;
}
