/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 28px 0;
    background: transparent;
    color: var(--color-text-on-dark);
    transition: background-color 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

/* Основной логотип */
.logo__img {
    height: 32px; /* Стандартная высота */
    width: auto;
    display: block;
}

.logo__img--employee {
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

.header.is-scrolled {
    background: rgb(20 20 20 / 51%);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    padding: 16px 0;
}

.header--light { color: #222222; }
.header--dark { color: #222222; }
.header--light.is-scrolled { color: #ffffff !important; }
.header--transparent { background: transparent; color: #FFFFFF; }

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    overflow: visible; /* Чтобы ничего не обрезалось */
}

/* ============ ДЕЙСТВИЯ В ШАПКЕ (Языки + Бургер) ============ */
.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__desktop-lang {
    display: flex;
    align-items: center;
}

/* ============ БУРГЕР-МЕНЮ (Кнопка) ============ */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
}

/* Анимация в крестик при открытии */
.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Оверлей для затемнения фона */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ============ ОСТАЛЬНЫЕ СТИЛИ (лого, тень и т.д.) ============ */
.top-shadow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 140px;
    z-index: 999;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.15) 70%, rgba(0,0,0,0) 100%);
    transition: opacity 0.4s ease;
}

.header.is-scrolled ~ .top-shadow { opacity: 0; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    line-height: 1;
    background: transparent;
}

.logo__img {
    height: 42px;
    width: auto;
    display: block;
    transition: height 0.4s ease;
}

.header.is-scrolled .logo__img { height: 36px; }

/* Основная навигация */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav__link {
    font-size: 15px;
    font-weight: var(--font-weight-regular);
    color: rgba(255, 255, 255, 0.75);
    padding: 4px 0;
    position: relative;
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav__link:hover { color: var(--color-white); }
.nav__link.active { color: var(--color-white); }

.nav__link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    background: var(--color-primary);
}

/* Цвета навигации в зависимости от темы шапки */
.nav--dark .nav__link { color: rgba(255, 255, 255, 0.75); }
.nav--dark .nav__link:hover, .nav--dark .nav__link.active { color: #FFFFFF; }
.nav--light .nav__link { color: #666; }
.nav--light .nav__link:hover, .nav--light .nav__link.active { color: #222; }
.nav--light .nav__link.active::after { background: var(--color-primary); }
.nav--transparent .nav__link { color: rgba(255, 255, 255, 0.75); }
.nav--transparent .nav__link:hover, .nav--transparent .nav__link.active { color: #FFFFFF; }

/* Переключатель языков */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 14px;
}

.lang-switcher a {
    color: rgba(255, 255, 255, 0.75);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.lang-switcher a:hover { color: var(--color-white); }

.lang-switcher a.active {
    background: var(--color-primary);
    color: var(--color-white);
}

.lang-switcher--light a { color: #666; }
.lang-switcher--light a.active { background: var(--color-primary); color: #FFFFFF; }

/* Скрываем мобильные элементы на десктопе */
.nav__footer {
    display: none;
}

/* ============ АДАПТИВ (Мобильная версия) ============ */
@media (max-width: 1024px) {
    /* Показываем бургер */
    .nav-toggle {
        display: flex !important;
        color: #ffffff;
    }

    /* Скрываем языки в шапке (они будут в меню) */
    .header__desktop-lang {
        display: none !important;
    }

    /* Настройки выезжающего меню */

    .nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        background-color: #1A1A1A;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 32px 40px; /* Уменьшил верхний отступ с 100 до 80 */
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        overflow-y: auto;
        gap: 0;
    }

    .nav.is-open {
        right: 0;
    }

    .nav__link {
        font-size: 16px; /* Чуть уменьшил шрифт */
        width: 100%;
        padding: 14px 0; /* Чуть уменьшил отступ */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: #FFFFFF;
    }

    .nav__link.active::after {
        bottom: 6px;
    }

    /* Футер меню — теперь просто идёт за ссылками, без прижатия */
    .nav__footer {
        display: flex;
        flex-direction: column;
        gap: 24px;
        margin-top: 32px; /* Отступ сверху вместо auto */
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .nav__footer .lang-switcher {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap; /* Если языки не влезут — перенесутся */
    }
}