/* PIXEL SHOWROOM · Playeras y Totebags — estación (forkeado de SHARING_TELCEL) */
:root {
  --brand: #E8562A;      /* TODO: acento de la marca del showroom */
  --brand-2: #ff7a4d;
  --bg: #0b0c0f;
  --bg-2: #14161c;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --txt: #f4f5f8;
  --muted: rgba(244, 245, 248, 0.6);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--txt);
  background: radial-gradient(1200px 700px at 80% -10%, #E8562A22 0%, transparent 55%),
              radial-gradient(900px 600px at -10% 110%, #ff7a4d1a 0%, transparent 60%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
  min-height: 100svh;
}

/* ---------- Pantalla de inicio (attractor) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
  background: radial-gradient(1200px 800px at 50% -10%, #E8562A26 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
}
.intro-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; max-width: 760px; }
.intro-badge { font-size: 26px; padding: 16px 24px; }
.intro-title { font-size: clamp(40px, 7vw, 72px); font-weight: 900; line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; }
.intro-title span { color: var(--brand); }
.intro-sub { color: var(--muted); font-size: clamp(17px, 2.4vw, 22px); max-width: 30ch; }
.intro-start {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px;
  background: var(--brand); color: #fff; font-family: inherit;
  font-weight: 800; font-size: 22px;
  border: 0; border-radius: 18px;
  padding: 24px 48px; min-height: 88px; cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  transition: transform .12s ease, background .12s ease;
}
.intro-start svg { width: 30px; height: 30px; }
.intro-start:hover { background: var(--brand-2); }
.intro-start:active { transform: scale(.98); }

/* ---------- Botón global "Atrás" ---------- */
.btn-back {
  position: fixed; top: 28px; left: 28px; z-index: 95;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.08); color: var(--txt);
  border: 1px solid var(--line); border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 16px;
  padding: 14px 22px 14px 18px; min-height: 56px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s, transform .12s;
}
.btn-back svg { width: 22px; height: 22px; }
.btn-back:hover { background: rgba(255, 255, 255, 0.16); }
.btn-back:active { transform: scale(.97); }

/* ---------- Paso 2: pantalla de elección de producto ---------- */
.screen-choose {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
  background: radial-gradient(1200px 800px at 50% -10%, #E8562A26 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
}
.choose-inner { display: flex; flex-direction: column; align-items: center; gap: 44px; width: 100%; max-width: 840px; }
.choose-title { font-size: clamp(30px, 5vw, 48px); font-weight: 900; text-align: center; text-wrap: balance; letter-spacing: -0.01em; }
.choose-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; }
.choose-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  color: var(--txt); font-family: inherit; font-weight: 800; font-size: 26px;
  padding: 56px 24px; min-height: 380px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.choose-card svg { width: 96px; height: 96px; stroke-width: 1.6; color: var(--muted); }
.choose-card:hover { border-color: var(--brand); background: rgba(232, 86, 42, 0.14); }
.choose-card:hover svg { color: var(--brand); }
.choose-card:active { transform: scale(.98); }

