/* Cart page styles
 * Follows shop.css / seat-selection.css naming conventions.
 * Uses CSS custom properties for vendor branding: --vendor-primary
 */

/* Cart page title */
.cart-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 16px;
}

/* ─── Sticky Timer Bar ────────────────────────────────────────────────────── */

.cart-timer-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--vendor-primary, #3C60A8);
    color: #fff;
    padding: 8px 0;
    text-align: center;
}

.cart-timer-bar.warning {
    background: #FEF5E7;
    color: #B5700A;
    border-bottom: 2px solid #D4920A;
}

.cart-timer-bar.expired {
    background: #FDF0EF;
    color: #C0392B;
    border-bottom: 2px solid #C0392B;
}

.cart-timer-label {
    font-size: 0.875rem;
}

.cart-timer-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-timer-urgency {
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ─── Cart Event Group ────────────────────────────────────────────────────── */

.cart-event-group {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    margin-bottom: 24px;
}

.cart-event-header {
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
    border-left: 3px solid var(--vendor-primary, #3C60A8);
    background: #F8FAFC;
    border-radius: 8px 8px 0 0;
}

.cart-event-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.cart-event-meta {
    font-size: 0.875rem;
    color: #64748B;
    margin-top: 2px;
}

/* ─── Cart Seat Row ───────────────────────────────────────────────────────── */

.cart-seat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid #F1F5F9;
    flex-wrap: wrap;
}

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

.cart-seat-row.stale {
    background: #FDF0EF;
    border-left: 3px solid #C0392B;
}

.cart-seat-row.removing {
    opacity: 0.4;
    pointer-events: none;
}

.cart-seat-info {
    flex: 1;
    font-size: 0.875rem;
    color: #334155;
    min-width: 120px;
}

.cart-seat-ticket-type {
    width: auto;
    min-width: 120px;
}

.cart-seat-ticket-type:focus-visible {
    outline: 2px solid var(--vendor-primary, #3C60A8);
    outline-offset: 2px;
}

.cart-seat-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    min-width: 56px;
    text-align: right;
}

.cart-stale-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: #FDF0EF;
    color: #C0392B;
    border: 1px solid #f5c6c2;
}

.cart-remove-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #C0392B;
    border-radius: 4px;
    background: #fff;
    color: #C0392B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.cart-remove-btn:hover {
    background: #C0392B;
    color: #fff;
}

