/* ---------- Variables ---------- */
:root {
  /* Todos los pares medidos (AA) sobre --color-fondo y --color-superficie. */
  --color-fondo: #17110d;
  --color-superficie: #211915;
  --color-superficie-alta: #2a1f19;
  --color-crema: #f3e7d6;        /* texto: 15,3:1 */
  --color-crema-suave: #b9a894;  /* texto secundario: ≥7,4:1 */
  --color-cobre: #c8814a;        /* acento y foco: ≥5,5:1; botones con texto oscuro */
  --color-cobre-claro: #e0a37a;
  --color-cafe: #6b4a34;         /* solo decorativo (2,4:1) */
  --color-borde: #8a6a52;        /* bordes de controles: ≥3,5:1 */
  --color-error: #f19a8a;
  --color-exito: #8fd1a4;
  --color-foco: var(--color-cobre);

  --radio: 14px;
  --radio-grande: 24px;
  --sombra: 0 18px 40px rgba(0, 0, 0, 0.35);
  --ancho-max: 1200px;
  --alto-cabecera: 4.5rem;
  --curva: cubic-bezier(0.22, 1, 0.36, 1);

  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-titulos: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  color-scheme: dark;
}

/* ---------- Reset mínimo ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-crema);
  background-color: var(--color-fondo);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-foco);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background-color: var(--color-crema);
  color: var(--color-fondo);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

#main:focus {
  outline: none;
}

/* ---------- Layout y tipografía ---------- */
.container {
  width: 100%;
  max-width: var(--ancho-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: clamp(4.5rem, 3rem + 6vw, 8rem);
  scroll-margin-top: var(--alto-cabecera);
}

.section--surface {
  background-color: var(--color-superficie);
}

.eyebrow {
  margin-bottom: 0.9rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-cobre);
}

.section__title {
  margin-bottom: 1.5rem;
  font-family: var(--fuente-titulos);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section__intro {
  max-width: 58ch;
  margin-bottom: 2.5rem;
  color: var(--color-crema-suave);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.8rem;
  border: 1px solid var(--color-cobre);
  border-radius: 999px;
  background-color: var(--color-cobre);
  color: var(--color-fondo);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  border-color: #d99462;
  background-color: #d99462;
}

.btn--ghost {
  border-color: var(--color-borde);
  background-color: transparent;
  color: var(--color-crema);
}

.btn--ghost:hover {
  border-color: var(--color-crema);
  background-color: rgba(243, 231, 214, 0.06);
}

.btn--small {
  padding: 0.55rem 1.2rem;
  font-size: 0.9375rem;
}

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

.link-btn {
  padding: 0.4rem;
  border: 0;
  background: none;
  color: var(--color-crema-suave);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--color-crema);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--color-borde);
  border-radius: 50%;
  background: transparent;
  color: var(--color-crema);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--color-crema);
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform 0.2s var(--curva), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .btn:hover {
    transform: translateY(-2px);
  }
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  background-color: rgba(23, 17, 13, 0.94);
  box-shadow: 0 1px 0 rgba(138, 106, 82, 0.35);
}

@supports (backdrop-filter: blur(1px)) {
  .site-header.is-scrolled,
  .site-header.is-open {
    background-color: rgba(23, 17, 13, 0.78);
    backdrop-filter: blur(16px) saturate(130%);
  }
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: var(--alto-cabecera);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: auto;
  text-decoration: none;
}

.brand__mark {
  width: 1.9rem;
  height: 1.9rem;
  fill: var(--color-cafe);
  stroke: var(--color-cobre);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.brand__text {
  font-family: var(--fuente-titulos);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  order: 2;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  order: 1;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-nav__list a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--color-crema-suave);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav__list a:hover {
  color: var(--color-crema);
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--color-borde);
  border-radius: 999px;
  background: transparent;
  color: var(--color-crema);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cart-btn[hidden] {
  display: none;
}

.cart-btn:hover {
  border-color: var(--color-crema);
}

.cart-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.cart-btn__count {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background-color: var(--color-cobre);
  color: var(--color-fondo);
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
  .cart-btn__count.is-bumped {
    animation: bump 0.4s var(--curva);
  }
}

@keyframes bump {
  40% {
    scale: 1.35;
  }
}

.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--color-borde);
  border-radius: 50%;
  background: transparent;
  color: var(--color-crema);
  cursor: pointer;
}

