/* ===== HERO СЕКЦИЯ - ПЕРЕИСПОЛЬЗУЕМЫЙ КОМПОНЕНТ ===== */

/* CSS переменные для легкой настройки */
:root {
    --hero-max-width: 1728px;
    --hero-padding: 20px 28px;
    --hero-bg-height: 962px;
    --hero-bg-radius: 40px;
    
    /* Плашка заголовка */
    --hero-title-bg-color: rgba(81, 81, 81, 0.8);
    --hero-title-bg-width: 897px;
    --hero-title-bg-height: 145px;
    --hero-title-blur: 88px;
    
    /* Заголовок */
    --hero-title-font-size: 44.56px;
    --hero-title-line-height: 53.47px;
    --hero-title-color: #ffffff;
    --hero-title-max-width: 973px;
}

/* Базовая Hero секция */
.hero {
    position: relative;
    width: 100%;
    max-width: var(--hero-max-width);
    margin: 0 auto 40px; /* Добавлен margin-bottom для десктопа */
    padding: var(--hero-padding);
    overflow: visible !important; /* КРИТИЧНО: не обрезаем выпадающие меню виджета */
}

/* Wrapper для hero секции (поддержка мобильной версии) */
.hero__wrapper {
    position: relative;
    width: 100%;
    max-width: 1671px;
    margin: 0 auto;
    overflow: visible !important; /* КРИТИЧНО: не обрезаем выпадающие меню виджета */
}

/* Обертка для основного фона */
.hero__background {
    position: relative;
    width: 100%;
    max-width: 1671px;
    height: var(--hero-bg-height);
    min-height: var(--hero-bg-height); /* Фиксируем минимальную высоту чтобы не было прыжков */
    margin: 0 auto;
    border-radius: var(--hero-bg-radius);
    overflow: visible !important; /* КРИТИЧНО: не обрезаем выпадающие меню виджета */
    clip-path: none !important;
    clip: auto !important;
    contain: none !important;
    isolation: auto !important;
}

/* Основное фоновое изображение */
.hero__background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--hero-bg-radius); /* Добавлено для сохранения скругленных углов */
}

/* Контентная обертка поверх фона */
.hero__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: visible !important; /* КРИТИЧНО: не обрезаем выпадающие меню виджета */
    z-index: 1; /* Поверх фона, но ниже выпадающих меню */
    /* Гарантируем что всплывающие меню не обрезаются сверху */
    clip-path: none !important;
    clip: auto !important;
    contain: none !important;
    isolation: auto !important;
}

/* Десктопный виджет в hero__content - должен быть абсолютно позиционирован */
/* Виджет находится в hero__content, позиционируем относительно hero__background */
.hero__content > .booking-widget-container.desktop-widget {
    position: absolute !important;
    bottom: 40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    right: auto !important;
    width: 1591px !important;
    max-width: calc(100% - 80px) !important;
    min-height: 222px !important; /* Минимальная высота для виджета */
    height: auto !important; /* Позволяем контейнеру расширяться для всплывающих меню */
    max-height: none !important; /* Убираем ограничение высоты чтобы всплывающие меню не обрезались */
    z-index: 100 !important; /* Увеличиваем z-index чтобы всплывающие меню были поверх всего */
    margin: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important; /* Дополнительный отступ сверху для всплывающих меню */
    /* Убираем влияние flex на виджет */
    align-self: auto !important;
    order: 0 !important;
    flex: none !important;
    /* Гарантируем что всплывающие меню не обрезаются */
    clip-path: none !important;
    clip: auto !important;
    /* Гарантируем что всплывающие меню не обрезаются сверху */
    contain: none !important;
    isolation: auto !important;
}

/* Мобильный виджет - СКРЫТ на десктопе */
.hero .booking-widget-container.mobile-widget {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Десктопный виджет - ПОКАЗАН на десктопе (по умолчанию) */
.hero .booking-widget-container.desktop-widget {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Обёртка для заголовка и плашки */
.hero__title-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 190px;
}

/* Полупрозрачная плашка под заголовком с Layer Blur */
.hero__title-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--hero-title-bg-color);
    border-radius: 0;
    width: var(--hero-title-bg-width);
    height: var(--hero-title-bg-height);
    /* Layer Blur эффект */
    filter: blur(var(--hero-title-blur));
    -webkit-filter: blur(var(--hero-title-blur)); /* Safari support */
    z-index: 1;
}

