@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --rojo-dragon: #FF6347;
  --dorado-chifa: #FFD700;
  --rojo-oscuro: #800000;
  --rojo-carmesi: #A52A2A;
  --negro-rico: #1A1A1A;
  --crema: #FFF8EE;
  --gris-texto: #4a4038;

  --font-display: 'Dancing Script', cursive;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --toolbar-h: 106px; /* alto real de .toolbar (buscador + chips), usado por scroll-margin-top */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--gris-texto);
  background: var(--crema);
  /* NO poner overflow-x aquí: si <body> recibe una regla de overflow no-visible, el navegador
     lo convierte en su propio contenedor de scroll separado de <html> (que es quien realmente
     scrollea la página) y eso rompe position:sticky en cualquier descendiente (el toolbar
     queda "pegado" a un scroll que nunca avanza). Basta con overflow-x:hidden en <html>. */
}
a { color: inherit; text-decoration: none; }
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* --- Header (scroll normal, no ocupa espacio fijo en móvil) --- */
.menu-header {
  background: radial-gradient(120% 160% at 50% -20%, var(--rojo-oscuro) 0%, var(--negro-rico) 70%);
  color: var(--crema); text-align: center; padding: 40px 20px 26px;
}
.menu-header-symbol { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 10px; }
.menu-header h1 { font-family: var(--font-display); color: var(--dorado-chifa); font-size: clamp(32px, 9vw, 42px); margin: 0 0 4px; }
.menu-header p { margin: 0; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .75; }
.menu-note { font-size: 11px; opacity: .55; margin-top: 8px; }

