/* ==========================================================================
   1. ШАПКА (Основа и поведение)
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 90px;
    background-color: #ffffff; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); 
    transition: height 0.45s ease, box-shadow 0.45s ease; 
}

.header.scrolled {
    height: 65px; 
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.08);
}

.header .container {
    max-width: 1440px; /* Увеличили ширину контейнера, чтобы влезли длинные пункты меню */
    width: 100%;
    height: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
}

/* ИЗМЕНЕНО: Используем Flexbox для защиты краев от сжатия */
.header__wrapper,
.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* Защитный интервал между лого, меню и кнопками */
    width: 100%;
    height: 100%;
}


/* ==========================================================================
   2. ЛОГОТИП 
   ========================================================================== */

.logo {
    position: relative;
    display: flex;
    align-items: center; 
    height: 100%;
    flex-shrink: 0; /* Запрещаем логотипу сжиматься */
}

.logo img {
    height: 55px; 
    width: auto; 
    max-width: 220px;
    object-fit: contain; 
    transition: height 0.45s ease; 
}

.header.scrolled .logo img {
    height: 40px; 
}

.logo-white {
    display: none !important; 
}
.logo-dark,
.logo-blue {
    opacity: 1; 
}


/* ==========================================================================
   3. НАВИГАЦИЯ (Центральная колонка) 
   ========================================================================== */

.header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* Заставляем меню занять всё пространство по центру */
    gap: 20px; /* Аккуратный отступ между ссылками */
}

.header__nav a {
    position: relative;
    color: #1A365D; 
    font-size: 14.5px; /* Чуть уменьшили размер шрифта для длинных слов */
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 0; 
    transition: color 0.35s ease;
    text-decoration: none;
}

.header__nav a:hover {
    color: #1fa2db; 
}

.header__nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #41B8FF;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.header__nav a:hover::after {
    width: 100%; 
}


/* ==========================================================================
   4. ПРАВАЯ ЧАСТЬ (Правая колонка - Кнопки и Языки)
   ========================================================================== */

.header__right-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 50;
    flex-shrink: 0; /* Запрещаем кнопкам сжиматься */
}

.header__button,
.consult-btn {
    display: inline-block;
    background-color: #1fa2db; 
    color: #ffffff; 
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(31, 162, 219, 0.2); 
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.header__button:hover,
.consult-btn:hover {
    background-color: #48bb78; 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

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

.lang-select {
    background: transparent;
    color: #1A365D;
    border: 1px solid rgba(26, 54, 93, 0.2);
    border-radius: 6px;
    padding: 8px 32px 8px 14px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M0 3l5 5 5-5z' fill='%231A365D'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-select:hover {
    border-color: #1fa2db;
    box-shadow: 0 2px 8px rgba(31, 162, 219, 0.1);
}

.lang-select option {
    background-color: #ffffff;
    color: #1A365D;
    font-weight: 600;
}


/* ==========================================================================
   5. АДАПТИВ (Планшеты и Мобильные устройства)
   ========================================================================== */

.header__burger,
.header__button--mobile,
.lang-switcher--mobile {
    display: none;
}

/* На экранах меньше 1200px меню может начать не помещаться, включаем бургер чуть раньше */
@media (max-width: 1200px) {

    .lang-select {
       color: #ffffff;
       background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M0 3l5 5 5-5z' fill='%23FFFFFF'/></svg>");
    }

    .header, .header.scrolled {
        height: 65px; 
    }

    .lang-switcher--desktop,
    .header__button--desktop,
    .header__nav {
        display: none !important; /* Прячем десктопное меню */
    }

    .lang-switcher--mobile {
        display: block;
        margin: 15px 0;
    }

    .header__button--mobile {
        display: inline-block;
        margin-top: 20px;
    }

    .logo img {
        height: 40px; 
        transition: none; 
    }

    .header__burger {
        display: block;
        position: relative;
        width: 30px;
        height: 20px;
        cursor: pointer;
        z-index: 10000;
    }

    .header__burger span,
    .header__burger::before,
    .header__burger::after {
        content: "";
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: #1A365D; 
        left: 0;
        transition: all 0.3s ease;
    }

    .header__burger::before { top: 0; }
    .header__burger span { top: 9px; }
    .header__burger::after { bottom: 0; }

    .header__burger.active span {
        transform: scale(0);
    }
    .header__burger.active::before {
        transform: rotate(45deg);
        top: 9px;
        background-color: #ffffff;
    }
    .header__burger.active::after {
        transform: rotate(-45deg);
        bottom: 9px;
        background-color: #ffffff;
    }

    .header__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: radial-gradient(circle at 80% 20%, #1a7fa6 0%, #0b2545 100%);
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 999;
        overflow-y: auto; 
    }

    .header__nav.active {
        right: 0;
    }

    .header__nav a {
        display: block;
        width: 85%;
        max-width: 320px;
        text-align: center;
        padding: 14px 20px;
        background-color: rgba(255, 255, 255, 0.08);
        border: 2px solid #ffffff;
        color: #ffffff;
        font-size: 14px; /* На мобилках можно сделать чуть меньше */
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.25s ease;
        white-space: normal; /* Разрешаем перенос длинных слов в мобильном меню */
    }

    .header__nav a::after {
        display: none; 
    }

    .header__nav a:hover,
    .header__nav a:active {
        background-color: #ffffff;
        color: #1fa2db;
    }

    .header__nav a.header__button--mobile {
        background-color: #ffffff;
        color: #1fa2db;
        border: none;
    }
}

body.no-scroll {
    overflow: hidden;
}