.nav-toggle[hidden] {
  display: none;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform 0.25s var(--curva);
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -5px;
}

.nav-toggle__bars::after {
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-5px) rotate(-45deg);
}

/* Menú desplegable en móvil: solo se pliega cuando hay JS (.has-js). */
@media (max-width: 899px) {
  .site-nav {
    order: 3;
    flex-basis: 100%;
  }

  .site-header.has-js .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 1.25rem;
  }

  .site-header.has-js .site-nav.is-open {
    display: flex;
  }

  .site-header.has-js .site-nav__list {
    flex-direction: column;
  }

  .site-header.has-js .site-nav__list a {
    display: block;
    padding-block: 0.8rem;
    border-bottom: 1px solid rgba(138, 106, 82, 0.35);
    font-family: var(--fuente-titulos);
    font-size: 1.25rem;
    font-weight: 400;
  }

  .site-header.has-js .site-nav .btn {
    margin-top: 0.75rem;
  }

  .cart-btn__label {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--alto-cabecera) + 2rem) 3rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 72% 45%, rgba(200, 129, 74, 0.2), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(107, 74, 52, 0.35), transparent 50%),
    var(--color-fondo);
}

/* Grano de película sutil sobre todo el hero. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero__text .eyebrow {
  margin: 0;
}

.hero__title {
  max-width: 13ch;
  font-family: var(--fuente-titulos);
  font-size: clamp(2.6rem, 1.2rem + 4.6vw, 5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero__title em {
  display: block;
  color: var(--color-cobre-claro);
}

.hero__subtitle {
  max-width: 44ch;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  color: var(--color-crema-suave);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.open-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(138, 106, 82, 0.6);
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--color-crema-suave);
}

.open-status__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background-color: var(--color-crema-suave);
}

.open-status.is-open .open-status__dot {
  background-color: var(--color-exito);
  box-shadow: 0 0 0 4px rgba(143, 209, 164, 0.18);
}

.open-status.is-closed .open-status__dot {
  background-color: var(--color-error);
}

.hero__visual {
  position: relative;
  width: 100%;
  max-width: 38rem;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}

/* Halo cobre detrás de la taza. Va en CSS y no en la escena para que no
   quede cortado por el borde del canvas. */
.hero__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(200, 129, 74, 0.28), rgba(200, 129, 74, 0.08) 45%, transparent 70%);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}

/* hero3d.js añade .is-3d-ready cuando ya ha dibujado el primer fotograma. */
.hero__visual.is-3d-ready .hero__canvas {
  opacity: 1;
}

.hero__visual.is-3d-ready .hero__fallback {
  opacity: 0;
  visibility: hidden;
}

/* Alternativa: sin JS, sin WebGL o desde file://. La foto se funde con el fondo. */
.hero__fallback {
  position: absolute;
  inset: 6%;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.hero__fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle, #000 55%, transparent 72%);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__text > * {
    animation: fade-up 1s var(--curva) both;
  }

  .hero__text > :nth-child(2) { animation-delay: 0.08s; }
  .hero__text > :nth-child(3) { animation-delay: 0.16s; }
  .hero__text > :nth-child(4) { animation-delay: 0.24s; }
  .hero__text > :nth-child(5) { animation-delay: 0.32s; }

  .hero__visual {
    animation: fade-in 1.4s ease 0.2s both;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    translate: 0 28px;
  }
}

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

/* ---------- Cinta ---------- */
.ticker {
  overflow: hidden;
  border-block: 1px solid rgba(138, 106, 82, 0.4);
  background-color: var(--color-superficie);
}

