/* Restaurante San Luis 1 - carta QR. Sin JS, sin fuentes externas. */
:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --card: #161616;
  --line: #2a2a2a;
  --text: #f2efe8;
  --muted: #b9b5ab;
  --accent: #ffc400;
  --accent-ink: #0b0b0b;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  overflow-wrap: break-word;
}

html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.7; }

a { color: var(--accent); }
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  inset-inline-start: 8px;
  top: -100px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  z-index: 10;
  border-radius: 8px;
}
.skip:focus { top: 8px; }

.wrap {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Cabecera */
.top { padding-block: 24px 12px; text-align: center; }
.top h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.01em;
}
html[lang="ar"] .top h1 { letter-spacing: 0; }
.logo { display: block; width: 100%; height: auto; }
/* Opening animation: logo grows in, then the bull keeps snorting (double puff every 3.4s). Nostrils sit at ~43.5% / 53% x, 79% y
   of logo.png; puffs are % of the box so they scale with the logo. */
.logo-box {
  position: relative;
  display: block;
  width: min(168px, 44vw);
  margin-inline: auto;
  animation: logo-in 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.smoke {
  position: absolute;
  top: 79%;
  width: 10%;
  height: 10%;
  margin: -5% 0 0 -5%;
  pointer-events: none;
}
.smoke.l { left: 43.5%; --dx: -170%; }
.smoke.r { left: 53%; --dx: 170%; }
.smoke::before, .smoke::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 245, 245, 1) 0%, rgba(245, 245, 245, .6) 40%, rgba(240, 240, 240, 0) 70%);
  opacity: 0;
  animation: snort 3.4s ease-out .8s infinite both;
}
.smoke::after { animation-delay: 1.25s; }
/* Stars: centres measured by tools/split_stars.py (% of logo). Each spins once in turn while the logo
   grows in, then they twinkle left to right forever. The twinkle only fades a bright copy (.hi) and a
   halo in and out: opacity only, because CSS filter on small <use> SVGs flickers on mobile browsers. */
.star {
  position: absolute;
  width: 5.8%;
  height: 5.8%;
  margin: -2.9% 0 0 -2.9%;
  animation: star-spin .7s cubic-bezier(.3, .7, .3, 1) var(--d) both;
}
.star svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.star .hi, .star::after { opacity: 0; animation: star-glow 4s ease-in-out calc(var(--d) * 2 + 1.3s) infinite; }
.star::after {
  content: "";
  position: absolute;
  inset: -80%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 100, .55) 0%, rgba(255, 214, 100, 0) 60%);
}
.star.s1 { left: 33.75%; top: 22.88%; --d: .25s; }
.star.s2 { left: 40.75%; top: 18.62%; --d: .37s; }
.star.s3 { left: 49.25%; top: 15.88%; --d: .49s; }
.star.s4 { left: 57.75%; top: 18.62%; --d: .61s; }
.star.s5 { left: 65.25%; top: 22.88%; --d: .73s; }
@keyframes star-spin {
  from { transform: rotate(-360deg) scale(.4); opacity: 0; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}
@keyframes star-glow {
  0%, 16%, 100% { opacity: 0; }
  8% { opacity: 1; }
}
@keyframes logo-in {
  from { opacity: 0; transform: scale(.8); }
  60% { opacity: 1; }
  to { opacity: 1; transform: scale(1); }
}
@keyframes snort {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  6% { opacity: 1; }
  50%, 100% { opacity: 0; transform: translate(var(--dx), 110%) scale(3.6); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-box { animation: none; }
  .smoke { display: none; }
  .star, .star .hi, .star::after { animation: none; }
}
.badge {
  display: inline-block;
  margin-block: 12px 0;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
}
.langs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}
.langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}
.langs a:hover { color: var(--text); }
.langs a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); font-weight: 700; }

/* Chips de categorías */
.cats {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-block-end: 1px solid var(--line);
}
.cats ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 720px;
  margin-inline: auto;
}
.cats ul::-webkit-scrollbar { display: none; }
.cats a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.cats a:hover { border-color: var(--accent); }

