/* Sazón · estilos compartidos. Tema oscuro cálido, pensado para tablets y pantallas de cocina. */
:root {
  --bg: #14110e; --surface: #1f1a15; --surface2: #2a231c; --line: #3a3027;
  --text: #f4ede2; --muted: #a8998a; --accent: #f2a23a; --accent-ink: #201405;
  --ok: #4fb36a; --warn: #f2c14e; --bad: #e5533d; --info: #5aa9e6;
  --radius: 14px; --gap: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .big { font-size: 1.5rem; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.hide { display: none !important; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--gap); padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 800; color: var(--accent); text-decoration: none; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: .9rem; }
.topbar nav a.on, .topbar nav a:hover { color: var(--text); background: var(--surface2); }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }

/* Botones y campos */
button, .btn { font: inherit; color: var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { border-color: var(--muted); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.ok { background: var(--ok); border-color: var(--ok); color: #06210f; font-weight: 700; }
button.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
button.ghost { background: transparent; }
button.sm { min-height: 34px; padding: 5px 10px; font-size: .9rem; }
button.on { border-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }

/* Contenedores */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.grid { display: grid; gap: var(--gap); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: var(--gap); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; border-radius: 999px; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* Etiquetas */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: var(--ok); } .tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.bad { color: var(--bad); border-color: var(--bad); } .tag.info { color: var(--info); border-color: var(--info); }
.tag.accent { color: var(--accent); border-color: var(--accent); }
.allergy { background: #3a120c; border: 1px solid var(--bad); color: #ffd9d2; border-radius: 10px; padding: 8px 10px; font-weight: 600; }

/* Tablas */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Ventana modal y avisos */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 18px; }
.modal.wide { width: min(900px, 100%); }
.modal h2 { margin-bottom: 10px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #06210f; }

/* Teclado de PIN */
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; margin-top: 14px; }
.pinpad button { height: 64px; font-size: 1.4rem; border-radius: 16px; }
.pindots { text-align: center; font-size: 2rem; letter-spacing: .4em; min-height: 2.6rem; color: var(--accent); }

/* Impresión de tickets: 80 mm */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .topbar, #toasts { display: none !important; }
}
@media (max-width: 640px) { main { padding: 10px; } .topbar { padding: 8px 10px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───── Identidad Sazón: tipografía, fondo y fotos ───── */
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-wght-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
:root {
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --bg: #15100b; --surface: #211912; --surface2: #2d2219; --line: #43352a;
  --text: #f6eedf; --muted: #b3a291; --chile: #e04a2f; --hoja: #6f9e3c;
  --shadow: 0 12px 32px rgba(0,0,0,.38);
}
body { background: radial-gradient(1100px 620px at 12% -12%, #33220f 0%, transparent 62%), radial-gradient(900px 520px at 105% 0%, #2a130c 0%, transparent 60%), var(--bg); background-attachment: fixed; }
h1, h2, .display { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.28rem; }
.display i, .display em { font-style: italic; color: var(--accent); }
.topbar { background: rgba(27,20,14,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar .brand { display: flex; align-items: center; }
.topbar .brand img { height: 38px; width: auto; display: block; }
.logo { display: block; height: auto; max-width: 100%; }
button.primary, .tabs button.on { background: linear-gradient(180deg, #f7b352, #ee972a); box-shadow: 0 4px 14px rgba(242,162,58,.22); }
.card { box-shadow: var(--shadow); }
.modal { box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-back { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal h2 { font-size: 1.6rem; }
/* Foto de producto: se usa en tarjetas, miniaturas y vitrinas. */
.photo { display: block; position: relative; overflow: hidden; background: var(--surface2); }
.photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.none { display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-style: italic; font-size: 2.4rem; color: rgba(255,255,255,.75); }
.thumb { width: 52px; height: 52px; border-radius: 10px; flex: none; }
@media print { body { background: #fff !important; } }

/* Acceso de demostración en la ventana de PIN */
.demo-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin: 16px 0 10px; }
.demo-sep::before, .demo-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.demo-login > * + * { margin-top: 8px; }

/* Barra superior: muchas pantallas caben en un renglón que se desliza */
.topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 0 1 auto; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { white-space: nowrap; }
.topbar .spacer { flex: 1 0 8px; }
