/* css/header.css */
.header {
    background-color: var(--bg-page);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    border-bottom: 1px solid rgba(35, 33, 30, 0.05);
}

.header__container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header__logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    text-transform: uppercase;
}

/* Бургер-кнопка (скрыта на ПК) */
.header__burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    cursor: pointer;
    padding: 10px;
}

.header__burger-line {
    width: 100%;
    height: 1.5px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* Десктопный поиск */
.header__search {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface);
    border-radius: var(--border-radius-pill);
    padding: 8px 18px;
    width: 250px;
}

.header__search-icon {
    color: var(--text-secondary);
    margin-right: 8px;
}

.header__search input {
    width: 100%;
    font-size: 13.5px;
    color: var(--text-primary);
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header__nav-link {
    font-size: 14.5px;
    font-weight: 500;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Языковой переключатель */
.lang-switch {
    position: relative;
}
.lang-switch__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-surface);
    padding: 7px 14px;
    border-radius: var(--border-radius-pill);
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

.lang-switch__btn:hover,
.lang-switch.is-open .lang-switch__btn {
    background-color: #EFECE4;
    border-color: rgba(212, 175, 55, 0.3);
}
/* Выпадающее окно */
.lang-switch__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px); /* Отступ окна вниз */
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.1);
    padding: 6px;
    min-width: 140px;
    z-index: 150;
    border: 1px solid rgba(35, 33, 30, 0.08);
}

/* НЕВИДИМЫЙ МОСТ: перекрывает 8px пустоты, чтобы курсор не терялся */
.lang-switch__dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent; /* Абсолютно прозрачная зона-ловушка для мыши */
}

/* Открытие и при наведении, и при клике */
.lang-switch:hover .lang-switch__dropdown,
.lang-switch.is-open .lang-switch__dropdown {
    display: block;
    animation: fadeInDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.header__admin-badge {
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: #1C1B18;
    color: #F5E0A3;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 6px 12px;
    border-radius: var(--border-radius-pill);
    transition: all 0.2s;
}
.header__admin-badge:hover {
    background: #D4AF37;
    color: #1A1917;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-switch__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    color: var(--text-primary);
    transition: background-color 0.15s, color 0.15s;
}

.lang-switch__item:hover,
.lang-switch__item.active {
    background-color: var(--bg-surface);
    color: #1A1917;
    font-weight: 600;
}

/* Иконки */
.header__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    position: relative;
}

.header__cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--brand-accent);
    color: #FFF;
    font-size: 10.5px;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Шторка мобильного меню */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 82%;
    max-width: 340px;
    height: 100%;
    background-color: var(--bg-page);
    z-index: 200;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-drawer.is-open {
    left: 0;
}

.mobile-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mobile-drawer__close {
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer__search {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.mobile-drawer__search input {
    flex-grow: 1;
    background: var(--bg-surface);
    padding: 10px 14px;
    border-radius: var(--border-radius-pill);
    font-size: 14px;
}

.mobile-drawer__search button {
    background: var(--brand-dark);
    color: #FFF;
    padding: 0 16px;
    border-radius: var(--border-radius-pill);
    font-size: 13px;
    cursor: pointer;
}

.mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.mobile-drawer__nav a {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-drawer__lang {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.mobile-drawer__lang-title {
    font-size: 12.5px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}

.mobile-drawer__lang-options {
    display: flex;
    gap: 8px;
}

.mobile-drawer__lang-options a {
    padding: 6px 12px;
    background: var(--bg-surface);
    border-radius: var(--border-radius-pill);
    font-size: 13px;
}

.mobile-drawer__lang-options a.active {
    background: var(--brand-dark);
    color: #FFF;
}

/* Затемняющий оверлей */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Мобильные точки адаптива */
@media (max-width: 992px) {
    .header__burger-btn { display: flex; }
    .header__nav, .header__search, .lang-switch { display: none; }
    .header__container { padding: 0 20px; }
}