/* ============================================
   EL GRILL HOUSE — Menú de escaneo QR / toma de pedidos
   Oscuro por defecto, claro automático según el sistema.
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-alt: #151515;
  --card: #1a1a1a;
  --text: #f5f3ef;
  --muted: #a3a3a3;
  --red: #ff2d2d;
  --red-dark: #b0121a;
  --gold: #f2a93b;
  --border: rgba(255,255,255,0.08);
  --shadow: rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf8f4;
    --bg-alt: #ffffff;
    --card: #ffffff;
    --text: #181512;
    --muted: #6b6b6b;
    --red: #d81616;
    --red-dark: #a00f12;
    --gold: #c9821f;
    --border: rgba(0,0,0,0.08);
    --shadow: rgba(0,0,0,0.15);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 90px; /* espacio para la barra flotante */
}

h1, h2, .brand-font { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; }

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

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo { height: 34px; width: auto; }

.topbar-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

/* ---------- Promo banner ---------- */
.promo-wrap { padding: 14px 14px 0; max-width: 720px; margin: 0 auto; }

.promo-slider {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/8;
  background: var(--bg-alt);
}

.promo-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.promo-track::-webkit-scrollbar { display: none; }

.promo-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}

.promo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.promo-phrase {
  position: absolute;
  top: 12px;
  right: 14px;
  max-width: 50%;
  text-align: right;
  font-family: 'Bebas Neue', sans-serif;
  color: #fff;
  font-size: clamp(0.95rem, 3.6vw, 1.35rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 18px rgba(0,0,0,0.7);
}

.promo-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.promo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s, width 0.2s;
}

.promo-dot.active {
  background: #fff;
  width: 16px;
  border-radius: 999px;
}

.promo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0) 100%);
  text-align: left;
}

.promo-eyebrow {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  width: fit-content;
}

.promo-overlay h2 {
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.promo-price {
  color: var(--gold);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  margin-top: 4px;
  display: block;
}

/* ---------- Chip row (categorías) ---------- */
.chip-row {
  display: flex;
  gap: 6px;
  padding: 10px 10px;
  max-width: 720px;
  margin: 0 auto;
  position: sticky;
  top: 58px;
  z-index: 49;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.chip {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  padding: 10px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------- Botón cambiar vista ---------- */
.view-toggle-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 14px 0;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

/* ---------- Lista de productos ---------- */
.product-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-list.grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.grid-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 0 10px;
}

.grid-item:active { transform: scale(0.97); }

.grid-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--bg-alt), var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.grid-img img { width: 100%; height: 100%; object-fit: cover; }

.grid-img.placeholder::after {
  content: "🍔";
  font-size: 1.8rem;
  opacity: 0.4;
}

.grid-item h3 {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
  padding: 0 6px;
}

.grid-price {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--red);
  font-size: 1.18rem;
  letter-spacing: 0.03em;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.row-item:active { transform: scale(0.98); }

.row-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-alt), var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.row-img img { width: 100%; height: 100%; object-fit: cover; }

.row-img.placeholder::after {
  content: "🍔";
  font-size: 1.6rem;
  opacity: 0.4;
}

.badge-new {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: var(--gold);
  color: #0a0a0a;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.row-text { flex: 1; min-width: 0; }

.group-header {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
  color: var(--gold);
  text-transform: uppercase;
  padding: 16px 2px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.product-list > .group-header:first-child { padding-top: 0; }

.product-list.grid-view .group-header {
  grid-column: 1 / -1;
}

.row-text h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-text p {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-price {
  flex-shrink: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: var(--red);
}

/* ---------- Bottom sheets ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  background: var(--bg-alt);
  border-radius: 20px 20px 0 0;
  max-width: 720px;
  margin: 0 auto;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px var(--shadow);
}

.sheet.open { transform: translateY(0); }

.sheet-close {
  position: sticky;
  top: 12px;
  left: 100%;
  margin-top: 12px;
  margin-right: 14px;
  background: rgba(0,0,0,0.55);
  color: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  z-index: 2;
  float: right;
}

/* La X se dibuja con CSS para que quede siempre centrada en el círculo */
.sheet-close::before,
.sheet-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.sheet-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.sheet-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.sheet-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--card), var(--bg-alt));
  position: relative;
}

.sheet-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-body { padding: 18px 20px 6px; clear: both; }

.sheet-body h2 { font-size: 1.8rem; margin-bottom: 8px; }
.sheet-body p { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }

.sheet-price {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--red);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.salsa-section {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}

.sheet-body .salsa-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.salsa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.salsa-chip {
  flex: 1 1 auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.salsa-chip.selected {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.salsa-chip.sin-salsa { border-style: dashed; grid-column: 1 / -1; }

.sheet-body .salsa-aviso {
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-add.pendiente { opacity: 0.45; }

.salsa-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
}

.qty-control button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

#qty-value { font-weight: 700; min-width: 16px; text-align: center; }

.btn-add {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-add:active { opacity: 0.85; }

/* ---------- Lista (carrito) ---------- */
.list-title { padding: 18px 20px 0; font-size: 1.8rem; clear: both; }
.list-hint {
  margin: 8px 20px 14px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

.list-items { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.list-item-info { flex: 1; min-width: 0; }
.list-item-info h4 { font-size: 0.95rem; }
.list-item-info span { color: var(--muted); font-size: 0.8rem; }

.list-item-right { display: flex; align-items: center; gap: 10px; }

.list-item-price { font-family: 'Bebas Neue', sans-serif; color: var(--red); font-size: 1rem; }

.remove-item {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.list-total {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px 6px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

.btn-clear {
  display: block;
  margin: 14px 20px 0;
  width: calc(100% - 40px);
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Barra flotante ---------- */
.cart-bar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 692px;
  margin: 0 auto;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 6px 24px var(--shadow);
  z-index: 60;
}

.cart-bar[hidden] {
  display: none;
}

.cart-bar-count {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.cart-bar-label { flex: 1; text-align: left; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 30px 20px 20px;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p { margin-bottom: 4px; }
