/* =============================================
   Reservation System — OyunEvi Calendar
   Event Info → Group Pricing → Cart → Payment
   ============================================= */

:root {
    --rez-gold: #c9a84c;
    --rez-dark: #1a1612;
    --rez-bg: #faf7f0;
    --rez-card-bg: #fff;
    --rez-border: rgba(201, 168, 76, 0.2);
    --rez-success: var(--color-success-dark);
    --rez-danger: var(--color-error);
    --rez-radius: 16px;
    --rez-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ===== OVERLAY ===== */
.rez-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(20, 18, 14, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rez-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ===== PANEL ===== */
.rez-panel {
    background: var(--rez-bg);
    border-radius: var(--rez-radius);
    width: 95%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--rez-shadow);
    border: 1.5px solid var(--rez-border);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s ease;
    position: relative;
}

.rez-overlay.open .rez-panel {
    transform: translateY(0) scale(1);
}

.rez-panel::-webkit-scrollbar {
    width: 6px;
}

.rez-panel::-webkit-scrollbar-thumb {
    background: var(--rez-gold);
    border-radius: 3px;
}

/* ===== CLOSE BUTTON ===== */
.rez-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--rez-border);
    background: var(--rez-card-bg);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #666;
}

.rez-close:hover {
    background: var(--rez-danger);
    color: #fff;
    border-color: var(--rez-danger);
}

/* ===== STEP PROGRESS ===== */
.rez-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 24px 24px 0;
}

.rez-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #999;
    background: #fff;
    transition: all 0.3s;
    flex-shrink: 0;
}

.rez-step-dot.active {
    border-color: var(--rez-gold);
    background: var(--rez-gold);
    color: #fff;
}

.rez-step-dot.done {
    border-color: var(--rez-success);
    background: var(--rez-success);
    color: #fff;
}

.rez-step-line {
    width: 60px;
    height: 2px;
    background: #ddd;
    transition: background 0.3s;
}

.rez-step-line.done {
    background: var(--rez-success);
}

.rez-step-label {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    text-align: center;
    color: #999;
}

.rez-step-dot.active+.rez-step-label,
.rez-step-dot.done+.rez-step-label {
    color: var(--rez-dark);
}

.rez-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== STEP CONTAINERS ===== */
.rez-step {
    padding: 24px;
    display: none;
}

.rez-step.active {
    display: block;
    animation: rezFadeIn 0.3s ease;
}

@keyframes rezFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== STEP 1: EVENT INFO ===== */
.rez-event-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.rez-event-thumb {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--rez-border);
}

.rez-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rez-event-details {
    flex: 1;
    min-width: 0;
}

.rez-event-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(201, 168, 76, 0.15);
    color: #8a6d2e;
    margin-bottom: 6px;
}

.rez-event-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--rez-dark);
    margin: 0 0 8px;
    line-height: 1.2;
}

.rez-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #666;
}

.rez-event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Participant Count Badge */
.rez-participants {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rez-success, #27ae60);
    background: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
}

.rez-participants:empty {
    display: none;
}

[data-theme="dark"] .rez-participants {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.25);
}

/* People Count Selector */
.rez-field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--rez-dark);
    margin-bottom: 8px;
    display: block;
}

.rez-people-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rez-stepper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--rez-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.rez-stepper-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--rez-dark);
    transition: background 0.2s;
}

.rez-stepper-btn:hover {
    background: rgba(201, 168, 76, 0.15);
}

.rez-stepper-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.rez-stepper-val {
    width: 48px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--rez-dark);
    border-left: 1px solid var(--rez-border);
    border-right: 1px solid var(--rez-border);
    padding: 8px 0;
}

.rez-people-note {
    font-size: 12px;
    color: #999;
}

/* ===== PRICING TABLE ===== */
.rez-pricing {
    background: var(--rez-card-bg);
    border-radius: 12px;
    border: 1.5px solid var(--rez-border);
    overflow: hidden;
    margin-bottom: 20px;
}

.rez-pricing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f7f1e3, #faf7f0);
    border-bottom: 1px solid var(--rez-border);
}