.ticker__track {
  display: flex;
  width: max-content;
  padding-block: 1.1rem;
  font-family: var(--fuente-titulos);
  font-size: clamp(1.125rem, 1rem + 0.8vw, 1.6rem);
  font-style: italic;
  white-space: nowrap;
  color: var(--color-crema-suave);
}

.ticker__track span {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
}

.ticker__track span::after {
  content: "✦";
  font-size: 0.7em;
  font-style: normal;
  color: var(--color-cobre);
}

/* La pista está duplicada: desplazarla la mitad hace el bucle continuo. */
@media (prefers-reduced-motion: no-preference) {
  .ticker__track {
    animation: ticker 38s linear infinite;
  }

  .ticker:hover .ticker__track {
    animation-play-state: paused;
  }
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Nuestro café ---------- */
.story {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.story__text p:not(.eyebrow) {
  max-width: 54ch;
  margin-bottom: 1.1rem;
  color: var(--color-crema-suave);
}

.story__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(138, 106, 82, 0.4);
  font-size: 0.9375rem;
  color: var(--color-crema-suave);
}

.story__facts strong {
  display: block;
  font-family: var(--fuente-titulos);
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-cobre-claro);
}

.story__figure {
  position: relative;
}

.story__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radio-grande);
}

.story__badge {
  position: absolute;
  left: -0.75rem;
  bottom: 1.5rem;
  padding: 1rem 1.3rem;
  border-radius: var(--radio);
  background-color: var(--color-crema);
  color: var(--color-fondo);
  font-family: var(--fuente-titulos);
  font-size: 1.2rem;
  box-shadow: var(--sombra);
}

.story__badge strong {
  font-style: italic;
  font-weight: 400;
  color: #8a4c22;
}

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter {
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--color-borde);
  border-radius: 999px;
  background: transparent;
  color: var(--color-crema);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter:hover {
  border-color: var(--color-crema);
}

.filter[aria-pressed="true"] {
  border-color: var(--color-cobre);
  background-color: var(--color-cobre);
  color: var(--color-fondo);
}

.filters__status {
  margin: 1rem 0 2rem;
  font-size: 0.875rem;
  color: var(--color-crema-suave);
}

/* ---------- Carta ---------- */
.menu {
  display: grid;
  gap: 0.5rem 3rem;
}

.menu-item {
  display: flex;
  gap: 1.1rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid rgba(138, 106, 82, 0.3);
}

.menu-item[hidden] {
  display: none;
}

.menu-item__thumb {
  flex-shrink: 0;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: var(--radio);
}

.menu-item__thumb--mono {
  display: grid;
  place-items: center;
  border: 1px solid rgba(138, 106, 82, 0.5);
  background:
    radial-gradient(circle at 30% 25%, rgba(200, 129, 74, 0.22), transparent 60%),
    var(--color-superficie-alta);
  font-family: var(--fuente-titulos);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--color-cobre-claro);
}

.menu-item__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  flex-grow: 1;
  min-width: 0;
}

.menu-item__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
}

.menu-item__name {
  font-family: var(--fuente-titulos);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.25;
}

.menu-item__dots {
  flex-grow: 1;
  min-width: 1rem;
  border-bottom: 2px dotted rgba(138, 106, 82, 0.7);
  transform: translateY(-0.3rem);
}

.menu-item__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-cobre-claro);
  white-space: nowrap;
}

.menu-item__desc {
  font-size: 0.9375rem;
  color: var(--color-crema-suave);
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--color-cobre);
  border-radius: 999px;
  background: transparent;
  color: var(--color-crema);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.add-btn::before {
  content: "+";
  font-size: 1.05em;
  line-height: 1;
}

.add-btn[hidden] {
  display: none;
}

.add-btn:hover {
  background-color: var(--color-cobre);
  color: var(--color-fondo);
}

@media (prefers-reduced-motion: no-preference) {
  .menu-item.is-entering {
    animation: fade-up 0.5s var(--curva) both;
  }
}

/* ---------- Galería ---------- */
.gallery {
  columns: 1;
  column-gap: 1rem;
}

