@font-face {
  font-family: 'Bricolage Grotesque';
  font-weight: 200 800;
  font-style: normal;
  src: url('/fonts/BricolageGrotesque.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  font-weight: 200 800;
  font-style: normal;
  src: url('/fonts/Manrope.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg-page: #F1EAE0;
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-2: #F3EEE6;
  --stroke: #EAE2D5;
  --stroke-strong: #DED2C0;
  --ink: #2A2620;
  --ink-dim: #8A8074;
  --ink-faint: #B3A99A;
  --coral: #FF6B4E;
  --coral-ink: #2A2620;
  --coral-tint: #FFE6DC;
  --mint: #359685;
  --mint-ink: #FFFFFF;
  --mint-tint: #DCF1EB;
  --ochre: #B8874A;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--stroke), 0 30px 70px rgba(42,38,32,0.14);
}

/* header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px 4px;
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(10px);
}
.icon-btn, .cart-btn {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn svg, .cart-btn svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; }
.icon-btn.whatsapp svg { stroke: none; fill: var(--mint); }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--coral);
  color: var(--coral-ink);
  font-family: var(--font-body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.cart-badge.show { transform: scale(1); }

.tagline {
  padding: 10px 18px 16px;
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.4;
}

.welcome-banner {
  margin: 12px 18px 0;
  padding: 12px 14px;
  background: var(--mint-tint);
  border: 1px solid var(--mint);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.welcome-banner .emoji { font-size: 17px; line-height: 1; flex: none; }
.welcome-banner b { font-weight: 800; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.92);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.15s;
}
.lightbox.show { opacity: 1; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-rail {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-rail::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip.active {
  background: var(--mint);
  border-color: var(--mint);
  color: var(--mint-ink);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 20px 18px 10px;
}

.combo-rail {
  display: flex;
  gap: 10px;
  padding: 0 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.combo-rail::-webkit-scrollbar { display: none; }
.combo-card {
  flex: none;
  width: 168px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 10px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 6px 18px 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.thumb {
  position: relative;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--stroke);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.tag-row {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 4px;
}
.tag.vendido { background: var(--coral); color: var(--coral-ink); }
.tag.gamer { background: var(--mint); color: var(--mint-ink); }
.tag.combo { background: var(--surface); color: var(--ink); border: 1px solid var(--stroke-strong); }

.card-body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-sub { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.card-name { font-size: 13px; font-weight: 700; line-height: 1.25; min-height: 2.4em; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-price { font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.add-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--mint-tint);
  border: 1.5px solid var(--mint);
  color: var(--mint);
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.add-btn:active { background: var(--mint); color: var(--mint-ink); }

.choose-btn {
  border-radius: var(--radius-sm);
  background: var(--mint-tint);
  border: 1.5px solid var(--mint);
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 9px;
  display: flex; align-items: center; gap: 4px;
}
.choose-btn .n {
  background: var(--mint);
  color: var(--mint-ink);
  border-radius: 999px;
  min-width: 15px;
  height: 15px;
  font-size: 9.5px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--mint);
}
.stepper button {
  background: var(--mint-tint);
  color: var(--mint);
  border: none;
  width: 26px; height: 30px;
  font-size: 15px;
  font-weight: 700;
}
.stepper .qty {
  width: 22px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  height: 30px;
  display: flex; align-items: center; justify-content: center;
}

.mini-cart {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin: 0 18px 18px;
  background: var(--coral);
  color: var(--coral-ink);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(255,107,78,0.35);
  transform: translateY(120%);
  transition: transform 0.25s cubic-bezier(.34,1.2,.64,1);
}
.mini-cart.show { transform: translateY(0); }
.mini-cart .l1 { font-size: 12px; }
.mini-cart .l2 { font-family: var(--font-display); font-size: 15px; font-variant-numeric: tabular-nums; }
.mini-cart .r { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.backdrop {
  position: fixed; inset: 0;
  background: rgba(42,38,32,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 30;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 430px;
  transform: translate(-50%, 100%);
  background: var(--bg);
  border-top: 1px solid var(--stroke-strong);
  border-radius: 20px 20px 0 0;
  z-index: 31;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(.32,.9,.4,1);
}
.drawer.show { transform: translate(-50%, 0); }
.drawer-handle { width: 36px; height: 4px; background: var(--stroke-strong); border-radius: 2px; margin: 10px auto 4px; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 18px 12px;
  border-bottom: 1px solid var(--stroke);
}
.drawer-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.drawer-close { background: none; border: none; color: var(--ink-dim); font-size: 20px; padding: 4px; }
.drawer-body { padding: 14px 18px 18px; overflow-y: auto; }
.drawer-back {
  background: none; border: none; color: var(--mint); font-weight: 800; font-size: 12.5px;
  padding: 4px 0; margin-bottom: 4px; display: flex; align-items: center; gap: 4px;
}

.cart-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--stroke); }
.cart-item .thumb { width: 54px; height: 54px; flex: none; border-radius: var(--radius-sm); aspect-ratio: auto; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-item-name { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.cart-item-meta { font-size: 10.5px; color: var(--ink-faint); }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.cart-item-price { font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; }

.empty-cart, .empty-state { text-align: center; padding: 40px 10px; color: var(--ink-faint); font-size: 13px; }

.totals-row { display: flex; justify-content: space-between; padding: 14px 0 4px; font-size: 13px; color: var(--ink-dim); }
.totals-row.total { color: var(--ink); font-weight: 800; font-size: 15px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.totals-row .v { font-variant-numeric: tabular-nums; }

.btn-primary {
  width: 100%;
  background: var(--coral);
  color: var(--coral-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  margin-top: 14px;
}
.btn-primary:disabled { opacity: 0.4; }
.btn-secondary {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 800;
  font-size: 13.5px;
  margin-top: 8px;
}
.btn-whatsapp {
  width: 100%;
  background: var(--mint);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn-whatsapp svg { width: 16px; height: 16px; fill: #fff; }

.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 13.5px;
  font-weight: 600;
}
.field textarea { resize: none; height: 60px; font-family: var(--font-body); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); font-weight: 500; }
.field-hint { font-size: 11px; color: var(--ink-faint); margin-top: 5px; line-height: 1.4; }
.field-error { font-size: 11.5px; color: var(--coral); margin-top: 8px; font-weight: 700; }

.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt {
  background: var(--surface-2);
  border: 1.5px solid var(--stroke-strong);
  border-radius: var(--radius-sm);
  padding: 11px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-dim);
}
.pay-opt.active { border-color: var(--mint); color: var(--mint); background: var(--mint-tint); }

.picker-thumb {
  width: 100%;
  aspect-ratio: 1 / 0.6;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}
.picker-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-bottom: 2px; }
.picker-price { font-size: 14px; color: var(--ink-dim); font-weight: 700; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.picker-desc { font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; margin: -8px 0 16px; }

.gallery-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 8px 0 14px; }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex: none; width: 52px; height: 52px; padding: 0;
  border-radius: var(--radius-sm); border: 1.5px solid var(--stroke-strong);
  overflow: hidden; background: var(--surface-2);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-thumb.active { border-color: var(--mint); }

.color-list { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--stroke-strong);
  background: var(--surface-2);
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 700;
}
.color-chip.on { border-color: var(--mint); background: var(--mint-tint); color: var(--mint); }
.color-chip.off { opacity: 0.45; text-decoration: line-through; cursor: not-allowed; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 4px; }
.qty-row .stepper button { width: 34px; height: 38px; font-size: 17px; }
.qty-row .stepper .qty { width: 34px; height: 38px; font-size: 15px; }

.ticket-id {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--mint);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.ticket-head { text-align: center; padding: 6px 0 16px; }
.ticket-check {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--mint-tint); border: 1.5px solid var(--mint);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.ticket-check svg { width: 20px; height: 20px; stroke: var(--mint); fill: none; stroke-width: 2.5; }
.ticket-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.ticket-sub { font-size: 12px; color: var(--ink-dim); }
.ticket-block {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ticket-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; }
.ticket-row .k { color: var(--ink-faint); }
.ticket-row .v { font-weight: 700; text-align: right; }
.ticket-item-action { text-align: right; margin: -2px 0 8px; }

.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--stroke); text-align: left;
  background: none; border-left: none; border-right: none; border-top: none;
  width: 100%;
}
.admin-row-name { font-size: 13px; font-weight: 700; }
.admin-row-sub { font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }
.admin-pill {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 8px; border-radius: 999px;
}
.admin-pill.ninguna { background: var(--surface-2); color: var(--ink-faint); }
.admin-pill.marca { background: var(--coral-tint); color: var(--coral); }
.admin-pill.modelo { background: var(--mint-tint); color: var(--mint); }

.radio-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.radio-opt {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--stroke-strong); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 13px; font-weight: 700; color: var(--ink-dim);
}
.radio-opt.active { border-color: var(--mint); color: var(--ink); background: var(--mint-tint); }
.radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-faint); flex: none; }
.radio-opt.active .radio-dot { border-color: var(--mint); background: var(--mint); }

.check-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 700; margin: 14px 0 8px; }
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-opt {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--stroke-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 12.5px; font-weight: 600;
}
.check-opt.on { border-color: var(--mint); background: var(--mint-tint); }
.check-box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--ink-faint); flex: none; display: flex; align-items: center; justify-content: center; }
.check-opt.on .check-box { border-color: var(--mint); background: var(--mint); }
.check-opt.on .check-box svg { width: 9px; height: 9px; stroke: #fff; fill: none; stroke-width: 3; }
.modelo-group-name { font-size: 11.5px; font-weight: 800; color: var(--ink); margin: 10px 0 6px; }

.img-upload {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.6;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--stroke-strong);
  overflow: hidden;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-upload img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-upload-empty { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.img-upload-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 11px;
  border-radius: 999px;
}
.img-upload.uploading { opacity: 0.55; pointer-events: none; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--stroke-strong); border-top-color: var(--mint);
  animation: spin 0.7s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
