/* =====================================================
   Range Reservation System — Booking Confirmation Modal
   ===================================================== */

/* ── Overlay (full-screen backdrop) ──────────────────── */
.rrs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.rrs-modal-overlay.is-open {
    display: flex;
}

/* ── Prevent body scroll when modal is open ──────────── */
body.rrs-modal-open {
    overflow: hidden;
}

/* ── Modal box ───────────────────────────────────────── */
.rrs-booking-modal {
    background: #fff;
    border-radius: 10px;
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    animation: rrs-modal-in 0.18s ease;
}

@keyframes rrs-modal-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* ── Header ──────────────────────────────────────────── */
.rrs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rrs-modal-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #111827;
}

.rrs-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.rrs-modal-close:hover {
    color: #111827;
    background: #f3f4f6;
}

/* ── Summary strip ───────────────────────────────────── */
.rrs-modal-summary {
    padding: 14px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rrs-modal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
}

.rrs-modal-summary-item label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
    margin-bottom: 2px;
    font-weight: 600;
}

.rrs-modal-summary-item span {
    font-size: 0.95em;
    font-weight: 700;
    color: #111827;
}

/* ── Scrollable body ─────────────────────────────────── */
.rrs-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Form fields inside modal (inherit .rrs-form-field styles from frontend.css) */
.rrs-modal-body .rrs-form-field {
    margin-bottom: 16px;
}

.rrs-modal-body .rrs-form-field:last-of-type {
    margin-bottom: 0;
}

.rrs-modal-body .rrs-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9em;
    color: #444;
}

.rrs-modal-body .rrs-form-field input[type="number"],
.rrs-modal-body .rrs-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rrs-modal-body .rrs-form-field input[type="number"]:focus,
.rrs-modal-body .rrs-form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.rrs-modal-body .rrs-form-field textarea {
    resize: vertical;
    min-height: 64px;
}

/* ── Status message ──────────────────────────────────── */
.rrs-modal-status-msg {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.88em;
    min-height: 0;
    display: none;
}

.rrs-modal-status-msg:not(:empty) {
    display: block;
}

.rrs-modal-status-msg.error {
    background: #fef2f2;
    color: #c62828;
    border: 1px solid #fca5a5;
}

.rrs-modal-status-msg.loading {
    background: #f3f4f6;
    color: #6b7280;
    font-style: italic;
}

/* ── Footer ──────────────────────────────────────────── */
.rrs-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Submit button — inherits WooCommerce button vars from frontend.css */
.rrs-modal-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    box-sizing: border-box;
    background-color: var(--wc-button-background-color, #333);
    color: var(--wc-button-color, #fff);
}

.rrs-modal-submit:hover:not(:disabled) {
    background-color: var(--wc-button-background-color-hover, #111);
    color: var(--wc-button-color, #fff);
    transform: translateY(-1px);
}

.rrs-modal-submit:active:not(:disabled) {
    transform: translateY(0);
}

.rrs-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Guest list inside modal ─────────────────────────── */
/* Re-uses .rrs-guest-list, .rrs-guest-row, .rrs-guest-label,
   .rrs-waiver-badge, .rrs-remove-guest from frontend.css     */

#rrs-modal-guest-list {
    margin-top: 4px;
}

/* ── Mobile: full-width bottom sheet ─────────────────── */
@media (max-width: 600px) {
    .rrs-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .rrs-booking-modal {
        border-radius: 16px 16px 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        animation: rrs-modal-in-mobile 0.22s ease;
    }

    @keyframes rrs-modal-in-mobile {
        from { transform: translateY(30px); opacity: 0; }
        to   { transform: translateY(0);    opacity: 1; }
    }
}

/* ── Post-booking page notice ─────────────────────────── */
.rrs-page-notice {
    display: block;
    margin: 0 0 16px;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}
.rrs-notice-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}
.rrs-notice-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
}
