/* =========================================================================
   Casa Acueducto
   Av. Acueducto 72, Chapultepec Norte, Morelia, Michoacán
   ========================================================================= */

/* ---------- 1. Tokens ---------- */

:root {
  /* Vino. La marca era #A32C55; --wine es ese color exacto en OKLCH. */
  --wine-900: oklch(0.205 0.072 8);
  --wine-800: oklch(0.272 0.098 7);
  --wine-700: oklch(0.365 0.131 8);
  --wine-600: oklch(0.432 0.148 6);
  --wine: oklch(0.488 0.157 4.34);
  /* Texto vino sobre porcelana. A L=0.585 se quedaba en 4.07:1; no llegaba a AA. */
  --wine-400: oklch(0.542 0.155 4);
  --wine-300: oklch(0.715 0.112 5);
  --wine-200: oklch(0.845 0.062 6);
  --wine-100: oklch(0.928 0.032 8);
  --wine-50: oklch(0.972 0.014 10);

  /* Neutros: ninguno es puro, todos llevan una traza del vino. */
  --ink: oklch(0.215 0.01 12);
  --ink-2: oklch(0.445 0.014 14);
  /* Texto terciario. A L=0.605 daba 3.71:1 y no pasaba AA. */
  --ink-3: oklch(0.532 0.014 16);
  --ink-4: oklch(0.755 0.01 18);
  --rule: oklch(0.905 0.008 20);
  --paper: oklch(0.984 0.004 10);
  --paper-2: oklch(0.963 0.007 12);

  --on-wine: oklch(0.985 0.006 20);
  --on-wine-2: oklch(0.845 0.026 10);

  /* Tipografía */
  --sans: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;

  --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.89rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.25rem, 1.18rem + 0.35vw, 1.42rem);
  --step-2: clamp(1.56rem, 1.44rem + 0.6vw, 1.9rem);
  --step-3: clamp(1.95rem, 1.75rem + 1vw, 2.75rem);
  --step-4: clamp(2.44rem, 2.1rem + 1.7vw, 4rem);
  --step-5: clamp(3.05rem, 2.45rem + 3vw, 6rem);

  /* Ritmo */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;

  --gutter: clamp(1.15rem, 0.7rem + 2.2vw, 2.5rem);
  --measure: 68ch;
  --page: 1180px;

  /* Forma */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  /* Movimiento */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);

  /* Altura real de la barra flotante, para reservar espacio abajo */
  --bar-h: 4.25rem;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

/* ---------- 2. Reset ---------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* El riel pegajoso del menú mide ~7rem; los anclajes no deben quedar debajo. */
  scroll-padding-top: 7.5rem;
}

body {
  min-height: 100svh;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/*
  Sin esto, cualquier regla con `display` explícito (.dish, .search__clear,
  .tabbar) gana sobre el `display:none` que el navegador aplica a [hidden],
  y los elementos filtrados se siguen viendo.
*/
[hidden] {
  display: none !important;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

/* El navegador ya dibuja su propia ✕ en los input[type=search]. Sobra una. */
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/*
  El fieldset no baja de min-content por defecto, así que un hijo ancho con
  overflow-x (la tira de días) lo estira y desborda la página en vez de
  desplazarse dentro. Sin esto, la reserva tiene scroll horizontal en teléfono.
*/
fieldset {
  min-inline-size: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.08;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2.5px solid var(--wine-400);
  outline-offset: 3px;
  border-radius: 6px;
}

.on-dark :where(a, button):focus-visible {
  outline-color: var(--on-wine);
}

::selection {
  background: var(--wine);
  color: var(--on-wine);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 200;
  padding: 0.75rem 1.1rem;
  background: var(--wine);
  color: var(--on-wine);
  border-radius: var(--r-sm);
  font-size: var(--step--1);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------- 3. Tipografía de display ---------- */

.display {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 96;
  letter-spacing: -0.018em;
  line-height: 1.02;
}

.eyebrow {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--wine-400);
}

.on-dark .eyebrow {
  color: var(--wine-200);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
}

/* ---------- 4. Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: 44rem;
}

.section {
  padding-block: var(--s-8);
}

.section--tight {
  padding-block: var(--s-7);
}

.stack > * + * {
  margin-top: var(--s-4);
}

.page-end {
  /* Espacio para que la barra flotante nunca tape el final del contenido. */
  height: calc(var(--bar-h) + var(--safe-b) + var(--s-6));
}

/* ---------- 5. Liquid Glass ---------- */
/*
   Solo para controles que flotan sobre contenido en movimiento.
   Cuatro capas: refracción, tinte, grosor y brillo especular del canto.
*/

.glass {
  position: relative;
  isolation: isolate;
  background: color-mix(in oklch, var(--paper) 62%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.85);
  backdrop-filter: blur(22px) saturate(1.85);
  box-shadow:
    inset 0 1px 0 0 oklch(1 0 0 / 0.72),
    inset 0 -1px 0 0 oklch(1 0 0 / 0.25),
    inset 1px 0 0 0 oklch(1 0 0 / 0.3),
    inset -1px 0 0 0 oklch(1 0 0 / 0.3),
    0 1px 2px oklch(0.205 0.072 8 / 0.05),
    0 8px 26px -6px oklch(0.205 0.072 8 / 0.16);
}

/* El grosor del cristal: un degradado interno, no un color plano. */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    oklch(1 0 0 / 0.42) 0%,
    oklch(1 0 0 / 0.1) 42%,
    oklch(0.972 0.014 10 / 0.16) 100%
  );
}

