/* ==========================================================================
   base.css · Reset, tipografía base y utilidades
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--luz);
  background: var(--acero);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

/* Titulares: condensada, en mayúsculas como el encabezado de una comanda */
h1, h2 {
  font-family: var(--cond);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 0.9;
  text-wrap: balance;
}
h3 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; }
p { text-wrap: pretty; }

/* Totales y cifras grandes */
.total { font-family: var(--cond); font-weight: 700; line-height: 0.85; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num, output, time, dd { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* Papel térmico: superficie reutilizable con borde inferior dentado */
.paper { background: var(--papel); color: var(--tinta); }
.paper--torn {
  --torn: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 16px 8px repeat-x;
  -webkit-mask: var(--torn); mask: var(--torn);
}
.rule { border: 0; border-top: 1.5px dashed currentColor; margin: 0; opacity: 0.9; }

/* Sello de goma */
.stamp {
  display: inline-block; padding: 0.3em 0.7em;
  border: 3px solid var(--sello); color: var(--sello);
  font-family: var(--mono); font-weight: 600; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.2;
  transform: rotate(-9deg);
  mix-blend-mode: multiply;
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -60px; z-index: 100; background: var(--luz); color: var(--tinta); padding: var(--s-2) var(--s-4); }
.skip-link:focus { top: var(--s-3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Dentro del papel los controles nativos (radios, selects) usan el esquema claro */
.paper, .dialog { color-scheme: light; }
