/* =========================================
   HEADER.CSS - Стили шапки
   ========================================= */

.header {
    background-color: var(--bg-cream);
    padding: 24px 0;
    border-bottom: 1px solid var(--light-gray);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap; /* Запрещает перенос дочерних блоков вниз */
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.logo-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}
.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 {
    font-size: 20px;
    font-weight: 600;
    transition: color 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

a.header-phone {
    color: inherit;
    text-decoration: none;
}

.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: var(--dark-blue);
    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: 1024px) {

    .header-mobile-actions {
        display: flex;
    }

    /* Кнопка-гамбургер */
    .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: var(--dark-blue);
        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: var(--dark-blue) !important;
        border-bottom: none !important;
    }
}

/* Мобильная выпадающая шторка: круглые кнопки мессенджеров */
.nav-messengers {
    display: flex;
    gap: 12px;
}

.nav-messenger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px;
    padding: 0 !important;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--dark-blue, #1d2d47);
    transition: all 0.3s ease;
    border-bottom: none !important;
}

.nav-messenger-btn img,
.nav-messenger-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

.nav-messenger-btn:hover {
    background: var(--gold, #c9a552);
    transform: translateY(-2px);
}

/* Выравнивание элементов в шапке */
.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: var(--dark-blue);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.mobile-menu-contacts {
    display: none;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (до 860px) ===== */
@media (max-width: 860px) {
    /* Показываем бургер */
    .burger-toggle {
        display: flex;
    }

    /* Анимация превращения полосок в крестик */
    .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;
    }
}

/* ===== Десктопные соцсети в шапке (под телефоном) ===== */
.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}

.header-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-social-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px;
    padding: 0 !important;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--dark-blue, #C6A664);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: none !important;
}

.header-social-btn img,
.header-social-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.header-social-btn:hover {
    background: var(--gold, #c9a552);
    transform: translateY(-2px);
}

/* На мобильных соцсети в шапке не нужны — они доступны в выдвижной шторке меню */
@media (max-width: 860px) {
    .header-social {
        display: none;
    }
}

/* На узких экранах (телефоны) номер не помещается между логотипом и бургером —
   уносим его на отдельную строку под шапкой, прижимаем влево, без разрыва номера */
@media (max-width: 560px) {
    .header .header-container {
        flex-wrap: wrap;
        height: auto;
        min-height: 70px;
    }

    .header-contacts {
        order: 3; /* после логотипа и бургера, иначе бургер уедет на третью строку */
        flex: 0 0 100%;
        width: 100%;
        align-items: flex-start; /* прижимаем к левому краю, под логотип */
        text-align: left;
        margin-top: 10px; /* чуть больше отступа от фамилии */
        padding-bottom: 4px; /* снизу места и так достаточно */
    }

        .header-contacts .header-phone {
        white-space: nowrap; /* номер всегда в одну строку */
    }
}

/* ===== Messenger buttons (hero CTA и mobile) ===== */
.messenger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--dark-blue, #1d2d47);
    color: var(--white, #ffffff) !important;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: none;
}
.messenger-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.messenger-btn:hover {
    background: var(--gold, #c9a654);
    transform: translateY(-2px);
}
.messenger-btn:focus-visible {
    outline: 2px solid var(--gold, #c9a654);
    outline-offset: 2px;
}