/* =========================================
   HEADER.CSS - Стили шапки
   ========================================= */

.header {
    background-color: var(--bg-cream);
    padding: 24px 0;
    border-bottom: 1px solid var(--light-gray);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo {
    color: inherit;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.nav {
    display: flex;
    gap: 40px;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-dark);
}
.nav a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}
.nav a:hover {
    color: var(--gold);
}
.header-phone {
    transition: color 0.2s ease, opacity 0.2s ease;
}

.header-phone:hover,
.header-phone:focus-visible {
    color: var(--gold);
    outline: none;
}

/* Базовое позиционирование */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    z-index: 1000;
    border-bottom: 1px solid rgba(29, 45, 71, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-mobile-actions {
    display: none;
    align-items: center;
    gap: 12px;
}

/* Десктопное меню */
.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav a {
    color: #1d2d47;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--gold, #c9a552);
}

.nav-mobile-footer {
    display: none;
}

/* Адаптив для мобильных устройств (планшеты и смартфоны) */
@media (max-width: 860px) {
    .header-phone {
        display: none; /* Прячем десктопный блок, заменяем иконкой вызова */
    }

    .header-mobile-actions {
        display: flex;
    }

    .btn-mobile-call {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: #1d2d47;
        color: var(--gold, #c9a552);
        border-radius: 50%;
        text-decoration: none;
    }

    /* Кнопка-гамбургер */
    .burger-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .burger-toggle span {
        width: 100%;
        height: 2.5px;
        background: #1d2d47;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.2s ease;
    }

    .burger-toggle.active span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }
    .burger-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-toggle.active span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }

    /* Мобильная выпадающая шторка */
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 24px;
        box-sizing: border-box;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .nav.open {
        transform: translateX(0);
    }

    .nav a {
        font-size: 18px;
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid rgba(29, 45, 71, 0.06);
    }

    .nav-mobile-footer {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 32px;
        width: 100%;
    }

    .mobile-phone-link {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #1d2d47 !important;
        border-bottom: none !important;
    }

    .mobile-messengers {
        display: flex;
        gap: 12px;
    }

    .mobile-messengers a {
        display: inline-block;
        text-align: center;
        padding: 10px 16px;
        border-radius: 4px;
        font-size: 14px;
        border-bottom: none;
        color: #fff !important;
    }

    .btn-wa { background: #25D366; }
    .btn-max { background: #1d2d47; border: 1px solid var(--gold); }
}

/* Выравнивание элементов в шапке */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Кнопка бургера скрыта на компьютере */
.burger-toggle {
    display: none;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    z-index: 1001;
}

.burger-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #1d2d47;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.mobile-menu-contacts {
    display: none;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (до 860px) ===== */
@media (max-width: 860px) {
    /* Показываем бургер */
    .burger-toggle {
        display: flex;
    }

    /* Прячем телефон из шапки (он будет внутри открытого меню) */
    .header-phone {
        display: none !important;
    }

    /* Анимация превращения полосок в крестик */
    .burger-toggle.active span:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    .burger-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-toggle.active span:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }

    /* Выдвижная шторка навигации */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        padding: 90px 30px 40px;
        box-sizing: border-box;
        transition: right 0.35s ease;
        z-index: 1000;
        gap: 0;
    }

    /* Когда меню активно */
    .nav.open {
        right: 0;
    }

    .nav a {
        padding: 14px 0;
        font-size: 17px;
        border-bottom: 1px solid rgba(29, 45, 71, 0.08);
        color: #1d2d47;
        text-decoration: none;
        display: block;
    }

    .mobile-menu-contacts {
        display: block;
        margin-top: 30px;
    }

    .mobile-call-btn {
        background: #1d2d47;
        color: #ffffff !important;
        text-align: center;
        padding: 12px !important;
        border-radius: 4px;
        font-weight: 600;
        border-bottom: none !important;
    }
}