/* Inkora · personalizador */

:root {
  color-scheme: light;

  /* Mundo «Orden de trabajo»: tinta negra, tickets blancos sobre gris de taller
     y las cuatro tintas CMYK del logo, cada una con un trabajo:
     magenta = paso activo y acción principal · cian = en curso
     amarillo = resaltador de precios · negro = texto y filetes */
  --paper: #eef0f3;
  --paper-2: #e2e5ea;
  --surface: #ffffff;
  --ink: #1d1d1b;
  --ink-2: #3d3f45;
  --muted: #5a5e67;
  --line: #d3d7de;
  --line-strong: #9ba1aa;
  --rule: #1d1d1b;

  --accent: #d4007a;
  --accent-hover: #b30067;
  --accent-soft: #fde6f2;
  --accent-ink: #ffffff;
  --cyan: #009fe3;
  --cyan-ink: #006a96;
  --magenta: #e6007e;
  --yellow: #ffed00;
  --cyan-soft: #e3f4fc;
  --yellow-soft: #fff9c2;
  --cmyk-strip: linear-gradient(90deg, var(--cyan) 0 25%, var(--magenta) 25% 50%, var(--yellow) 50% 75%, var(--ink) 75% 100%);

  --ok: #1d7a4b;
  --ok-soft: #e3f3ea;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --whatsapp: #0f7a3b;

  --font-ui: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --radius: 4px;
  --radius-md: 3px;
  --radius-sm: 3px;
  --shadow-sm: none;
  --shadow: 0 2px 4px rgba(29, 29, 27, 0.08), 0 16px 32px -16px rgba(29, 29, 27, 0.35);
  --gutter: 16px;
  --topbar-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
h1:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip:focus { top: 12px; }

.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted { color: var(--muted); }

/* ── Barra superior ─────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--topbar-h);
  padding: 0 max(var(--gutter), env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 800 22px/1 var(--font-display);
  letter-spacing: -0.03em;
}

.brand-mark {
  position: relative;
  width: 26px; height: 24px;
}
.brand-mark i {
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
.brand-mark i:nth-child(1) { left: 0; top: 0; background: var(--cyan); }
.brand-mark i:nth-child(2) { right: 0; top: 0; background: var(--magenta); }
.brand-mark i:nth-child(3) { left: 5.5px; bottom: 0; background: var(--yellow); }

.steps {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.steps button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.steps button:not(:disabled):hover { background: var(--paper-2); color: var(--ink); }
.steps button:disabled { cursor: default; }

.step-n {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.steps .is-current button { color: var(--ink); }
.steps .is-current .step-n { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps .is-done .step-n { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.step-short { display: none; }

@media (max-width: 760px) {
  .steps { gap: 0; }
  .steps .step-label { display: none; }
  .steps .is-current .step-short { display: inline; }
  .steps button { padding-right: 6px; }
  .steps .is-current button { padding-right: 12px; }
}

/* ── Vistas ─────────────────────────────────────────────────────────────── */

main { padding: 0 var(--gutter); }

.view { max-width: 1320px; margin: 0 auto; }

.view:not([hidden]) { animation: view-in 0.35s var(--ease); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede { color: var(--ink-2); font-size: 18px; max-width: 34em; }

/* ── Paso 1 · Productos ─────────────────────────────────────────────────── */

.view-products { padding: clamp(32px, 7vw, 80px) 0 64px; }

.intro { display: grid; gap: 14px; margin-bottom: clamp(28px, 5vw, 48px); }
.intro h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 800; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.product-thumb {
  display: block;
  aspect-ratio: 1;
  background:
    radial-gradient(120% 90% at 50% 15%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    var(--paper-2);
}
.product-thumb canvas,
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.product-body { display: grid; gap: 6px; padding: 18px 18px 20px; }
.product-name { font: 700 20px/1.15 var(--font-display); letter-spacing: -0.01em; }
.product-desc { color: var(--ink-2); font-size: 15px; }
.product-area {
  justify-self: start;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-skeleton {
  aspect-ratio: 0.78;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--paper-2) 30%, #f1f2f5 50%, var(--paper-2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }

.load-error {
  grid-column: 1 / -1;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
}

/* ── Paso 2 · Editor ────────────────────────────────────────────────────── */

.view-editor { padding: 24px 0 120px; }

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.editor-main { display: grid; gap: 14px; min-width: 0; }

.editor-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.editor-sub { margin-top: 4px; color: var(--muted); }
.editor-sub strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.tool:hover { background: var(--paper); }
.tool:disabled { opacity: 0.35; background: none; }
.tool[aria-expanded='true'] { background: var(--paper-2); }
.tool-primary { position: relative; background: var(--ink); color: #fff; }
.tool-primary:hover { background: #2b2536; }
.tool-primary:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.tool-icon { padding: 0; width: 44px; justify-content: center; }
.tool-sep { flex: 1; }

.tool-pop { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 236px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  animation: pop 0.18s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.popover-title { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }

.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shape-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--accent);
  transition: background 0.15s, transform 0.15s;
}
.shape-btn:hover { background: var(--accent-soft); transform: scale(1.04); }
.shape-btn svg { width: 26px; height: 26px; fill: currentColor; }

/* Mesa de trabajo */

.stage-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(280px, 62vh, 660px);
  padding: 28px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle, rgba(29, 29, 27, 0.09) 1px, transparent 1.4px) 0 0 / 18px 18px,
    var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.stage-wrap.is-dropping { outline: 2.5px dashed var(--accent); outline-offset: -8px; }

.stage {
  position: relative;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(29, 29, 27, 0.12), 0 18px 40px -18px rgba(29, 29, 27, 0.35);
}
.stage .canvas-container { position: absolute !important; inset: 0; }

.guides { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.guide-safe {
  position: absolute;
  inset: var(--safe-y, 6px) var(--safe-x, 6px);
  border: 1px dashed rgba(212, 0, 122, 0.55);
}
.guide-v, .guide-h { position: absolute; background: var(--cyan); opacity: 0; transition: opacity 0.1s; }
.guide-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.guide-h { top: 50%; left: 0; right: 0; height: 1px; }
.stage.snap-v .guide-v, .stage.snap-h .guide-h { opacity: 1; }

.stage-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
  text-align: center;
}
.stage-empty p {
  max-width: 300px;
  color: var(--muted);
  font-size: 14px;
}
.stage-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font: 700 18px/1.2 var(--font-display);
}

.drop-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  background: rgba(212, 0, 122, 0.08);
  color: var(--accent);
  font-weight: 700;
}
.is-dropping .drop-hint { display: grid; }

.stage-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.stage-note .dash { width: 22px; flex: none; border-top: 1.5px dashed var(--cyan-ink); }

/* Paneles laterales */

.editor-side {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: grid;
  gap: 16px;
  max-height: calc(100dvh - var(--topbar-h) - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin-right: -6px;
  padding-right: 6px;
}

.panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-title { font: 700 17px/1.2 var(--font-display); letter-spacing: -0.01em; }
.panel-hint { color: var(--muted); font-size: 13px; }

.preview-stage {
  border-radius: var(--radius-md);
  background:
    radial-gradient(110% 80% at 50% 20%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    var(--paper-2);
}
#mockup-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  cursor: grab;
  touch-action: pan-y;
}
#mockup-canvas.is-dragging { cursor: grabbing; }

.preview-controls { display: grid; gap: 10px; margin-top: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }

input[type='range'] {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Ajustes */

.props-group { display: grid; gap: 16px; }
/* Línea entre grupos visibles, aunque haya grupos ocultos en el medio */
.props-group:not([hidden]) ~ .props-group:not([hidden]) { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

.field { display: grid; gap: 7px; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.field-row > .field { flex: 1 1 140px; }

.label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.label output { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.optional { color: var(--muted); font-weight: 500; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }

input:not([type='range']):not([type='checkbox']):not([type='radio']):not([type='color']),
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
select {
  appearance: none;
  padding-right: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2347414f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 10px center / 18px no-repeat;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 0, 122, 0.16);
}
[aria-invalid] { border-color: var(--bad) !important; }
.field-error { color: var(--bad); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  position: relative;
  width: 30px; height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 27, 0.16);
  transition: transform 0.12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed='true'] { box-shadow: inset 0 0 0 1px rgba(29, 29, 27, 0.16), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch-none {
  background:
    linear-gradient(135deg, transparent 46%, var(--bad) 46%, var(--bad) 54%, transparent 54%),
    var(--surface);
}
.swatch-custom {
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: conic-gradient(#e0352b, #ffed00, #21995a, #009fe3, #2f45c9, #e6007e, #e0352b);
}
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch-custom:focus-within { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.seg button {
  display: grid;
  place-items: center;
  width: 40px; height: 36px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink-2);
}
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.stroke-opts { display: grid; gap: 8px; margin-top: 4px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.btn-tool:hover { background: var(--paper); border-color: var(--line-strong); }
.btn-tool .icon { width: 18px; height: 18px; }

.icon-row { display: flex; gap: 6px; }
.btn-icon {
  display: grid;
  place-items: center;
  flex: 1;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover { background: var(--paper); border-color: var(--line-strong); }
.btn-icon.danger:hover { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

.quality {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.quality strong { display: block; font-variant-numeric: tabular-nums; }
.quality span:not(.quality-dot) { color: var(--ink-2); }
.quality-dot { width: 10px; height: 10px; margin-top: 5px; flex: none; border-radius: 50%; background: currentColor; }
.quality[data-level='great'], .quality[data-level='ok'] { background: var(--ok-soft); color: var(--ok); }
.quality[data-level='low'] { background: var(--warn-soft); color: var(--warn); }
.quality[data-level='bad'] { background: var(--bad-soft); color: var(--bad); }

/* Barra de acciones */

.actionbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25;
  padding: 12px var(--gutter);
}
.actionbar-inner { display: flex; justify-content: space-between; gap: 12px; max-width: 1320px; margin: 0 auto; }

/* ── Botones ────────────────────────────────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.is-waiting { opacity: 0.55; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-link { min-height: 44px; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #0b6630; }
.btn-block { width: 100%; }

.btn .progress { position: absolute; inset: auto 0 0 0; height: 4px; opacity: 0; }
.btn .progress i {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.75);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform 0.2s linear;
}
.btn.is-busy { pointer-events: none; background: var(--accent-hover); }
.btn.is-busy .progress { opacity: 1; }

/* ── Paso 3 · Confirmación ──────────────────────────────────────────────── */

.view-confirm { padding: clamp(24px, 4vw, 48px) 0 64px; }

.confirm {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}

.summary {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  display: grid;
  gap: 16px;
  justify-items: start;
}
.summary-shot {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.summary-shot img { display: block; width: 100%; height: auto; }

.specs { display: grid; gap: 10px; width: 100%; margin: 0; }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; text-align: right; }

.warnings { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.warnings li {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}
.warnings span { color: var(--ink-2); }
.warnings strong { color: var(--ink); overflow-wrap: anywhere; }

.order-form {
  display: grid;
  gap: 24px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top-width: 4px;
}
.order-form h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }

fieldset { display: grid; gap: 16px; margin: 0; padding: 0; border: 0; min-width: 0; }
legend {
  margin-bottom: 14px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stepper button {
  width: 48px;
  border: 0;
  background: var(--paper);
  font-size: 22px;
  font-weight: 500;
}
.stepper button:hover { background: var(--paper-2); }
.stepper input {
  border: 0 !important;
  border-radius: 0 !important;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 0, 122, 0.16); }
.stepper input:focus { box-shadow: none !important; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.choice input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.form-error {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 600;
}
.fine { color: var(--muted); font-size: 14px; text-align: center; }

/* ── Pedido enviado ─────────────────────────────────────────────────────── */

.view-done { padding: clamp(48px, 10vw, 120px) 0 64px; }
.done { display: grid; justify-items: center; gap: 12px; max-width: 520px; margin: 0 auto; text-align: center; }
.done h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 800; }
.done-mark {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.done-mark .icon { width: 32px; height: 32px; stroke-width: 2.4; }
.order-id {
  padding: 10px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: 800 clamp(26px, 6vw, 36px)/1 var(--font-display);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
.done-actions { display: grid; gap: 10px; width: 100%; max-width: 360px; margin-top: 16px; }

/* ── Avisos ─────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 50;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: toast-in 0.25s var(--ease);
}
.toast[data-tone='warn'] { background: #5c3700; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.noscript { padding: 24px; text-align: center; }

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

@media (max-width: 1080px) {
  .editor { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 880px) {
  :root { --topbar-h: 58px; }
  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; grid-template-columns: 1fr; max-height: none; overflow: visible; margin-right: 0; padding-right: 0; }
  .preview { order: 2; }
  .props { order: 1; }
  .preview-stage { max-width: 420px; margin: 0 auto; width: 100%; }
  .confirm { grid-template-columns: 1fr; }
  .summary { position: static; }
  .summary-shot { max-width: 420px; }
}

@media (max-width: 560px) {
  .view-editor { padding-top: 16px; }
  .toolbar { gap: 2px; padding: 4px; }
  .tool { padding: 0 10px; font-size: 14px; }
  .tool[data-tool='shapes'] span { display: none; }
  .tool-icon { width: 40px; }
  .popover { left: auto; right: -90px; }
  .stage-wrap { height: clamp(240px, 52vh, 460px); padding: 14px; }
  .actionbar .btn { flex: 1; padding: 0 14px; }
  .lede { font-size: 16px; }
}

@media (max-width: 380px) {
  .tool[data-tool='text'] span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Marca, precios y pedido ────────────────────────────────────────────── */

.brand-logo { display: block; width: auto; height: 46px; }
@media (max-width: 760px) { .brand-logo { height: 38px; } }

.intro-note {
  justify-self: start;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--cyan-soft);
  color: var(--ink-2);
  font-size: 15px;
}
.intro-note strong { color: var(--ink); }

.product-price {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.product-price strong { font: 800 24px/1 var(--font-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.product-price span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.icon-sm { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
form .hint { display: flex; align-items: flex-start; }

.option-list { display: grid; gap: 8px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; top: 18px; left: 16px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.option-body {
  display: grid;
  gap: 2px;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.option:hover .option-body { border-color: var(--ink-2); }
.option input:checked + .option-body { border-color: var(--ink); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.option input:focus-visible + .option-body { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.option-title { font-weight: 700; }
.option-title em { margin-left: 4px; color: var(--accent); font-style: normal; font-weight: 700; }
.option-note { color: var(--ink-2); font-size: 14px; }
.option-meta { color: var(--ink); font-size: 14px; font-weight: 600; }
.option-meta:empty { display: none; }

.price-box {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--paper);
  border: 1px solid var(--line);
}
.price-lines { display: grid; gap: 8px; margin: 0; }
.price-lines div { display: flex; justify-content: space-between; gap: 12px; }
.price-lines dt { color: var(--ink-2); }
.price-lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
}
.price-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
  font-weight: 700;
}
.price-total strong { font: 800 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.price-deposit {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  border: 1px solid #efe08a;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.price-ready { color: var(--ink-2); font-size: 14px; font-weight: 600; }

.chip-magic[aria-pressed='true'] { background: var(--ink); color: #fff; }

/* Último paso: WhatsApp */

.done h1 { font-size: clamp(32px, 5.5vw, 52px); }
.done-step {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.done .lede strong { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.done-deposit {
  max-width: 460px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--yellow-soft);
  border: 1px solid #efe08a;
  font-size: 15px;
}
.btn-xl { min-height: 60px; margin-top: 8px; padding: 0 30px; font-size: 18px; box-shadow: 0 10px 24px -12px rgba(15, 122, 59, 0.7); }
.btn-xl .icon { width: 24px; height: 24px; }
.done-sent { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; }
.done-actions { margin-top: 8px; }

/* Visor 3D */
.preview-stage { position: relative; overflow: hidden; }
.viewer3d { width: 100%; aspect-ratio: 1; cursor: grab; touch-action: none; }
.viewer3d:active { cursor: grabbing; }
.viewer3d canvas { display: block; width: 100% !important; height: 100% !important; }
.preview-stage.is-3d #mockup-canvas { display: none; }


/* ── Cuenta y carrito en la barra superior ──────────────────────────────── */

.topbar { gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.top-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.top-action:hover { background: var(--paper-2); }
#cart-button { justify-content: center; padding: 0 10px; }
.cart-badge {
  position: absolute;
  top: 3px; right: 1px;
  display: grid;
  place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .top-action-label { display: none; }
  .top-action { padding: 0 10px; }
}
@media (max-width: 420px) {
  .topbar-actions { gap: 0; }
  .brand-logo { height: 32px; }
}

/* ── Paso 3 · Carrito ───────────────────────────────────────────────────── */

.cart { display: grid; gap: 16px; align-content: start; justify-items: start; }
.cart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; }
.cart-head h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
.cart-units { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.cart-list { display: grid; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.cart-thumb {
  display: block;
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
}
.cart-info { display: grid; gap: 4px; min-width: 0; }
.cart-name { font-weight: 700; }
.cart-meta { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.cart-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cart-controls select { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: 15px; }
.cart-controls select[aria-invalid] { border-color: var(--bad); }
.stepper-sm { width: 132px; }
.stepper-sm button { width: 40px; font-size: 18px; }
.stepper-sm input { min-height: 40px !important; padding: 6px 4px !important; }
.cart-side { display: grid; justify-items: end; gap: 8px; }
.cart-line { font: 800 18px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.cart-side .btn-icon { width: 40px; height: 40px; }

.cart-empty {
  width: 100%;
  padding: 32px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  text-align: center;
}
.cart-empty strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 18px; }

.form-title { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; }
.account-note {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
}
.account-note .icon-sm { margin-top: 2px; }
.account-note a { color: var(--accent); font-weight: 700; }
.option-title .icon-sm { margin-right: 8px; vertical-align: -3px; }

@media (max-width: 560px) {
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-thumb { width: 72px; height: 72px; }
  .cart-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
}

/* ── Diálogo «Agregar al carrito» ───────────────────────────────────────── */

.sheet {
  width: min(100vw - 32px, 640px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(29, 29, 27, 0.4); }
.sheet[open] { animation: view-in 0.25s var(--ease); }
.sheet-inner { display: grid; gap: 18px; padding: 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 26px; font-weight: 800; }
.sheet-head .btn-icon { width: 44px; height: 44px; flex: none; }
.sheet-head h2 { flex: 1; }
.add-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.add-shot { overflow: hidden; aspect-ratio: 1; border-radius: var(--radius-md); background: var(--paper-2); }
.add-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.add-fields { display: grid; gap: 14px; }
.add-product { display: grid; gap: 2px; }
.add-product strong { font: 800 20px/1.15 var(--font-display); }
.add-product span { color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

@media (max-width: 560px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; }
  .add-body { grid-template-columns: 1fr; }
  .add-shot { max-width: 220px; justify-self: center; width: 100%; }
  .sheet-actions .btn { flex: 1; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Mundo «Orden de trabajo»
   Cada producto y cada pedido es un ticket del taller: código en mono,
   talón troquelado, precio con resaltador y estados como sellos de goma.
   ══════════════════════════════════════════════════════════════════════════ */

::selection { background: var(--yellow); color: var(--ink); }
html { scrollbar-color: var(--line-strong) var(--paper); }
h1, h2, h3 { font-weight: 900; letter-spacing: -0.02em; }
mark { padding: 0 0.12em; background: var(--yellow); color: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:focus-visible { outline-offset: 3px; }

/* Rótulos condensados: la voz de la etiqueta de taller */
legend,
.label,
.panel-hint,
.popover-title {
  font-stretch: 85%;
}
legend { color: var(--ink); letter-spacing: 0.1em; }

/* ── Barra de tinta ─────────────────────────────────────────────────────── */

.topbar {
  gap: 20px;
  padding-right: 0;
  background: var(--ink);
  color: #fff;
  border-bottom: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 6px;
  background: var(--cmyk-strip);
}
.brand-logo { height: 42px; }

.steps { align-self: stretch; gap: 0; }
.steps li { display: flex; }
.steps button {
  height: 100%;
  gap: 10px;
  padding: 0 20px;
  border-left: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 0;
  color: #b4b6bb;
  font-size: 13px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.steps button:not(:disabled):hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.steps button:disabled { color: #8d9096; }
.step-n {
  width: 30px; height: 30px;
  border: 1.5px solid currentColor;
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0;
}
.steps .is-current button { background: var(--accent); color: #fff; }
.steps .is-current .step-n { background: transparent; border-color: #fff; color: #fff; }
.steps .is-done .step-n { background: #fff; border-color: #fff; color: var(--ink); }

.topbar-actions { align-self: stretch; padding: 0 12px; border-left: 1px dashed rgba(255, 255, 255, 0.28); }
.top-action { color: #fff; font-weight: 700; font-stretch: 85%; letter-spacing: 0.06em; text-transform: uppercase; }
.top-action:hover { background: rgba(255, 255, 255, 0.1); }
.cart-badge { border-color: var(--ink); font-family: var(--font-mono); }

@media (max-width: 760px) {
  .steps button { padding: 0 8px; gap: 6px; border-left: 0; }
  .steps .is-current button { padding: 0 12px; }
  .step-n { width: 26px; height: 26px; font-size: 11px; }
  .topbar-actions { padding: 0 4px; border-left: 0; }
  .brand-logo { height: 34px; }
}
@media (max-width: 420px) {
  .brand-logo { height: 28px; }
  .steps .is-current button { padding: 0 8px; }
}

/* ── Paso 1 · Catálogo de tickets ───────────────────────────────────────── */

.view-products { padding-top: clamp(32px, 5vw, 64px); }
.intro {
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: end;
  column-gap: 48px;
  row-gap: 16px;
}
.intro h1 {
  grid-row: span 2;
  max-width: 13ch;
  font-size: clamp(44px, 7.4vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}
.intro .lede { font-size: 18px; }
.intro-note {
  padding: 10px 14px;
  border: 1.5px dashed var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@media (max-width: 880px) {
  .intro { grid-template-columns: 1fr; }
  .intro h1 { grid-row: auto; }
}

.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 22px;
}
.product-card {
  position: relative;
  overflow: visible;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
  transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: inset 0 0 0 1px var(--rule); }
.product-card:hover .product-name { background: var(--yellow); box-shadow: 0.15em 0 0 var(--yellow), -0.15em 0 0 var(--yellow); }

.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink);
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Talón troquelado: línea punteada con dos medias lunas en los bordes */
.product-body { position: relative; gap: 4px; padding: 16px 16px 18px; border-top: 1px dashed var(--rule); }
.product-body::before,
.product-body::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 16px; height: 16px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
}
.product-body::before { left: -9px; clip-path: inset(0 0 0 50%); }
.product-body::after { right: -9px; clip-path: inset(0 50% 0 0); }

.product-name { font: 900 22px/1.05 var(--font-display); letter-spacing: -0.01em; text-transform: uppercase; }
.product-desc { font-size: 15px; }
.product-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}
.product-price strong { padding: 2px 6px; background: var(--yellow); font: 900 26px/1 var(--font-display); }
.product-price span { color: var(--ink-2); font: 600 12px/1.3 var(--font-mono); }
.product-skeleton { border-radius: var(--radius); }

/* ── Paso 2 · Mesa de trabajo ───────────────────────────────────────────── */

.editor-title { font-size: clamp(26px, 3.4vw, 40px); text-transform: uppercase; letter-spacing: -0.025em; }
.editor-sub strong { font-family: var(--font-mono); font-size: 15px; }
.toolbar { border-color: var(--rule); }
.tool { font-weight: 700; }
.tool-primary:hover { background: #3a3a37; }

/* Plancha de corte: grilla fina cada 20 px y marcada cada 100 px */
.stage-wrap {
  border-color: var(--rule);
  background-color: #dde1e7;
  background-image:
    linear-gradient(rgba(29, 29, 27, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 27, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(29, 29, 27, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 27, 0.05) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
}
.stage { box-shadow: 0 0 0 1px var(--rule), 0 18px 40px -18px rgba(29, 29, 27, 0.45); }

.panel { border-color: var(--rule); }
.panel-title { font: 900 15px/1.2 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; }
.preview-stage { border-radius: var(--radius-sm); }
.chip { border-color: var(--line-strong); border-radius: var(--radius-sm); font-weight: 700; }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); }
.popover { border-color: var(--rule); }

.actionbar { background: var(--ink); }
.actionbar::before { content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 6px; background: var(--cmyk-strip); }
.actionbar .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.actionbar .btn-ghost:hover { border-color: #fff; }

/* ── Botones y campos ───────────────────────────────────────────────────── */

.btn { border-radius: var(--radius-sm); font-weight: 800; font-stretch: 90%; letter-spacing: 0.05em; text-transform: uppercase; }
.btn-ghost { border-color: var(--rule); }
.btn-link { font-stretch: 100%; letter-spacing: 0; text-transform: none; }
.btn-xl { box-shadow: none; }
.tag { padding: 3px 8px; border-radius: 0; background: var(--yellow); font-stretch: 85%; letter-spacing: 0.06em; text-transform: uppercase; }
.option-title { font-weight: 800; }

/* ── Paso 3 · Carrito como tickets ──────────────────────────────────────── */

.cart-head h1 { text-transform: uppercase; letter-spacing: -0.03em; }
.cart-units { font-family: var(--font-mono); font-size: 14px; }
.cart-item {
  row-gap: 12px;
  padding: 0 12px 12px;
  border-color: var(--rule);
  border-radius: var(--radius);
}
.cart-row { grid-column: 1 / -1; margin: 0 -12px; }
.cart-thumb { border-radius: 0; }
.cart-name { font: 900 18px/1.1 var(--font-display); text-transform: uppercase; }
.cart-line { font: 700 18px/1 var(--font-mono); }
.cart-empty { border-color: var(--rule); border-radius: 0; }
.cart-empty strong { font-weight: 900; text-transform: uppercase; }

/* El momento firma: el ticket nuevo sale de la impresora y entra al carrito */
.cart-item.is-new { animation: ticket-print 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes ticket-print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-16px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

.form-title { text-transform: uppercase; letter-spacing: -0.025em; }
.account-note { border: 1px dashed var(--line-strong); border-radius: 0; background: transparent; }

.price-box { border: 1px dashed var(--rule); border-radius: 0; background: var(--surface); }
.price-lines dd { font-family: var(--font-mono); font-size: 15px; }
.price-total { border-top: 1px dashed var(--rule); }
.price-total span { font-stretch: 85%; letter-spacing: 0.08em; text-transform: uppercase; }
.price-total strong { padding: 2px 8px; background: var(--yellow); font-size: 32px; font-weight: 900; }
.price-deposit, .done-deposit { border-radius: 0; border-style: dashed; border-color: var(--rule); background: var(--yellow-soft); }

/* ── Pedido enviado ─────────────────────────────────────────────────────── */

.done h1 { text-transform: uppercase; letter-spacing: -0.03em; }
.done .lede strong { padding: 0 6px; background: var(--yellow); font-family: var(--font-mono); font-size: 0.92em; }

/* ── Diálogo y avisos ───────────────────────────────────────────────────── */

.sheet { border: 1px solid var(--rule); border-top-width: 4px; border-radius: 0; }
.sheet-head h2 { text-transform: uppercase; letter-spacing: -0.02em; }
.add-product strong { font-weight: 900; text-transform: uppercase; }
.add-product span { font-family: var(--font-mono); font-size: 13px; }
.add-shot { border-radius: 0; }
.toast { border-radius: var(--radius-sm); }
@media (max-width: 560px) {
  .sheet { border-radius: 0; }
}

/* ── Pie de página ──────────────────────────────────────────────────────── */

.site-footer { margin-top: 48px; background: var(--ink); color: #c9cbd0; font-size: 15px; }
.site-footer::before { content: ''; display: block; height: 6px; background: var(--cmyk-strip); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px 40px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 52px var(--gutter) 36px;
}
.footer-brand img { display: block; width: auto; height: 52px; margin-bottom: 16px; }
.footer-brand p { max-width: 34ch; }
.footer-col h2 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  color: #fff;
  font: 800 13px/1 var(--font-ui);
  font-stretch: 85%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-col ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 4px;
  cursor: pointer;
}
.footer-link:hover { text-decoration-color: var(--yellow); }
.footer-link .icon-sm { margin: 0; }
.footer-legal {
  display: grid;
  gap: 6px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #a9abb0;
  font-size: 13px;
}
.footer-legal a { color: inherit; text-underline-offset: 3px; }
body[data-step='2'] .site-footer { padding-bottom: 76px; }
@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; padding-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-item.is-new { animation: none; }
}

/* Nueve productos: 3 × 3 en escritorio, 2 en tableta, 1 en celular */
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
}
.cart-side .btn-icon { flex: none; }

/* ── Sellos de goma ─────────────────────────────────────────────────────── */

/* El estado del pedido se estampa como sello */
.stamp-title {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px 8px;
  border: 4px solid currentColor;
  border-radius: 3px;
  font-size: clamp(30px, 6vw, 46px) !important;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
  transform-origin: left center;
  animation: stamp-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.stamp-title[data-status='a_confirmar'] { color: var(--ink); border-style: dashed; }
.stamp-title[data-status='pendiente'] { color: var(--cyan-ink); }
.stamp-title[data-status='en_impresion'] { color: var(--warn); }
.stamp-title[data-status='listo'], .stamp-title[data-status='entregado'] { color: var(--ok); }
.stamp-title[data-status='cancelado'] { color: var(--bad); text-decoration: line-through; }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-2.5deg) scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .stamp-title { animation: none; } }

/* ── Ajustes de la revisión ─────────────────────────────────────────────── */

/* Guías que no se imprimen: cian, como en el taller */
.guide-safe { border-color: var(--cyan-ink); opacity: 0.7; }
input[type='range'] { accent-color: var(--ink); }
.option input { accent-color: var(--ink); }
.cart-badge { background: var(--yellow); color: var(--ink); }
.account-note a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Primer vistazo: la primera fila de tickets entra completa en 1440 × 900 */
@media (min-width: 900px) {
  .view-products { padding-top: 40px; }
  .intro { margin-bottom: 36px; }
  .intro h1 { font-size: clamp(44px, 6vw, 84px); }
  .product-thumb { aspect-ratio: 4 / 3; }
  .product-thumb canvas,
  .product-thumb img { object-fit: cover; object-position: 50% 55%; }
}

/* Ticket del carrito: talón troquelado entre el producto y su total */
.cart-item { grid-template-columns: 96px minmax(0, 1fr); padding-bottom: 0; }
.cart-item .cart-side {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -12px;
  padding: 10px 12px;
  border-top: 1px dashed var(--rule);
}
.cart-item .cart-side::before,
.cart-item .cart-side::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 16px; height: 16px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
}
.cart-item .cart-side::before { left: -9px; clip-path: inset(0 0 0 50%); }
.cart-item .cart-side::after { right: -9px; clip-path: inset(0 50% 0 0); }
@media (max-width: 560px) {
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); }
}

/* Celular: el paso actual conserva su nombre */
@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .steps button { padding: 0 6px; font-size: 12px; letter-spacing: 0.04em; }
  .steps .is-current button { padding: 0 8px; }
  .top-action { min-width: 40px; padding: 0 8px; }
}

/* Pedido enviado: el número queda sellado */
.done .stamp-title { margin: 0 0 8px; transform-origin: center; font-size: clamp(26px, 5vw, 36px) !important; }
.stamp-id { display: block; margin-bottom: 2px; font: 700 0.6em/1.2 var(--font-mono); letter-spacing: 0.02em; }
@media (min-width: 900px) {
  .product-thumb { overflow: hidden; min-height: 0; }
  .product-thumb canvas,
  .product-thumb img { height: 100%; }
}
.done .stamp-title { text-align: center; line-height: 1.05; }
.product-card:hover { transform: none; }
.product-name { justify-self: start; }
.stamp-title { font-weight: 900; }

/* Barra del editor: acompaña al editor mientras se diseña y termina donde
   termina el editor, arriba del pie (antes quedaba fija debajo del pie). */
.view-editor { padding-bottom: 32px; }
.actionbar {
  position: sticky;
  left: auto; right: auto;
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 0;
}
/* iPhone con barra de inicio: un poco más de aire abajo */
.actionbar-inner { padding-bottom: env(safe-area-inset-bottom, 0px); }
body[data-step='2'] .site-footer { padding-bottom: 0; }
.actionbar .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .actionbar { margin-inline: calc(-1 * var(--gutter)); }
  .actionbar .btn { padding: 0 12px; font-size: 14px; letter-spacing: 0.03em; }
}
@media (max-width: 380px) {
  .actionbar .btn .icon { display: none; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .actionbar .btn-ghost { flex: 0 0 auto; }
  .actionbar .btn { font-size: 14px; letter-spacing: 0.02em; }
}

/* ── Talles: cantidad por talle ─────────────────────────────────────────── */

.size-picker { display: grid; gap: 10px; }
.size-picker legend { margin-bottom: 10px; }
.size-cells { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.size-cell {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: text;
}
.size-cell:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.size-name { font: 700 13px/1 var(--font-mono); }
.size-cell input {
  width: 100%;
  min-height: 40px !important;
  padding: 4px !important;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.size-cell input::-webkit-inner-spin-button,
.size-cell input::-webkit-outer-spin-button { -webkit-appearance: none; }
.size-cells-sm { gap: 6px; width: min(100%, 300px); }
.size-cells-sm .size-cell { padding: 6px 4px; }
.size-cells-sm .size-cell input { min-height: 34px !important; }

/* ── Stock ──────────────────────────────────────────────────────────────── */

.product-card.is-out .product-thumb { opacity: 0.45; filter: grayscale(1); }
.product-card.is-out .product-price strong { background: var(--paper-2); }
.card-stamp {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 1;
  margin: 0;
  padding: 6px 12px;
  border-width: 3px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 18px !important;
  white-space: nowrap;
  text-decoration: none !important;
  transform: translateX(-50%) rotate(-6deg);
  animation: none;
  pointer-events: none;
}
.size-cell.is-out { background: var(--paper); border-style: dashed; }
.size-left { min-height: 14px; color: var(--bad); font: 700 11px/1.2 var(--font-mono); text-transform: uppercase; }
.consult-link { margin-left: 4px; color: var(--whatsapp); font-weight: 800; text-underline-offset: 3px; white-space: nowrap; }