.gallery__item {
  margin-bottom: 1rem;
  break-inside: avoid;
}

.gallery__button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radio);
  overflow: hidden;
  background-color: var(--color-superficie);
  color: var(--color-crema);
  font: inherit;
  cursor: zoom-in;
}

.gallery__button img {
  width: 100%;
  transition: transform 0.8s var(--curva), filter 0.4s ease;
  filter: saturate(0.9);
}

.gallery__caption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.5rem 1rem 0.85rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery__button:hover .gallery__caption,
.gallery__button:focus-visible .gallery__caption {
  opacity: 1;
}

.gallery__button:hover img,
.gallery__button:focus-visible img {
  filter: saturate(1.05);
}

@media (prefers-reduced-motion: no-preference) {
  .gallery__button:hover img,
  .gallery__button:focus-visible img {
    transform: scale(1.05);
  }
}

@media (hover: none) {
  .gallery__caption {
    opacity: 1;
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: 0;
  background-color: rgba(10, 7, 5, 0.97);
  color: var(--color-crema);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.lightbox::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-width: 0;
  height: 100%;
  touch-action: pan-y;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.9rem;
  max-width: 70ch;
  font-size: 0.9375rem;
  text-align: center;
  color: var(--color-crema-suave);
}

.lightbox__counter {
  color: var(--color-crema);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lightbox__desc {
  flex-basis: 100%;
  color: var(--color-crema);
}

.lightbox__btn {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--color-borde);
  border-radius: 50%;
  background-color: rgba(243, 231, 214, 0.06);
  color: var(--color-crema);
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__btn:hover {
  border-color: var(--color-crema);
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  font-size: 1.2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] .lightbox__img {
    animation: zoom-in 0.35s var(--curva);
  }
}

@keyframes zoom-in {
  from {
    opacity: 0;
    scale: 0.96;
  }
}

/* ---------- Reservas y formularios ---------- */
.booking {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

.booking__intro p:not(.eyebrow) {
  max-width: 46ch;
  margin-bottom: 1rem;
  color: var(--color-crema-suave);
}

.booking__intro a {
  color: var(--color-cobre-claro);
  font-weight: 700;
}

.card {
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 1px solid rgba(138, 106, 82, 0.35);
  border-radius: var(--radio-grande);
  background-color: var(--color-fondo);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form__row {
  display: grid;
  gap: 1.1rem;
}

.form__note {
  font-size: 0.875rem;
  color: var(--color-crema-suave);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  font-weight: 600;
}

.field__optional {
  font-weight: 400;
  color: var(--color-crema-suave);
}

.field__required {
  color: var(--color-error);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--color-borde);
  border-radius: 12px;
  background-color: var(--color-superficie);
  color: var(--color-crema);
  font: inherit;
  transition: border-color 0.2s ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--color-foco);
}

.field [aria-invalid="true"] {
  border-color: var(--color-error);
}

.field__error {
  min-height: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-error);
}

/* Regiones vivas: nunca se ocultan con display/hidden; vacías no ocupan espacio. */
.form__success {
  padding: 0.85rem 1rem;
  border: 1px solid rgba(143, 209, 164, 0.45);
  border-radius: 12px;
  background-color: rgba(143, 209, 164, 0.1);
  color: var(--color-exito);
  font-weight: 600;
}

.form__success:empty {
  padding: 0;
  border: 0;
}

/* ---------- Visítanos ---------- */
.visit {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.visit__address {
  margin-bottom: 1.25rem;
  font-family: var(--fuente-titulos);
  font-size: 1.5rem;
  font-style: normal;
  line-height: 1.35;
}

.visit__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.visit__links a {
  color: var(--color-cobre-claro);
  font-weight: 700;
}

.hours {
  width: 100%;
  border-collapse: collapse;
}

.hours__caption {
  margin-bottom: 0.75rem;
  font-family: var(--fuente-titulos);
  font-size: 1.5rem;
  text-align: left;
}

.hours th,
.hours td {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(138, 106, 82, 0.3);
  text-align: left;
}

.hours th {
  font-weight: 600;
}

.hours td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--color-cobre-claro);
  font-weight: 700;
}