.glass--dark {
  background: color-mix(in oklch, var(--wine-900) 58%, transparent);
  color: var(--on-wine);
  box-shadow:
    inset 0 1px 0 0 oklch(1 0 0 / 0.2),
    inset 0 -1px 0 0 oklch(1 0 0 / 0.07),
    inset 1px 0 0 0 oklch(1 0 0 / 0.08),
    inset -1px 0 0 0 oklch(1 0 0 / 0.08),
    0 10px 34px -8px oklch(0.205 0.072 8 / 0.5);
}

.glass--dark::before {
  background: linear-gradient(
    to bottom,
    oklch(1 0 0 / 0.14) 0%,
    oklch(1 0 0 / 0.02) 46%,
    oklch(0 0 0 / 0.1) 100%
  );
}

/* Sin backdrop-filter el vidrio se vuelve superficie sólida, no una mancha. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--paper);
  }
  .glass--dark {
    background: var(--wine-900);
  }
  .glass::before {
    display: none;
  }
}

/* ---------- 6. La arcada ---------- */

.arch {
  border-radius: 50% 50% var(--r-md) var(--r-md) / 37.5% 37.5% var(--r-md) var(--r-md);
  overflow: hidden;
}

.arcade {
  display: block;
  width: 100%;
  height: clamp(28px, 5vw, 46px);
  color: var(--wine-200);
}

.on-dark .arcade {
  color: oklch(1 0 0 / 0.16);
}

