/* ============================
   CSS VARIABLES / TOKENS
============================ */
:root {
  --bg:        #141414;
  --card:      #1e1e1e;
  --border:    rgba(255,255,255,0.08);
  --fg:        #fafafa;
  --muted:     #888;
  --primary:   #7a2e2e;
  --accent:    #c9a96e;
  --radius:    4px;
}

/* ============================
   RESET & BASE
============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* Sin JS nadie añade la clase .visible, así que las tarjetas se verían a
   opacity 0 (definido más abajo en .dish-card). Aquí se fuerzan visibles. */
.no-js .dish-card { opacity: 1; transform: none; }
/* El loader solo se oculta desde menu.js: sin JS taparía la página para siempre. */
.no-js #loader { display: none; }

/* ============================
   HEADER
============================ */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  text-align: center;
  padding: 14px 0;
  background: #141414;
  transition: background 0.4s, padding 0.4s, backdrop-filter 0.4s;
}
.header-logo {
  display: inline-block;
  line-height: 0;
}
#header.scrolled {
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(12px);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#header img {
  width: 130px;
  height: auto;
  object-fit: contain;
  transition: width 0.4s;
  display: inline-block;
}
#header.scrolled img { width: 100px; }

.footer-access {
  display: block;
  width: max-content;
  margin: 24px auto 0;
  padding: 8px 20px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  color: var(--fg);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.footer-access:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--fg);
}

/* ============================
   HERO
============================ */
#hero {
  position: relative;
  margin-top: 141px;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#hero-bg {
  position: absolute;
  inset: 0;
  background: #141414;
}
#hero-bg video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent 78%, rgba(20,20,20,0.5) 92%, #141414 100%);
}
#sound-btn {
  position: absolute;
  right: 20px;
  bottom: 24px;
  z-index: 6;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(20,20,20,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fafafa;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
#sound-btn:hover {
  background: rgba(20,20,20,0.85);
  border-color: var(--accent);
  color: var(--accent);
}
#sound-btn svg { width: 22px; height: 22px; display: block; }
#sound-btn .icon-sound-on  { display: none; }
#sound-btn .icon-sound-off { display: block; }
#sound-btn.sound-on .icon-sound-on  { display: block; }
#sound-btn.sound-on .icon-sound-off { display: none; }
@media (max-width: 768px) {
  #sound-btn { right: 12px; bottom: 12px; width: 40px; height: 40px; }
  #sound-btn svg { width: 20px; height: 20px; }
}

/* ============================
   TAGLINE SECTION
============================ */
#tagline {
  padding: 80px 24px;
  text-align: center;
}
#tagline h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  color: rgba(250, 250, 250, 0.75);
  animation: fadeUp 0.8s ease both;
}
#tagline h1 em {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-style: normal;
  color: rgba(250, 250, 250, 0.75);
  text-transform: none;
  letter-spacing: 0.02em;
}
#tagline p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
  letter-spacing: 0.05em;
}

/* ============================
   CATEGORY NAV
============================ */
#category-nav {
  position: relative;
  z-index: 80;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
#menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}
#menu-btn:hover { border-color: var(--primary); color: var(--accent); }
#menu-btn svg { transition: transform 0.3s; flex-shrink: 0; }
#menu-btn.open svg { transform: rotate(180deg); }
#nav-dropdown {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 8px);
  min-width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  padding: 8px 0;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.9);
  transform-origin: top;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#nav-dropdown.open {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
  pointer-events: auto;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
.dropdown-item.active { background: rgba(122,46,46,0.15); color: var(--primary); font-weight: 600; }
.nav-indicator {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-indicator span { color: var(--fg); font-weight: 400; }

/* ============================
   MENU SECTIONS
============================ */
#menu-content { padding-bottom: 80px; }
.menu-section { padding: 64px 24px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 300; letter-spacing: 0.05em; margin-bottom: 12px; }
.section-divider { width: 80px; height: 1px; background: var(--primary); margin: 0 auto 14px; }
.section-desc { font-size: 1rem; font-style: italic; font-weight: 300; color: var(--muted); }
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}
.dish-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
  opacity: 0;
  transform: translateY(16px);
}
.dish-card.visible { animation: fadeUp 0.5s ease forwards; }
.dish-card:hover { transform: translateY(-4px); }
.dish-img-wrap { aspect-ratio: 4/3; overflow: hidden; position: relative; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid var(--border); }
.dish-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; display: block; }
.dish-card:hover .dish-img-wrap img { transform: scale(1.04); }
.dish-info {
  padding: 8px 4px;
  text-align: left;
}
.dish-name {
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 4px;
  transition: color 0.3s;
  line-height: 1.3;
  color: var(--fg);
}
.dish-card:hover .dish-name { color: var(--accent); }
.dish-price {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ============================
   DETAIL OVERLAY (modal)
============================ */
#detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #141414;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}
#detail-overlay.open { display: block; }
.detail-inner { min-height: 100%; display: flex; flex-direction: column; }
.detail-hero { position: relative; margin-top: 86px; height: 75vh; overflow: hidden; flex-shrink: 0; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.detail-hero img.detail-hero-img--offset-down { object-position: center 2%; }
.detail-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent calc(100% - 120px), rgba(20,20,20,0.4) calc(100% - 80px), rgba(20,20,20,0.85) calc(100% - 40px), #141414 calc(100% - 5px), #141414 100%);
}

.detail-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300; display: flex; align-items: center; padding: 16px 20px;
  background: rgba(20,20,20,0.96); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.detail-topbar::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 16px; background: linear-gradient(to bottom, #141414 0%, transparent 100%); pointer-events: none;
}

@media (min-width: 900px) { .detail-hero { height: 70vh; } }

.detail-back {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--accent); border-radius: 100px; color: var(--accent); font-family: inherit;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; cursor: pointer; transition: background 0.3s, color 0.3s;
}
.detail-back:hover { background: var(--accent); color: #141414; }
.detail-back svg { transition: transform 0.3s; }
.detail-back:hover svg { transform: translateX(-3px); }

.detail-content { position: relative; margin-top: -80px; padding: 0 24px 80px; max-width: 700px; margin-left: auto; margin-right: auto; flex: 1; }
.detail-badge { display: none; }
.detail-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 300; line-height: 1.2; margin-bottom: 20px; animation: fadeUp 0.4s 0.2s both; }
.detail-price { font-size: clamp(2rem, 5vw, 2.5rem); font-weight: 300; color: var(--accent); margin-bottom: 28px; animation: fadeUp 0.4s 0.3s both; }
.detail-line { width: 80px; height: 1px; background: var(--primary); margin-bottom: 28px; animation: fadeUp 0.4s 0.4s both; }
.detail-desc { font-size: 1.1rem; font-weight: 300; color: var(--muted); line-height: 1.8; margin-bottom: 40px; animation: fadeUp 0.4s 0.5s both; }
.detail-desc strong { font-weight: 600; color: var(--fg); }

