/**
 * Shared Reservation Experience System components.
 * Used by public + admin summary/form/management modes.
 * Prefer these classes over page-specific badge/pricing/add-on CSS duplicates.
 */

:root {
    --gb-rsv-success: #027a48;
    --gb-rsv-success-soft: #ecfdf3;
    --gb-rsv-warning: #9a5b00;
    --gb-rsv-warning-soft: #fff7e6;
    --gb-rsv-danger: #b42318;
    --gb-rsv-danger-soft: #fff1f0;
    --gb-rsv-info: #175cd3;
    --gb-rsv-info-soft: #eef4ff;
    --gb-rsv-neutral: #697586;
    --gb-rsv-neutral-soft: #f0f2f4;
    --gb-rsv-text: #101828;
    --gb-rsv-muted: #667085;
    --gb-rsv-border: #e4e7ec;
    --gb-rsv-surface: #ffffff;
    --gb-rsv-radius: 10px;
}

/* —— Status badges (reservation) —— */
.gb-rsv-status,
.gb-rsv-pay-status,
.gb-rsv-note-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
}

.gb-rsv-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.gb-rsv-status--success { background: var(--gb-rsv-success-soft); color: var(--gb-rsv-success); }
.gb-rsv-status--warning { background: var(--gb-rsv-warning-soft); color: var(--gb-rsv-warning); }
.gb-rsv-status--danger { background: var(--gb-rsv-danger-soft); color: var(--gb-rsv-danger); }
.gb-rsv-status--info { background: var(--gb-rsv-info-soft); color: var(--gb-rsv-info); }
.gb-rsv-status--neutral { background: var(--gb-rsv-neutral-soft); color: var(--gb-rsv-neutral); }

/* Payment status — distinct family (same palette, different prefix for clarity) */
.gb-rsv-pay-status--success { background: var(--gb-rsv-success-soft); color: var(--gb-rsv-success); }
.gb-rsv-pay-status--warning { background: var(--gb-rsv-warning-soft); color: var(--gb-rsv-warning); }
.gb-rsv-pay-status--danger { background: var(--gb-rsv-danger-soft); color: var(--gb-rsv-danger); }
.gb-rsv-pay-status--info { background: var(--gb-rsv-info-soft); color: var(--gb-rsv-info); }
.gb-rsv-pay-status--neutral { background: var(--gb-rsv-neutral-soft); color: var(--gb-rsv-neutral); }

.gb-rsv-note-badge--customer { background: var(--gb-rsv-success-soft); color: var(--gb-rsv-success); }
.gb-rsv-note-badge--staff { background: var(--gb-rsv-danger-soft); color: var(--gb-rsv-danger); }

/* —— Pricing breakdown —— */
.gb-rsv-price {
    color: var(--gb-rsv-text);
}

.gb-rsv-muted {
    color: var(--gb-rsv-muted);
    margin: 0;
}

.gb-rsv-price-table-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
}

.gb-rsv-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gb-rsv-price-table th,
.gb-rsv-price-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gb-rsv-border);
    text-align: left;
    vertical-align: top;
}

.gb-rsv-price-table th.num,
.gb-rsv-price-table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gb-rsv-price-summary {
    display: grid;
    gap: 6px;
}

.gb-rsv-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.gb-rsv-price-label {
    color: var(--gb-rsv-muted);
}

.gb-rsv-price-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--gb-rsv-text);
    text-align: right;
}

.gb-rsv-price-row--total {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--gb-rsv-border);
}

.gb-rsv-price-row--total .gb-rsv-price-label,
.gb-rsv-price-row--total .gb-rsv-price-value {
    color: var(--gb-rsv-text);
    font-size: 15px;
    font-weight: 700;
}

.gb-rsv-price-row--balance .gb-rsv-price-label,
.gb-rsv-price-row--balance .gb-rsv-price-value {
    color: var(--gb-rsv-warning);
    font-weight: 700;
}

.gb-rsv-price-row--paid .gb-rsv-price-value {
    color: var(--gb-rsv-success);
}

.gb-rsv-price-row--credit .gb-rsv-price-value {
    color: var(--gb-rsv-success);
}

.gb-rsv-price-row--held .gb-rsv-price-value {
    color: var(--gb-rsv-info);
}

/* Local loading for price refresh */
.gb-rsv-price.is-loading,
.gb-rsv-local-loading {
    position: relative;
    min-height: 28px;
}

.gb-rsv-price.is-loading::after,
.gb-rsv-local-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(244,246,248,.85), rgba(255,255,255,.2));
    border-radius: var(--gb-rsv-radius);
    pointer-events: none;
}

.gb-rsv-local-loading-msg {
    font-size: 12px;
    color: var(--gb-rsv-muted);
    margin: 6px 0 0;
}

/* —— Add-on rows / qty stepper —— */
.gb-rsv-addon-table-wrap {
    overflow-x: auto;
}

.gb-rsv-addon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.gb-rsv-addon-table th,
.gb-rsv-addon-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--gb-rsv-border);
    vertical-align: middle;
}

.gb-rsv-addon-name {
    display: block;
    font-weight: 650;
    color: var(--gb-rsv-text);
}

.gb-rsv-addon-desc,
.gb-rsv-addon-modifiers {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--gb-rsv-muted);
}

.gb-rsv-addon-row.is-selected {
    background: #f8fafc;
}

.gb-rsv-addon-row.is-unavailable {
    opacity: .55;
}

.gb-rsv-qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.gb-rsv-qty-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gb-rsv-qty-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.gb-rsv-qty-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.gb-rsv-qty-btn:hover:not(:disabled) {
    background: #f8fafc;
}

.gb-rsv-qty-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.gb-rsv-qty-input {
    width: 44px;
    height: 32px;
    text-align: center;
    border: 1px solid #d0d5dd;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--gb-rsv-text);
    padding: 0;
    -moz-appearance: textfield;
}

.gb-rsv-qty-input::-webkit-outer-spin-button,
.gb-rsv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gb-rsv-addon-unit,
.gb-rsv-addon-line {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gb-rsv-addon-subtotal {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
}

/* —— Transactions —— */
.gb-rsv-tx-list {
    display: grid;
    gap: 10px;
}

.gb-rsv-tx-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--gb-rsv-border);
    border-radius: var(--gb-rsv-radius);
    background: var(--gb-rsv-surface);
}

.gb-rsv-tx-method,
.gb-rsv-tx-time {
    margin-top: 4px;
    font-size: 12px;
    color: var(--gb-rsv-muted);
}

.gb-rsv-tx-aside {
    text-align: right;
    flex: 0 0 auto;
}

.gb-rsv-tx-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gb-rsv-tx-receipt {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
}

.gb-rsv-tx-empty {
    font-size: 13px;
    color: var(--gb-rsv-muted);
}

/* —— Form section / summary card chrome —— */
.gb-rsv-section {
    margin-bottom: 16px;
}

.gb-rsv-section-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gb-rsv-text);
}

.gb-rsv-section-help {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--gb-rsv-muted);
}

.gb-rsv-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.gb-rsv-action-bar--sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}

@media (prefers-reduced-motion: reduce) {
    .gb-rsv-price.is-loading::after,
    .gb-rsv-local-loading::after {
        animation: none;
        background: rgba(244, 246, 248, .75);
    }
}