/* ---------- 7. Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.95rem 1.75rem;
  border-radius: var(--r-pill);
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  transition:
    transform 140ms var(--ease-out),
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--wine);
  color: var(--on-wine);
  box-shadow: 0 6px 18px -6px oklch(0.488 0.157 4.34 / 0.6);
}

.btn--ghost {
  background: transparent;
  color: var(--wine-400);
  box-shadow: inset 0 0 0 1.5px var(--wine-200);
}

.btn--on-dark {
  background: oklch(1 0 0 / 0.1);
  color: var(--on-wine);
  box-shadow: inset 0 0 0 1.5px oklch(1 0 0 / 0.26);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn--block {
  width: 100%;
}

.btn[aria-disabled='true'] {
  background: var(--rule);
  color: var(--ink-2);
  box-shadow: none;
  cursor: not-allowed;
}

.btn[aria-disabled='true']:active {
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: var(--wine-600);
  }
  .btn--ghost:hover {
    background: var(--wine-50);
    box-shadow: inset 0 0 0 1.5px var(--wine-300);
  }
  .btn--on-dark:hover {
    background: oklch(1 0 0 / 0.18);
  }
  .btn[aria-disabled='true']:hover {
    background: var(--rule);
  }
}

/* ---------- 8. Barra de navegación flotante ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(0.7rem + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem;
  border-radius: var(--r-pill);
  width: min(26rem, calc(100vw - 1.6rem));
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  padding: 0.5rem 0.25rem 0.45rem;
  border-radius: var(--r-pill);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 140ms var(--ease-out);
}

.tabbar a:active {
  transform: scale(0.95);
}

.tabbar a svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.6;
}

.tabbar a[aria-current='page'] {
  color: var(--on-wine);
  background: var(--wine);
  box-shadow: 0 3px 12px -3px oklch(0.488 0.157 4.34 / 0.65);
}

@media (hover: hover) and (pointer: fine) {
  .tabbar a:not([aria-current='page']):hover {
    color: var(--wine);
    background: var(--wine-50);
  }
}

/* ---------- 9. Encabezado de página interna ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: var(--s-4);
}

.topbar__logo img {
  height: 2.5rem;
  width: auto;
}

.volver {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem 0.55rem 0.8rem;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper-2);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 140ms var(--ease-out);
}

.volver:active {
  transform: scale(0.96);
}

@media (hover: hover) and (pointer: fine) {
  .volver:hover {
    background: var(--wine-50);
    color: var(--wine);
  }
}

/* En la página de reserva el borde inferior lo ocupa el resumen. */
.tabbar--solo-escritorio {
  display: none;
}

@media (min-width: 60rem) {
  .tabbar--solo-escritorio {
    display: flex;
  }

  .volver {
    display: none;
  }
}

/* ---------- 9b. Cortina de entrada ---------- */

.cortina {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--s-4);
  background: var(--wine-900);
  color: var(--on-wine);
  /*
    Red de seguridad: si el JS no corre, esta animación la retira igual.
    Empieza tarde para no pelearse con el retiro normal.
  */
  animation: cortinaFuera 600ms var(--ease-out) 2.2s forwards;
}

.cortina__arco {
  width: clamp(54px, 13vw, 78px);
  height: auto;
  color: var(--wine-200);
}

/* El arco se dibuja solo: 220 es de sobra para el largo de los dos trazos. */
.cortina__arco path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: trazar 420ms var(--ease-out) forwards;
}

.cortina__arco path:nth-child(2) {
  animation-delay: 100ms;
}

.cortina__texto {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.45);
  opacity: 0;
  animation: fundirEntrada 380ms var(--ease-out) 240ms forwards;
}

.cortina[data-fuera='true'] {
  /* El retiro real gana sobre la red de seguridad. */
  animation: none;
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  transition:
    opacity 520ms var(--ease-out),
    transform 720ms var(--ease-out);
}

