:root {
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 26px;

  --shadow-sm: 0 2px 10px rgba(20, 12, 6, .08);
  --shadow-md: 0 10px 30px rgba(20, 12, 6, .16);
  --shadow-lg: 0 -8px 40px rgba(0, 0, 0, .35);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* Paleta única (restaurante, sin modo noche) */
  --bg: #faf3e7;
  --surface: #ffffff;
  --surface-2: #fff8ef;
  --ink: #2b1b12;
  --ink-soft: #7a6a58;
  --accent: #c0392b;
  --accent-2: #e0533f;
  --gold: #b9812c;
  --line: #ecdfc9;

  --sheet-bg: #241109;
  --sheet-surface: #2f1811;
  --sheet-ink: #fff9f2;
  --sheet-ink-soft: #d8c4b1;
  --sheet-line: #402716;
  --sheet-input-bg: #1a0d07;
  --sheet-accent: #e2a03f;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(104px + var(--safe-b));
  min-height: 100vh;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

img { max-width: 100%; display: block; }
button { font: inherit; }
ul { margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: calc(14px + var(--safe-t)) 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--gold);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: .03em;
  color: var(--accent);
}

.brand-tag {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- panel ---------- */

main { max-width: 720px; margin: 0 auto; }

.panel { animation: fadeIn .45s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: .9rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.panel-intro { padding: 30px 20px 6px; text-align: center; }

.eyebrow {
  font-family: var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--gold);
  margin: 0 0 6px;
}

.panel-intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: .01em;
}

.panel-sub { color: var(--ink-soft); font-size: .88rem; margin: 0 0 4px; }

.divider {
  height: 2px;
  width: 130px;
  margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- category chips (jump nav) ---------- */

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 20px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar { display: none; }

.chip-nav {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, color .2s ease, transform .15s ease, background .2s ease;
}

.chip-nav:hover, .chip-nav:focus-visible { border-color: var(--accent); color: var(--accent); }
.chip-nav:active { transform: scale(.96); }

/* ---------- categories (accordion cards) ---------- */

.menu-list { padding: 0 16px; }

.category {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow .2s ease;
}

.category[open] { box-shadow: var(--shadow-md); }

.category summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: .02em;
}

.category summary::-webkit-details-marker { display: none; }

.cat-label { display: flex; align-items: center; gap: 10px; }
.cat-icon { font-size: 1.1rem; }

.category summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform .25s ease;
}

.category[open] summary::after { content: '–'; }

.category-body { padding: 0 18px 16px; }

.category-note { color: var(--ink-soft); font-size: .85rem; margin: 2px 0 12px; }

.extra-note {
  text-align: center;
  font-weight: 600;
  padding: 14px 20px;
  margin: 0 16px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--line);
}

/* item rows with price */

.items { list-style: none; display: flex; flex-direction: column; gap: 0; }

.items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  border-bottom: 1px dashed var(--line);
  font-size: .95rem;
  transition: background .2s ease;
}

.items li:last-child { border-bottom: none; }

.items li.in-cart {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-bottom-color: transparent;
}

.items li small { color: var(--ink-soft); font-weight: 400; font-size: .85em; }

.items .price {
  font-family: var(--font-display);
  letter-spacing: .02em;
  color: var(--accent);
  white-space: nowrap;
  font-size: 1.1rem;
}

/* poster link */

.poster-link {
  display: block;
  margin: 4px auto 22px;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: .85rem;
  border-radius: 999px;
  cursor: pointer;
  width: fit-content;
  transition: background .25s ease, color .25s ease, transform .15s ease;
}

.poster-link:hover { background: var(--ink); color: var(--bg); }
.poster-link:active { transform: scale(.97); }

/* ---------- footer ---------- */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 30px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.social-row { display: flex; gap: 10px; }
.social-row a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 2px; }
.social-row img { width: 40px; height: 40px; transition: transform .2s ease; }
.social-row a:hover img, .social-row a:focus-visible img { transform: translateY(-3px) scale(1.06); }

.footer-note { font-size: .74rem; color: var(--ink-soft); margin: 0; text-align: center; }

/* ============================================================
   CARRITO — BOTÓN FLOTANTE (FAB)
   ============================================================ */

.cart-fab {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--safe-b));
  z-index: 900;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .18);
  animation: fabIn .35s cubic-bezier(.34, 1.56, .64, 1);
}

.cart-fab:active { transform: scale(.98); }

@keyframes fabIn {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cart-fab-icon {
  font-size: 1.3rem;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .2);
  border-radius: 50%;
}

.cart-fab-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.cart-fab-count {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .85;
}

.cart-fab-total {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .02em;
}

.cart-fab-arrow {
  font-size: 1.4rem;
  opacity: .85;
}

