/* =============================================================
   RESERVATION POPUP — index.php
   Modal overlay + bottom sheet on mobile
   ============================================================= */

/* --- Overlay --- */
.res-popup-overlay {
    display: none;
    position: fixed; inset: 0;
    z-index: 2000;
    background: rgba(8,14,28,0);
    transition: background 0.3s ease;
    align-items: center;
    justify-content: center;
}
.res-popup-overlay.open { display: flex; background: rgba(8,14,28,0.82); }

/* --- Modal box — desktop --- */
.res-popup-box {
    position: relative;
    width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px 32px 28px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    transform: translateY(24px) scale(0.97); opacity: 0;
    transition: transform 0.32s cubic-bezier(0.32,0.72,0,1), opacity 0.32s ease;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.res-popup-overlay.open .res-popup-box { transform: translateY(0) scale(1); opacity: 1; }

.res-popup-handle { display: none; }
.res-popup-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; }
.res-popup-title  { font-size:20px; font-weight:700; color:var(--text-primary); }
.res-popup-close  {
    display:flex; align-items:center; justify-content:center;
    width:36px; height:36px; flex-shrink:0;
    background:var(--bg-tertiary); border:1px solid var(--glass-border); border-radius:50%;
    color:var(--text-secondary); cursor:pointer; transition:var(--transition-fast);
}
.res-popup-close:hover { background:var(--accent-muted); color:var(--text-primary); }
.res-popup-form   { display:flex; flex-direction:column; gap:14px; }
.res-popup-field  { display:flex; flex-direction:column; gap:6px; }
.res-popup-label  { font-size:13px; font-weight:500; color:var(--text-primary); }
.res-popup-row    { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.res-popup-input  { font-size:15px !important; padding:11px 14px !important; }
.res-popup-submit { margin-top:6px; padding:14px !important; font-size:15px; font-weight:600; }

/* --- Calendar / time popups — must be above modal (z > 2000) --- */
.res-cal-backdrop {
    display: none;
    position: fixed; inset: 0;
    z-index: 2100;
    background: rgba(8,14,28,0.4);
    transition: opacity 0.2s ease;
    opacity: 0;
}
.res-cal-backdrop.open { opacity: 1; }

.res-cal-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0.93);
    z-index: 2101;
    width: calc(100vw - 40px); max-width: 340px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.res-cal-popup.open {
    opacity: 1; pointer-events: all;
    transform: translate(-50%,-50%) scale(1);
}
.res-cal-head {
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 16px 10px; border-bottom:1px solid var(--glass-border);
}
.res-cal-head-title { font-size:15px; font-weight:600; color:var(--text-primary); }
.res-cal-close-btn {
    display:flex; align-items:center; justify-content:center;
    width:30px; height:30px;
    background:var(--bg-tertiary); border:1px solid var(--glass-border); border-radius:50%;
    color:var(--text-secondary); font-size:18px; line-height:1; cursor:pointer;
}
.res-cal-body { padding:0; }
.res-cal-body .calendar-dropdown,
.res-cal-body .time-dropdown {
    position:static !important; opacity:1 !important; visibility:visible !important;
    transform:none !important; box-shadow:none !important;
    border:none !important; border-radius:0 0 var(--radius-lg) var(--radius-lg) !important;
    background:transparent !important;
}

/* --- Mobile: bottom sheet variant --- */
@media (max-width: 900px) {
    .res-popup-overlay { align-items: flex-end; }
    .res-popup-box {
        max-width:100%; width:100%;
        border-radius:20px 20px 0 0;
        border-left:none; border-right:none; border-bottom:none;
        padding:8px 20px 36px; max-height:92vh;
        transform:translateY(100%); opacity:1;
    }
    .res-popup-overlay.open .res-popup-box { transform:translateY(0); opacity:1; }
    .res-popup-handle {
        display:block; width:40px; height:4px;
        background:var(--glass-border); border-radius:2px; margin:8px auto 16px; opacity:0.6;
    }
}

/* --- Person selector glider positions for popup (ids rp1–rp5) --- */
.person-selector input#rp1:checked ~ .selector-glider { left: 4px; }
.person-selector input#rp2:checked ~ .selector-glider { left: calc(20% + 1px); }
.person-selector input#rp3:checked ~ .selector-glider { left: calc(40% - 1px); }
.person-selector input#rp4:checked ~ .selector-glider { left: calc(60% - 2px); }
.person-selector input#rp5:checked ~ .selector-glider { left: calc(80% - 4px); }
