/* Стили для header секции */

/* Универсальные текстовые классы для header */
.text-contact {
    color: var(--color-primary);
    text-align: center;
    font-family: 'Geologica', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    letter-spacing: 0.54px;
}

.text-hero-title {
    color: var(--color-primary);
    text-align: center;
    font-family: 'Dela Gothic One', cursive;
    font-size: 42px;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: 1.26px;
}

.text-hero-subtitle {
    max-width: 633px;
    margin: 0 auto;
    color: var(--color-primary);
    text-align: center;
    font-family: 'Geologica', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 300;
    line-height: 140%;
}

/* ВИПРАВЛЕНА КНОПКА - відповідно до Figma */
.btn-primary-custom {
    height: 56px;
    display: flex;
    padding: 10px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    align-self: stretch;
    border-radius: 60px;
    border: 2px solid var(--tp-48, rgba(250, 250, 250, 0.08));
    background: #F4F4F5;
    backdrop-filter: blur(6px);
    color: #1F1F24;
    text-align: center;
    font-family: 'Geologica', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 140%; /* 22.4px */
    letter-spacing: 0.16px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%; /* Займає всю ширину контейнера */
}

.btn-primary-custom:hover {
    background: rgba(244, 244, 245, 0.9);
    color: #1F1F24;
    transform: translateY(-2px);
    text-decoration: none; /* Переконуємося, що підкреслення не з'являється */
}

/* Основные стили header секции */
.header-section {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Система фоновых слоев для плавной анимации */
.header-section .bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 2s ease-in-out;
    z-index: 0;
}

.header-section .bg-layer-1 {
    background-image: url('../images/hero-bg1.png');
    opacity: 1;
}

.header-section .bg-layer-2 {
    background-image: url('../images/hero-bg2.WEBP');
    opacity: 0;
}

.header-section .bg-layer-3 {
    background-image: url('../images/hero-bg3.JPG');
    opacity: 0;
}

/* Темная накладка */
.header-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.header-section > * {
    position: relative;
    z-index: 2;
}

/* Анимационные состояния - теперь все переходы одинаковые */
.header-section.show-bg-1 .bg-layer-1 {
    opacity: 1;
}

.header-section.show-bg-1 .bg-layer-2,
.header-section.show-bg-1 .bg-layer-3 {
    opacity: 0;
}

.header-section.show-bg-2 .bg-layer-2 {
    opacity: 1;
}

.header-section.show-bg-2 .bg-layer-1,
.header-section.show-bg-2 .bg-layer-3 {
    opacity: 0;
}

.header-section.show-bg-3 .bg-layer-3 {
    opacity: 1;
}

.header-section.show-bg-3 .bg-layer-1,
.header-section.show-bg-3 .bg-layer-2 {
    opacity: 0;
}

/* Верхняя полоса - высота 80px */
.header-top {
    height: 80px;
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 60px;
    width: 293px;
}