/* Заголовок Hero секции */
.hero__title {
    font-family: 'Coolvetica', 'Yanone Kaffeesatz', sans-serif;
    font-weight: 400; /* Book */
    font-size: var(--hero-title-font-size);
    line-height: var(--hero-title-line-height);
    color: var(--hero-title-color);
    text-align: center;
    max-width: var(--hero-title-max-width);
    margin: 0;
    padding: 20px 30px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.28);
    position: relative;
    z-index: 2;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1440px) {
    .hero__background {
        height: 800px;
        min-height: 800px; /* Фиксируем минимальную высоту чтобы не было прыжков */
    }
    
    .hero__title {
        font-size: 38px;
        line-height: 46px;
        max-width: 850px;
        padding: 18px 25px;
    }
    
    .hero__title-background {
        width: 780px;
        height: 130px;
    }
}

@media (max-width: 1024px) {
    .hero {
        margin-bottom: 0 !important; /* УБИРАЕМ gap - следующая секция идет сразу */
        padding: 15px 20px;
        overflow: visible !important;
    }
    
    /* Wrapper на мобильных - определяет высоту по контенту */
    .hero__wrapper {
        position: relative;
        height: auto !important;
        min-height: 100px !important; /* Контент определяет высоту */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }
    
    /* Фон на мобильных - абсолютный и растягивается на всю высоту wrapper */
    .hero__background {
        position: absolute !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100% !important; /* Растягиваем на всю высоту wrapper */
        min-height: 100%;
        border-radius: 20px;
        z-index: 1;
        overflow: hidden !important; /* Обрезаем ТОЛЬКО изображение */
    }
    
    .hero__background-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    /* Контент на мобильных - относительное позиционирование */
    .hero__content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px 20px !important;
        z-index: 2;
    }
    
    .hero__title {
        font-size: 26px;
        line-height: 34px;
        max-width: 90%;
        padding: 15px 20px;
    }
    
    .hero__title-wrapper {
        margin-bottom: 20px !important;
    }
    
    .hero__title-background {
        width: 90%;
        height: 100px;
    }
    
    /* Скрываем десктопный виджет на мобильных */
    .hero .booking-widget-container.desktop-widget {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Показываем мобильный виджет - относительное позиционирование */
    .hero .booking-widget-container.mobile-widget {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: all !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: 380px !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important; /* НЕ ограничиваем высоту */
        margin: 0 auto !important;
        padding: 0 15px 40px 15px !important;
        z-index: 2 !important;
        overflow: visible !important; /* НЕ обрезаем выпадающие меню */
    }
    
    /* iframe виджета на мобильных */
    .hero .booking-widget-container.mobile-widget iframe {
        height: auto !important;
        min-height: 500px !important;
        max-height: none !important;
        overflow: visible !important;
        clip-path: none !important;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 15px;
        margin-bottom: 0 !important; /* УБИРАЕМ gap полностью */
        overflow: visible !important;
    }
    
    .hero__wrapper {
        position: relative;
        height: auto !important;
        min-height: 100px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: visible !important;
        padding-bottom: 0 !important;
    }
    
    .hero__background {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100% !important;
        min-height: 100%;
        border-radius: 16px;
        z-index: 1;
        overflow: hidden !important;
    }
    
    .hero__background-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .hero__content {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        padding: 40px 15px 15px !important;
        z-index: 2;
    }
    
    .hero__title {
        font-size: 24px;
        line-height: 32px;
        max-width: 95%;
        padding: 12px 15px;
    }
    
    .hero__title-wrapper {
        margin-bottom: 15px !important;
    }
    
    .hero__title-background {
        width: 95%;
        height: 90px;
    }
    
    /* Мобильный виджет на 768px */
    .hero .booking-widget-container.mobile-widget {
        max-width: 340px !important;
        padding: 0 15px 30px 15px !important;
    }
}

@media (max-width: 480px) {
    .hero {
        margin-bottom: 0 !important; /* УБИРАЕМ gap полностью */
        padding: 10px;
    }
    
    .hero__wrapper {
        border-radius: 12px;
    }
    
    .hero__background {
        border-radius: 12px;
    }
    
    .hero__content {
        padding: 30px 10px 10px !important;
    }
    
    .hero__title {
        font-size: 20px;
        line-height: 26px;
        padding: 10px 12px;
    }
    
    .hero__title-wrapper {
        margin-bottom: 10px !important;
    }
    
    .hero__title-background {
        height: 80px;
    }
    
    /* Мобильный виджет на 480px */
    .hero .booking-widget-container.mobile-widget {
        max-width: 320px !important;
        padding: 0 10px 25px 10px !important;
    }
}
