/* Хедер - фиксированная высота */
.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: hidden;
}

/* Левый блок с логотипом */
.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(6px, 6px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==============================================
   МОБИЛЬНОЕ МЕНЮ
   ============================================== */

.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;
    }
}