/* ==========================================================================
   Totti Pizza - Kebab & Pizzeria (Playa de las Americas, Adeje)
   B22G 2026 - HTML/CSS/JS vanilla, sin framework, compatible con CSP estricta.
   Paleta muestreada del arte real del cliente (menu PSB + flyer).
   ========================================================================== */

:root {
  --red:        #D71219;
  --red-hot:    #ED2124;
  --red-dark:   #A51E22;
  --maroon:     #7D1516;
  --yellow:     #FFDD00;
  --cream:      #FDF4E0;
  --ink:        #1A1A1A;
  --ink-soft:   #4A4A4A;
  --line:       #E6DCC6;
  --white:      #FFFFFF;
  --green:      #25D366;          /* WhatsApp */
  --green-dark: #128C7E;

  --radius:     14px;
  --radius-lg:  24px;
  --shadow:     0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.22);

  /* Archivo variable, autoalojada: dos ejes (peso 400-900, ancho 75-125%).
     Antes esto era Arial Black / Impact / system-ui, que es exactamente lo
     que el gate anti-slop de la casa rechaza: no es una decision tipografica,
     es rendirse a lo que trae el sistema. */
  --fam:  "Archivo", system-ui, sans-serif;
  /* ChunkFive es la tipografia REAL de la marca: es la del rotulo exterior,
     la del flyer y la del cartel de neon. Solo tiene un peso, asi que donde
     se use hay que fijar font-weight:400 o el navegador la engorda a mano y
     la emborrona. */
  --display: "ChunkFive", Rockwell, Georgia, serif;
  --head: 900 1em/1.02 var(--fam);
  --body: 400 1em/1.55 var(--fam);

  --nav-h: 62px;
  --ease:  cubic-bezier(.16, 1, .3, 1);
}

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "ChunkFive";
  src: url("../assets/fonts/chunkfive.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: var(--body);
  color: var(--ink);
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

/* Los titulares grandes van con la letra de la marca. Peso 400 fijo: solo
   hay un corte y si se pide 900 el navegador la engorda sinteticamente. */
h1, h2 {
  font-family: var(--display); font-weight: 400;
  letter-spacing: -.005em; line-height: 1.04; margin: 0;
  text-wrap: balance;
}
h3 {
  font-family: var(--fam); font-weight: 900; font-stretch: 112%;
  letter-spacing: -.02em; line-height: 1.1; margin: 0;
}

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- cabecera */
.hdr {
  position: sticky; top: 0; z-index: 60;
  background: var(--red);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.hdr__in {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--nav-h);
}
.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; font-family: var(--display); font-weight: 400; }
.brand__name { font-size: 1.45rem; letter-spacing: -.02em; }
.brand__sub {
  font-size: .62rem; letter-spacing: .14em; color: var(--yellow);
  text-transform: uppercase; font-weight: 700; white-space: nowrap;
}
.hdr__nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.hdr__nav a {
  text-decoration: none; padding: .5rem .7rem; border-radius: 10px;
  font-weight: 700; font-size: .9rem; white-space: nowrap;
}
.hdr__nav a.is-active { background: rgba(0,0,0,.2); }

.lang { display: flex; gap: 2px; background: rgba(0,0,0,.22); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; color: var(--white); cursor: pointer;
  font: 700 .76rem/1 system-ui, sans-serif; padding: .34rem .54rem; border-radius: 999px;
}
.lang button.is-on { background: var(--yellow); color: var(--ink); }

.cart-btn {
  position: relative; border: 0; cursor: pointer;
  background: var(--yellow); color: var(--ink);
  font: 800 .88rem/1 system-ui, sans-serif;
  padding: .66rem .95rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .4rem;
}
.cart-btn__count {
  background: var(--ink); color: var(--yellow); border-radius: 999px;
  min-width: 1.35em; padding: .1em .35em; font-size: .78rem; text-align: center;
}
.cart-btn[hidden] { display: none; }