/* Центральная часть - позиционирование по Y координатам */
.header-main {
    position: absolute;
    top: 101px;
    left: 0;
    right: 0;
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title-spacing {
    margin-bottom: 23px; /* 124 - 101 = 23px разница между слоганом и подписью */
}

/* Нижняя часть с кнопкой - Y = 645 */
.header-bottom {
    position: absolute;
    bottom: 75px;
    left: 0;
    right: 0;
    z-index: 2;
}

/* ВИПРАВЛЕНИЙ КОНТЕЙНЕР КНОПКИ - відповідно до Figma */
.cta-button {
    width: 240px; /* Точна ширина з Figma */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin: 0 auto; /* Центруємо контейнер */
}

/* Адаптивные стили для планшетов */
@media (max-width: 991px) and (min-width: 769px) {
    .text-hero-title {
        font-size: 36px;
        letter-spacing: 1.08px;
    }

    .text-hero-subtitle {
        font-size: 15px;
        max-width: 580px;
    }

    /* Адаптируем позиционирование для планшетов */
    .header-main {
        top: 90px;
    }

    .header-bottom {
        top: 680px;
    }

    /* Адаптуємо ширину контейнера кнопки для планшетів */
    .cta-button {
        width: 280px;
        gap: 28px;
    }
}

/* Мобильная версия - точные координаты */
@media (max-width: 768px) {
    .text-contact {
        font-size: 16px;
        letter-spacing: 0.48px;
    }

    .text-hero-title {
        font-size: 20px;
        font-style: normal;
        font-weight: 400;
        line-height: 120%;
        letter-spacing: 0.6px;
    }

    .text-hero-subtitle {
        font-size: 14px;
        max-width: none;
    }

    /* Мобільні стилі кнопки */
    .btn-primary-custom {
        font-size: 14px;
        letter-spacing: 0.14px;
        height: 48px;
    }

    /* Мобільний контейнер кнопки */
    .cta-button {
        width: 100%;
        max-width: 320px;
        gap: 24px;
    }

    /* Мобильная версия: переопределяем позиционирование */
    .header-section {
        position: relative;
    }

    .header-top {
        position: relative;
        height: auto;
        padding: 0;
    }

    /* Телефон Y = 16 */
    .header-top .order-1 {
        margin-top: 16px;
        margin-bottom: 15px;
    }

    /* Адрес Y = 47 */
    .header-top .order-2 {
        margin-bottom: 39px;
    }

    /* Логотип Y = 102 */
    .header-top .order-3 {
        margin-bottom: 100px;
    }

    /* СЛОГАН ОСТАЕТСЯ НА СВОЕМ МЕСТЕ */
    .header-main {
        position: relative;
        top: auto;
    }

    /* Опускаем hero-content на 25px для мобильных */
    .hero-content {
        margin-top: 25px;
    }

    /* КНОПКА ОСТАЕТСЯ ВНИЗУ КАК В ДЕСКТОПЕ */
    .header-bottom {
        position: absolute;
        bottom: 120px; /* Еще больше поднимаем кнопку (было 80px, +40px ≈ сантиметр) */
        left: 0;
        right: 0;
        z-index: 2;
    }

    .logo img {
        max-height: 45px;
    }

    /* НЕ скрываем "712 CARS CLUB" на мобильных - показываем полный слоган */
    .hero-title .d-lg-block {
        display: block !important;
    }

    .hero-title-spacing {
        margin-bottom: 20px;
    }
}

/* Стили для очень маленьких экранов */
@media (max-width: 576px) {
    .text-contact {
        font-size: 14px;
    }

    .text-hero-title {
        font-size: 18px;
        letter-spacing: 0.54px;
    }

    .text-hero-subtitle {
        font-size: 13px;
    }

    /* Контейнер кнопки для малих екранів */
    .cta-button {
        width: 100%;
        max-width: 280px;
        gap: 20px;
    }

    /* Уменьшаем отступы для маленьких экранов */
    .header-top .order-1 {
        margin-top: 12px;
        margin-bottom: 12px;
    }

    .header-top .order-2 {
        margin-bottom: 30px;
    }

    .header-top .order-3 {
        margin-bottom: 30px;
    }

    .header-main {
        margin-bottom: 30px;
    }
}

/* СПЕЦИАЛЬНЫЕ НАСТРОЙКИ BACKGROUND-POSITION ДЛЯ МОБИЛЬНЫХ */
/* Для мобильных устройств - сдвигаем первый фон влево */
@media (max-width: 768px) {

    .header-section .bg-layer {
        background-size: auto !important;
    }

    .header-section .bg-layer-1 {
        background-position: 30% center !important;
    }

    .header-section .bg-layer-2,
    .header-section .bg-layer-3 {
        background-position: 50% center !important;
    }
}

/* Для очень маленьких экранов - еще больше влево */
@media (max-width: 576px) {

    .header-section .bg-layer {
        background-size: auto !important;
    }


    .header-section .bg-layer-1 {
        background-position: 25% center !important;
    }

    .header-section .bg-layer-2 {
        background-position: 50.5% center !important;
    }


}

/* Дополнительно - если нужен более радикальный сдвиг */
@media (max-width: 480px) {
    .header-section .bg-layer-1 {
        background-position: 20% center !important;
    }
}