/* Tachán Carta · carta pública
   Cada plantilla fija sus propios colores (no siguen el modo oscuro del móvil:
   la carta debe verse igual que la ha diseñado el bar). */
:root {
  --c: #2f6b4f;                 /* color del local */
  --bg: #fffdf8; --fg: #2a241c; /* fondo y texto de la plantilla */
  --nav-bg: #fffdf8; --nav-line: #e6dfd2; --md-bg: #f4efe4;
  --top-bg: transparent; --top-fg: var(--fg);
  --mt: "Lora", Georgia, serif;           /* letra de títulos */
  --mb: "Lora", Georgia, serif;           /* letra del texto */
  --sz: 1;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--mb); font-size: calc(16px * var(--sz)); line-height: 1.45;
}
img { max-width: 100%; display: block; }
button, select { font: inherit; color: inherit; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.carta { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
.estado { padding: 48px 20px; text-align: center; opacity: .75; }

/* Plantillas */
body.t-clasica { --bg: #fffdf8; --fg: #2a241c; --nav-bg: #fffdf8; --nav-line: #e6dfd2; --md-bg: #f4efe4; }
body.t-pizarra { --bg: #1f2622; --fg: #eef0e8; --nav-bg: #1f2622; --nav-line: #3a443e; --md-bg: #2b342f; color-scheme: dark; }
body.t-tapas   { --bg: #ffffff; --fg: #1a1a1a; --nav-bg: #ffffff; --nav-line: var(--c); --md-bg: #f3f3f3; --top-bg: var(--c); --top-fg: #fff; }

/* Cabecera */
.top { padding: calc(20px + env(safe-area-inset-top, 0px)) 18px 12px; background: var(--top-bg); color: var(--top-fg); }
.tline { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.marca { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 56px; background: #fff; }
.nombre { font-family: var(--mt); font-weight: 700; font-size: 1.85em; line-height: 1.05; margin: 0; overflow-wrap: anywhere; }
.t-tapas .nombre { text-transform: uppercase; letter-spacing: .02em; }
.direccion { font-size: .85em; opacity: .75; margin: 4px 0 0; }
.idiomas { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.idiomas button { font-size: .8em; padding: 4px 10px; border-radius: 99px; border: 1px solid currentColor; background: none; opacity: .65; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; }
.idiomas button[aria-pressed="true"] { opacity: 1; font-weight: 700; }
.idioma-sel { font-size: .85em; padding: 6px 8px; border-radius: 8px; border: 1px solid currentColor; background: transparent; }
.idioma-sel option { color: #111; background: #fff; }
.bandera { display: inline-block; width: 1.4em; height: .95em; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.15); flex: 0 0 auto; }
.bandera svg { display: block; width: 100%; height: 100%; }
.banner { width: 100%; height: auto; }

/* Barra de secciones */
.nav { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; white-space: nowrap;
  background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); scrollbar-width: none; }
.t-tapas .nav { border-bottom-width: 3px; }
.nav::-webkit-scrollbar { display: none; }
.nav button { font-size: .88em; font-weight: 700; border: 0; background: none; padding: 7px 11px; border-radius: 99px; cursor: pointer; opacity: .8; min-height: 36px; }
.nav button.actual { background: var(--c); color: #fff; opacity: 1; }

/* Filtro de alérgenos */
.filtro { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 0; }
.filtro button { font-size: .76em; padding: 4px 10px; border-radius: 99px; border: 1px solid currentColor; background: none; opacity: .7; cursor: pointer; min-height: 30px; }
.filtro button[aria-pressed="true"] { opacity: 1; background: var(--c); border-color: var(--c); color: #fff; }

.cuerpo { padding: 12px 18px 6px; }
.menu-dia { border-radius: 14px; padding: 14px 16px; margin: 6px 0 12px; background: var(--md-bg); scroll-margin-top: 60px; }
.t-tapas .menu-dia { border-left: 5px solid var(--c); border-radius: 4px; }
.menu-dia h2 { font-family: var(--mt); font-size: 1.3em; margin: 0; line-height: 1.15; }
.menu-dia .horario { font-size: .82em; opacity: .7; margin: 3px 0 8px; }
.menu-dia p { margin: 0; font-size: .95em; }

.seccion { scroll-margin-top: 60px; }
.st { font-family: var(--mt); font-weight: 700; font-size: 1.2em; margin: 18px 0 4px; color: var(--c); display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 0; }
.t-pizarra .st { color: inherit; }
.st .sn { flex: 1; min-width: 0; }
.st-h { margin: 0; font-size: 1em; }
.plato.cab { border: 0; padding: 0 0 2px; color: var(--c); }
.t-pizarra .plato.cab { color: inherit; }
.plato.cab .p { font-size: .68em; letter-spacing: .06em; text-transform: uppercase; opacity: .85; width: calc(4.6em / .68); }
.plato.cab .relleno { visibility: hidden; }
button.st { cursor: pointer; padding: 12px 0; margin: 4px 0 0; border-bottom: 1px solid currentColor; font-size: 1.2em; }
button.st .abre { font-family: var(--mb); font-size: .85em; width: 1em; text-align: center; }

.plato { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 9px 0; border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent); }
.plato.dos { grid-template-columns: minmax(0, 1fr) auto auto; }
.puntos .plato { grid-template-columns: minmax(0, max-content) minmax(1em, 1fr) auto; border-bottom: 0; padding: 6px 0; }
.puntos .plato.dos { grid-template-columns: minmax(0, max-content) minmax(1em, 1fr) auto auto; }
.plato .relleno { display: none; }
.puntos .plato .relleno { display: block; border-bottom: 2px dotted currentColor; opacity: .3; margin-bottom: .35em; align-self: end; }
.plato .n { font-weight: 700; }
.plato .num { color: var(--c); margin-right: .25em; }
.t-pizarra .plato .num { color: inherit; opacity: .7; }
.plato .alc { font-weight: 400; font-size: .8em; opacity: .7; white-space: nowrap; }
.plato .simbolos { display: inline-flex; gap: 2px; margin-left: .35em; vertical-align: -.12em; }
.plato .etiq { font-size: .62em; font-weight: 700; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; letter-spacing: .04em; text-transform: uppercase; vertical-align: .15em; margin-left: .35em; white-space: nowrap; }
.plato .p { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; white-space: nowrap; }
.plato.dos .p { width: 4.6em; }
.plato .d, .plato .alg { grid-column: 1 / -1; font-size: .88em; opacity: .78; }
.plato .alg { display: flex; flex-wrap: wrap; gap: 4px; }
.plato .alg span { font-size: .78em; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; }
.plato.agotado .n, .plato.agotado .p { text-decoration: line-through; opacity: .5; }
.plato .agot { font-weight: 700; }
.vacio { opacity: .7; font-size: .9em; padding: 8px 0; }

.ico { display: inline-block; width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.ico svg { display: block; width: 100%; height: 100%; }

.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8em; opacity: .85; padding: 14px 18px 0; }
.leyenda span { display: inline-flex; gap: 5px; align-items: center; }
.legal { font-size: .8em; opacity: .75; padding: 12px 18px 8px; margin: 0; }
.pie { text-align: center; font-size: .76em; padding: 8px 18px 28px; opacity: .65; }
.pie a { color: inherit; }
.pie .alta { display: block; margin-top: 4px; font-weight: 700; }

/* Pantallas al abrir: bienvenida y elegir idioma */
.capa { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px;
  padding: 28px; text-align: center; background: var(--bg); color: var(--fg); transition: opacity .45s ease; }
.capa.color { background: var(--c); color: #fff; }
.capa.oculta { opacity: 0; pointer-events: none; }
.capa .hola { font-size: 1rem; opacity: .75; margin: 0; }
.capa .sn { font-family: var(--mt); font-weight: 700; font-size: 2.2rem; line-height: 1.1; margin: 0; max-width: 16ch; }
.capa .otros { font-size: .8rem; opacity: .6; margin: 0; }
.capa .wlogo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: #fff; }
.capa .barra { position: absolute; left: 30%; right: 30%; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); height: 3px; border-radius: 3px; background: color-mix(in srgb, currentColor 15%, transparent); overflow: hidden; }
.capa .barra i { display: block; height: 100%; width: 0; background: currentColor; opacity: .6; animation: llenar var(--dur, 2s) linear forwards; }
.capa .hecho { position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; align-items: center; gap: 6px; font-size: .74rem; opacity: .6; }
.capa .hecho svg { width: 16px; height: 16px; }
.capa.elegir button { font-size: 1.05rem; padding: 12px 18px; border-radius: 14px; border: 1px solid currentColor; background: none; cursor: pointer; display: flex; gap: 12px; align-items: center; justify-content: center; min-width: 220px; }
.capa.elegir .bandera { width: 1.8em; height: 1.2em; }
@keyframes llenar { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .capa { transition: none; }
  .capa .barra i { animation: none; width: 100%; }
  html { scroll-behavior: auto !important; }
}

.pie .hecho-ico { display: inline-block; width: 1.4em; height: 1.4em; vertical-align: -.35em; margin-right: .35em; }
.pie .hecho-ico svg { width: 100%; height: 100%; }

/* Wi-Fi */
.wifi { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .82em; margin: 6px 0 0; }
.wifi .wi { width: 1.2em; height: 1.2em; color: var(--c); display: inline-flex; }
.wifi .wi svg { width: 100%; height: 100%; }
.wifi .copiar { font: inherit; font-size: .9em; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; background: none; color: inherit; cursor: pointer; min-height: 28px; }

/* Barra / Terraza */
.donde { display: inline-flex; margin: 10px 18px 0; border: 1px solid currentColor; border-radius: 99px; overflow: hidden; }
.donde button { font: inherit; font-size: .82em; font-weight: 700; padding: 6px 16px; border: 0; background: none; color: inherit; cursor: pointer; min-height: 34px; opacity: .75; }
.donde button[aria-pressed="true"] { background: var(--c); color: #fff; opacity: 1; }

/* Sección fuera de horario (solo en la vista previa del panel) */
.seccion.fuera { opacity: .45; }
.fuera-nota { font-size: .75em; font-weight: 700; margin: 8px 0 -4px; text-transform: uppercase; letter-spacing: .05em; }

/* Reseñas */
.resena { padding: 4px 18px 12px; margin: 0; }
.resena a { display: inline-block; font-weight: 700; font-size: .9em; color: var(--c); text-decoration: none; border: 1.5px solid var(--c); border-radius: 99px; padding: 8px 14px; }
