/* ===========================
   VAR 37 · Estilos globales
   =========================== */

:root {
  --brand-dark: #0b0b0c;       /* fondo general oscuro */
  --brand-dark-2: #111315;     /* secciones */
  --brand-card: #1a1c1f;       /* tarjetas (gradiente en .card) */
  --brand-ink: #e7e9ee;        /* texto principal */
  --brand-sub: #a8adb7;        /* texto secundario */
  --brand-accent: #ffcc00;     /* acento amarillo */
  --brand-accent-2: #e63946;   /* rojo spicy */
  --chip: #0f1114;
  --shadow-soft: 0 4px 12px rgba(0,0,0,.25);
  --shadow-med: 0 6px 16px rgba(0,0,0,.28);
  --shadow-xl: 0 12px 30px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.35);
  --radius-xl: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--brand-dark);
  color: var(--brand-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bloquear scroll mientras precargamos */
html.preloading, html.preloading body {
  overflow: hidden;
}

/* =====================================
   OVERLAY / PRELOAD (anti pop-in)
   ===================================== */

#preload-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(80vw 80vw at 50% -10%, rgba(255,204,0,.08), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,.95), rgba(0,0,0,.9));
  display: grid;
  place-items: center;
  z-index: 10000;
}

#preload-box {
  width: min(520px, 92vw);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  background: rgba(26,28,31,.72);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px) saturate(130%);
  text-align: center;
}

#preload-logo {
  width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.5));
}

#preload-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.35);
}

#preload-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffcc00, #ffe480);
  transition: width .25s ease;
}

#preload-text {
  margin-top: 10px;
  font-size: 14px;
  color: var(--brand-ink);
  opacity: .9;
}

/* =====================================
   HEADER / NAVBAR
   ===================================== */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(0,0,0,0.95), rgba(0,0,0,0.85));
  backdrop-filter: saturate(120%) blur(4px);
  box-shadow: var(--shadow-med);
  will-change: transform;
}

body.scrolling header { backdrop-filter: none; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 30px;
}

.logo {
  height: 50px;
  width: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.nav-list li a {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.25s ease;
}

.nav-list li a:hover {
  color: var(--brand-accent);
}

/* =====================================
   INTRO / HERO
   ===================================== */

.introduction-container {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.introduction-container::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 120px;
  background: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
  z-index: 2;
}

.introduction-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  filter: saturate(105%);
}

.banner-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(28px, 4.5vw, 54px);
  text-align: center;
  font-weight: 800;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
  z-index: 3;
}

/* =====================================
   TOOLBAR (filtros/orden)
   ===================================== */

.menu-toolbar {
  position: sticky;
  top: 76px;
  z-index: 60;
  max-width: 1200px;
  margin: 18px auto 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17,19,21,.95), rgba(17,19,21,.85));
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-med);
  padding: 10px;
  contain: paint; /* aísla repintados del sticky */
}

body.scrolling .menu-toolbar { backdrop-filter: none; }

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  background: var(--chip);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--brand-ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: .25s ease;
  user-select: none;
}

.tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.16);
}

.tab.active {
  background: var(--brand-accent);
  color: #111;
  border-color: transparent;
  font-weight: 800;
}

.right-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sort {
  background: var(--brand-accent);
  color: #111;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

/* =====================================
   CONTENEDOR / SECCIONES
   ===================================== */

.menu-container {
  padding: 20px 18px 60px;
  background: var(--brand-dark-2);
}

.menu-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.menu-container h2 {
  text-align: center;
  font-size: 3em;
  margin: 30px 0 10px;
  color: #fff;
  letter-spacing: .5px;
}

.section {
  margin-top: 36px;
  /* Render diferido performante */
  content-visibility: auto;
  contain-intrinsic-size: 800px;
}

.section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 6px;
}

.section__head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .4px;
  color: #fff;
}

.stripe {
  height: 10px;
  width: 14px;
  border-radius: 4px;
  background: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(255,204,0,.22);
}

/* =====================================
   GRID / CARDS
   ===================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 18px;

  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

.card {
  position: relative;
  background: linear-gradient(180deg, #1d2024, #121417);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;

  /* Virtualización ligera por card */
  content-visibility: auto;
  contain-intrinsic-size: 360px;

  will-change: transform, opacity, filter; /* también usado por reveal */
}

/* Hover pesado sólo en dispositivos con cursor fino */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0,0,0,.45);
  }
}

.card__media {
  position: relative;
  aspect-ratio: 16/9; /* evita CLS */
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(105%);
}

.card__label {
  position: absolute;
  left: 12px; top: 12px;
  background: #111a;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #fff;
}

.spicy {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand-accent-2);
}

.new {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand-accent);
}

.card__body { padding: 14px; }

.card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card__title h4 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .2px;
  color: #fff;
}

.price {
  background: var(--brand-accent);
  color: #111;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 10px;
  min-width: 70px;
  text-align: center;
}

.desc {
  margin: 10px 0 0;
  color: var(--brand-sub);
  font-size: 14px;
  line-height: 1.4;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip {
  background: var(--chip);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--brand-sub);
}

/* =====================================
   FOOTER
   ===================================== */

footer {
  background: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
  background-color: rgb(7, 7, 65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh;
  color: white;
}

.br-footer {
  width: 100%;
  border: none;
  border-radius: 1vh;
  height: 2px;
  background-color: white;
  margin: 20px 0;
}

.socialMedias-Container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.socialMedia {
  width: 7vh;
  height: 7vh; /* fija alto para evitar CLS */
  object-fit: cover;
  padding: 1vh;
  border-radius: 50px;
}

a { text-decoration: none; }

.copyright {
  width: 100%;
  text-align: left;
  padding-left: 30px;
}

/* =====================================
   SCROLL REVEAL (.card)
   ===================================== */

/* Estado inicial (oculto) */
.card.reveal {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  filter: blur(6px);
  transition:
    opacity .6s ease,
    transform .6s ease,
    filter .6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

/* Visible */
.card.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Variantes sutiles para alternar direcciones */
.card.reveal[data-reveal-variant="left"]  { transform: translate(-14px, 18px) scale(.985); }
.card.reveal[data-reveal-variant="right"] { transform: translate( 14px, 18px) scale(.985); }
.card.reveal.is-visible[data-reveal-variant] { transform: none; }

/* Accesibilidad: preferencia por menos animación */
@media (prefers-reduced-motion: reduce) {
  .card.reveal, .card.reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  #preload-overlay #preload-box { backdrop-filter: none !important; }
}

/* =====================================
   RESPONSIVE
   ===================================== */

@media (max-width: 1024px) {
  .menu-container h2 { font-size: 2.4em; }
}

@media (max-width: 768px) {
  /* quita blur en móvil para FPS altos */
  header, .menu-toolbar { backdrop-filter: none; }
  .navbar { padding: 10px 18px; }
  .menu-container { padding: 12px 12px 48px; }
}

@media (max-width: 640px) {
  .tabs {
    overflow: auto;
    white-space: nowrap;
  }
}
