/**
 * Tour Radar Booking Popup Styles
 */

/* Предотвращение скролла при открытом попапе */
body.tourradar-popup-open {
    overflow: hidden;
}

/* Контейнер попапа */
.tourradar-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Затемняющий оверлей */
.tourradar-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

/* Контейнер контента */
.tourradar-popup__container {
    position: relative;
    width: 95%;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: visible;
    z-index: 1;
    animation: tourradar-popup-appear 0.3s ease-out;
    padding: 20px;
}

/* Большие экраны (1600px+) */
@media (min-width: 1600px) {
    .tourradar-popup__container {
        max-width: 1200px;
        max-height: 800px;
    }
}

.tourradar-popup__content {
    overflow: hidden;
    border-radius: 12px;
}

@keyframes tourradar-popup-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Кнопка закрытия */
.tourradar-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2ECC40;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 99999;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.tourradar-popup__close:hover {
    background-color: #27ae36;
    transform: scale(1.1);
}

.tourradar-popup__close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.tourradar-popup__close-icon {
    position: relative;
    width: 18px;
    height: 18px;
}

.tourradar-popup__close-icon::before,
.tourradar-popup__close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
}

.tourradar-popup__close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tourradar-popup__close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Контент (iframe) */
.tourradar-popup__content {
    width: 100%;
    height: calc(100% - 0px);
    box-sizing: border-box;
}

.tourradar-popup__content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Индикатор загрузки */
.tourradar-popup__content::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tourradar-spinner 0.8s linear infinite;
    z-index: -1;
}

@keyframes tourradar-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .tourradar-popup__container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .tourradar-popup__close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .tourradar-popup__close svg {
        width: 18px;
        height: 18px;
    }
}

/* Стили для кнопок, которые были заменены на Tour Radar */
.tourradar-book-btn {
    cursor: pointer;
    background-color: #3eb368 !important;
    border-color: #3eb368 !important;
}

/* Визуальный индикатор при наведении */
.tourradar-book-btn:hover {
    background-color: #35a05c !important;
    border-color: #35a05c !important;
    opacity: 1;
}

/* Кнопка Hold Seat for 48H */
.tourradar-hold-btn {
    background-color: #3498db !important;
    border: 1px solid #3498db !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 10px !important;
    white-space: normal;
    transition: background-color 0.2s ease;
    line-height: 1.2;
    text-align: center;
    border-radius: 6px;
}

.tourradar-hold-btn:hover {
    background-color: #2980b9 !important;
    border-color: #2980b9 !important;
}

/* Десктоп стили для кнопок в ряд */
@media (min-width: 992px) {
    .tour-date-item__btn-wrap.hold-btn {
        margin-left: 5px;
    }

    .tourradar-hold-btn {
        font-size: 10px !important;
        padding: 6.5px 10px !important;
        min-width: 70px;
    }
}

/* Планшеты и маленькие ноутбуки */
@media (min-width: 768px) and (max-width: 991px) {
    .tour-date-item__btn-wrap.hold-btn {
        margin-left: 3px;
    }

    .tourradar-hold-btn {
        font-size: 10px !important;
        padding: 6px 4px !important;
        min-width: 55px;
    }

    .tour-date-item__btn-wrap.main-btn .tourradar-book-btn,
    .tour-date-item__btn-wrap.main-btn .tour-date-item__btn {
        font-size: 10px !important;
        padding: 8px 10px !important;
    }

    .tour-date-item .request-btn {
        font-size: 10px !important;
        padding: 8px 10px !important;
    }
}

/* Мобильные стили - 3 кнопки в один ряд */
@media (max-width: 767px) {
    .tour-date-item__btn-wrap.main-btn,
    .tour-date-item__btn-wrap.hold-btn,
    .tour-date-item__btn-wrap:last-child {
        width: 32% !important;
        margin: 0 !important;
    }

    .tourradar-hold-btn {
        width: 100% !important;
        padding: 4px 2px !important;
        height: auto;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px !important;
    }

    .tourradar-hold-btn .hold-btn-br {
        display: none;
    }
}

/* Скрываем FancyBox когда открыт наш попап */
body.tourradar-popup-open .fancybox-container,
body.tourradar-popup-open .fancybox-overlay,
body.tourradar-popup-open .fancybox-wrap {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
