/* =========================================================
   Las Flautas de Mitras · Estilos
   ========================================================= */

:root {
  --rosa: #E8195B;          /* color del logo */
  --rosa-oscuro: #C4104A;
  --rosa-suave: #FFF0F4;
  --blanco: #FFFFFF;
  --tinta: #231A1E;
  --tinta-suave: #6B5E63;
  --borde: #E6E6E6;
  --wa: #25D366;
  --wa-oscuro: #1DA851;

  --fuente-titulos: "Baloo 2", "Nunito", system-ui, sans-serif;
  --fuente-texto: "Nunito", system-ui, -apple-system, sans-serif;

  --radio: 18px;
  --ancho: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--fuente-texto);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--blanco);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rosa); }

h1, h2, h3 {
  font-family: var(--fuente-titulos);
  line-height: 1.1;
  margin: 0;
}

p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 0 16px;
}

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.4em;
  border-radius: 999px;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease;
}

.btn--wa {
  background: var(--wa);
  color: #fff;
}
.btn--wa:hover { background: var(--wa-oscuro); }

.btn--ghost {
  background: transparent;
  color: var(--rosa);
  border: 2px solid var(--rosa);
}
.btn--ghost:hover { background: var(--rosa-suave); }

.btn--lg { font-size: 1.1rem; padding: .95em 1.7em; }
.btn--sm { font-size: .9rem; padding: .6em 1.1em; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--tinta);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-size: .95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blanco);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 104px;
  transition: height .25s ease;
}
.header__brand img {
  width: 88px;
  height: 88px;
  transition: width .25s ease, height .25s ease;
}

/* Estado compacto al hacer scroll */
.header--compact .header__inner { height: 68px; }
.header--compact .header__brand img { width: 52px; height: 52px; }

.nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  color: var(--tinta);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav a.is-active { background: var(--rosa-suave); color: var(--rosa); }

.header__cta { margin-left: auto; }
.header__cta-label::after { content: ":"; }
.header__cta-phone { font-variant-numeric: tabular-nums; }

@media (max-width: 400px) {
  .header__cta-label { display: none; }
}
@media (min-width: 768px) {
  .nav { display: flex; }
  .header__cta { margin-left: 0; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .header, .header__brand img, .header__inner { transition: none; }
}

/* ---------- Secciones de menú ---------- */
.menu-section { padding: 44px 0; }
.menu-section:first-child { padding-top: 32px; }

.section-head {
  text-align: center;
  margin-bottom: 24px;
}

/* Móvil: bloques más compactos */
@media (max-width: 559px) {
  .menu-section { padding: 28px 0; }
  .menu-section:first-child { padding-top: 24px; }
  .section-head { margin-bottom: 16px; }
  .grid { gap: 14px; }
}
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--tinta);
}
.section-head p { color: var(--tinta-suave); margin-top: 6px; }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .grid--main { grid-template-columns: repeat(2, 1fr); }
  .grid--small { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid--main { grid-template-columns: repeat(4, 1fr); }
  .grid--small { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Tarjetas ---------- */
.card {
  position: relative;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card__media {
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media { cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.card__media:focus-visible { outline: 3px solid var(--rosa); outline-offset: -3px; }

.card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card__title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.card h3 { font-size: 1.25rem; font-weight: 800; }
.card p { color: var(--tinta-suave); font-size: .95rem; flex: 1; }

.price {
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--rosa);
  white-space: nowrap;
}

.card__cta { margin-top: 6px; width: 100%; }

/* Tarjetas pequeñas (extras y bebidas): tipografía un poco más compacta */
.card--small h3 { font-size: 1.05rem; }
.card--small .price { font-size: 1.1rem; }
.card--small p { font-size: .88rem; }

/* Móvil: foto más baja para no ocupar tanto espacio vertical */
@media (max-width: 559px) {
  .card__media {
    aspect-ratio: auto;
    height: 200px;
  }
  .card__media img { object-fit: contain; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--tinta);
  color: rgba(255, 255, 255, .8);
  padding: 36px 0 110px;   /* espacio para el botón flotante */
  font-size: .95rem;
}
.footer__inner {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}
.footer__brand {
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
}
.footer a { color: #fff; font-weight: 700; }
.footer__copy { font-size: .85rem; color: rgba(255, 255, 255, .55); }

@media (min-width: 768px) {
  .footer { padding-bottom: 96px; }
  .footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
    justify-items: start;
  }
  .footer__copy { justify-self: end; }
}

/* ---------- Lightbox ----------
   El propio <dialog> es el overlay a pantalla completa. Así el fondo negro y el
   centrado no dependen de ::backdrop ni del centrado automático del navegador,
   que Safari en iOS maneja distinto a Chrome. */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: rgba(0, 0, 0, .85);
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: transparent; }
body:has(.lightbox[open]) { overflow: hidden; }

.lightbox__box {
  position: relative;
  width: 100%;
  max-width: 640px;
}
.lightbox__img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: var(--blanco);
  border-radius: var(--radio);
}
.lightbox__caption {
  text-align: center;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: 1.15rem;
}
.lightbox__price { color: var(--rosa); margin-left: 6px; }
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--blanco);
  color: var(--tinta);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.lightbox__close:hover { background: var(--borde); }

/* ---------- Botón flotante WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 999px;
  transition: background .15s ease;
}
.wa-float:hover { background: var(--wa-oscuro); }
.wa-float .icon { width: 28px; height: 28px; }

@media (max-width: 480px) {
  .wa-float { padding: 14px; }
  .wa-float__label { display: none; }
}
