/* Tipografías del manual V5, servidas desde la propia web: cargan antes y no envían datos a terceros. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/barlow-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/barlow-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/barlow-condensed-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/barlow-condensed-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/barlow-condensed-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Noto Serif Display'; font-style: normal; font-weight: 600 900; font-display: swap; src: url('/assets/fonts/noto-serif-display.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Spotlight — tokens y piezas compartidas por la carta, el POS y el panel.
   Identidad: Manual de identidad y sistema visual V5 (oct. 2026).
   Editorial cotidiano: pared crema/cemento, titular serif negro, gesto rosa, dato turquesa,
   zócalo de azulejo negro. El POS usa el modo «noche contenida» (.theme-night): mismo sistema,
   mayor contraste, sin humo ni saturación.

   Los nombres heredados se mantienen como roles:
   --velvet-900…500  superficies (fondo de página → controles → trazos)
   --ink, -2, -3     texto principal, secundario, terciario
   --tungsten        acción principal (negro en crema, crema en noche) · --on-tungsten su texto
   --tungsten-2      acento de texto (rosa legible sobre el fondo)
   --gel-teal        dato / listo (turquesa) · --gel-rose error · --gel-blue en preparación */


:root {
  color-scheme: light;

  /* paleta del manual */
  --crema: #d7c9b6;
  --negro: #0f0f0f;
  --blanco: #ffffff;
  --turquesa: #00d1d1;
  --rosa: #ff2d7a;

  --velvet-900: #f3ece2;   /* pared crema clara */
  --velvet-800: #ebe1d3;
  --velvet-700: #fbf8f3;   /* papel: hojas, tarjetas */
  --velvet-600: #e6dacb;   /* controles en reposo */
  --velvet-500: #d7c9b6;   /* cemento: trazos, pistas */
  --line: rgba(15, 15, 15, 0.1);
  --line-strong: rgba(15, 15, 15, 0.2);

  --ink: #0f0f0f;
  --ink-2: #3d3731;
  --ink-3: #6b6158;

  --tungsten: #0f0f0f;
  --tungsten-2: #c8105a;
  --on-tungsten: #f3ece2;
  --gel-teal: #007c80;
  --gel-rose: #b3261e;
  --gel-blue: #0f0f0f;

  --glow: #2b2118;          /* sombras y tintes cálidos */
  --shadow: #2b2118;
  --glass: #fbf8f3;
  --bg: #f3ece2;
  --tile: #111111;          /* azulejo negro */

  --font-display: 'Noto Serif Display', 'Georgia', serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --font-data: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --section-gap: 36px;      /* aire entre secciones de la web y la carta */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --shadow-float: 0 14px 30px -14px rgba(43, 33, 24, 0.45), 0 2px 6px rgba(43, 33, 24, 0.12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Noche contenida: POS detrás de la barra. Más contraste, mismos componentes. */
.theme-night {
  color-scheme: dark;
  --velvet-900: #0f0f0f;
  --velvet-800: #171615;
  --velvet-700: #1f1d1b;
  --velvet-600: #2b2825;
  --velvet-500: #3c3833;
  --line: rgba(243, 236, 226, 0.1);
  --line-strong: rgba(243, 236, 226, 0.2);
  --ink: #f3ece2;
  --ink-2: #d7c9b6;
  --ink-3: #a59a8c;
  --tungsten: #f3ece2;
  --tungsten-2: #ff5c97;
  --on-tungsten: #0f0f0f;
  --gel-teal: #00d1d1;
  --gel-rose: #ff6b6b;
  --gel-blue: #d7c9b6;
  --glow: #000000;
  --shadow: #000000;
  --glass: #1f1d1b;
  --bg: #0f0f0f;
  --shadow-float: 0 18px 40px -12px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--velvet-900);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--tungsten-2); text-underline-offset: 3px; }
::selection { background: var(--tungsten); color: var(--on-tungsten); }

:focus-visible {
  outline: 2px solid var(--tungsten);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- botones ---------- */

.btn {
  --bg: var(--velvet-600);
  --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.25rem;
  border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg);
  font-weight: 600; letter-spacing: 0.005em; text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
  user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { --bg: var(--tungsten); --fg: var(--on-tungsten); }
.btn--ghost { --bg: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--danger { --bg: color-mix(in srgb, var(--gel-rose) 14%, transparent); --fg: var(--gel-rose); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 0.9rem; font-size: 0.9375rem; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--tungsten-2); }
  .btn--ghost:hover { --bg: color-mix(in srgb, var(--ink) 6%, transparent); }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  background: var(--velvet-600); color: var(--ink);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- formularios ---------- */

.field { display: grid; gap: 0.4rem; }
.field > span { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 0.8125rem; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 0.7rem 0.9rem;
  border-radius: var(--r-sm);
  background: var(--velvet-800);
  border: 1px solid var(--line-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.4; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--tungsten);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rosa) 22%, transparent);
}
.input[aria-invalid='true'] { border-color: var(--gel-rose); }

/* Interruptor accesible: <button role="switch" aria-checked> */
.switch {
  position: relative; flex: none;
  width: 52px; height: 32px; border-radius: var(--r-pill);
  background: var(--velvet-500);
  transition: background-color 200ms ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 260ms var(--ease-out);
}
.switch[aria-checked='true'] { background: var(--tungsten); }
.switch[aria-checked='true']::after { transform: translateX(20px); background: var(--on-tungsten); }
.switch:active::after { width: 30px; }
.switch[aria-checked='true']:active::after { transform: translateX(16px); }

/* ---------- avisos (toasts) ---------- */

.toasts {
  position: fixed; z-index: 100; left: 50%; top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: 0.8rem 1rem; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--glass) 92%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  font-weight: 500; font-size: 0.9375rem;
  pointer-events: auto;
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
  @starting-style { opacity: 0; transform: translateY(-12px) scale(0.97); }
}
.toast[data-leaving] { opacity: 0; transform: translateY(-12px) scale(0.97); }
.toast--error { border-color: color-mix(in srgb, var(--gel-rose) 50%, transparent); }
.toast--ok { border-color: color-mix(in srgb, var(--gel-teal) 50%, transparent); }

/* ---------- chips de estado ---------- */

.status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.65rem; border-radius: var(--r-pill);
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2);
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--new { color: var(--tungsten-2); background: color-mix(in srgb, var(--rosa) 12%, transparent); }
.status--accepted { color: var(--gel-blue); background: color-mix(in srgb, var(--gel-blue) 12%, transparent); }
.status--ready { color: var(--gel-teal); background: color-mix(in srgb, var(--gel-teal) 12%, transparent); }
.status--served { color: var(--ink-3); }
.status--rejected { color: var(--gel-rose); background: color-mix(in srgb, var(--gel-rose) 12%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .toast { background: var(--velvet-600); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