/* --- Destacados: carrusel horizontal con foto grande, primera impresión tras el header --- */
.destacados { padding: 22px 0 6px; }
.destacados-title {
  font-family: var(--font-heading); font-size: 15px; font-weight: 700; color: var(--negro-rico);
  max-width: 880px; margin: 0 auto 12px; padding: 0 20px; display: flex; align-items: center; gap: 6px;
}
.destacados-title::before { content: '★'; color: var(--dorado-chifa); font-size: 13px; }
.destacados-track {
  display: flex; gap: 12px; max-width: 880px; margin: 0 auto; padding: 0 20px 6px; overflow-x: auto;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.destacados-track::-webkit-scrollbar { display: none; }
.destacado-card {
  flex: none; width: 168px; scroll-snap-align: start; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 2px 10px rgba(26,26,26,.08); border: 1px solid #f1ebdf;
}
.destacado-img { width: 100%; height: 116px; object-fit: cover; display: block; background: #eee2ce; }
.destacado-info { padding: 9px 11px 11px; }
.destacado-nombre {
  display: block; font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  color: var(--negro-rico); line-height: 1.25; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.destacado-precio { font-family: var(--font-heading); font-weight: 700; font-size: 12.5px; color: var(--rojo-dragon); }

/* --- Toolbar sticky: buscador + índice de categorías, pegados arriba al hacer scroll --- */
.toolbar {
  position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid #eee2ce;
}
.search-bar { position: relative; max-width: 880px; margin: 0 auto; padding: 10px 16px 8px; }
.search-icon { position: absolute; left: 28px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: var(--gris-texto); opacity: .5; pointer-events: none; }
.search-input {
  width: 100%; padding: 9px 14px 9px 34px; border-radius: 20px; border: 1px solid #e6dcc6;
  background: #f9f5ea; font-family: var(--font-body); font-size: 13.5px; color: var(--negro-rico);
}
.search-input::placeholder { color: var(--gris-texto); opacity: .55; }
.search-input:focus { outline: none; border-color: var(--dorado-chifa); background: #fff; }

.chip-nav {
  display: flex; gap: 8px; max-width: 880px; margin: 0 auto; padding: 4px 16px 12px;
  overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chip-nav::-webkit-scrollbar { display: none; }
.chip {
  font-family: var(--font-heading); font-size: 12.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 20px; background: #f4efe0; color: var(--rojo-carmesi);
  border: 1px solid #eadfc6; white-space: nowrap; flex: none; scroll-snap-align: start;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover, .chip:active { background: var(--dorado-chifa); color: var(--negro-rico); }
.chip.active { background: var(--dorado-chifa); color: var(--negro-rico); border-color: var(--dorado-chifa); }

.search-empty { text-align: center; padding: 60px 20px; opacity: .6; }

/* --- Skeleton de carga: evita el salto de layout y el "Cargando…" plano --- */
.skeleton { padding: 22px 20px 0; }
.skel-chip, .skel-cat-title, .skel-row {
  border-radius: 8px; background: linear-gradient(90deg, #f0e9d8 25%, #f7f1e3 37%, #f0e9d8 63%);
  background-size: 400% 100%; animation: skel-shimmer 1.4s ease infinite;
}
.skel-chip { display: inline-block; width: 84px; height: 30px; border-radius: 20px; margin: 0 8px 16px 0; }
.skel-cat-title { width: 140px; height: 20px; margin: 18px 0 14px; }
.skel-row { width: 100%; height: 58px; margin-bottom: 10px; }
@keyframes skel-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --- Categorías --- */
.categoria { max-width: 880px; margin: 0 auto; padding: 30px 20px 6px; scroll-margin-top: var(--toolbar-h); }
.categoria h2 {
  font-family: var(--font-heading); font-size: clamp(19px, 5vw, 22px); color: var(--negro-rico);
  border-bottom: 2px solid var(--dorado-chifa); padding-bottom: 8px; margin-bottom: 6px;
}
.categoria .cat-desc { font-size: 13px; opacity: .7; margin: 0 0 16px; }

.plato {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px dashed #e6dcc6;
}
.plato:last-child { border-bottom: none; }
/* Sin imagen ni placeholder: el texto usa todo el ancho, sin caja vacía */
.plato.sin-imagen { gap: 0; }
.plato-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: #eee2ce; flex: none; }
.plato-info { flex: 1; min-width: 0; }
.plato-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plato-nombre { font-family: var(--font-heading); font-weight: 600; font-size: 15.5px; color: var(--negro-rico); }
.plato-precio { font-family: var(--font-heading); font-weight: 700; color: var(--rojo-dragon); white-space: nowrap; font-size: 14.5px; }
.plato-desc { font-size: 13px; opacity: .7; margin-top: 2px; }
.plato-variantes { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.variante-chip {
  font-size: 11.5px; background: #f4efe0; padding: 3px 9px; border-radius: 12px; color: var(--gris-texto);
}
.plato-nota { font-size: 11.5px; font-style: italic; opacity: .65; margin-top: 2px; }
.badge-destacado {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  color: var(--negro-rico); background: var(--dorado-chifa); padding: 2px 7px; border-radius: 3px;
  margin-left: 8px; vertical-align: middle;
}

.empty-state { text-align: center; padding: 80px 20px; opacity: .6; }

.menu-footer { text-align: center; padding: 30px 20px 44px; font-size: 12px; opacity: .6; }
.menu-footer a { color: var(--rojo-carmesi); font-weight: 600; }

/* --- Botón flotante "volver arriba" --- */
.back-to-top {
  position: fixed; right: 16px; bottom: 20px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--negro-rico); border: none; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); cursor: pointer; z-index: 20;
  opacity: 0; transform: translateY(10px) scale(.9); pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.back-to-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top svg { width: 20px; height: 20px; fill: var(--dorado-chifa); }

/* --- Móvil --- */
@media (max-width: 600px) {
  :root { --toolbar-h: 98px; }
  .menu-header { padding: 30px 16px 20px; }
  .container, .categoria { padding-left: 16px; padding-right: 16px; }
  .destacados-title { margin-left: 16px; margin-right: 16px; }
  .destacados-track { padding-left: 16px; padding-right: 16px; }
  .destacado-card { width: 148px; }
  .destacado-img { height: 102px; }
  .search-bar { padding: 9px 12px 6px; }
  .chip-nav { padding: 4px 12px 10px; }
  .chip { padding: 8px 14px; font-size: 12px; }
  .plato-img { width: 60px; height: 60px; }
  .plato-nombre { font-size: 14.5px; }
  .plato-precio { font-size: 14px; }
  .back-to-top { right: 12px; bottom: 16px; }
}
