/* Molienda Alba — Plan Esencial.
   Carta tipográfica en una columna: papel claro, tinta café y un solo acento (teja). */

:root {
  --papel: #f4eee3;
  --papel-claro: #fbf8f2;
  --tinta: #2a211c;
  --suave: #67584d;
  --linea: #ddd2c2;
  --teja: #9a4524;
  --teja-hondo: #7f3519;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ancho: 640px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 1rem/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--teja); outline-offset: 3px; border-radius: 4px; }

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  padding: 10px 16px; background: var(--tinta); color: var(--papel-claro); border-radius: 8px;
}
.saltar:focus { top: 12px; }
.visualmente-oculto {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Franja de demo ---------- */
.franja {
  margin: 0;
  padding: 9px var(--gutter);
  background: var(--tinta);
  color: #e9e0d2;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.franja a { color: #fff; text-underline-offset: 2px; }

/* ---------- Portada ---------- */
.portada {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 44px var(--gutter) 30px;
  text-align: center;
}
.portada__sello { margin: 0 0 14px; color: var(--teja); }
.portada__sello svg { display: inline-block; vertical-align: top; }

.logo { margin: 0; font-weight: 400; }
.logo__nombre {
  display: block;
  font: 400 clamp(2.6rem, 11vw, 3.6rem)/1 var(--serif);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
}
.logo__nombre em { font-style: italic; color: var(--teja); }
.logo__sub {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 12px;
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  text-transform: uppercase;
  color: var(--suave);
}
.logo__sub::before, .logo__sub::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }

.portada__frase {
  max-width: 30ch;
  margin: 22px auto 0;
  font: 400 1.12rem/1.45 var(--serif);
  font-style: italic;
}

.horario {
  display: inline-grid;
  gap: 4px;
  margin: 24px 0 0;
  padding: 14px 20px;
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
  font-size: 0.88rem;
}
.horario div { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; }
.horario dt { color: var(--suave); }
.horario dd { margin: 0; font-weight: 500; }

/* ---------- Índice de categorías ---------- */
.indice {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--papel) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.indice__lista {
  display: flex; gap: 4px;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 8px var(--gutter);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.indice__lista::-webkit-scrollbar { display: none; }
.indice__enlace {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.92rem; font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--suave);
  transition: color 0.2s, background-color 0.2s;
}
.indice__enlace:hover { color: var(--tinta); }
.indice__enlace.es-activo { background: var(--tinta); color: var(--papel-claro); }

/* ---------- Carta ---------- */
.carta { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--gutter); }
.carta:focus { outline: none; }
.carta__nojs { padding: 40px 0; text-align: center; }

.categoria { padding: 44px 0 8px; }
.categoria + .categoria { border-top: 1px solid var(--linea); }
.categoria__cabeza { margin-bottom: 18px; }
.categoria__num { display: block; font: 500 0.75rem/1 var(--sans); letter-spacing: 0.2em; color: var(--teja); }
.categoria__titulo {
  margin: 8px 0 0;
  font: 400 2rem/1.1 var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 96;
}
.categoria__nota { margin: 6px 0 0; color: var(--suave); font-size: 0.92rem; }

.categoria__lista { list-style: none; margin: 0; padding: 0; }
.plato { padding: 14px 0; }
.plato + .plato { border-top: 1px dashed var(--linea); }
.plato__linea { display: flex; align-items: baseline; gap: 10px; margin: 0; }
.plato__nombre { flex: 0 1 auto; font: 600 1.12rem/1.3 var(--serif); }
.plato__etiqueta {
  display: inline-block;
  margin: 6px 0 0;
  padding: 2px 8px;
  border: 1px solid var(--teja);
  border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--teja);
}
.plato__puntos { flex: 1 1 16px; min-width: 16px; border-bottom: 1.5px dotted #b9ab98; transform: translateY(-4px); }
.plato__precio { flex: none; font-weight: 600; color: var(--teja); white-space: nowrap; }
.plato__desc { margin: 4px 0 0; max-width: 46ch; color: var(--suave); font-size: 0.93rem; }
.plato__variantes { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.93rem; }
.plato__opcion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.plato__tam { flex: 1 1 auto; color: var(--suave); }
.plato__ctl { margin-top: 10px; }
.plato__opcion .plato__ctl { margin-top: 0; }

/* ---------- Carrito: botones de cantidad ---------- */
.btn-agregar {
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--teja); border-radius: 999px;
  background: none; color: var(--teja);
  font: 600 0.95rem/1 var(--sans); cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn-agregar:hover { background: var(--teja); color: #fff; }
.stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--linea); border-radius: 999px;
  background: var(--papel-claro);
}
.stepper button {
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: none;
  color: var(--teja); font: 600 1.25rem/1 var(--sans); cursor: pointer;
}
.stepper output { min-width: 2.2em; text-align: center; font-weight: 600; }

