/* Mismos tokens y misma cookie (home_theme) que el toggle lima/noche del
   header — antes esta página tenía los colores fijos y no reaccionaba. */
:root {
  color-scheme: dark;
  --bg: #0B0B0D; --fg: #f2f2f0; --muted: #a9a9a2; --faint: #7a7a72;
  --line: #26262a; --accent: #B8F500; --accent-fg: #0B0B0D;
  --surface: #16161a; --surface-2: #1e1e22;
  --danger: #ff6b6b; --danger-bg: #3a1f1d; --danger-line: #5a2f2b;
  --field: #1e1e22; --field-line: #33333a;
}
:root[data-theme="lima"] {
  color-scheme: light;
  --bg: #fff; --fg: #16161a; --muted: #62625c; --faint: #8a8a80;
  --line: #e5e5e0; --accent: #7a8f00; --accent-fg: #fff;
  --surface: #fff; --surface-2: #f4f4f0;
  --danger: #b3261e; --danger-bg: #fdecea; --danger-line: #f0c9c4;
  --field: #fff; --field-line: #ccc;
}

html, body { background: var(--bg); }

.cart { max-width: 34rem; margin: 1.5rem auto 3rem; padding: 0 1.25rem; font-family: system-ui, sans-serif; color: var(--fg); }
.cart h1 { font-size: 1.35rem; margin: 0 0 1.25rem; }
.cart__empty { color: var(--muted); }

/* Una tarjeta por evento. */
.cart__ev { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1.1rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05); }
.cart__ev-head { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.cart__ev-flyer { width: 44px; height: 55px; border-radius: 6px; object-fit: cover; flex: none; }
.cart__ev-head h2 { font-size: 1rem; margin: 0 0 .1rem; line-height: 1.25; }
.cart__ev-head h2 a { color: inherit; text-decoration: none; }
.cart__ev-head h2 a:hover { text-decoration: underline; }
.cart__ev-when { margin: 0; color: var(--muted); font-size: .8rem; }

.cart__lines { list-style: none; margin: 0; padding: .35rem 0; }
.cart__line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 1.25rem; }
.cart__line + .cart__line { border-top: 1px solid var(--line); }
.cart__line-info { min-width: 0; }
.cart__line-name { display: block; font-weight: 600; font-size: .92rem; }
.cart__line-price { display: block; color: var(--muted); font-size: .8rem; }
.cart__line-controls { display: flex; align-items: center; gap: .5rem; flex: none; }

.cart__ev-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.25rem; background: var(--surface-2); border-top: 1px solid var(--line); }
.cart__ev-subtotal { font-size: .9rem; color: var(--muted); }
.cart__ev-subtotal b { color: var(--fg); font-size: 1rem; }
.cart__pay-btn { padding: .55rem 1.15rem; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: .9rem; text-decoration: none; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--field-line); border-radius: 6px; overflow: hidden; }
.qty button { width: 1.9rem; height: 1.9rem; border: 0; background: var(--field); color: var(--fg); font-size: 1rem; line-height: 1; cursor: pointer; }
.qty input { width: 2.2rem; text-align: center; border: 0; border-left: 1px solid var(--field-line); border-right: 1px solid var(--field-line); padding: .3rem 0; background: var(--surface); color: var(--fg); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart__rm { width: 1.9rem; height: 1.9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 0; }
.cart__rm:hover { border-color: var(--danger); color: var(--danger); }

.modal { border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; max-width: 20rem; background: var(--surface); color: var(--fg); box-shadow: 0 10px 40px rgba(0, 0, 0, .2); font: inherit; }
.modal::backdrop { background: rgba(0, 0, 0, .35); }
.modal p { margin: 0 0 1rem; }
.modal__actions { display: flex; gap: .5rem; justify-content: flex-end; margin: 0; padding: 0; list-style: none; }
.modal__actions button { padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--field-line); background: var(--field); color: var(--fg); cursor: pointer; font: inherit; }
.modal__danger { border-color: var(--danger); color: var(--danger); }

/* Loader de "vamos a pagar": tapa la pantalla mientras arranca el checkout. */
.pay-loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; background: color-mix(in srgb, var(--bg) 92%, transparent); }
.pay-loader[hidden] { display: none; }
.pay-loader__spinner { width: 2.25rem; height: 2.25rem; border: 3px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: pay-loader-spin .8s linear infinite; }
.pay-loader__text { color: var(--muted); font-size: .9rem; }
@keyframes pay-loader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pay-loader__spinner { animation-duration: 2s; } }