@keyframes trazar {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fundirEntrada {
  to {
    opacity: 1;
  }
}

@keyframes cortinaFuera {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Sin JS no hay quien la quite, así que la red de seguridad llega antes. */
@media (scripting: none) {
  .cortina {
    animation-delay: 300ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cortina {
    display: none;
  }
}

/* ---------- 10. Portada ---------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: var(--s-5) var(--gutter) calc(var(--bar-h) + var(--safe-b) + var(--s-5));
  text-align: center;
  color: var(--on-wine);
  background:
    radial-gradient(120% 78% at 50% -12%, var(--wine-800) 0%, transparent 62%),
    linear-gradient(to bottom, var(--wine-900) 0%, oklch(0.172 0.055 10) 100%);
  overflow: hidden;
}

/* La arcada en perspectiva. Va detrás de todo, incluso del patrón SVG. */
.hero__lienzo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Con el lienzo encendido, el patrón plano estorba: se apaga. */
.hero:has(.hero__lienzo:not([hidden])) .hero__arcade {
  opacity: 0;
}

/*
  Velo entre la arcada y el texto. Sin esto el resplandor del punto de fuga cae
  justo detrás del logotipo y le come el contraste. Va debajo del contenido.
*/
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    64% 46% at 50% 46%,
    oklch(0.16 0.05 10 / 0.72) 0%,
    oklch(0.16 0.05 10 / 0.42) 45%,
    transparent 78%
  );
}

/* La arcada de fondo: un patrón SVG, no una fila de divs. */
.hero__arcade {
  transition: opacity 600ms var(--ease-out);
}

.hero__arcade {
  position: absolute;
  inset: auto 0 0 0;
  height: min(46vh, 380px);
  z-index: -1;
  color: oklch(1 0 0 / 0.052);
  -webkit-mask-image: linear-gradient(to top, oklch(0 0 0) 12%, transparent 100%);
  mask-image: linear-gradient(to top, oklch(0 0 0) 12%, transparent 100%);
}

.hero__inner {
  display: grid;
  justify-items: center;
  gap: clamp(0.9rem, 2.5svh, 1.5rem);
  max-width: 38rem;
}

/*
  El logotipo se limita por ALTURA, no por ancho: es muy vertical (900x1381) y
  atado al ancho se comía media pantalla y empujaba los botones bajo la barra.
*/
.hero__titulo {
  margin: 0;
  line-height: 0;
}

.hero__mark {
  height: min(40svh, 24rem);
  width: auto;
  max-width: 84vw;
}

/*
  Parallax de la portada, por capas y ligado al scroll.

  El fondo se queda atrás, el logotipo un poco menos, y el texto con sus botones
  se va al ritmo de la página. Esa diferencia es lo que se lee como profundidad.

  Es CSS nativo: corre fuera del hilo principal y no hay una línea de JS
  escuchando el scroll. Donde no exista `animation-timeline`, no pasa nada y la
  portada se comporta como hasta ahora.

  Va sobre .hero__mark y no sobre .hero__titulo a propósito: el h1 ya lleva la
  animación de entrada y el atajo `animation` se pisaría a sí mismo.
*/
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero__mark {
      animation: parallaxMarca linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100svh;
    }

    .hero__lienzo,
    .hero__arcade {
      animation: parallaxFondo linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100svh;
    }
  }
}

@keyframes parallaxMarca {
  to {
    transform: translateY(22%) scale(0.92);
    opacity: 0.3;
  }
}

@keyframes parallaxFondo {
  to {
    transform: translateY(42%) scale(1.12);
  }
}

.hero__tagline {
  font-size: var(--step-1);
  line-height: 1.42;
  color: var(--on-wine-2);
  max-width: 24ch;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.9rem;
  font-size: var(--step--1);
  color: oklch(1 0 0 / 0.62);
}

/* Si las dos frases se apilan, el punto separador queda colgando solo. */
@media (max-width: 32rem) {
  .hero__meta [aria-hidden='true'] {
    display: none;
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  width: 100%;
}

/* Base angosta para que los dos botones quepan lado a lado en un teléfono chico. */
.hero__actions .btn {
  flex: 1 1 8.5rem;
  max-width: 17rem;
  padding-inline: 1rem;
}

/* Estado del horario, calculado en vivo */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem 0.3rem 0.65rem;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  background: oklch(1 0 0 / 0.08);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.14);
  color: var(--on-wine-2);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  flex: none;
}

.status[data-open='true'] .status__dot {
  background: oklch(0.78 0.17 148);
  box-shadow: 0 0 0 3px oklch(0.78 0.17 148 / 0.22);
}

.status[data-open='false'] .status__dot {
  background: oklch(0.72 0.16 55);
}

.status--light {
  background: var(--wine-50);
  box-shadow: inset 0 0 0 1px var(--wine-100);
  color: var(--wine-400);
}

/* ---------- 11. Bloques editoriales ---------- */

.feature {
  display: grid;
  gap: var(--s-6);
  align-items: center;
}

@media (min-width: 52rem) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
  .feature--flip > :first-child {
    order: 2;
  }
}

.feature__media {
  position: relative;
  aspect-ratio: 3 / 4;
  max-width: 26rem;
  width: 100%;
  margin-inline: auto;
  background: var(--wine-900);
}

.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--s-6) var(--s-4) var(--s-4);
  color: var(--on-wine);
  background: linear-gradient(to top, oklch(0.14 0.04 10 / 0.86), transparent);
  text-align: center;
}

.feature__caption .display {
  font-size: var(--step-2);
}

.feature__caption span {
  display: block;
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.66);
  margin-bottom: 0.4rem;
}