/* ============================
   FOOTER
============================ */
footer { background: var(--card); border-top: 1px solid var(--border); padding: 64px 24px; text-align: center; }
footer img { width: 120px; height: auto; object-fit: contain; margin-bottom: 20px; opacity: 0.75; }
footer blockquote { font-style: italic; font-weight: 300; color: var(--muted); max-width: 420px; margin: 0 auto 24px; font-size: 1rem; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: var(--primary); }
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
footer small { color: rgba(255,255,255,0.25); font-size: 0.75rem; font-weight: 300; }

/* ============================
   LOADER
============================ */
#loader {
  position: fixed;
  inset: 0;
  background: #141414;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hide {
  opacity: 0;
  visibility: hidden;
}
#loader-logo-wrap {
  position: relative;
  width: 180px;
  aspect-ratio: 341 / 296;
  opacity: 0;
  transform: scale(0.85);
  animation: logoReveal 1.4s cubic-bezier(0.22,1,0.36,1) 0.2s forwards;
}
#loader-logo-outline,
#loader-logo-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
#loader-logo-outline {
  filter: brightness(0) invert(1);
  opacity: 0.15;
}
#loader-logo-fill {
  clip-path: inset(100% 0 0 0);
  animation: liquidFill 3.6s cubic-bezier(0.65,0,0.35,1) 0.5s forwards;
}
#loader.loaded #loader-logo-fill {
  animation: none;
  clip-path: inset(0% 0 0 0);
  transition: clip-path 0.5s cubic-bezier(0.22,1,0.36,1);
}
@keyframes logoReveal {
  0%   { opacity: 0; transform: scale(0.82); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes liquidFill {
  0%   { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(6% 0 0 0); }
}

/* ============================
   ANIMATIONS
============================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
  #header { padding: 10px 0; background: #141414; }
  #header img { width: 60px; height: auto; }
  #hero { margin-top: 73px; height: auto; overflow: hidden; display: block; position: relative; }
  #hero-bg { position: relative; width: 100%; }
  #hero-bg video { position: relative; top: auto; left: auto; width: 100%; height: 56vw; object-fit: cover; display: block; }
  #hero-overlay { position: absolute; top: 0; left: 0; right: 0; height: 56vw; background: linear-gradient(to bottom, transparent 78%, rgba(20,20,20,0.5) 92%, #141414 100%); }
  #tagline { padding: 20px 20px 12px; }
  #tagline h1 { font-size: 1.6rem; margin-bottom: 6px; }
  #tagline p  { font-size: 0.9rem; }
  #category-nav { padding: 10px 20px; }
  .dish-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dish-name  { font-size: 0.9rem; }
  .dish-price { font-size: 1rem; }
  .detail-topbar { padding: 12px 16px; }
  .detail-topbar::after { height: 12px; }
  .detail-hero { margin-top: 68px; height: 55vw; min-height: 200px; }
  .detail-hero img.detail-hero-img--offset-down { object-position: center 0%; }
  .detail-hero-overlay { background: linear-gradient(to bottom, transparent 0%, transparent calc(100% - 55px), rgba(20,20,20,0.35) calc(100% - 36px), rgba(20,20,20,0.8) calc(100% - 18px), #141414 calc(100% - 2px), #141414 100%); }
  .detail-title { font-size: 1.5rem; }
  .detail-price { font-size: 1.7rem; }
  .detail-content { padding: 0 16px 60px; margin-top: 30px; }
}

/* ============================
   ALÉRGENOS (Preparado para BBDD)
============================ */
.alergenos-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.alergeno-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--accent);
  transition: transform 0.3s ease, background 0.3s ease;
}

.alergeno-item:hover {
  transform: scale(1.1);
  background: rgba(201, 169, 110, 0.2);
}

.alergeno-item img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.alergenos-title {
  width: 100%;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.alergeno-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--fg);
}