/* -------------------------------------------------------------- estado abierto */
.status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 700; font-size: .85rem;
  padding: .3rem .7rem; border-radius: 999px;
  background: rgba(255,255,255,.14); color: var(--white);
}
.status__dot { width: 9px; height: 9px; border-radius: 50%; background: #9e9e9e; flex: 0 0 auto; }
.status.is-open  .status__dot { background: #35D07F; box-shadow: 0 0 0 4px rgba(53,208,127,.22); }
.status.is-closed .status__dot { background: #FF5252; }
.status--light { background: #FFF; color: var(--ink); border: 1px solid var(--line); }
/* En el hero el fondo es crema, no rojo: el blanco sobre blanco no se lee. */
.status--hero { background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------- hero
   Asimetrico 1,05fr / 0,95fr: texto a la izquierda, producto a la derecha.
   Nada centrado, que es el default del que hay que huir. */
.hero {
  position: relative;
  background: var(--cream);
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2rem, 5vw, 3rem);
  overflow: hidden;
}
/* mancha roja de marca detras del producto, no un gradiente de relleno */
.hero::before {
  content: ""; position: absolute; z-index: 0;
  right: -18vw; top: -14vh; width: 78vw; height: 78vw;
  max-width: 920px; max-height: 920px; border-radius: 50%;
  background: radial-gradient(circle, var(--red) 0%, var(--red) 55%, var(--red-dark) 100%);
  opacity: .96;
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; gap: clamp(1rem, 4vw, 3rem);
  grid-template-columns: 1.05fr .95fr; align-items: center;
  min-height: min(78dvh, 640px);
}
/* OJO: nada de max-width en ch aqui. El `ch` se calcula sobre el tamano de
   ESTE elemento (1rem), no sobre el del titular, asi que un "20ch" dejaba la
   columna en ~160px y el h1 salia partido palabra por palabra. La columna de
   la rejilla ya limita el ancho; el titular se controla con el tamano. */
.hero__text { min-width: 0; }
.hero__h1 {
  font-size: clamp(2.3rem, 5.2vw, 4.2rem);
  letter-spacing: -.035em;
  margin: .7rem 0 0;
  text-wrap: pretty;
}
.hero__l1, .hero__l2 { display: block; }
.hero__l1 { color: var(--ink); }
.hero__l2 { color: var(--red); font-stretch: 118%; }
.hero__lead {
  max-width: 34ch; margin: 1.1rem 0 0; color: var(--ink-soft);
  font-size: clamp(1rem, 2.4vw, 1.18rem); line-height: 1.5;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.hero__micro { margin: .85rem 0 0; font-size: .88rem; color: var(--ink-soft); }

.hero__shot { position: relative; justify-self: center; }
.hero__shot img {
  width: min(100%, 520px); height: auto;
  filter: drop-shadow(0 26px 34px rgba(0,0,0,.34));
}

/* --------------------------------------------------- entrada del hero
   Reparto: el titular y el producto son el protagonista, el parrafo y los
   botones le siguen, y la chapa de estado y la letra pequeña solo funden
   sin moverse. El circulo rojo no se mueve: es el fondo.

   Los huecos entre pasos se van ACORTANDO (100, 90, 80, 70 ms). Con huecos
   iguales el grupo entra como un metronomo; acortandolos entra como una ola.
   `both` en el fill es obligatorio: sin el, lo retrasado parpadea en su
   estado final antes de empezar.                                         */
.js .hero__shot img,
.js .hero__h1 .hero__l1,
.js .hero__h1 .hero__l2,
.js .hero__lead,
.js .hero__cta,
.js .hero__micro,
.js .status--hero { animation: heroIn .62s var(--ease) both; }

.js .status--hero   { animation-delay: .08s; animation-name: heroFade; }
.js .hero__h1 .hero__l1 { animation-delay: .15s; }
.js .hero__shot img { animation-delay: .19s; animation-duration: .78s; animation-name: heroShot; }
.js .hero__h1 .hero__l2 { animation-delay: .25s; }
.js .hero__lead     { animation-delay: .34s; animation-name: heroRiseS; }
.js .hero__cta      { animation-delay: .42s; animation-name: heroRiseS; }
.js .hero__micro    { animation-delay: .49s; animation-name: heroFade; }

/* el protagonista recorre mas camino que el acompañamiento */
@keyframes heroIn    { from { opacity: 0; transform: translateY(18px); } }
@keyframes heroRiseS { from { opacity: 0; transform: translateY(9px); } }
@keyframes heroFade  { from { opacity: 0; } }
@keyframes heroShot  { from { opacity: 0; transform: translateY(22px) scale(.96); } }

/* --------------------------------------------------- tira de transparencia */
.facts { background: var(--ink); color: var(--cream); }
.facts__in {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,.14);
  border-inline: 1px solid rgba(255,255,255,.14);
}
.fact { background: var(--ink); padding: 1.05rem 1rem; }
.fact__k {
  display: block; font-family: var(--fam); font-weight: 900; font-stretch: 112%;
  font-size: clamp(1rem, 2.2vw, 1.32rem); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--yellow);
}
.fact__v { display: block; margin-top: .18rem; font-size: .84rem; opacity: .8; }

/* ---------------------------------------------------------------- marquee */
.marquee { overflow: hidden; background: var(--red); color: var(--white); padding: .55rem 0; }
.marquee__track {
  display: flex; width: max-content; gap: 0;
  animation: slide 38s linear infinite;
  font-weight: 900; font-stretch: 118%; letter-spacing: .02em;
  font-size: clamp(.9rem, 2vw, 1.15rem); white-space: nowrap;
}
@keyframes slide { to { transform: translateX(-50%); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; cursor: pointer; text-decoration: none;
  font: 800 1rem/1 var(--fam);
  padding: 1rem 1.5rem; border-radius: 999px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn--xl { padding: 1.15rem 1.9rem; font-size: 1.05rem; }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(215,18,25,.32); }
.btn--ghost   { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn--dark    { background: var(--ink); color: var(--white); }
.btn--wa      { background: var(--green); color: #053D29; }
.btn--wa:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn--block   { width: 100%; }

/* ------------------------------------------------------------- secciones */
.sec { padding: clamp(2.6rem, 7vw, 4.6rem) 0; }
.sec--cream { background: var(--cream); }
.sec--white { background: var(--white); }
.sec--pop   { background: var(--cream); }
.sec--info  { background: var(--white); }
.sec__title { font-size: clamp(1.9rem, 5.4vw, 3rem); color: var(--red); }
.sec__title--light { color: var(--cream); }
.sec__intro { max-width: 52ch; color: var(--ink-soft); margin-top: .6rem; }
.sec__head { margin-bottom: 1.8rem; }
.sec__more { margin-top: 1.8rem; }

/* -------------------------------------------------------- los mas pedidos
   Rejilla deliberadamente desigual: la primera pieza ocupa dos columnas.
   Tres tarjetas identicas en fila es el patron que delata una IA. */
.popgrid { display: grid; gap: .9rem; grid-template-columns: repeat(4, 1fr); }
.pop {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.1rem; display: flex; flex-direction: column; gap: .5rem;
  text-decoration: none; color: inherit;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.pop:active { transform: translateY(-1px); }
.pop--big { grid-column: span 2; }
/* La foto absorbe el alto sobrante: en una rejilla con una pieza a doble
   ancho, las tarjetas pequenas se estiran y sin esto quedan con un hueco
   muerto enorme entre el nombre y el precio. */
.pop__img { width: 100%; flex: 1 1 auto; min-height: 150px; object-fit: contain; background: var(--white); }
.pop--big .pop__img { min-height: 220px; }
.pop__name { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.pop__foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.pop__price {
  font-family: var(--fam); font-weight: 900; font-stretch: 112%;
  font-size: clamp(1.25rem, 3vw, 1.7rem); color: var(--red);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.pop__go { font-size: .82rem; font-weight: 800; color: var(--ink-soft); }

/* ------------------------------------------------------------ pides directo */
.sec--direct { background: var(--maroon); color: var(--cream); }
.direct__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.4rem, 5vw, 3.5rem); align-items: start; }
.direct__lead { margin-top: .9rem; max-width: 36ch; opacity: .88; font-size: 1.05rem; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: baseline;
  padding: 1.1rem 0; border-top: 1px solid rgba(253,244,224,.22);
}
.steps li:last-child { border-bottom: 1px solid rgba(253,244,224,.22); }
.steps b {
  font-family: var(--fam); font-weight: 900; font-stretch: 118%;
  font-size: clamp(1.6rem, 4vw, 2.3rem); color: var(--yellow);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.steps span { font-size: 1.02rem; line-height: 1.5; }

/* --------------------------------------------------------------- resenas
   La nota y las opiniones son REALES, copiadas de la ficha de Google con su
   autor. No se inventa ninguna y no se marca con aggregateRating en el
   schema: Google prohibe expresamente que un negocio se auto-puntue con
   datos estructurados tomados de otro sitio. */
.sec--reviews { background: var(--cream); }
.reviews__grid {
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: clamp(1.4rem, 4vw, 3rem); align-items: start;
}
.score { display: flex; flex-direction: column; gap: .5rem; }
.score__n {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3.4rem, 9vw, 5.4rem); line-height: .9; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.score__stars { display: flex; gap: .18rem; color: #F5B50A; }
.score__stars svg { width: 22px; height: 22px; }
.score__src { color: var(--ink-soft); font-size: .95rem; max-width: 28ch; }
.score__cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }

.quotes { display: grid; gap: .8rem; }
.quote {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.1rem 1.2rem;
}
.quote p { margin: 0 0 .6rem; font-size: 1.02rem; line-height: 1.5; }
.quote footer {
  display: flex; align-items: center; gap: .5rem;
  font-size: .84rem; color: var(--ink-soft);
}
.quote footer b { color: var(--ink); font-weight: 800; }
.quote footer svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .75; }

/* ----------------------------------------------------------- iconos sociales
   Los mismos SVG en linea que el resto de webs de la casa. En linea y no
   desde un CDN porque la CSP de este sitio es default-src 'self': un
   cdn.simpleicons.org saldria bloqueado y no se veria ningun icono. */
.social { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); color: inherit;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.social a svg { width: 20px; height: 20px; }
.social a:active { transform: scale(.94); }
.social--ink a { border-color: var(--line); }

/* ------------------------------------------------------------ texto legal
   Columna estrecha: un texto legal a todo el ancho del wrap no se lee. */
.wrap--txt { max-width: 760px; }
.wrap--txt h2 { font-size: clamp(1.15rem, 3.2vw, 1.5rem); line-height: 1.2; }
.wrap--txt p  { max-width: 68ch; line-height: 1.65; }
.wrap--txt code {
  font-size: .88em; background: rgba(0,0,0,.06);
  padding: .1em .35em; border-radius: 4px;
}

.tabla-env { overflow-x: auto; margin-top: 1.2rem; -webkit-overflow-scrolling: touch; }
.tabla { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tabla th, .tabla td {
  text-align: left; vertical-align: top;
  padding: .7rem .8rem; border-bottom: 1px solid rgba(0,0,0,.12);
}
.tabla thead th { background: rgba(0,0,0,.05); font-weight: 700; }

/* En movil una tabla de 4 columnas obliga a arrastrarla de lado para leerla,
   justo en la pagina que explica lo que hacemos con sus datos. Se apila: cada
   fila pasa a ser una ficha y la cabecera la pone el ::before de cada celda. */
@media (max-width: 620px) {
  .tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr {
    border: 1px solid rgba(0,0,0,.14); border-radius: var(--radius);
    margin-bottom: .9rem; padding: .35rem .25rem; background: rgba(255,255,255,.5);
  }
  .tabla td { border: 0; padding: .45rem .8rem; }
  .tabla td::before {
    content: attr(data-col); display: block;
    font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
    opacity: .62; margin-bottom: .15rem;
  }
}

/* -------------------------------------------------------- aviso de cookies
   Abajo y acotado: no tapa el contenido ni el boton de pedir. Los dos
   botones pesan lo mismo visualmente porque rechazar tiene que costar lo
   mismo que aceptar (criterio de la AEPD). */
.cookies {
  position: fixed; z-index: 80;
  left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 620px; margin-inline: auto;
  background: var(--ink); color: #E6DFD2;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1.05rem 1.15rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem;
  animation: ckIn .45s var(--ease) both .6s;
}
@keyframes ckIn { from { opacity: 0; transform: translateY(14px); } }
.cookies__txt { margin: 0; flex: 1 1 260px; font-size: .88rem; line-height: 1.45; }
.cookies__btns { display: flex; gap: .5rem; flex: 0 0 auto; }
.cookies .btn { padding: .7rem 1.1rem; min-height: 42px; font-size: .9rem; }
.cookies .btn--ghost { color: #E6DFD2; border-color: rgba(230,223,210,.5); }
.cookies .btn--ghost:hover { background: #E6DFD2; color: var(--ink); }

@media (max-width: 560px) {
  .cookies { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .cookies__btns { width: 100%; }
  .cookies .btn { flex: 1 1 0; }
}

/* ------------------------------------------------------------------- mapa
   Carga bajo demanda: el iframe de Google pone cookies en cuanto aparece, y
   soltarlo sin permiso en una web española es un problema de LSSI/RGPD. Hasta
   que el visitante lo pide, aqui no hay ninguna peticion a Google. */
.mapa {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--white);
  min-height: 300px; display: grid; place-items: center; text-align: center;
}
.mapa__aviso { padding: 2rem 1.4rem; max-width: 46ch; }
.mapa__aviso p { color: var(--ink-soft); font-size: .92rem; margin: .5rem 0 1rem; }
.mapa iframe { width: 100%; height: 380px; border: 0; display: block; }

/* ------------------------------------------------------------------ info */
.info__grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); margin-top: 1.8rem; }
.info__card { border-top: 3px solid var(--red); padding-top: 1rem; }
.info__card h3 { font-size: 1rem; color: var(--red); margin-bottom: .45rem; }
.info__card p { margin: .25rem 0; font-size: .95rem; color: var(--ink-soft); }
.u-link { color: var(--red); font-weight: 800; }

/* --------------------------------------------------- reveals al hacer scroll
   El estado oculto cuelga de .js, que lo pone el propio home.js al arrancar.
   Si el JS no llega a ejecutarse, nada se oculta y la pagina se ve entera:
   ocultar por CSS algo que solo puede destapar el JS es como se queda una
   home en blanco sin que nadie se entere. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Las 6 tarjetas de destacados entran en ola, no de golpe ni en fila india.
   Huecos decrecientes (80, 70, 60, 50, 40) y menos recorrido segun avanzan:
   con el mismo retardo para todas, el grupo se mueve como un metronomo.
   El tope son 300 ms: a partir de ahi deja de ser una entrada y es una cola. */
.js .popgrid .pop:nth-child(1) { transition-delay: 0ms; }
.js .popgrid .pop:nth-child(2) { transition-delay: 80ms; }
.js .popgrid .pop:nth-child(3) { transition-delay: 150ms; }
.js .popgrid .pop:nth-child(4) { transition-delay: 210ms; }
.js .popgrid .pop:nth-child(5) { transition-delay: 260ms; }
.js .popgrid .pop:nth-child(6) { transition-delay: 300ms; }
.js .popgrid .pop:nth-child(n+4) { transform: translateY(11px); }

/* Los pasos 01/02/03 se leen en orden, asi que entran en ese orden. */
.js .steps li:nth-child(2) { transition-delay: 90ms; }
.js .steps li:nth-child(3) { transition-delay: 165ms; }

/* --------------------------------------------------- barra modo + aviso */
.modebar { background: var(--white); border-bottom: 1px solid var(--line); padding: .85rem 0; position: sticky; top: var(--nav-h); z-index: 50; }
.modebar__in { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }

.seg { display: inline-flex; background: var(--cream); border: 2px solid var(--line); border-radius: 999px; padding: 4px; }
.seg button {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-soft);
  font: 800 .92rem/1 system-ui, sans-serif; padding: .66rem 1.15rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .4rem; min-height: 42px;
}
.seg button.is-on { background: var(--red); color: var(--white); }

.modenote { font-size: .9rem; color: var(--ink-soft); }
.modenote b { color: var(--red); }

/* ---------------------------------------------------------- nav categorias */
.catnav { background: var(--cream); border-bottom: 1px solid var(--line); padding: .6rem 0; position: sticky; top: calc(var(--nav-h) + 61px); z-index: 45; }
.catnav__in { display: flex; align-items: center; gap: .6rem; }
.catnav select {
  flex: 1 1 auto; max-width: 720px; min-height: 44px;
  font: 700 .95rem/1 system-ui, sans-serif; color: var(--ink);
  background: var(--white); border: 2px solid var(--line); border-radius: 999px;
  padding: .55rem 1rem;
}
.searchbox { display: flex; align-items: center; gap: .4rem; }
.searchbox__btn {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid var(--line); background: var(--white); cursor: pointer;
  font-size: 1.1rem; line-height: 1;
}
.searchbox input {
  width: 0; opacity: 0; padding: 0; border: 2px solid var(--line); border-radius: 999px;
  min-height: 44px; font-size: .95rem; transition: width .25s ease, opacity .2s ease, padding .25s ease;
}
.searchbox.is-open input { width: min(220px, 48vw); opacity: 1; padding: .5rem .9rem; }

/* ------------------------------------------------------------- platos */
.catblock { padding-top: 1.8rem; }
.catblock__h { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; border-bottom: 3px solid var(--red); padding-bottom: .4rem; }
.catblock__h h2 { color: var(--red); font-size: clamp(1.25rem, 3.6vw, 1.7rem); text-transform: uppercase; }
.catblock__h span { font-size: .85rem; color: var(--ink-soft); }
.catblock[hidden] { display: none; }

.dishes { display: grid; gap: .7rem; margin-top: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.dish {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem .95rem; display: flex; flex-direction: column; gap: .45rem;
}
.dish[hidden] { display: none; }
.dish--dim { opacity: .34; }
/* ---- forma de pago en el carrito ---- */
.field--pay { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; margin: 0 0 .8rem; }
.field--pay legend { font-weight: 800; font-size: .9rem; padding: 0 .3rem; }
.seg--pay { display: flex; gap: .5rem; }
.seg--pay button {
  flex: 1 1 0; padding: .6rem .5rem; cursor: pointer; font: inherit; font-weight: 700;
  border: 2px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink-soft);
  transition: background .15s, border-color .15s, color .15s;
}
.seg--pay button:active { transform: translateY(1px); }
.seg--pay button.is-on { background: var(--red); border-color: var(--red); color: #fff; }
.field__hint { margin: .5rem 0 0; font-size: .82rem; color: var(--ink-soft); }
#pay-change-row { margin-top: .6rem; }

/* h1 que existe para Google y para el lector de pantalla, no para el ojo:
   la pagina ya se explica sola con la barra de modo y las categorias. */
.u-h1sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.modebar__h1 { font-size: 1rem; margin: 0; font-family: inherit; }

.dish__top { display: flex; align-items: flex-start; gap: .6rem; }
.dish__head { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: .4rem; }
.dish__img {
  width: 64px; height: 64px; flex: 0 0 auto; border-radius: 10px;
  object-fit: cover; background: #fff; border: 1px solid var(--line);
}
.dish__name { font-weight: 800; font-size: 1rem; line-height: 1.25; }
.dish__ref { color: #B9A98A; font-weight: 800; font-size: .82rem; flex: 0 0 auto; }
.dish__price { font-weight: 900; color: var(--red); font-size: 1.05rem; white-space: nowrap; flex: 0 0 auto; }
.dish__desc { font-size: .86rem; color: var(--ink-soft); line-height: 1.4; }
.dish__foot { display: flex; align-items: center; gap: .5rem; margin-top: auto; flex-wrap: wrap; }

.tag { font: 700 .66rem/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em;
       padding: .28rem .5rem; border-radius: 999px; }
.tag--veg { background: #E7F6EC; color: #1E7A43; }
.tag--sala { background: #F3EDDD; color: #8A7A55; }

.algs { display: flex; flex-wrap: wrap; gap: .25rem; }
.alg {
  width: 26px; height: 26px; border-radius: 50%; color: #fff;
  font: 800 .54rem/26px system-ui, sans-serif; text-align: center; cursor: help;
  flex: 0 0 auto;
}
/* Color por alérgeno en CSS y no en style="": asi el color sobrevive aunque
   se endurezca la CSP a style-src 'self'. Los id son los de menu-data.js. */
.alg--gluten     { background: #C8A165; }
.alg--crustaceos { background: #E0735A; }
.alg--huevos     { background: #F0C330; }
.alg--pescado    { background: #4FA3D1; }
.alg--cacahuetes { background: #B5651D; }
.alg--soja       { background: #8FAE52; }
.alg--lacteos    { background: #6FA8DC; }
.alg--frutos     { background: #A0522D; }
.alg--apio       { background: #7CB342; }
.alg--mostaza    { background: #D4A017; }
.alg--sesamo     { background: #C2B280; }
.alg--sulfitos   { background: #9575CD; }
.alg--altramuces { background: #C0A050; }
.alg--moluscos   { background: #7E8FA6; }

.add {
  margin-left: auto; border: 0; cursor: pointer; background: var(--red); color: var(--white);
  font: 800 .88rem/1 system-ui, sans-serif; padding: .62rem 1rem; border-radius: 999px;
  min-height: 42px; display: inline-flex; align-items: center; gap: .35rem;
}
.add.is-added { background: var(--green-dark); }

/* ------------------------------------------------- filtro de alergenos */
.algfilter { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-top: 1.2rem; }
.algfilter summary { cursor: pointer; font-weight: 800; color: var(--red); }
.algfilter__grid { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; }
.algfilter__grid label {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  border: 2px solid var(--line); border-radius: 999px; padding: .34rem .7rem;
  font-size: .84rem; font-weight: 600; background: var(--cream);
}
.algfilter__grid label:has(input:checked) { border-color: var(--red); background: #FDE9EA; color: var(--red); font-weight: 800; }
.algfilter__note { font-size: .82rem; color: var(--ink-soft); margin-top: .8rem; }

.legal {
  background: #FFF8E1; border: 1px solid #F0DFA8; border-left: 5px solid var(--yellow);
  border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .88rem; color: #5B4A14;
  margin-top: 1.2rem;
}

/* ------------------------------------------------------------ carrito */
.drawer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.drawer.is-open { pointer-events: auto; }
.drawer__veil {
  position: absolute; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .3s ease;
}
.drawer.is-open .drawer__veil { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--cream); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .32s ease;
  box-shadow: var(--shadow-lg);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__head {
  flex: 0 0 auto; background: var(--red); color: var(--white);
  padding: 1rem 1.1rem; display: flex; align-items: center; gap: .7rem;
}
.drawer__head h2 { font-size: 1.15rem; }
.drawer__close {
  margin-left: auto; border: 0; background: rgba(0,0,0,.22); color: #fff;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.drawer__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.1rem; }
.drawer__foot { flex: 0 0 auto; background: var(--white); border-top: 1px solid var(--line); padding: 1rem 1.1rem; }

.line { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.line__name { flex: 1 1 auto; font-weight: 700; font-size: .92rem; line-height: 1.3; }
.line__sub { font-weight: 400; font-size: .78rem; color: var(--ink-soft); }
.line__price { font-weight: 800; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: .1rem; background: var(--white); border: 2px solid var(--line); border-radius: 999px; }
.qty button { border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; font-size: 1.05rem; font-weight: 800; line-height: 1; }
.qty span { min-width: 1.6em; text-align: center; font-weight: 800; font-size: .9rem; }

.cartempty { text-align: center; color: var(--ink-soft); padding: 2.5rem 1rem; }

.field { margin-bottom: .85rem; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  border: 2px solid var(--line); border-radius: 10px; font: inherit; font-size: .95rem;
  background: var(--white);
}
.field textarea { min-height: 76px; resize: vertical; }
.field--half { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.field.is-invalid input, .field.is-invalid select { border-color: var(--red); }

.progress { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: .85rem; }
.progress__bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.progress__fill { height: 100%; background: var(--red); border-radius: 999px; transition: width .3s ease; }
.progress.is-ok .progress__fill { background: var(--green-dark); }
.progress__txt { font-size: .86rem; font-weight: 700; }
.progress.is-ok .progress__txt { color: var(--green-dark); }

.totals { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.25rem; font-weight: 900; margin-bottom: .7rem; }
.totals small { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }

.warn { background: #FDE9EA; border: 1px solid #F3B8BB; border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; color: #8E1B20; margin-bottom: .7rem; }
.warn[hidden] { display: none; }

.linkbtn { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: .82rem; padding: .4rem 0; }

/* ------------------------------------------------------------- info/pie */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); margin-top: 1.6rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.card h3 { color: var(--red); font-size: 1.05rem; margin-bottom: .5rem; }
.card p, .card a { font-size: .95rem; color: var(--ink-soft); }
.card a { color: var(--red); font-weight: 700; }

/* ------------------------------------------------------------------- pie
   El rotulo de neon que B22G le diseño al local, encendido sobre negro.
   Es su marca de verdad, no un adorno: el local abre hasta las 2. */
.ft {
  background: #0D0A0A; color: #CFC7B8; font-size: .92rem;
  padding: 0 0 1.4rem; position: relative;
}
.ft__neon {
  display: block; width: min(560px, 82%); height: auto; margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 2.8rem) 0 clamp(1rem, 3vw, 1.6rem);
  /* El rotulo lleva transparencia real (el alfa se genero desde la
     luminosidad del render). Nada de mix-blend-mode: el fondo del render
     era gris 21,21,21, no negro puro, y "screen" dejaba el rectangulo
     igualmente visible. */
}
.ft__claim {
  text-align: center; margin: 0 0 clamp(1.8rem, 5vw, 2.6rem);
  font-family: var(--fam); font-weight: 800; font-stretch: 110%;
  font-size: clamp(.78rem, 2vw, .92rem); letter-spacing: .18em;
  text-transform: uppercase; color: var(--yellow);
}

.ft__grid {
  display: grid; gap: clamp(1.4rem, 4vw, 2.4rem);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  border-top: 1px solid #262020; padding-top: clamp(1.6rem, 4vw, 2.2rem);
}
.ft__col h3 {
  font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: #7E7569; margin-bottom: .8rem; font-stretch: 100%;
}
.ft__col p { margin: .2rem 0; line-height: 1.55; }
.ft a { color: #CFC7B8; text-decoration: none; }

/* Los dos telefonos son cosas distintas y la gente los confunde: uno es para
   llamar al local y el otro el WhatsApp donde entran los pedidos. */
.ft__tel {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px solid #1C1717;
}
.ft__tel:last-child { border-bottom: 0; }
.ft__tel b {
  font-family: var(--fam); font-weight: 900; font-size: 1.02rem;
  font-variant-numeric: tabular-nums; color: #fff; letter-spacing: -.01em;
}
.ft__tel span { font-size: .78rem; color: #7E7569; }
.ft__wa {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--green); color: #053D29 !important;
  font-weight: 800; padding: .7rem 1.1rem; border-radius: 999px;
  margin-top: .8rem; transition: transform .18s var(--ease);
}

.ft__bot {
  border-top: 1px solid #262020; margin-top: clamp(1.6rem, 4vw, 2.2rem);
  padding-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: space-between; font-size: .8rem; color: #6B6358;
}

/* ------------------------------------------------------- botones flotantes */
.fab { position: fixed; right: 16px; z-index: 55; border: 0; cursor: pointer; border-radius: 999px;
       box-shadow: var(--shadow-lg); font: 800 .92rem/1 system-ui, sans-serif;
       display: inline-flex; align-items: center; gap: .45rem; padding: .95rem 1.25rem; min-height: 52px; text-decoration: none; }
.fab--wa    { bottom: 16px; background: var(--green); color: #053D29; }
.fab--cart  { bottom: 80px; background: var(--red); color: #fff; }
/* unico flotante de la pagina de pedido: verde (acaba en WhatsApp), abajo */
.fab--order { bottom: 16px; background: var(--green); color: #053D29; }
.fab[hidden] { display: none; }

/* Los botones flotantes no deben tapar el final del contenido. */
body { padding-bottom: 92px; }

/* Utilidades (en CSS, no en style="": la CSP de B22G no admite inline). */
.u-push     { margin-left: auto; }
.u-pagebot  { padding-bottom: 5rem; }
.u-mt       { margin-top: 1.6rem; }
.u-why      { font-size: .82rem; color: #8E1B20; margin: .5rem 0 0; text-align: center; }
.u-center   { text-align: center; margin: .3rem 0 0; }
.u-strong   { color: var(--red); font-weight: 800; }
.progress__fill { width: 0; }

/* La asimetria se mantiene en tablet y colapsa a una columna en movil. */
@media (max-width: 960px) {
  .popgrid { grid-template-columns: repeat(2, 1fr); }
  .pop--big { grid-column: span 2; }
  .direct__grid { grid-template-columns: 1fr; }
  .facts__in { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .hero__grid { grid-template-columns: 1fr; min-height: 0; text-align: left; }
  .hero__text { max-width: none; order: 2; }
  .hero__shot { order: 1; }
  .hero__shot img { width: min(88%, 340px); }
  /* El circulo tiene que morir ANTES del titular: el h1 lleva una linea roja
     y sobre el circulo rojo desaparecia. Acotado a la zona de la foto. */
  .hero::before { right: -10vw; top: -6vw; width: 120vw; height: 92vw; }
  .hero__h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
}

@media (max-width: 640px) {
  .hdr__nav a { padding: .45rem .5rem; font-size: .82rem; }
  .brand__sub { display: none; }
  /* la marca debe caber en UNA linea: si parte, aplasta la navegacion */
  .brand { flex: 0 0 auto; }
  .brand__name { font-size: 1.05rem; white-space: nowrap; }
  .hdr__in { gap: .5rem; }
  .cart-btn { padding: .55rem .7rem; font-size: .8rem; }
  .dishes { grid-template-columns: 1fr; }
  .catnav { top: calc(var(--nav-h) + 92px); }
  .popgrid { grid-template-columns: 1fr; }
  .pop--big { grid-column: span 1; }
  .hdr__cta { display: none; }   /* ya hay CTA enorme en el hero */
}


/* ==========================================================================
   Linea base movil (skill mobile-native)
   Nada de esto se reproduce en el emulador del escritorio: son
   comportamientos de hardware real.
   ========================================================================== */

html {
  /* el destello gris que pinta iOS/Android encima de lo que tocas */
  -webkit-tap-highlight-color: transparent;
}

/* iOS hace zoom al enfocar un input de menos de 16px y NO lo deshace al
   salir: el cliente se queda con la pagina ampliada y descuadrada justo en
   el formulario del pedido. En escritorio se mantiene el tamano compacto. */
@media (pointer: coarse) {
  .field input, .field select, .field textarea { font-size: 16px; }
}

/* sin esto el navegador espera ~300ms por si viene un segundo toque */
button, a, [role="button"], .seg button, .fab { touch-action: manipulation; }

/* Al quitar el destello del toque nos hemos quedado SIN ninguna senal al
   pulsar en los botones que no tenian :active propio. Un boton nativo
   responde en cuanto el dedo aterriza; si solo responde al soltar, se
   percibe como lento aunque tarde 0 ms. */
.add, .hdr__nav a, .fab, .cart-btn, .lang button,
.searchbox__btn, .drawer__close, .qty button, .linkbtn {
  transition: transform .12s var(--ease), filter .12s var(--ease);
}
.add:active, .hdr__nav a:active, .fab:active, .cart-btn:active,
.lang button:active, .searchbox__btn:active, .drawer__close:active,
.qty button:active, .linkbtn:active {
  transform: scale(.96);
  filter: brightness(.94);
}

/* mantener pulsado un boton no debe seleccionar su texto. En el cuerpo NO:
   la direccion y el telefono se copian. */
button, [role="button"], .seg button, .fab, .brand {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

/* Los flotantes caian sobre la barra de gestos del iPhone. */
.fab--wa, .fab--order { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.fab--cart { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.drawer__foot { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }

/* El hover solo existe donde hay raton de verdad. En tactil el navegador lo
   deja PEGADO tras el toque: la tarjeta de plato se quedaba levantada y con
   borde rojo despues de tocarla. El feedback tactil va por :active. */
@media (hover: hover) and (pointer: fine) {
  .hdr__nav a:hover { background: rgba(0,0,0,.2); }
  .btn:hover { transform: translateY(-2px); }
  .btn--primary:hover { background: var(--red-hot); box-shadow: 0 10px 26px rgba(215,18,25,.42); }
  .btn--ghost:hover { background: var(--ink); color: var(--cream); }
  .pop:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--red); }
  .seg--pay button:hover { border-color: var(--red); }
  .add:hover { filter: brightness(1.1); }
  .ft a:hover { color: var(--yellow); }
  .ft__wa:hover { transform: translateY(-2px); color: #053D29 !important; }
}

/* ==========================================================================
   Transiciones entre paginas (View Transitions nativas)
   Dos reglas de CSS y cero JavaScript: al ir de la portada a la carta o al
   pedido, el contenido funde en vez de parpadear en blanco. La cabecera y el
   pie llevan nombre propio, asi que se quedan quietos y solo cambia el medio
   — que es lo que hace que parezca una app y no tres paginas sueltas.
   Donde no este soportado, simplemente no pasa nada.
   ========================================================================== */
@view-transition { navigation: auto; }

.hdr { view-transition-name: hdr; }
.ft  { view-transition-name: ft; }

::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .26s;
  animation-timing-function: var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    /* La coreografia se COLAPSA, no se acelera: sin esto los retardos
       siguen corriendo y el grupo aparece a trompicones en vez de junto. */
    animation-delay: 0ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; }
  .reveal, .js .reveal { opacity: 1; transform: none; }
  .js .popgrid .pop:nth-child(n+4) { transform: none; }
}