/* ---------- Pedido (cajón lateral) ---------- */
.drawer {
  width: min(26rem, 100%);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(138, 106, 82, 0.4);
  background-color: var(--color-superficie);
  color: var(--color-crema);
}

/* Todo el panel hace scroll: en pantallas bajas el formulario no aplasta
   la lista de productos. */
.drawer[open] {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

@supports (backdrop-filter: blur(1px)) {
  .drawer::backdrop {
    backdrop-filter: blur(3px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .drawer[open] {
    animation: slide-in 0.4s var(--curva);
  }
}

@keyframes slide-in {
  from {
    translate: 100% 0;
  }
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(138, 106, 82, 0.35);
}

.drawer__title {
  font-family: var(--fuente-titulos);
  font-size: 1.75rem;
  font-weight: 400;
}

.drawer__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 0 auto;
  padding: 1.25rem 1.5rem;
}

.drawer__empty {
  color: var(--color-crema-suave);
}

.drawer__empty[hidden] {
  display: none;
}

.drawer__empty a {
  color: var(--color-cobre-claro);
  font-weight: 700;
}

.drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(138, 106, 82, 0.35);
  background-color: var(--color-fondo);
}

.drawer__foot[hidden] {
  display: none;
}

.drawer__note {
  font-size: 0.8125rem;
  color: var(--color-crema-suave);
}

.order-lines {
  display: grid;
  gap: 0.25rem;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  padding-block: 0.85rem;
  border-bottom: 1px solid rgba(138, 106, 82, 0.3);
}

.order-line__name {
  font-family: var(--fuente-titulos);
  font-size: 1.15rem;
}

.order-line__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-cobre-claro);
  text-align: right;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.qty__btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--color-borde);
  border-radius: 50%;
  background: transparent;
  color: var(--color-crema);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.qty__btn:hover {
  border-color: var(--color-crema);
}

.qty__value {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.order-line__unit {
  font-size: 0.8125rem;
  color: var(--color-crema-suave);
  text-align: right;
}

.order-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.05rem;
}

.order-total strong {
  font-family: var(--fuente-titulos);
  font-size: 1.75rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* ---------- Aviso flotante ---------- */
/* Es una región viva: se "oculta" vaciándola, nunca con display: none. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 60;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background-color: var(--color-crema);
  color: var(--color-fondo);
  font-weight: 600;
  box-shadow: var(--sombra);
  transform: translateX(-50%);
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.toast:empty {
  opacity: 0;
  padding: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: opacity 0.25s ease, translate 0.35s var(--curva);
  }

  .toast:empty {
    translate: 0 1rem;
  }
}

/* ---------- Animación al hacer scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--curva);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Footer ---------- */
.footer {
  padding-block: 4rem 2rem;
  border-top: 1px solid rgba(138, 106, 82, 0.35);
  font-size: 0.9375rem;
}

.footer__inner {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(138, 106, 82, 0.25);
}

.footer .brand {
  margin-right: 0;
}

.footer__tagline {
  margin-top: 0.6rem;
  color: var(--color-crema-suave);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.footer__links a {
  font-weight: 600;
  text-decoration: none;
}

.footer__links a:hover {
  text-decoration: underline;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-crema-suave);
}

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .gallery {
    columns: 2;
  }

  .form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form__row--3 {
    grid-template-columns: 1.3fr 1fr 0.8fr;
  }
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .lightbox {
    padding: 2rem;
  }
}

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    order: 1;
  }

  .hero__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .hero__visual {
    max-width: none;
  }

  .story {
    grid-template-columns: 1.05fr 1fr;
    gap: 5rem;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
  }

  .booking__intro {
    position: sticky;
    top: calc(var(--alto-cabecera) + 2rem);
  }

  .visit {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

@media (min-width: 1024px) {
  .gallery {
    columns: 3;
  }
}
