/* Carta pública de Mostrador. Los colores llegan de cada negocio
   (aplicarColores en js/comun.js); acá solo hay valores por defecto. */

@font-face {
  font-family: "Young Serif";
  src: url("/fuentes/young-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fuentes/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --fondo: #f5efe3;
  --tinta: #1d1a17;
  --tinta-2: #5a524a;
  --superficie: #ece5d8;
  --superficie-2: #e0d8ca;
  --marca: #2c3352;
  --acento: #2c3352;
  --sobre-marca: #ffffff;

  --titulos: "Young Serif", Georgia, serif;
  --texto: "Instrument Sans", system-ui, sans-serif;

  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px; --e-8: 64px; --e-9: 96px;
  --margen: 20px;
  --ancho: 46rem;
  --salida: cubic-bezier(0.23, 1, 0.32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 1.0625rem/1.5 var(--texto);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }

.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: var(--margen); top: -100px; z-index: 20; padding: var(--e-3) var(--e-4); background: var(--marca); color: var(--sobre-marca); border-radius: 999px; }
.saltar:focus { top: var(--e-3); }
.sin-js { padding: var(--e-6) var(--margen); }

.aviso-demo {
  background: var(--superficie-2);
  padding: var(--e-2) var(--margen);
  font-size: 0.9375rem;
  text-align: center;
}

/* ---------- Portada: el nombre del negocio, grande y con su color ---------- */

.portada {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: var(--e-7) var(--margen) var(--e-6);
}
.portada-marca { display: flex; align-items: center; gap: var(--e-4); }
.logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--superficie); }
.nombre {
  font-family: var(--titulos);
  font-size: clamp(2.75rem, 13vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--acento);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.descripcion { margin-top: var(--e-4); font-size: 1.1875rem; max-width: 34ch; text-wrap: pretty; }
.estado { margin-top: var(--e-4); display: flex; align-items: center; gap: var(--e-2); font-weight: 600; min-height: 1.5em; }
.estado[data-abierto]::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--tinta-2);
}
.estado[data-abierto="si"]::before { background: #1f9d55; }

/* ---------- Pestañas de secciones (quedan fijas arriba) ---------- */

.pestanas {
  position: sticky; top: 0; z-index: 10;
  background: var(--fondo);
  display: flex; gap: var(--e-2);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: var(--e-3) max(var(--margen), calc((100% - var(--ancho)) / 2 + var(--margen)));
  scroll-padding-inline: var(--margen);
}
.pestanas::-webkit-scrollbar { display: none; }
.pestanas a {
  flex: none;
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 var(--e-4);
  border-radius: 999px;
  background: var(--superficie);
  text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  white-space: nowrap;
  user-select: none;
  transition: background-color 200ms var(--salida), color 200ms var(--salida), transform 160ms var(--salida);
}
.pestanas a[aria-current="true"] { background: var(--marca); color: var(--sobre-marca); }
.pestanas a:active { transform: scale(0.96); }

/* ---------- La carta ---------- */

.carta { max-width: var(--ancho); margin: 0 auto; padding: 0 var(--margen) var(--e-9); outline: none; }
.seccion { padding-top: var(--e-7); }
.seccion-titulo { font-family: var(--titulos); font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.05; letter-spacing: -0.02em; }
.seccion-desc { margin-top: var(--e-2); color: var(--tinta-2); }
.items { list-style: none; margin: var(--e-5) 0 0; padding: 0; display: grid; gap: var(--e-2); }

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--e-1) var(--e-4);
  align-items: start;
  padding: var(--e-4) 0;
}
.item.con-foto { grid-template-columns: 88px minmax(0, 1fr) auto; }
.item-foto { width: 88px; height: 88px; object-fit: cover; background: var(--superficie); grid-row: span 2; }
.item-nombre { font-size: 1.125rem; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.item-precio { font-weight: 600; font-size: 1.125rem; font-variant-numeric: tabular-nums; color: var(--acento); white-space: nowrap; }
.item-detalle { grid-column: 1 / -1; color: var(--tinta-2); font-size: 1rem; text-wrap: pretty; }
.item.con-foto .item-detalle { grid-column: 2 / -1; }
.item-etiquetas { display: block; margin-top: var(--e-1); font-size: 0.9375rem; font-weight: 600; color: var(--tinta); }

/* Destacado: foto grande arriba y nombre con la letra de los títulos. */
.item.destacado { grid-template-columns: minmax(0, 1fr) auto; padding-top: var(--e-2); }
.item.destacado .item-foto { grid-column: 1 / -1; grid-row: auto; width: 100%; height: auto; aspect-ratio: 4 / 3; margin-bottom: var(--e-3); }
.item.destacado .item-nombre { font-family: var(--titulos); font-weight: 400; font-size: 1.625rem; letter-spacing: -0.01em; }
.item.destacado .item-precio { font-size: 1.375rem; }
.item.destacado .item-detalle { grid-column: 1 / -1; }

.item.agotado .item-nombre { text-decoration: line-through; text-decoration-thickness: 2px; }
.item.agotado .item-foto { opacity: 0.5; filter: grayscale(1); }
.item.agotado .item-precio { color: var(--tinta-2); font-size: 0.9375rem; }

.vacio, .error { padding: var(--e-8) 0; font-size: 1.1875rem; max-width: 34ch; }
.error h1 { font-family: var(--titulos); font-size: 2.5rem; line-height: 1; margin-bottom: var(--e-4); }

/* ---------- Pie: horarios, dirección y el nombre otra vez ---------- */

.pie { background: var(--superficie); padding: var(--e-8) var(--margen) calc(var(--e-9) + 56px + env(safe-area-inset-bottom)); overflow: hidden; }
.visitanos { max-width: var(--ancho); margin: 0 auto; }
.visitanos h2 { font-family: var(--titulos); font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.05; letter-spacing: -0.02em; }
.visitanos-grilla { display: grid; gap: var(--e-6); margin-top: var(--e-5); }
.horarios { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.horarios th, .horarios td { text-align: left; padding: var(--e-2) 0; font-weight: 400; vertical-align: top; }
.horarios th { padding-right: var(--e-4); width: 7.5rem; }
.horarios tr.hoy th, .horarios tr.hoy td { font-weight: 700; }
.donde { display: grid; gap: var(--e-3); align-content: start; }
.donde a {
  display: inline-flex; align-items: center; min-height: 44px; font-weight: 600;
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.donde a:hover { color: var(--acento); }
.pie-nombre {
  max-width: var(--ancho); margin: var(--e-8) auto 0;
  font-family: var(--titulos); font-size: clamp(3.5rem, 19vw, 8rem); line-height: 0.9; letter-spacing: -0.04em;
  color: var(--acento); overflow-wrap: anywhere;
}
.pie-creditos { max-width: var(--ancho); margin: var(--e-6) auto 0; font-size: 0.9375rem; color: var(--tinta-2); }
.pie-creditos a { color: var(--tinta); }

/* ---------- WhatsApp: siempre a mano ---------- */

.whatsapp {
  position: fixed; z-index: 15;
  left: 50%; bottom: calc(var(--e-4) + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: inline-flex; align-items: center; gap: var(--e-3);
  min-height: 56px; padding: 0 var(--e-5);
  border-radius: 999px;
  background: var(--marca); color: var(--sobre-marca);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  user-select: none;
  transition: transform 160ms var(--salida);
}
.whatsapp:active { transform: scale(0.97); }

/* ---------- Mientras carga ---------- */

.esqueleto { display: block; background: var(--superficie-2); border-radius: 4px; }
.esqueleto-titulo { width: 70%; height: 0.9em; }
.esqueleto-lista { display: grid; gap: var(--e-4); padding-top: var(--e-7); }
.esqueleto-lista .esqueleto { height: 64px; }

/* ---------- Movimiento (solo si no se pidió reducirlo) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .esqueleto { animation: latido 1.2s ease-in-out infinite alternate; }
  @keyframes latido { from { opacity: 1; } to { opacity: 0.5; } }

  .js-entrada .portada > *, .js-entrada .seccion-titulo, .js-entrada .item {
    opacity: 0; transform: translateY(16px);
    transition: opacity 500ms var(--salida), transform 500ms var(--salida);
    transition-delay: var(--retraso, 0ms);
  }
  .js-entrada .visible, .js-entrada .portada.lista > * { opacity: 1; transform: none; }
  .whatsapp { animation: subir 500ms var(--salida) 300ms both; }
  @keyframes subir { from { opacity: 0; transform: translateY(24px); } }
}

@media (hover: hover) and (pointer: fine) {
  .pestanas a:hover:not([aria-current="true"]) { background: var(--superficie-2); }
}

/* ---------- Pantallas grandes ---------- */

@media (min-width: 900px) {
  :root { --margen: 32px; }
  .portada { padding-top: var(--e-9); }
  .item.con-foto { grid-template-columns: 112px minmax(0, 1fr) auto; }
  .item-foto { width: 112px; height: 112px; }
  .visitanos-grilla { grid-template-columns: 1fr 1fr; }
  .item.destacado .item-foto { aspect-ratio: 16 / 9; }
}
