/* ============================================================
   BRASSAS — Fuego · Mar · Humo
   Shared stylesheet for the mobile-only digital menu.
   Design: solid black, white typography, 3-column category grid.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --text: #ffffff;
  --text-dim: #b8b8b8;
  --radius-card: 18px;
  --radius-btn: 999px;

  --gap: 12px;              /* gap between category cards          */
  --page-pad: 16px;         /* horizontal page padding             */
  --max-width: 480px;       /* mobile-only container width         */

  /* iPhone safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;                 /* never scroll horizontally */
  min-height: 100vh;
  min-height: 100dvh;
}

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

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* Mobile-only container: centered on larger screens */
.app {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}

/* ============================================================
   PAGE LOAD FADE-IN
   ============================================================ */
body {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
body.is-loaded { opacity: 1; }
body.is-leaving { opacity: 0; }

/* Reveal utility (logo, cards, menu image) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  transition-delay: calc(var(--i, 0) * 65ms);
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-header {
  text-align: center;
  padding-top: calc(var(--safe-top) + 26px);
  padding-bottom: 22px;
}

.home-logo {
  height: 38px;
  width: auto;
  max-width: 60%;
  margin: 0 auto;
  object-fit: contain;
}

.home-tagline {
  margin-top: 8px;
  font-size: clamp(11px, 3.2vw, 14px);
  letter-spacing: 0.32em;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  padding-left: 0.32em; /* compensate letter-spacing for centering */
}

/* Barra BEBIDAS bajo el logo (enlaza a bebidas.html) */
.drinks-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin: 2px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  padding-left: 0.2em;
  transition: transform 0.16s var(--ease), background 0.2s var(--ease);
}
.drinks-bar:active {
  transform: scale(0.97);
  background: #1a1a1a;
}

/* 3-column grid of category cards */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--gap);
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.card { display: block; }

.card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;               /* uniform square across all cards */
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.card__media img,
.card__media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                 /* replace photos freely */
  transition: transform 0.6s var(--ease);
}

/* subtle dark overlay over every food image */
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.34) 100%);
  pointer-events: none;
}

.card__label {
  margin-top: 7px;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.2;
  font-size: clamp(9px, 2.9vw, 12px);
  overflow-wrap: break-word;         /* nunca se desborda */
}

/* zoom photo on touch / hover */
@media (hover: hover) {
  .card:hover .card__media img,
  .card:hover .card__media video { transform: scale(1.06); }
}
.card:active .card__media img,
.card:active .card__media video { transform: scale(1.06); }

/* tactile feedback: scale card down slightly on press */
.card { transition: transform 0.18s var(--ease); }
.card:active { transform: scale(0.96); }

/* ============================================================
   CATEGORY PAGES
   ============================================================ */
.cat-header {
  text-align: center;
  padding-top: calc(var(--safe-top) + 22px);
  padding-bottom: 16px;
}

.cat-logo {
  height: 24px;
  width: auto;
  max-width: 55%;
  margin: 0 auto 10px;
  object-fit: contain;
}

.cat-title {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cat-main {
  /* generous bottom padding so the fixed button never covers the menu */
  padding-bottom: calc(var(--safe-bottom) + 108px);
}

.menu-img {
  width: 100%;                        /* never crop the menu image */
  height: auto;
  margin: 8px auto 0;
  border-radius: 14px;
  background: var(--surface);
}

/* ---------- Featured image (una por sección) ---------- */
.featured {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  margin-top: 4px;
}
.featured img,
.featured video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                  /* reemplazable sin romper el diseño */
}
.featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.42) 100%);
  pointer-events: none;
}

/* ---------- Tabla / lista de productos ---------- */
.menu-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}
.menu-section-title {
  margin-top: 30px;
  font-size: clamp(17px, 5vw, 21px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.menu-list--section { margin-top: 8px; }
.menu-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.menu-row:first-child { padding-top: 4px; }

.menu-name {
  flex: 1 1 auto;
  min-width: 0;                       /* permite el ajuste de línea, sin overflow */
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.menu-price {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Platillos con fotografía disponible */
.dish-photo-trigger {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, 0.72);
}
.dish-photo-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Lightbox: la imagen no recibe src hasta que se toca el platillo. */
body.lightbox-open { overflow: hidden; }
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 20px);
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox__panel {
  position: relative;
  width: min(100%, 720px);
}
.lightbox__image,
.lightbox__video {
  display: block;
  width: 100%;
  max-height: 78dvh;
  object-fit: contain;
  border-radius: 14px;
  background: var(--surface);
}
.lightbox__image[hidden],
.lightbox__video[hidden] { display: none; }
.lightbox__caption {
  margin-top: 12px;
  padding: 0 44px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

/* Subtítulo de grupo dentro de una sección (p. ej. BEBIDAS) */
.menu-group-title {
  margin: 26px 0 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.menu-group-title.first { margin-top: 20px; }
.menu-group-title + .menu-list { margin-top: 6px; }

/* ---------- Sticky/fixed back button ---------- */
.back-btn {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-bottom) + 18px);
  z-index: 20;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  white-space: nowrap;

  background: var(--text);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-btn);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  transition: transform 0.16s var(--ease), background 0.2s var(--ease);
  will-change: transform;
}
.back-btn:active { transform: translateX(-50%) scale(0.94); }

/* ============================================================
   ACCESSIBILITY: reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body,
  .reveal,
  .reveal.is-visible,
  .card,
  .card__media img,
  .card__media video,
  .back-btn {
    transition: none !important;
    animation: none !important;
  }
  body { opacity: 1 !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