/* ---------- 12. Horarios ---------- */

.hours {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.hours th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-2);
}

.hours td {
  text-align: right;
  color: var(--ink);
  font-weight: 500;
}

.hours th,
.hours td {
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--rule);
}

.hours tr:last-child :is(th, td) {
  border-bottom: 0;
}

.hours tr[data-today='true'] :is(th, td) {
  color: var(--wine);
  font-weight: 700;
}

.hours tr[data-today='true'] th::after {
  content: ' · hoy';
  font-weight: 500;
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- 13. Menú ---------- */

.menu-head {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: 0.6rem;
  background: color-mix(in oklch, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  transition: box-shadow 220ms ease;
}

.menu-head[data-stuck='true'] {
  box-shadow: 0 1px 0 var(--rule), 0 10px 24px -20px oklch(0.205 0.072 8 / 0.5);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.2rem 0.6rem 0.2rem 1rem;
  border-radius: var(--r-pill);
  min-height: 3.1rem;
}

.search svg {
  width: 19px;
  height: 19px;
  color: var(--ink-3);
  flex: none;
}

.search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--step-0);
  padding-block: 0.8rem;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search__clear {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--paper-2);
  transition: transform 140ms var(--ease-out), opacity 160ms ease;
}

.search__clear:active {
  transform: scale(0.9);
}

.search__clear[hidden] {
  display: none;
}

/* Riel de categorías */
.rail {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
  padding: 0.15rem var(--gutter) 0.3rem;
  margin-inline: calc(var(--gutter) * -1);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail a {
  flex: none;
  scroll-snap-align: start;
  padding: 0.55rem 1.05rem;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--paper-2);
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 140ms var(--ease-out);
}

.rail a:active {
  transform: scale(0.95);
}

.rail a[aria-current='true'] {
  background: var(--wine);
  color: var(--on-wine);
}

.rail a small {
  font-size: 0.78em;
  opacity: 0.62;
  margin-left: 0.3rem;
  font-variant-numeric: tabular-nums;
}

/* Secciones y platillos */
.menu-cat {
  padding-top: var(--s-7);
}

.menu-cat__title {
  font-size: var(--step-3);
  color: var(--wine);
}

.menu-cat__count {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-top: var(--s-2);
}

.menu-group {
  margin-top: var(--s-6);
}

.menu-group__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--wine-400);
}

.menu-group__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--wine-100);
}

.menu-group__note {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--step--1);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}

.dish {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem var(--s-4);
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}

.menu-group .dish:last-of-type {
  border-bottom: 0;
}

.dish__name {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.dish__desc {
  grid-column: 1 / -1;
  font-size: var(--step--1);
  line-height: 1.52;
  color: var(--ink-2);
  max-width: 54ch;
}

.dish__price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.dish__prices {
  display: flex;
  gap: 0.9rem;
  white-space: nowrap;
}

.dish__price-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.dish__price-label {
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Resaltado de búsqueda */
mark {
  background: var(--wine-100);
  color: var(--wine-700);
  border-radius: 3px;
  padding: 0 0.12em;
}

.empty {
  padding: var(--s-8) 0;
  text-align: center;
  color: var(--ink-2);
}

.empty .display {
  font-size: var(--step-2);
  color: var(--ink);
  margin-bottom: var(--s-2);
}

/* ---------- 13b. ¿Qué se te antoja? ---------- */

.antojo {
  margin-top: var(--s-6);
  padding: var(--s-5) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
  text-align: center;
}

.antojo__pregunta {
  font-family: var(--display);
  font-variation-settings: 'SOFT' 0, 'WONK' 1, 'opsz' 60;
  font-size: var(--step-2);
  color: var(--wine);
  margin-bottom: var(--s-4);
}

.antojo__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.antojo__chips button {
  padding: 0.6rem 1.15rem;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper-2);
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 140ms var(--ease-out);
}

.antojo__chips button:active {
  transform: scale(0.95);
}

.antojo__chips button[aria-selected='true'] {
  background: var(--wine);
  color: var(--on-wine);
}

@media (hover: hover) and (pointer: fine) {
  .antojo__chips button:not([aria-selected='true']):hover {
    background: var(--wine-50);
    color: var(--wine);
  }
}

.antojo__salida {
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0 0;
  display: grid;
  gap: 0.5rem;
  text-align: left;
  view-transition-name: antojo-salida;
}

.antojo__salida a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'nombre precio'
    'desc   desc';
  gap: 0.15rem 1rem;
  align-items: baseline;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--paper-2);
  transition:
    transform 180ms var(--ease-out),
    background-color 180ms ease;
}