.rez-pricing-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--rez-dark);
}

.rez-discount-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--rez-success);
    color: #fff;
    display: none;
}

.rez-discount-badge.visible {
    display: inline-block;
}

.rez-pricing-body {
    padding: 16px;
}

.rez-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #555;
}

.rez-price-row.total {
    border-top: 1.5px solid var(--rez-border);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--rez-dark);
}

.rez-price-original {
    text-decoration: line-through;
    color: #bbb;
    font-size: 13px;
    margin-right: 6px;
}

.rez-price-discounted {
    color: var(--rez-success);
    font-weight: 700;
}

/* ===== STEP 2: CART ===== */
.rez-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.rez-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--rez-card-bg);
    border-radius: 12px;
    border: 1px solid var(--rez-border);
}

.rez-cart-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.rez-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rez-cart-info {
    flex: 1;
    min-width: 0;
}

.rez-cart-edit-trigger {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: background 0.2s;
}

.rez-cart-edit-trigger:hover {
    background: rgba(201, 168, 76, 0.1);
}

.rez-cart-edit-icon {
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.rez-cart-edit-trigger:hover .rez-cart-edit-icon {
    opacity: 1;
}

.rez-cart-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--rez-dark);
    margin-bottom: 2px;
}

.rez-cart-detail {
    font-size: 12px;
    color: #888;
}

.rez-cart-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--rez-dark);
    white-space: nowrap;
}

.rez-cart-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e0d5c0;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rez-cart-remove:hover {
    background: var(--rez-danger);
    color: #fff;
    border-color: var(--rez-danger);
}

/* Cart Summary */
.rez-cart-summary {
    background: var(--rez-card-bg);
    border-radius: 12px;
    border: 1.5px solid var(--rez-border);
    padding: 16px;
    margin-bottom: 20px;
}

.rez-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: #666;
}

.rez-summary-row.grand-total {
    border-top: 2px solid var(--rez-gold);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--rez-dark);
}

.rez-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

.rez-cart-empty span {
    display: block;
    font-size: 40px;
    margin-bottom: 12px;
}

/* ===== STEP 3: PAYMENT ===== */
.rez-payment-section {
    margin-bottom: 20px;
}

.rez-payment-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--rez-dark);
    margin: 0 0 12px;
}

.rez-input-group {
    margin-bottom: 14px;
}

.rez-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rez-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e0d5c0;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: #1a1612;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.rez-input:focus {
    outline: none;
    border-color: var(--rez-gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.rez-input.error {
    border-color: var(--rez-danger);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.rez-input-row {
    display: flex;
    gap: 12px;
}

.rez-input-row .rez-input-group {
    flex: 1;
}

/* Card brand icons */
.rez-card-brands {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.rez-card-brand {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1.5px solid #e0d5c0;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.rez-card-brand.selected {
    border-color: var(--rez-gold);
    background: rgba(201, 168, 76, 0.1);
    color: var(--rez-dark);
}

/* Payment total bar */
.rez-pay-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--rez-dark), #2c2419);
    border-radius: 12px;
    color: #fff;
    margin-bottom: 16px;
}

.rez-pay-total-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.rez-pay-total-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--rez-gold);
}

/* ===== STEP 2: PARTICIPANT DETAILS ===== */
.rez-section-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--rez-dark);
    margin: 0 0 4px;
}

.rez-section-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
}

.rez-participant-card {
    background: var(--rez-card-bg);
    border: 1.5px solid var(--rez-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.rez-participant-card:last-child {
    margin-bottom: 20px;
}

.rez-participant-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--rez-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rez-contact-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(201, 168, 76, 0.15);
    color: #8a6d2e;
}

.rez-participant-card .rez-input-group {
    margin-bottom: 10px;
}

.rez-participant-card .rez-input-group:last-child {
    margin-bottom: 0;
}

.rez-participant-card .rez-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rez-participant-card .rez-input-row .rez-input-group {
    flex: 1;
    margin-bottom: 0;
}

/* Confirmation participant list */
.rez-confirm-participants {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1.5px solid var(--rez-border);
}

.rez-confirm-part-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--rez-dark);
    margin-bottom: 8px;
}