/* ---------- Paso 4: nombre + stickers ---------- */
.screen-form {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px; overflow-y: auto;
  background: radial-gradient(1200px 800px at 50% -10%, #E8562A26 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
}
.form-inner { display: flex; flex-direction: column; align-items: stretch; gap: 28px; width: 100%; max-width: 680px; }
.form-inner .choose-title { text-align: center; }
.name-input {
  width: 100%; font-family: inherit; font-weight: 700; font-size: 28px; text-align: center;
  color: var(--txt); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; min-height: 76px; outline: none;
  transition: border-color .15s, background .15s;
}
.name-input::placeholder { color: var(--muted); font-weight: 500; }
.name-input:focus { border-color: var(--brand); background: rgba(232, 86, 42, 0.08); }

.stickers-block { display: flex; flex-direction: column; gap: 14px; }
.stickers-title { font-size: 16px; font-weight: 700; color: var(--muted); text-align: center; letter-spacing: .3px; }
.stickers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sticker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  color: var(--txt); font-family: inherit; font-weight: 600; font-size: 12.5px;
  padding: 18px 8px; min-height: 104px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.sticker svg { width: 40px; height: 40px; color: var(--muted); }
.sticker span { opacity: .85; }
.sticker:active { transform: scale(.97); }
.sticker.on { border-color: var(--brand); background: rgba(232, 86, 42, 0.16); }
.sticker.on svg { color: var(--brand); }

.form-next { width: 100%; margin-top: 6px; }
.primary:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Paso 5: vista del mockup del producto ---------- */
.screen-mockup {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
  background: radial-gradient(1200px 800px at 50% -10%, #E8562A26 0%, transparent 55%),
              linear-gradient(160deg, var(--bg-2), var(--bg));
}
.mockup-inner { display: flex; flex-direction: column; align-items: center; gap: 32px; width: 100%; max-width: 640px; }
.mockup-frame {
  width: min(560px, 88%); background: #f3f3f5; border-radius: 24px; padding: 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.mockup-stage { position: relative; display: block; }
.mockup-stage img { display: block; width: 100%; height: auto; }

/* Nombre superpuesto sobre el producto */
.name-overlay {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%);
  color: #1a1a1a; font-family: inherit; font-weight: 800;
  white-space: nowrap; pointer-events: none; line-height: 1;
  max-width: 60%; overflow: hidden; text-overflow: ellipsis;
}
.name-overlay.sm { font-size: 20px; }
.name-overlay.lg { font-size: 34px; }

/* Controles de posición */
.pos-controls { display: flex; flex-direction: column; gap: 14px; width: min(560px, 88%); }
.side-toggle { display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px; }
.side-opt {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  font-family: inherit; font-weight: 700; font-size: 16px;
  padding: 14px; min-height: 52px; border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.side-opt.active { background: var(--brand); color: #fff; }
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pos-opt {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--txt); font-family: inherit; font-weight: 600; font-size: 13px;
  padding: 14px 8px; min-height: 60px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.pos-opt.active { border-color: var(--brand); background: rgba(232, 86, 42, 0.16); }
.pos-opt:active { transform: scale(.97); }

/* ---------- Layout vertical (totem / monitor en retrato) ----------
   Todo se apila en una sola columna centrada, pensado para 9:16 (1080x1920). */
header {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 44px 24px 22px; text-align: center;
}
.badge {
  background: var(--brand); color: #fff;
  font-weight: 900; font-size: 20px; letter-spacing: 1px;
  border-radius: 14px; padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.head-txt h1 { font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.head-txt p { color: var(--muted); font-size: 15px; margin-top: 4px; }

main {
  display: flex; flex-direction: column;
  gap: 28px;
  width: 100%; max-width: 900px;
  margin: 0 auto;
  padding: 8px 28px 56px;
}
.compose { display: flex; flex-direction: column; gap: 0; }

/* ---------- Selector de producto ---------- */
.product-picker { display: flex; gap: 14px; margin-bottom: 18px; }
.product-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  color: var(--txt); font-weight: 700; font-size: 18px; padding: 20px; min-height: 88px; cursor: pointer;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.product-opt svg { width: 32px; height: 32px; color: var(--muted); }
.product-opt:hover { background: rgba(255, 255, 255, 0.08); }
.product-opt.active { border-color: var(--brand); background: rgba(232, 86, 42, 0.14); }
.product-opt.active svg { color: var(--brand); }

/* ---------- Panel de composición ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  min-height: clamp(420px, 46vh, 640px);
  backdrop-filter: blur(6px);
}
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; gap: 18px; }

.dropzone {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.dropzone:hover { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.07); }
.dropzone.drag { border-color: var(--brand-2); background: rgba(232, 86, 42, 0.18); transform: scale(1.01); }
.dz-inner { text-align: center; padding: 56px 28px; }
.dz-icon { margin-bottom: 14px; color: rgba(244, 245, 248, 0.75); }
.dz-icon svg { width: 72px; height: 72px; }
.dz-inner h2 { font-size: 30px; font-weight: 800; }
.dz-inner p { color: var(--muted); margin-top: 8px; font-size: 17px; }
.dz-hint { display: block; margin-top: 22px; font-size: 14px; color: var(--muted); opacity: .8; max-width: 34ch; margin-left: auto; margin-right: auto; }

.preview-wrap { width: min(380px, 82%); border-radius: 16px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.preview-wrap canvas { display: block; width: 100%; height: auto; background: #f3f3f5; }
.progress {
  width: 84%; height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
#bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .18s ease; }
.bar-label { font-size: 14px; color: var(--muted); }
.notice { font-size: 12.5px; color: #ffd97a; text-align: center; max-width: 90%; }

.result { padding: 28px; }
/* Vertical: imagen del producto arriba, QR grande debajo. */
.result-cols { display: flex; flex-direction: column; gap: 26px; align-items: center; }
.result-gif-wrap { border-radius: 16px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.45); background: #f3f3f5; width: min(420px, 90%); }
.result-gif-wrap img { display: block; width: 100%; height: auto; }
.result-qr { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.qr-wrap { background: #fff; padding: 16px; border-radius: 18px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.qr-wrap img { display: block; width: 260px; height: 260px; }
.scan { font-weight: 800; font-size: 18px; }
.link { font-size: 12.5px; color: var(--muted); word-break: break-all; max-width: 300px; }
.result-actions { display: flex; gap: 10px; }

/* ---------- Botones ---------- */
button, a.ghost, a.primary { font-family: inherit; }
.primary {
  background: var(--brand); color: #fff;
  border: 0; border-radius: 14px;
  font-weight: 800; font-size: 17px;
  padding: 17px 30px; min-height: 56px; cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  text-decoration: none;
}
.primary:active { transform: scale(.98); }
.ghost {
  background: rgba(255, 255, 255, 0.08); color: var(--txt);
  border: 1px solid var(--line); border-radius: 12px;
  font-weight: 600; font-size: 13.5px;
  padding: 10px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.ghost:hover { background: rgba(255, 255, 255, 0.14); }

.error .err-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: #ff5470; color: #fff; font-weight: 900; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.error p { color: var(--txt); text-align: center; max-width: 85%; font-size: 15px; }

/* ---------- Galería ---------- */
.gallery-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gallery-head h2 { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.count {
  background: rgba(255, 255, 255, 0.12); border-radius: 999px;
  font-size: 12.5px; padding: 3px 10px; margin-left: 6px; vertical-align: 2px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  content-visibility: auto; contain-intrinsic-size: 320px;
}
.thumb { aspect-ratio: 1 / 1; background: #f3f3f5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 2px; }
.meta .date { font-size: 12px; color: var(--muted); }
.meta .cid { font-size: 10.5px; color: var(--muted); opacity: .55; font-family: Consolas, monospace; }
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  color: var(--brand); background: rgba(232, 86, 42, 0.14);
  border-radius: 6px; padding: 2px 8px; margin: 0 12px 4px;
}
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 12px 12px; }
.act {
  background: rgba(255, 255, 255, 0.08); color: var(--txt);
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; font-weight: 600; padding: 8px 4px;
  cursor: pointer; text-align: center; text-decoration: none;
}
.act:hover { background: rgba(255, 255, 255, 0.16); }
.act.del:hover { background: #ff547033; border-color: #ff5470; }

/* ---------- Overlay de drop página completa ---------- */
#drop-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(232, 86, 42, 0.82);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#drop-overlay[hidden] { display: none; }
.drop-overlay-box {
  text-align: center; color: #fff;
  border: 3px dashed rgba(255, 255, 255, 0.65);
  border-radius: 24px; padding: 60px 80px;
}
.drop-overlay-box svg { width: 72px; height: 72px; margin-bottom: 14px; }
.drop-overlay-box h2 { font-size: 30px; font-weight: 900; letter-spacing: .5px; }
.drop-overlay-box p { margin-top: 8px; font-size: 15px; opacity: .85; }

/* ---------- Modal QR ---------- */
#modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 4, 8, 0.78);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#modal[hidden] { display: none; }
.modal-box {
  background: #fff; color: #14213d;
  border-radius: 20px; padding: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 92vw;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal-box img { width: min(340px, 70vw); height: auto; }
.modal-box p { font-size: 12.5px; color: #46557a; word-break: break-all; text-align: center; max-width: 340px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .ghost { color: #14213d; border-color: #d6ddef; background: #f1f4fb; }
.modal-actions .ghost:hover { background: #e5ebf8; }