/* ---------- QR ---------- */
.qr-bloque {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
  max-width: var(--ancho);
  margin: 40px auto 0;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
}
.qr { width: 112px; aspect-ratio: 1; border-radius: 10px; background: var(--papel-claro); }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-bloque__titulo { margin: 0; font: 400 1.35rem/1.2 var(--serif); font-style: italic; }
.qr-bloque__texto p { margin: 6px 0 4px; color: var(--suave); font-size: 0.92rem; }
.enlace {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; color: var(--teja); text-underline-offset: 3px;
}

/* ---------- Pie ---------- */
.pie { max-width: var(--ancho); margin: 0 auto; padding: 36px var(--gutter) 24px; text-align: center; }
.pie__marca { margin: 0; font: 400 1.5rem/1 var(--serif); }
.pie__marca em { color: var(--teja); }
.pie__nota { margin: 10px 0 0; color: var(--suave); font-size: 0.85rem; }
.pie__firma { margin: 18px 0 0; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pie__firma a { display: inline-flex; align-items: center; min-height: 44px; color: var(--suave); text-underline-offset: 3px; }
.pie__firma a:hover { color: var(--tinta); }

/* ---------- Botón Pedir por WhatsApp ---------- */
.pedir {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--papel) 55%, transparent);
  pointer-events: none;
}
.pedir__boton {
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 420px; min-height: 54px;
  padding: 0 24px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--teja);
  color: #fff;
  font: 600 1.02rem/1 var(--sans);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(127, 53, 25, 0.28);
  transition: background-color 0.2s, transform 0.2s;
}
.pedir__boton svg { flex: none; }
.pedir__boton:hover { background: var(--teja-hondo); }
.pedir__boton:active { transform: scale(0.98); }
.pedir__boton:focus-visible { outline-color: var(--tinta); }

/* ---------- Hoja del pedido (dialog) ---------- */
[hidden] { display: none !important; }
.hoja {
  width: min(420px, calc(100% - 28px)); max-height: calc(100% - 28px);
  margin: auto; padding: 0; border: 0; border-radius: 18px;
  background: var(--papel-claro); color: var(--tinta);
  box-shadow: 0 24px 60px rgba(42, 33, 28, 0.3);
}
.hoja::backdrop { background: rgba(42, 33, 28, 0.45); }
.hoja__cuerpo { padding: 22px 20px 20px; }
.hoja__cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hoja__titulo { margin: 0; font: 400 1.6rem/1.1 var(--serif); font-style: italic; }
.hoja__cerrar {
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: var(--papel);
  color: var(--tinta); font: 400 1.5rem/1 var(--sans); cursor: pointer;
}
.lineas { list-style: none; margin: 10px 0 0; padding: 0; }
.linea { padding: 12px 0; border-top: 1px dashed var(--linea); }
.linea__cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.linea__nombre { font: 600 1.05rem/1.3 var(--serif); }
.linea__pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.linea__quitar {
  min-height: 44px; padding: 0 8px;
  border: 0; background: none; color: var(--teja);
  font: 600 0.92rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.hoja__vacio { margin: 14px 0; color: var(--suave); }
.hoja__total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0 6px; border-top: 1px solid var(--linea);
}
.hoja__total strong { font: 600 1.3rem var(--serif); color: var(--teja); }
.hoja__aviso { min-height: 1.4em; margin: 6px 0 12px; color: var(--suave); font-size: 0.9rem; }
.hoja .pedir__boton { display: flex; width: 100%; max-width: none; }
.enlace-boton {
  display: block; width: 100%; min-height: 44px; margin-top: 8px;
  border: 0; background: none; color: var(--suave);
  font: 600 0.95rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .portada { padding-top: 64px; }
  .indice__lista { justify-content: center; }
  .categoria { padding-top: 56px; }
  .qr-bloque { grid-template-columns: 136px 1fr; }
  .qr { width: 136px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