.antojo__salida strong {
  grid-area: nombre;
  font-weight: 600;
}

.antojo__salida span {
  grid-area: desc;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--ink-3);
}

.antojo__salida em {
  grid-area: precio;
  font-style: normal;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--wine);
}

.antojo__salida a:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .antojo__salida a:hover {
    background: var(--wine-50);
  }
}

/* Entran escalonados; el retraso lo pone el índice desde el JS. */
@media (prefers-reduced-motion: no-preference) {
  .antojo__salida li {
    animation: rise 460ms var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 55ms);
  }
}

::view-transition-old(antojo-salida),
::view-transition-new(antojo-salida) {
  animation-duration: 260ms;
  animation-timing-function: var(--ease-out);
}

/* ---------- 14. Reserva ---------- */

.field {
  display: grid;
  gap: 0.45rem;
}

.field > label,
.field-label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-2);
}

.input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1.1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--paper);
  font-size: max(16px, var(--step-0)); /* 16px evita el zoom automático en iOS */
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.input::placeholder {
  color: var(--ink-3);
}

.input:focus {
  outline: none;
  border-color: var(--wine-400);
  box-shadow: 0 0 0 4px oklch(0.488 0.157 4.34 / 0.13);
}

.input[aria-invalid='true'] {
  border-color: oklch(0.58 0.19 28);
}

.input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 4px oklch(0.58 0.19 28 / 0.14);
}

.error {
  font-size: var(--step--1);
  color: oklch(0.52 0.19 28);
  min-height: 1.2em;
}

.error:empty {
  min-height: 0;
}

/* Tira de días */
.tira {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  /* Sangra hasta el borde para que se vea que hay más días. */
  padding: 0.2rem var(--gutter) 0.4rem;
  margin-inline: calc(var(--gutter) * -1);
}

.tira::-webkit-scrollbar {
  display: none;
}

.tira button {
  flex: none;
  scroll-snap-align: center;
  display: grid;
  gap: 0.05rem;
  justify-items: center;
  min-width: 3.6rem;
  padding: 0.6rem 0.55rem 0.7rem;
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-2);
  line-height: 1.15;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 140ms var(--ease-out);
}

.tira button:active {
  transform: scale(0.94);
}

.tira__sem,
.tira__mes {
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tira__num {
  font-size: var(--step-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tira button[aria-checked='true'] {
  background: var(--wine);
  box-shadow: 0 4px 14px -4px oklch(0.488 0.157 4.34 / 0.6);
}

.tira button[aria-checked='true'] :is(.tira__sem, .tira__mes) {
  color: oklch(1 0 0 / 0.75);
}

.tira button[aria-checked='true'] .tira__num {
  color: var(--on-wine);
}

@media (hover: hover) and (pointer: fine) {
  .tira button:not([aria-checked='true']):hover {
    background: var(--wine-50);
  }
}

.tira__lejos {
  margin-top: var(--s-2);
}

.tira__lejos button {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--wine-400);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--wine-200);
}

.tira__lejos input {
  margin-top: var(--s-3);
  max-width: 14rem;
}

/* Segmentado Hoy / Otro día */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.3rem;
  border-radius: var(--r-pill);
  background: var(--paper-2);
}

.segmented__thumb {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  width: calc(50% - 0.3rem);
  height: calc(100% - 0.6rem);
  border-radius: var(--r-pill);
  background: var(--wine);
  box-shadow: 0 3px 10px -3px oklch(0.488 0.157 4.34 / 0.6);
  transition: transform 260ms var(--ease-out);
}

.segmented[data-index='1'] .segmented__thumb {
  transform: translateX(100%);
}