/* Dark mode overrides */
[data-theme="dark"] .rez-section-title {
    color: #e6e6e6;
}

[data-theme="dark"] .rez-section-desc {
    color: #999;
}

[data-theme="dark"] .rez-participant-title {
    color: #e6e6e6;
}

[data-theme="dark"] .rez-contact-badge {
    background: rgba(201, 168, 76, 0.2);
    color: #c9a84c;
}

[data-theme="dark"] .rez-confirm-part-title {
    color: #e6e6e6;
}

[data-theme="dark"] .rez-participant-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-gold);
}

[data-theme="dark"] .rez-input {
    background: rgba(255, 255, 255, 0.08);
    color: #e6e6e6;
    border-color: rgba(201, 168, 76, 0.3);
}

[data-theme="dark"] .rez-input-label {
    color: #ccc;
}

/* ===== STEP 4: CONFIRMATION ===== */
.rez-confirm-center {
    text-align: center;
    padding: 20px 0;
}

.rez-confirm-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--rez-success);
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: rezBounce 0.6s ease;
}

@keyframes rezBounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.rez-confirm-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--rez-dark);
    margin-bottom: 8px;
}

.rez-confirm-ref {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.rez-confirm-ref strong {
    color: var(--rez-gold);
    font-size: 16px;
}

.rez-confirm-details {
    text-align: left;
    background: var(--rez-card-bg);
    border-radius: 12px;
    border: 1px solid var(--rez-border);
    padding: 16px;
    margin-bottom: 20px;
}

.rez-confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

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

.rez-confirm-row strong {
    color: var(--rez-dark);
}

/* ===== BUTTONS ===== */
.rez-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rez-btn-primary {
    background: linear-gradient(135deg, var(--rez-gold), #d4b65e);
    color: var(--rez-dark);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.rez-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

.rez-btn-primary:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.rez-btn-secondary {
    background: transparent;
    border: 1.5px solid #ddd;
    color: #666;
}

.rez-btn-secondary:hover {
    border-color: var(--rez-gold);
    color: var(--rez-dark);
}

.rez-btn-success {
    background: linear-gradient(135deg, var(--rez-success), var(--color-success));
    color: #fff;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.rez-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.rez-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.rez-btn-row .rez-btn {
    flex: 1;
}

.rez-btn-row .rez-btn-secondary {
    flex: 0 0 auto;
    width: auto;
    padding: 14px 24px;
}

/* Cart badge on header */
.rez-cart-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--rez-gold);
    color: var(--rez-dark);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
    transition: transform 0.3s;
}

.rez-cart-badge.visible {
    display: flex;
}

.rez-cart-badge:hover {
    transform: scale(1.1);
}

.rez-cart-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--rez-danger);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== AUTH GATE (Step 0) ===== */
.rez-auth-gate {
    text-align: center;
    padding: 2rem 1rem;
}

.rez-auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.rez-auth-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rez-dark);
    margin: 0 0 0.5rem;
}

.rez-auth-desc {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.rez-auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rez-auth-buttons .rez-btn {
    width: auto;
    min-width: 140px;
    padding: 12px 24px;
}

[data-theme="dark"] .rez-auth-title {
    color: #e6e6e6;
}

[data-theme="dark"] .rez-auth-desc {
    color: #999;
}

/* ===== SECURITY NOTE ===== */
.rez-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    color: #aaa;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .rez-panel {
        width: 100%;
        max-width: none;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .rez-overlay {
        align-items: flex-end;
    }

    .rez-event-header {
        flex-direction: column;
    }

    .rez-event-thumb {
        width: 100%;
        height: 160px;
    }

    .rez-input-row {
        flex-direction: column;
        gap: 0;
    }

    .rez-btn-row {
        flex-direction: column;
    }

    .rez-btn-row .rez-btn-secondary {
        width: 100%;
    }
}