/* ============================================================
   RESERVATION.CSS — Popup reservation widget
   Inspired by ONYX Zenchef-style dark green card
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────────── */
.res-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 20, 22, 0.80);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                visibility 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.res-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Card ────────────────────────────────────────────────────── */
.res-card {
    background: #2d4538;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.93) translateY(12px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.res-overlay.active .res-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Card header ─────────────────────────────────────────────── */
.res-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.res-brand-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.res-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.res-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ── Card intro / description ────────────────────────────────── */
.res-intro {
    padding: 20px 24px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.res-intro-line1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 6px;
    line-height: 1.5;
}

.res-brand-highlight {
    color: #f26522;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.res-intro-address {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
    font-style: normal;
}

/* ── Selector rows ───────────────────────────────────────────── */
.res-selectors {
    /* rows stacked, each with bottom border */
}

.res-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.res-row:last-child {
    border-bottom: none;
}

/* The clickable trigger (full-width row) */
.res-row-trigger {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    color: #fff;
    text-align: left;
    transition: background 0.2s ease;
}

.res-row-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
}

.res-row-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: -2px;
}

.res-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.res-row-text {
    flex: 1;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.2px;
}

.res-chevron {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.res-row.open .res-chevron {
    transform: rotate(180deg);
}

/* ── Options panel (expandable) ──────────────────────────────── */
.res-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.res-row.open .res-panel {
    max-height: 220px;
}

.res-options-list {
    overflow-y: auto;
    max-height: 200px;
    padding: 4px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.res-options-list::-webkit-scrollbar {
    width: 4px;
}

.res-options-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.res-option {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 24px 10px 52px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.res-option.selected {
    color: #fff;
    font-weight: 700;
}

.res-option.selected::before {
    content: '✓ ';
    color: #f26522;
}

/* ── Action / submit ─────────────────────────────────────────── */
.res-action {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.res-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: #ffffff;
    color: #1d1d1b;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

.res-submit-btn:hover {
    background: #f0ede4;
}

.res-submit-btn:active {
    transform: scale(0.99);
}

.res-submit-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ── Card footer ─────────────────────────────────────────────── */
.res-card-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.res-card-footer-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.3px;
}

/* ── Success state ───────────────────────────────────────────── */
.res-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 32px;
    text-align: center;
    gap: 16px;
}

.res-success.visible {
    display: flex;
}

.res-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 8px;
}

.res-success-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.res-success-sub {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

.res-success-close {
    margin-top: 8px;
    padding: 12px 32px;
    background: #fff;
    color: #1d1d1b;
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}

.res-success-close:hover {
    background: #f0ede4;
}

/* ── Validation error message ────────────────────────────────── */
.res-error-msg {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: #ff8a65;
    text-align: center;
    padding: 0 24px 12px;
    display: none;
}

.res-error-msg.visible {
    display: block;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .res-card {
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .res-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .res-overlay.active .res-card {
        transform: translateY(0);
    }

    .res-overlay:not(.active) .res-card {
        transform: translateY(100%);
    }
}