.segmented button {
  position: relative;
  z-index: 1;
  padding: 0.85rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink-2);
  transition: color 200ms ease;
}

.segmented button[aria-selected='true'] {
  color: var(--on-wine);
}

/* Fila de control (personas, hora) */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
}

.control-row__label {
  display: grid;
  gap: 0.1rem;
}

.control-row__label strong {
  font-size: var(--step-0);
  font-weight: 600;
}

.control-row__label span {
  font-size: var(--step--1);
  color: var(--ink-3);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--r-pill);
  background: var(--paper-2);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--paper);
  color: var(--wine);
  font-size: 1.25rem;
  font-weight: 600;
  box-shadow: 0 1px 3px oklch(0.205 0.072 8 / 0.12);
  transition:
    transform 140ms var(--ease-out),
    opacity 180ms ease;
}

.stepper button:active {
  transform: scale(0.9);
}

.stepper button[aria-disabled='true'] {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper button[aria-disabled='true']:active {
  transform: none;
}

.stepper output {
  min-width: 2.4rem;
  text-align: center;
  font-size: var(--step-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Horas sugeridas */
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.slots button {
  padding: 0.6rem 1rem;
  border-radius: var(--r-pill);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--paper-2);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 140ms var(--ease-out);
}

.slots button:active {
  transform: scale(0.94);
}

.slots button[aria-pressed='true'] {
  background: var(--wine);
  color: var(--on-wine);
}

@media (hover: hover) and (pointer: fine) {
  .slots button:not([aria-pressed='true']):hover {
    background: var(--wine-50);
    color: var(--wine);
  }
}

.fecha-larga {
  display: inline-block;
  margin-top: var(--s-3);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--wine-400);
}

.fecha-larga::first-letter {
  text-transform: uppercase;
}

/* Barra de resumen de la reserva */
.summary {
  position: fixed;
  left: 50%;
  bottom: calc(0.7rem + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  width: min(34rem, calc(100vw - 1.6rem));
  padding: 0.85rem 0.9rem 0.9rem;
  border-radius: var(--r-lg);
  display: grid;
  gap: 0.6rem;
}

.summary__line {
  display: grid;
  gap: 0.1rem;
  padding-inline: 0.35rem;
  font-size: var(--step--1);
}

.summary__line strong {
  font-weight: 600;
  color: var(--ink);
}

.summary__line strong::first-letter {
  text-transform: uppercase;
}

.summary__line span {
  font-size: var(--step--2);
  color: var(--ink-3);
}

@media (min-width: 26rem) {
  .summary__line {
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: var(--s-3);
  }

  .summary__line span {
    text-align: right;
  }
}

/* ---------- 15. Pie ---------- */

.footer {
  position: relative;
  padding-block: var(--s-8) var(--s-6);
  color: var(--on-wine-2);
  background: var(--wine-900);
}

.footer__grid {
  display: grid;
  gap: var(--s-6);
}

@media (min-width: 46rem) {
  .footer__grid {
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: var(--s-7);
  }
}

.footer h3 {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: oklch(1 0 0 / 0.6);
  margin-bottom: var(--s-3);
}

.footer a {
  color: var(--on-wine-2);
  transition: color 180ms ease;
}

.footer__mark {
  width: 11rem;
  margin-bottom: var(--s-4);
}

.footer__legal {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid oklch(1 0 0 / 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem var(--s-4);
  justify-content: space-between;
  font-size: var(--step--2);
  color: oklch(1 0 0 / 0.58);
}

@media (hover: hover) and (pointer: fine) {
  .footer a:hover {
    color: var(--on-wine);
  }
}

/* ---------- 16. Hoja de aviso (toast) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + var(--safe-b) + var(--s-5));
  z-index: 90;
  width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem 1.15rem;
  border-radius: var(--r-md);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--on-wine);
  background: var(--wine-900);
  box-shadow: 0 16px 40px -12px oklch(0.205 0.072 8 / 0.55);
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.97);
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out);
  pointer-events: none;
}

.toast[data-show='true'] {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---------- 17. Entradas escalonadas ---------- */

/*
  El ocultado inicial sólo existe si hay JS que lo pueda revelar. Sin esta
  guarda, un error de script dejaría medio sitio invisible para siempre.
*/
@media (scripting: enabled) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
  }
}

.reveal[data-shown='true'] {
  opacity: 1;
  transform: none;
  transition:
    opacity 620ms var(--ease-out),
    transform 620ms var(--ease-out);
}

.hero__inner > * {
  animation: rise 720ms var(--ease-out) backwards;
}

.hero__inner > *:nth-child(1) {
  animation-delay: 60ms;
}
.hero__inner > *:nth-child(2) {
  animation-delay: 150ms;
}
.hero__inner > *:nth-child(3) {
  animation-delay: 225ms;
}
.hero__inner > *:nth-child(4) {
  animation-delay: 300ms;
}
.hero__inner > *:nth-child(5) {
  animation-delay: 375ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 18. Transición entre páginas ---------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 130ms var(--ease-out) both;
}

::view-transition-new(root) {
  animation: vt-in 220ms var(--ease-out) both;
}

/*
  Elementos con continuidad entre páginas. El navegador los saca del recorte
  general y los mueve de una posición a la otra, en vez de fundirlos.

  Cada nombre tiene que ser único por página: sólo hay un logotipo y una barra.
*/
@media (prefers-reduced-motion: no-preference) {
  .hero__mark,
  .topbar__logo img {
    view-transition-name: marca;
  }

  .tabbar {
    view-transition-name: barra;
  }

  .menu-head {
    view-transition-name: cabecera-menu;
  }
}

/* El logotipo viaja; el cambio de versión (blanca a oscura) se funde encima. */
::view-transition-group(marca) {
  animation-duration: 420ms;
  animation-timing-function: var(--ease-in-out);
}

::view-transition-old(marca),
::view-transition-new(marca) {
  animation-duration: 420ms;
  animation-timing-function: var(--ease-out);
  /* Sin esto las dos versiones se estiran una sobre otra y se deforman. */
  height: 100%;
  object-fit: contain;
}

/* La barra no se vuelve a dibujar: se queda quieta y sólo cambia lo activo. */
::view-transition-group(barra) {
  animation-duration: 300ms;
  animation-timing-function: var(--ease-out);
}

::view-transition-group(cabecera-menu) {
  animation-duration: 320ms;
  animation-timing-function: var(--ease-out);
}

@keyframes vt-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
  }
}