.cart-remove-btn:focus-visible {
    outline: 2px solid var(--vendor-primary, #3C60A8);
    outline-offset: 2px;
}

/* ─── Subscription Line Styles ────────────────────────────────────────────── */

/* Subscription line row — extends .cart-seat-row for subscription-specific layout */
.cart-subscription-line {
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Stale price warning: red left-border, error-light background */
.cart-subscription-line.stale {
    border-left: 3px solid #C0392B;
    background: #FDF0EF;
}

/* Stale price inline banner text (rendered inside the row) */
.stale-price-banner {
    flex: 0 0 100%;
    padding: 4px 0 0;
}

/* Early bird savings callout */
.subscription-savings {
    color: #D4920A;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ─── Sticky Bottom Bar ───────────────────────────────────────────────────── */

.cart-checkout-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    padding: 12px 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.cart-checkout-summary {
    font-size: 0.875rem;
    color: #475569;
    display: block;
}

.cart-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
}

.cart-checkout-btn {
    background: var(--vendor-primary, #3C60A8);
    color: #fff;
    border: none;
    min-width: 160px;
    padding: 10px 24px;
    font-weight: 700;
    border-radius: 6px;
    font-size: 1rem;
}

.cart-checkout-btn:hover:not(:disabled) {
    filter: brightness(0.9);
    color: #fff;
}

.cart-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-checkout-btn:focus-visible {
    outline: 2px solid var(--vendor-primary, #3C60A8);
    outline-offset: 2px;
}

/* ─── Header Cart Icon ────────────────────────────────────────────────────── */

.shop-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 4px 8px;
    font-size: 1.25rem;
}

.shop-cart-icon:hover {
    color: #fff;
}

.shop-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #D4920A;
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Failed Payment Notice (global banner + header badge) ───────────────── */

.failed-payment-banner {
    background-color: #FEF5E7;
    border-bottom: 2px solid #D4920A;
    color: #7C4A00;
    padding: 10px 0;
    font-size: 0.9rem;
}

.failed-payment-banner a.btn {
    white-space: nowrap;
    color: #7C4A00;
    border-color: #7C4A00;
}

.failed-payment-banner a.btn:hover {
    background-color: #7C4A00;
    color: #fff;
}

.shop-retry-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #D4920A;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ─── Checkout Pending Page ───────────────────────────────────────────────── */

.checkout-pending {
    text-align: center;
    padding: 48px 16px;
}

.checkout-spinner {
    color: var(--vendor-primary, #3C60A8);
    width: 48px;
    height: 48px;
}

.checkout-status-message {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
    margin-top: 16px;
}

.checkout-notice {
    font-size: 0.875rem;
    color: #64748B;
    margin-top: 8px;
}

/* ─── Order Confirmed / Declined Banners ─────────────────────────────────── */

.order-status-banner {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.order-status-banner.confirmed {
    background: #EDFAF2;
    border: 1px solid #1A7A42;
    color: #1A7A42;
}

.order-status-banner.declined {
    background: #FDF0EF;
    border: 1px solid #C0392B;
    color: #C0392B;
}

.order-status-banner.expired {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #64748B;
}

.order-status-banner.awaiting-retry {
    background-color: #FEF5E7;
    border-left: 4px solid #B5700A;
    color: #7C4A00;
}

/* Badge for AwaitingPaymentRetry status — brand-100 bg + brand-700 text */
.badge-awaiting-retry {
    background-color: #D4E0F5;
    color: #253D75;
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.order-details {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 16px 20px;
}

/* Order summary groups reuse cart-event-group styling — read-only, no buttons */
.order-summary-group .cart-seat-row {
    cursor: default;
}

/* ─── Discount Code Section ───────────────────────────────────────────────── */

.cart-discount-toggle {
    font-size: 0.875rem;
    color: var(--tm-brand-500, #3C60A8);
    cursor: pointer;
    padding: 8px 0;
}

.cart-discount-toggle:hover {
    text-decoration: underline;
}

.cart-discount-input {
    padding: 8px 0;
}

.cart-discount-apply-btn {
    background-color: var(--tm-brand-500, #3C60A8);
    color: #fff;
    white-space: nowrap;
}

.cart-discount-apply-btn:hover:not(:disabled) {
    filter: brightness(0.9);
    color: #fff;
}

.cart-discount-apply-btn:disabled {
    opacity: 0.7;
}

.cart-discount-error {
    font-size: 0.75rem;
    color: var(--tm-error, #C0392B);
    margin-top: 4px;
}

.cart-discount-applied {
    padding: 8px 0;
}

.cart-discount-applied {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.cart-discount-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EDFAF2;
    color: #1A7A42;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
}

.cart-discount-chip .bi-check-circle-fill {
    font-size: 1rem;
}

.cart-discount-separator {
    color: #CBD5E1;
    font-size: 0.875rem;
}

.cart-discount-remove-link {
    background: none;
    border: none;
    color: #C0392B;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    text-decoration: underline;
}

.cart-discount-remove-link:hover {
    color: #922b21;
}

.cart-discount-feedback {
    font-size: 0.75rem;
    color: #1A7A42;
    margin-left: 8px;
}

/* Discount code input uppercase transform */
#discount-code-input {
    text-transform: uppercase;
}

/* Cart checkout bar discount line */
.cart-discount-line {
    font-size: 0.875rem;
    color: #D4920A;
    display: block;
}

.cart-original-total {
    font-size: 0.875rem;
    color: #94A3B8;
    text-decoration: line-through;
}

/* Per-line discount display */
.cart-seat-original-price {
    font-size: 0.75rem;
    color: #94A3B8;
    text-decoration: line-through;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

/* Order history list page */
.order-history-table tbody tr[data-href] { cursor: pointer; }
.order-history-table tbody tr[data-href]:hover { background-color: #F8FAFC; }

@media (max-width: 575.98px) {
    .cart-seat-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .cart-seat-ticket-type {
        width: 100%;
    }

    .cart-seat-price {
        text-align: left;
    }

    .cart-checkout-bar .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .cart-checkout-btn {
        width: 100%;
    }

    .cart-checkout-bar {
        padding: 12px 16px;
    }
}

/* ── Phase 43-04: CCV payment-method picker (UI-SPEC §CSS Conventions, verbatim) ── */

.ccv-method-picker {
    padding: 16px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}

.ccv-method-picker-title {
    font-size: 16px;
    color: #0F172A;
}

.ccv-method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .ccv-method-grid {
        gap: 16px;
    }
}

.ccv-method-logo-cluster {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ccv-method-button {
    position: relative;
    min-height: 56px;
    min-width: 88px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #F1F5F9;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.ccv-method-button:hover {
    background: #FFFFFF;
    border-color: #304E8F;
}

.ccv-method-button:focus-visible {
    outline: 2px solid #3C60A8;
    outline-offset: 2px;
}

.ccv-method-button[aria-checked="true"] {
    background: #F1F5FB;
    border: 3px solid #3C60A8;
    padding: 11px 15px;
}

.ccv-method-button[aria-checked="true"]::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background: url("/img/payment-methods/check-brand.svg") no-repeat center / contain;
}

.ccv-method-logo {
    height: 24px;
    width: auto;
}

.ccv-method-label {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.2;
}

.ccv-error-panel {
    padding: 16px;
    margin-top: 16px;
    background: #FDF0EF;
    border-left: 4px solid #C0392B;
    border-radius: 4px;
}

.ccv-error-heading {
    font-size: 16px;
    font-weight: 600;
    color: #C0392B;
    margin: 0 0 4px 0;
}

.ccv-error-message {
    font-size: 16px;
    color: #0F172A;
}

.ccv-error-reference {
    color: #94A3B8;
}

@media (prefers-reduced-motion: reduce) {
    .ccv-method-button {
        transition: none;
    }
}
