/* ============================================
   STAIRZ BOOKING - Popup/Modal Overlay
   Version: 1.0
   ============================================ */

/* --- Overlay backdrop --- */
/* Uses !important to override theme's inline display:none!important */
.stairz-booking-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stairz-booking-overlay.active {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
}

.stairz-booking-overlay.visible {
    opacity: 1;
}

/* --- Modal container --- */
.stairz-booking-modal {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 40px auto;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;
}

.stairz-booking-overlay.visible .stairz-booking-modal {
    transform: translateY(0) scale(1);
}

/* --- Close button --- */
.stairz-booking-close {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    padding: 0;
    color: #666;
}

.stairz-booking-close:hover {
    background: #f5f5f5;
    color: #313131;
    transform: scale(1.05);
}

/* --- Override booking-wrap for popup context --- */
.stairz-booking-overlay .stairz-booking-wrap {
    max-width: 100%;
}

.stairz-booking-overlay .booking-container {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    border: none;
}

/* --- Responsive --- */
@media (max-width: 680px) {
    .stairz-booking-overlay {
        padding: 10px;
    }

    .stairz-booking-modal {
        margin: 10px auto;
    }

    .stairz-booking-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .stairz-booking-overlay {
        padding: 0;
    }

    .stairz-booking-modal {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }

    .stairz-booking-overlay .booking-container {
        border-radius: 0;
        min-height: 100vh;
    }

    .stairz-booking-close {
        top: 12px;
        right: 12px;
        z-index: 20;
    }
}

/* --- Fix header CTA button hover flicker --- */
/* Theme sets margin-left/right: 10px normal, 0 on hover, causing layout shift loop */
.site-header .stairz-booking-trigger.btn-primary {
    margin-left: 10px;
    margin-right: 10px;
}

.site-header .stairz-booking-trigger.btn-primary:hover {
    margin-left: 10px;
    margin-right: 10px;
}

/* --- Body scroll lock when popup is open --- */
body.stairz-booking-popup-open {
    overflow: hidden;
}