/* ============================================================
   CARRITO — MODAL / BOTTOM SHEET
   ============================================================ */

.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

.cart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 3, .55);
  backdrop-filter: blur(2px);
  animation: fadeIn .25s ease;
}

.cart-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--sheet-bg);
  color: var(--sheet-ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetUp .32s cubic-bezier(.32, .72, .33, 1);
  padding-bottom: var(--safe-b);
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cart-sheet-handle {
  width: 42px;
  height: 4px;
  background: var(--sheet-line);
  border-radius: 999px;
  margin: 10px auto 2px;
  flex-shrink: 0;
}

.cart-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 6px;
  flex-shrink: 0;
}

.cart-sheet-header h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: .02em;
  margin: 0;
  color: var(--sheet-ink);
}

.cart-sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: var(--sheet-ink);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.cart-sheet-close:hover { background: rgba(255, 255, 255, .16); }

.cart-sheet-body {
  overflow-y: auto;
  padding: 6px 20px 4px;
  flex: 1;
}

.cart-sheet-body::-webkit-scrollbar { width: 6px; }
.cart-sheet-body::-webkit-scrollbar-thumb { background: var(--sheet-line); border-radius: 999px; }

/* items dentro del modal */

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

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--sheet-surface);
  border: 1px solid var(--sheet-line);
  border-radius: var(--radius-sm);
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  color: var(--sheet-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-unit {
  display: block;
  font-size: .76rem;
  color: var(--sheet-ink-soft);
  margin-top: 2px;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.cart-item-subtotal {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--sheet-accent);
  letter-spacing: .02em;
}

.cart-item-remove {
  border: none;
  background: transparent;
  color: var(--sheet-ink-soft);
  font-size: .72rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 0;
}

.cart-item-remove:hover { color: #ff8080; }

.cart-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--sheet-ink-soft);
  font-size: .9rem;
}

.cart-empty-icon { font-size: 2rem; display: block; margin-bottom: 10px; }

.cart-clear-btn {
  display: block;
  margin: 4px 0 18px;
  background-color: transparent;
  color: #ff8080;
  border: 1px solid rgba(255, 128, 128, .5);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  margin-right: auto;
}

.cart-clear-btn:hover { background-color: #ff8080; color: #241109; }

.cart-form-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sheet-ink-soft);
  margin: 6px 0 10px;
}

.cart-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.table-selector-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.table-selector-container label {
  font-size: 0.82rem;
  color: var(--sheet-ink-soft);
  white-space: nowrap;
}

.table-select {
  background-color: var(--sheet-input-bg);
  color: var(--sheet-accent);
  border: 1px solid var(--sheet-accent);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: bold;
  outline: none;
  cursor: pointer;
  flex: 1;
  max-width: 220px;
}

.delivery-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sheet-line);
}

.delivery-fields[hidden] { display: none; }

.form-row { display: flex; gap: 8px; }

.form-input {
  background-color: var(--sheet-input-bg);
  color: var(--sheet-ink);
  border: 1px solid var(--sheet-line);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  width: 100%;
  outline: none;
  transition: border-color .2s ease;
}

.form-input::placeholder { color: var(--sheet-ink-soft); }
.form-input:focus { border-color: var(--sheet-accent); }

.cart-sheet-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px calc(14px + var(--safe-b));
  border-top: 1px solid var(--sheet-line);
  background: var(--sheet-bg);
}

.cart-sheet-total {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.cart-sheet-total span {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sheet-ink-soft);
}

.cart-sheet-total strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sheet-accent);
}

.whatsapp-send-btn {
  flex: 1;
  background-color: #25d366;
  color: #ffffff;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-weight: bold;
  font-size: .95rem;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease, transform .15s ease;
}

.whatsapp-send-btn:hover { background-color: #1ebc57; }
.whatsapp-send-btn:active { transform: scale(.98); }

.cart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.btn-qty {
  background: linear-gradient(135deg, var(--gold), var(--accent));
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-qty:active { transform: scale(0.95); }

.qty-count {
  font-weight: bold;
  font-size: 0.95rem;
  min-width: 18px;
  text-align: center;
}

/* ---------- desktop: modal centrado en vez de bottom-sheet ---------- */

@media (min-width: 640px) {
  .cart-modal { align-items: center; }

  .cart-sheet {
    border-radius: var(--radius-lg);
    max-height: 80vh;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    animation: sheetInDesktop .28s cubic-bezier(.34, 1.2, .64, 1);
  }

  @keyframes sheetInDesktop {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .cart-sheet-handle { display: none; }
  .cart-fab { left: auto; right: 24px; bottom: 24px; width: 340px; }
}

@media (max-width: 480px) {
  .brand-tag { display: none; }
  .form-row { flex-direction: column; }
}