/* ---------- 19. Movimiento reducido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Se van los desplazamientos, se quedan las opacidades. */
  .reveal,
  .hero__inner > * {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .segmented__thumb {
    transition: none;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

/* ---------- 20. Escritorio ---------- */

@media (min-width: 60rem) {
  :root {
    --bar-h: 0rem;
  }

  /* En escritorio la barra flotante se vuelve una cabecera. */
  .tabbar {
    top: 1rem;
    bottom: auto;
    left: auto;
    right: var(--gutter);
    transform: none;
    width: auto;
    gap: 0.2rem;
  }

  .tabbar a {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    font-size: var(--step--1);
  }

  .tabbar a svg {
    width: 18px;
    height: 18px;
  }

  .page-end {
    height: var(--s-7);
  }

  .summary {
    bottom: 1.5rem;
  }

  .toast {
    bottom: 1.5rem;
  }


  .hero {
    padding-bottom: var(--s-8);
  }

  /* Sin barra abajo hay sitio: el logotipo puede ocupar lo que merece. */
  .hero__mark {
    height: min(52svh, 30rem);
  }

  /*
    La barra flotante pasa a ser cabecera arriba a la derecha, así que el
    encabezado pegajoso del menú se estaciona debajo en vez de chocar con ella.
  */
  .menu-head {
    top: 5.5rem;
  }

  /*
    140 platillos en una sola columna de 1100px dejan el precio a un palmo del
    nombre. Dos columnas es como se lee una carta impresa.
  */
  .menu-group {
    columns: 2;
    column-gap: var(--s-7);
  }

  .menu-group__title {
    column-span: all;
  }

  .dish {
    break-inside: avoid;
  }
}

@media print {
  .tabbar,
  .summary,
  .toast,
  .menu-head {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .dish {
    break-inside: avoid;
  }
}