/* Carta */
main { padding-block: 8px 24px; }
.cat { padding-block-start: 20px; }
/* Clear the sticky category bar (44px chips + 20px padding + border) on anchor jumps. */
#carta, .cat, .legend-box { scroll-margin-top: 72px; }
.note { margin: 12px 0 0; }
.note strong { color: var(--accent); }
.cat h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  color: var(--accent);
}
.cat:target h2 { text-decoration: underline; text-underline-offset: 6px; }
.items { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
/* Photo tile as tall as the card content (same gap top and bottom), square where the text allows,
   never more than 40% of the card. When text is taller the photo is centred on black (photos have
   black backgrounds, so the tile reads as one piece) instead of being cropped into a strip. */
.item.has-img { display: flex; gap: 12px; align-items: stretch; }
/* Width must not depend on the image having loaded: with width:auto a lazy photo was 88 px until it
   arrived and 240 px / 40% after, so the page grew ~5800 px during a jump to Bebidas and the smooth
   scroll stopped short (2026-09-29). min(40%, 240px) = the size a loaded photo used to get. */
.thumb {
  flex: 0 0 auto;
  align-self: stretch;
  width: min(40%, 240px);
  height: auto;
  min-width: 88px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #000;
  border-radius: 10px;
}
.body { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: baseline; gap: 12px; }
.row h3 { margin: 0; font-size: 1.05rem; font-weight: 700; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.price {
  flex: 0 0 auto;
  margin-inline-start: auto;
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ask { color: var(--muted); font-weight: 600; font-style: italic; }
.desc { margin: 4px 0 0; color: var(--muted); font-size: 0.93rem; }
/* No synthetic italics for Arabic script. */
html[lang="ar"] .ask { font-style: normal; }
.vars { margin: 8px 0 0; padding: 0; list-style: none; }
.vars li {
  display: flex;
  gap: 12px;
  padding-block: 4px;
  border-block-start: 1px dashed var(--line);
  font-size: 0.95rem;
}
.vars li:first-child { border-block-start: 0; }
.vars li > span:first-child { flex: 1 1 auto; min-width: 0; }
/* Allergen badges: bottom-end corner of the card (bottom-left in RTL). */
.body { display: flex; flex-direction: column; }
.al-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: auto 0 0;
  padding: 6px 0 0;
}
.al-link { color: var(--muted); font-size: 0.75rem; text-decoration: underline; text-underline-offset: 2px; }
.al {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.al li, .legend b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #5a5548;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.al li { width: 1.6rem; height: 1.6rem; }
.ic { width: 70%; height: 70%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Leyenda y pie */
.to-top { margin: 16px 0 0; text-align: center; }
.to-top a {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.legend-box {
  margin-block-start: 28px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.legend-box h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--accent); }
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.legend li { display: flex; align-items: center; gap: 8px; }

footer {
  margin-block-start: 24px;
  padding-block: 20px 32px;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
footer p { margin: 0 0 6px; }
footer .legal { color: var(--text); font-weight: 600; }
footer .biz { margin-block-start: 14px; }
footer strong { color: var(--text); }
footer a[href^="tel:"] { display: inline-block; padding-block: 11px; }
[dir="ltr"] { unicode-bidi: isolate; }

/* Portada (lo que abre el QR): logo grande + 2 botones */
.landing {
  min-height: 88vh;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 32px 16px;
  text-align: center;
}
.landing h1 { margin: 0; }
.home .logo-box { width: min(340px, 78vw); }
.cta {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 1.125rem;
  font-weight: 800;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { border: 2px solid var(--accent); color: var(--accent); }
.btn svg { width: 1.2em; height: 1.2em; flex: 0 0 auto; fill: currentColor; }
.btn:active { transform: scale(.98); }
.wifi summary { cursor: pointer; list-style: none; }
.wifi summary::-webkit-details-marker { display: none; }
.wifi[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wifi dl {
  margin: 0;
  padding: 14px 18px 4px;
  border: 2px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card);
  text-align: start;
}
.wifi dt { color: var(--muted); font-size: 0.8rem; }
.wifi dd { margin: 0 0 10px; font-size: 1.15rem; font-weight: 700; }
.wifi .pw { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .03em; user-select: all; -webkit-user-select: all; }
.wifi button { width: 100%; margin-top: 12px; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.wifi button[hidden] { display: none; }
.wifi button.done { background: #3fae5a; color: #fff; }
.cta small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.landing .langs { margin-top: 24px; }
.home-foot { padding-block: 0 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.home-foot p { margin: 2px 0; }
.home-foot a { color: var(--muted); }

/* 404 */
.nf { padding-block: 64px; text-align: center; }
.nf h1 { color: var(--accent); margin: 0 0 12px; }
.nf a { display: inline-block; margin: 6px; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; }

@media (min-width: 720px) {
  .top { padding-block-start: 40px; }
  .item { padding: 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  :root { --bg: #fff; --card: #fff; --line: #999; --text: #000; --muted: #333; --accent: #000; }
  .cats, .langs, .skip { display: none; }
  body, html { background: #fff; color: #000; }
  .item, .legend-box { border-color: #999; background: #fff; }
  .top h1, .cat h2, .price, .badge, .legend-box h2 { color: #000; }
}

/* Order number from the printed carta: yellow disc, same as on paper. */
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Fixed square box: two-digit numbers stay a circle, the digits shrink a little instead. */
  width: 1.9em;
  height: 1.9em;
  flex: 0 0 auto;
  margin-inline-end: 0.4em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.95em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  vertical-align: middle;
}
.vars .num { font-size: 0.9em; }
@media print { .num { background: none; color: #000; border: 1.5px solid #000; } }

/* Marca en lugar del nombre (bebidas): tamaño de un título, sin fondo. */
.brand { display: inline-block; max-width: 100%; height: auto; vertical-align: middle; }
.flavor { margin-inline-start: 0.5em; vertical-align: middle; }
