/* Оверлей: скрыт, пока скрипт не откроет баннер */
.ub-promo {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
/* Сторонние виджеты (чат, модуль бронирования) прячем на время показа баннера */
.ub-promo-hidden { display: none !important; }
.ub-promo.is-open { display: flex; }

.ub-promo__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(10, 24, 20, .72);
}

/* Тема вешает на виджеты elementor-invisible для анимации по скроллу.
   В перенесённом баннере этот класс уже некому снять, поэтому гасим его принудительно. */
.ub-promo-host .elementor-invisible,
.ub-promo-host .elementor-element {
    visibility: visible !important;
    opacity: 1 !important;
    animation: none !important;
}

.ub-promo__box {
    position: relative;
    width: 1200px;
    height: 700px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
}
/* Режим «размер по картинке»: окно повторяет пропорции изображения и целиком влезает в экран */
.ub-promo--auto-h .ub-promo__box {
    width: auto !important;
    height: auto !important;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
}

.ub-promo__media {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    line-height: 0;
}
/* Селекторы с .ub-promo, иначе правило темы `.elementor img { height: auto }` перебивает высоту */
.ub-promo .ub-promo__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ub-promo.ub-promo--auto-h .ub-promo__img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    object-fit: contain;
}
.ub-promo picture { display: block; width: 100%; height: 100%; }
.ub-promo--auto-h picture { width: auto; height: auto; }
.ub-promo--auto-h .ub-promo__media { width: auto; height: auto; }

/* Текстовый слой поверх картинки */
.ub-promo__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    line-height: normal;
    pointer-events: none;
}
.ub-promo__content-inner {
    max-width: 70%;
    padding: 32px;
    text-align: center;
    border-radius: 4px;
    pointer-events: auto;
}
.ub-promo__title {
    margin: 0 0 10px;
    color: #fff;
    font-size: 42px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.ub-promo__subtitle {
    margin: 0 0 12px;
    color: #fff;
    font-size: 26px;
    line-height: 1.25;
}
.ub-promo__desc {
    margin: 0;
    color: #f2f2f2;
    font-size: 16px;
    line-height: 1.5;
}
.ub-promo__btn {
    display: inline-block;
    margin-top: 20px;
    padding: 15px 36px;
    background: #c6a875;
    color: #fff !important;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease;
}
.ub-promo__btn:hover { background: #b3925f; }

/* Крестик */
.ub-promo__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .85);
    color: #1c2c26;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.ub-promo__close:hover { background-color: #fff; color: #000; }
.ub-promo--close-outside .ub-promo__close {
    top: -50px;
    right: 0;
    background-color: transparent;
    color: #fff;
    font-size: 34px;
}
.ub-promo--close-outside .ub-promo__close:hover { background-color: transparent; color: #c6a875; }
.ub-promo--close-outside .ub-promo__box { overflow: visible; }
.ub-promo--close-outside .ub-promo__media { border-radius: inherit; overflow: hidden; }

/* Появление (после показа анимация снимается, чтобы баннер не моргал при правках DOM) */
.ub-promo.ub-promo--shown .ub-promo__box { animation: none !important; }
.ub-promo.is-open .ub-promo__box { animation: ub-promo-zoom .26s ease; }
.ub-promo--anim-fade.is-open .ub-promo__box { animation: ub-promo-fade .3s ease; }
.ub-promo--anim-slide.is-open .ub-promo__box { animation: ub-promo-slide .3s ease; }
@keyframes ub-promo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ub-promo-zoom { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes ub-promo-slide { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* В редакторе Elementor баннер показывается прямо в холсте, чтобы его можно было настроить */
.ub-promo--editor {
    position: relative;
    inset: auto;
    display: flex;
    padding: 0;
}
.ub-promo--editor .ub-promo__overlay { display: none; }
.ub-promo--editor .ub-promo__box { max-width: 100%; max-height: none; }
.ub-promo--editor.ub-promo--close-outside .ub-promo__close { top: 10px; color: #1c2c26; }

@media (max-width: 767px) {
    .ub-promo { padding: 12px; }
    .ub-promo__box { max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
    .ub-promo--auto-h .ub-promo__box,
    .ub-promo.ub-promo--auto-h .ub-promo__img { max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
    .ub-promo__content-inner { max-width: 92%; padding: 18px; }
    .ub-promo__title { font-size: 26px; }
    .ub-promo__subtitle { font-size: 18px; }
    .ub-promo__desc { font-size: 14px; }
    .ub-promo__btn { margin-top: 14px; padding: 12px 24px; font-size: 13px; }
    .ub-promo--close-outside .ub-promo__close { top: -44px; }
}
