/* Хедер - фиксированная высота */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #ffffff;

    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin: 0;
}

/* Основной контейнер */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    position: relative;
    width: 100%;
    overflow: visible;
}

/* Левый блок с логотипом */
.header-left {
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 180px;
    padding-left: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    text-decoration: none;
    min-width: 0;
}

.logo {
    height: 100%;
    max-height: 70px;
    min-height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
    padding: 10px 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

.company-name {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
    flex-shrink: 1;
}

.company-title {
    font-family: 'Gilroy', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-subtitle {
    font-family: 'Gilroy', sans-serif;
    font-size: 12px;
    color: #666666;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================================
   НАВИГАЦИЯ (ДЕСКТОП)
   ============================================== */

.nav {
    height: 100%;
    display: flex;
    flex: 1;
    justify-content: center;
    margin: 0 15px;
    min-width: 0;
    max-width: calc(100% - 400px);

}

.nav-list {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2px;
    min-width: 0;
    width: 100%;
    justify-content: center;
}

.nav-list li {
    height: 100%;
    position: relative;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
}

.nav-list a {
    font-family: 'Gilroy', sans-serif;
    color: #333333;
    text-decoration: none;
    font-size: 13px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 4px;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: manual;
}

.nav-list a:hover {
    color: #e70000;
    background-color: #f9f9f9;
}

.nav-list a.active {
    color: #e70000;
    font-weight: 500;
}

/* ==============================================
   ТЕЛЕФОН (ДЕСКТОП)
   ============================================== */

.header-right.desktop-only {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    height: 100%;
    flex-shrink: 0;
    min-width: 180px;
    justify-content: flex-end;
    padding-right: 15px;
}

.phone-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.header-right a,
.mobile-phone a {
    font-family: 'Gilroy', sans-serif;
    color: #000000;
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
    font-weight: 700;
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

.header-right a:hover {
    color: #e70000;
}

/* ==============================================
   БУРГЕР МЕНЮ
   ============================================== */

.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex-shrink: 0;
}

.burger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================== */

.mobile-phone {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
    margin-top: auto;
    width: 100%;
}

.mobile-phone .phone-icon {
    width: 20px;
    height: 20px;
}

/* ==============================================
   АНИМАЦИИ
   ============================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   АДАПТИВНОСТЬ
   ============================================== */

/* Средние планшеты (992px - 1100px) */
@media (max-width: 1100px) {
    .header-container {
        padding: 0 15px;
    }

    .nav {
        margin: 0 10px;
    }

    .nav-list a {
        font-size: 12px;
        padding: 0 6px;
    }

    .company-title {
        font-size: 16px;
    }

    .company-subtitle {
        font-size: 11px;
    }

    .header-right a {
        font-size: 14px;
    }

    .header-left {
        min-width: 160px;
    }

    .header-right.desktop-only {
        min-width: 160px;
    }
}

/* БУРГЕР ПОКАЗЫВАЕМ С 992px */
@media (max-width: 992px) {
    .header {
        min-height: 70px;
        display: flex;
        align-items: center;
    }

    .header-container {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        height: 70px;
    }

    /* Левый блок - логотип */
    .header-left {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        height: 70px;
        margin: 0;
        padding-left: 0;
        border-left: none;
        min-width: auto;
    }

    /* Логотип по центру вертикали */
    .logo-container {
        height: 100%;
        display: flex;
        align-items: center;
    }

    .logo {
        min-height: 35px;
        padding: 8px 0;
    }

    /* Убираем название компании */
    .company-name {
        display: none;
    }

    /* Бургер - справа, по центру вертикали */
    .burger {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-around;
        height: 30px;
        margin: 0;
        padding: 0;
        position: relative;
        top: 0;
    }

    /* Убираем навигацию и телефон из хедера */
    .nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        flex-direction: column;
        margin: 0;
        z-index: 999;
        overflow-y: auto;
        padding: 0;
        max-width: none;
        border: none;
    }

    .header-right.desktop-only {
        display: none;
    }

    .nav.open {
        display: flex;
        transform: translateX(0);
        align-items: center;
        justify-content: center;
    }

    /* Центрированное мобильное меню */
    .nav-list {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 0;
        padding: 20px 0 0;
        justify-content: center;
        align-items: center;
        max-width: none;
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-list li {
        width: 90%;
        max-width: 500px;
        height: auto;
        border-bottom: 1px solid #eee;
        min-width: 0;
        text-align: center;
        opacity: 0;
        transform: translateY(10px);
        animation: fadeInUp 0.3s ease forwards;
    }

    .nav-list li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-list li:nth-child(2) {
        animation-delay: 0.15s;
    }

    .nav-list li:nth-child(3) {
        animation-delay: 0.2s;
    }

    .nav-list li:nth-child(4) {
        animation-delay: 0.25s;
    }

    .nav-list li:nth-child(5) {
        animation-delay: 0.3s;
    }

    .nav-list li:nth-child(6) {
        animation-delay: 0.35s;
    }

    .nav-list li:nth-child(7) {
        animation-delay: 0.4s;
    }

    .nav-list a {
        padding: 18px 20px;
        font-size: 16px;
        justify-content: center;
        height: auto;
        border-radius: 8px;
        white-space: nowrap;
        text-align: center;
        line-height: 1.4;
        word-break: keep-all;
        overflow-wrap: normal;
        hyphens: none;
        margin: 0 auto;
        width: 100%;
        background: rgba(231, 0, 0, 0.03);
        margin: 4px 0;
        transition: all 0.3s ease;
    }

    .nav-list a:hover {
        background-color: rgba(231, 0, 0, 0.1);
        transform: translateX(5px);
    }

    /* Телефон в мобильном меню */
    .mobile-phone {
        display: flex;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #eee;
        width: 90%;
        max-width: 500px;
    }


}

/* Маленькие планшеты (768px - 991px) */
@media (max-width: 768px) {
    .header {
        min-height: 65px;
    }

    .header-container {
        height: 65px;
        padding: 0 15px;
    }

    .header-left {
        height: 65px;
    }

    .burger {
        height: 35px;
    }

    .nav {
        top: 65px;
        height: calc(100vh - 65px);
    }

    .logo {
        min-height: 30px;
        padding: 8px 0;
    }
}

/* Большие телефоны (576px - 767px) */
@media (max-width: 767px) {
    .header {
        min-height: 60px;
    }

    .header-container {
        height: 60px;
    }

    .header-left {
        height: 60px;
    }

    .burger {
        height: 30px;
    }

    .nav {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .logo {
        min-height: 30px;
    }

    .nav-list a {
        font-size: 15px;
        padding: 16px 15px;
    }

    .burger span {
        width: 24px;
        height: 2px;
    }
}

/* Средние телефоны (480px - 575px) */
@media (max-width: 575px) {
    .header {
        min-height: 55px;
    }

    .header-container {
        height: 55px;
        padding: 0 12px;
    }

    .header-left {
        height: 55px;
    }

    .burger {
        height: 35px;
    }

    .nav {
        top: 55px;
        height: calc(100vh - 55px);
    }

    .logo {
        min-height: 25px;
        padding: 6px 0;
    }

    .nav-list a {
        font-size: 14px;
        padding: 14px 12px;
    }

    .burger {
        width: 26px;
        height: 20px;
    }

    .mobile-phone a {
        font-size: 16px;
    }
}

/* Маленькие телефоны (375px - 479px) */
@media (max-width: 479px) {
    .header {
        min-height: 50px;
    }

    .header-container {
        height: 50px;
        padding: 0 10px;
    }

    .header-left {
        height: 50px;
    }

    .burger {
        height: 30px;
    }

    .nav {
        top: 50px;
        height: calc(100vh - 50px);
    }

    .logo {
        min-height: 25px;
        padding: 5px 0;
    }

    .nav-list a {
        font-size: 13px;
        padding: 12px 10px;
    }

    .burger {
        width: 24px;
        height: 18px;
    }

    .mobile-phone {
        padding: 15px;
    }

    .mobile-phone a {
        font-size: 15px;
    }
}

/* Очень маленькие телефоны (до 374px) */
@media (max-width: 374px) {
    .header {
        min-height: 48px;
    }

    .header-container {
        height: 48px;
        padding: 0 8px;
    }

    .header-left {
        height: 48px;
    }

    .burger {
        height: 30px;
    }

    .nav {
        top: 48px;
        height: calc(100vh - 48px);
    }

    .logo {
        min-height: 22px;
        padding: 4px 0;
    }

    .nav-list a {
        font-size: 12px;
        padding: 10px 8px;
    }

    .burger {
        width: 22px;
        height: 16px;
    }

    .mobile-phone {
        padding: 12px;
    }

    .mobile-phone a {
        font-size: 14px;
    }
}

/* Ландшафтный режим мобильных устройств */
@media (max-height: 500px) and (orientation: landscape) {
    .nav {
        top: 60px;
        height: calc(100vh - 60px);
    }

    .nav-list {
        padding: 10px 0 0;
        max-height: 70vh;
    }

    .nav-list li {
        min-height: 40px;
    }

    .nav-list a {
        padding: 8px 15px;
        font-size: 14px;
    }

    .mobile-phone {
        padding: 10px;
    }
}












/* ==============================================
   ВЫПАДАЮЩЕЕ МЕНЮ (ДЕСКТОП) - ИСПРАВЛЕНО
   ============================================== */

.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding-right: 12px !important;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s ease;
    display: inline-block;
    line-height: 1;
}

/* Анимация стрелки при наведении */
.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: #e70000;
}

/* Стрелка меняет цвет при наведении на пункт */
.dropdown-toggle:hover .dropdown-arrow {
    color: #e70000;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 8px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    /* Исправляем z-index - делаем больше чем у хедера */
    z-index: 9999;
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Добавляем небольшой отступ сверху для лучшего взаимодействия */
    margin-top: 5px;
}

/* Появление по ховеру на десктопе */
@media (min-width: 993px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Увеличиваем область наведения */
    .dropdown {
        padding-bottom: 10px;
        margin-bottom: -10px;
    }
}

/* Стрелочка-треугольник сверху */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: white;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dropdown-menu li {
    height: auto !important;
    width: 100%;
    white-space: nowrap;
}

.dropdown-menu a {
    padding: 12px 20px !important;
    font-size: 14px !important;
    justify-content: flex-start !important;
    text-align: left;
    white-space: nowrap;
    background: transparent !important;
    transition: all 0.2s ease;
    border-radius: 0 !important;
}

.dropdown-menu a:hover {
    background-color: #f5f5f5 !important;
    color: #e70000;
    padding-left: 25px !important;
}

/* Подсветка активного пункта */
.dropdown-menu a:active {
    background-color: #e70000 !important;
    color: white !important;
}

/* Убеждаемся что хедер не перекрывает выпадающее меню */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Оставляем 1000 для хедера */
    background-color: #ffffff;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ==============================================
   МОБИЛЬНАЯ ВЕРСИЯ (до 992px)
   ============================================== */

@media (max-width: 992px) {
    .dropdown {
        position: relative;
        width: 90%;
        max-width: 500px;
        height: auto;
        flex-direction: column;
        border-bottom: 1px solid #eee;
        /* Убираем лишние отступы для мобилок */
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .dropdown-toggle {
        width: 100%;
        padding: 18px 20px !important;
        background: rgba(231, 0, 0, 0.03) !important;
        margin: 4px 0;
        border-radius: 8px !important;
    }

    .dropdown-arrow {
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    /* Поворот стрелки при открытом подменю */
    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
        color: #e70000;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: transparent;
        width: 100%;
        min-width: 100%;
        border: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.3s ease-in-out;
        margin: 0;
        display: block;
        border: none;
        /* На мобилках z-index не нужен */
        z-index: 1;
        /* Убираем стрелочку сверху */
        margin-top: 0;
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown.active .dropdown-menu {
        max-height: 300px;
        /* Достаточно для двух пунктов */
        padding: 5px 0;
    }

    .dropdown-menu li {
        width: 100%;
        opacity: 1 !important;
        transform: none !important;
        border: none;
    }

    .dropdown-menu a {
        padding: 14px 20px 14px 35px !important;
        font-size: 15px !important;
        background: #f5f5f5 !important;
        border-radius: 8px !important;
        margin: 3px 0;
        white-space: normal;
        word-break: break-word;
        justify-content: flex-start !important;
    }

    .dropdown-menu a:hover {
        background-color: #e8e8e8 !important;
        padding-left: 40px !important;
    }

    .dropdown-menu a:active {
        background-color: #e70000 !important;
        color: white !important;
    }

    /* Анимация для мобильного подменю */
    .dropdown.active .dropdown-menu li {
        animation: slideIn 0.3s ease forwards;
    }

    .dropdown.active .dropdown-menu li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .dropdown.active .dropdown-menu li:nth-child(2) {
        animation-delay: 0.15s;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Дополнительная адаптация для маленьких экранов */
@media (max-width: 767px) {
    .dropdown-toggle {
        padding: 16px 15px !important;
        font-size: 15px;
    }

    .dropdown-menu a {
        padding: 12px 15px 12px 30px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 575px) {
    .dropdown-toggle {
        padding: 14px 12px !important;
        font-size: 14px;
    }

    .dropdown-menu a {
        padding: 10px 12px 10px 25px !important;
        font-size: 13px !important;
    }

    .dropdown-arrow {
        font-size: 10px;
    }
}

@media (max-width: 479px) {
    .dropdown-toggle {
        padding: 12px 10px !important;
    }

    .dropdown-menu a {
        padding: 10px 10px 10px 22px !important;
    }
}

/* ==============================================
   ОБЩИЕ СТИЛИ ДЛЯ ИНДИКАТОРА
   ============================================== */

/* Подсветка пункта с выпадающим меню */
.dropdown-toggle {
    position: relative;
    font-weight: 500;
}

/* Эффект при наведении на десктопе */
@media (min-width: 993px) {
    .dropdown-toggle:hover {
        background-color: #f9f9f9 !important;
    }

    .dropdown-toggle:hover .dropdown-arrow {
        color: #e70000;
    }
}

/* Активное состояние на мобилках */
@media (max-width: 992px) {
    .dropdown.active>.dropdown-toggle {
        background-color: rgba(231, 0, 0, 0.08) !important;
        color: #e70000;
        border-radius: 8px 8px 0 0 !important;
    }

    .dropdown.active>.dropdown-toggle .dropdown-arrow {
        color: #e70000;
    }
}