:root {
  --bg: #f6f4f0;
  --ink: #1a1714;
  --muted: #6b6560;
  --panel: #ffffff;
  --line: rgba(26, 23, 20, 0.1);
  --accent: #1f6b4a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 107, 74, 0.12);
  --ok: #15803d;
  --no: #b91c1c;
  --wa: #128c7e;
  --radius: 18px;
  --shadow-card: 0 1px 2px rgba(26, 23, 20, 0.04), 0 12px 28px -18px rgba(26, 23, 20, 0.28);
  --shadow-lift: 0 10px 30px -12px rgba(26, 23, 20, 0.35);
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    var(--bg);
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Portada */
.hero {
  position: relative;
  text-align: center;
  padding: 0 14px 12px;
  min-width: 0;
}
.hero-cover {
  position: relative;
  height: 168px;
  margin: 0 -14px;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  background-size: cover;
  background-position: center;
}
.hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.05), rgba(10, 8, 6, 0.22) 55%, rgba(10, 8, 6, 0.38));
  pointer-events: none;
}
.hero-inner {
  max-width: 720px;
  margin: -28px auto 0;
  min-width: 0;
  position: relative;
  padding: 18px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
}
.biz-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 22px;
  background: var(--panel);
  border: 3px solid var(--panel);
  margin: -52px auto 12px;
  display: block;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.biz-logo[hidden] { display: none !important; }
.hero-inner:not(:has(.biz-logo:not([hidden]))) { margin-top: -36px; }
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 5.4vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
}
.biz-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px;
}
.biz-chips span {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 5px 11px;
}
.biz-chips .chip-mesa {
  background: var(--accent);
  color: var(--accent-ink);
}
.biz-hours {
  margin: 10px auto 0;
  max-width: 420px;
  white-space: pre-line;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 12px 24px;
  min-width: 0;
}
.status { text-align: center; color: var(--muted); font-size: 0.95rem; padding: 18px 12px; }
.status--loading::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Buscador y categorías */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0 8px;
  margin: 0 0 4px;
  min-width: 0;
}
.toolbar[hidden] { display: none; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  min-width: 0;
}
.search svg { width: 18px; height: 18px; fill: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 16px;
}
.search { transition: border-color 0.2s, box-shadow 0.2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cat-nav {
  position: relative;
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin: 10px auto 0;
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.35);
}
.cat-nav.fade-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.cat-nav.fade-l {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px);
  mask-image: linear-gradient(90deg, transparent, #000 28px);
}
.cat-nav.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s ease, transform 0.15s ease;
}
.cat-nav button:hover { color: var(--ink); }
.cat-nav button:active { transform: scale(0.94); }
.cat-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat-nav button.active { color: var(--accent-ink); }
.cat-nav:not(.has-pill) button.active { background: var(--accent); }
.cat-pill {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 75%, transparent);
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.3, 0.9, 0.25, 1), width 0.42s cubic-bezier(0.3, 0.9, 0.25, 1);
}
.cat-pill.no-anim { transition: none; }
.cat-nav:not(.has-pill) .cat-pill { display: none; }

/* Productos */
.menu-section { margin: 16px 0 22px; min-width: 0; }
.menu-section h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.product-grid--list {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.product--list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  perspective: none;
  animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.product--list .product-open {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 10px 0 10px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.product--list .product-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 14px;
}
.product-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--accent-soft), transparent 60%), #ece8e1;
  flex-shrink: 0;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-thumb--empty {
  display: grid;
  place-items: center;
  color: rgba(26, 23, 20, 0.22);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}
.product-thumb .stock-badge,
.product-thumb .photo-count { z-index: 1; }
.product-thumb .photo-count {
  right: 6px;
  bottom: 6px;
  font-size: 0.62rem;
  padding: 2px 6px;
}
.product-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 2px;
}
.product--list .product-name {
  font-size: 0.98rem;
  -webkit-line-clamp: 2;
}
.product--list .product-desc {
  -webkit-line-clamp: 2;
  font-size: 0.8rem;
}
.product--list .product-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 4px;
  min-width: 76px;
}
.product--list .price { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.product--list .btn-add--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
.product--list .stepper {
  width: 108px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}
.product--list .stepper button { height: 34px; border-radius: 10px; }
.product--list.is-out .product-thumb img { filter: grayscale(0.7); opacity: 0.6; }
body.is-table .menu-section { margin-top: 12px; }
.product {
  position: relative;
  min-width: 0;
  perspective: 1100px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: card-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.flip-inner {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.3, 0.75, 0.2, 1);
}
.face {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -16px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}
.face-back {
  transform: rotateY(180deg);
  pointer-events: none;
  isolation: isolate;
  gap: 8px;
  padding: 14px 12px 12px;
  color: #fff;
  border-color: #141312;
  background-color: #141312;
  background-image: linear-gradient(160deg, color-mix(in srgb, var(--accent) 78%, #000), #141312);
}
.face-back::before {
  content: "";
  position: absolute;
  inset: -24px;
  z-index: -2;
  background-image: var(--card-img, none);
  background-size: cover;
  background-position: center;
  filter: blur(16px) saturate(1.25);
}
.face-back::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(14, 12, 10, 0.62), rgba(14, 12, 10, 0.9));
}
.product.is-flipped .flip-inner { transform: rotateY(180deg); }
.product.is-flipped .face-front { pointer-events: none; }
.product.is-flipped .face-back { pointer-events: auto; }
.product.hint .flip-inner { animation: flip-hint 1.2s ease-in-out 0.9s 1; }
@media (hover: hover) and (pointer: fine) {
  .product:hover .flip-inner,
  .product:has(.face-back :focus-visible) .flip-inner { transform: rotateY(180deg); }
  .product:hover .face-front,
  .product:has(.face-back :focus-visible) .face-front { pointer-events: none; }
  .product:hover .face-back,
  .product:has(.face-back :focus-visible) .face-back { pointer-events: auto; }
  .product:hover .face { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 22px 36px -18px rgba(0, 0, 0, 0.45); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes flip-hint {
  0%, 100% { transform: rotateY(0); }
  35% { transform: rotateY(-32deg); }
  65% { transform: rotateY(10deg); }
}
.flip-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.flip-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.front-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px 12px;
}
.front-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.flip-hint {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 0.4s ease;
}
.flip-hint svg { width: 15px; height: 15px; fill: currentColor; }
.face-back .product-name { color: #fff; -webkit-line-clamp: 3; }
.face-back .product-desc { color: rgba(255, 255, 255, 0.84); -webkit-line-clamp: 6; font-size: 0.8rem; }
.face-back .badge { color: #fff; background: rgba(255, 255, 255, 0.16); }
.face-back .product-foot { margin-top: auto; }
.face-back .price { color: #fff; }
.face-back .price-old,
.face-back .price-usd { color: rgba(255, 255, 255, 0.7); }
.face-back .stepper { background: rgba(255, 255, 255, 0.14); }
.face-back .stepper span { color: #fff; }
.face-back .btn-add:disabled { background: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.75); }
.back-more {
  align-self: flex-start;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0.9;
}
.back-more:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.product.is-out .product-photo img { filter: grayscale(0.7); opacity: 0.6; }
.product-photo {
  display: block;
  aspect-ratio: 1;
  width: 100%;
  background: linear-gradient(145deg, var(--accent-soft), transparent 60%), #ece8e1;
  overflow: hidden;
  position: relative;
}
.product-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.12));
  pointer-events: none;
}
.photo-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: rgba(15, 15, 18, 0.62);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-photo--empty {
  display: flex; align-items: center; justify-content: center;
  color: rgba(24, 24, 27, 0.2); font-size: 2rem; font-weight: 700;
}
.stock-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.92);
}
.stock-badge.ok { color: var(--ok); }
.stock-badge.no { color: #fff; background: var(--no); }
.product-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 12px;
  min-width: 0;
  flex: 1;
}
.product-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.product-foot { margin-top: auto; display: grid; gap: 8px; min-width: 0; }
.price { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-wrap { min-width: 0; }
.price-old-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.price-old {
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.off-badge {
  flex: none;
  border-radius: 999px;
  padding: 2px 7px;
  background: #d92d20;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.usd-note { margin: 0 0 10px; color: var(--muted); font-size: 0.8rem; font-weight: 600; overflow-wrap: anywhere; }
.price-usd {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-add {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-add:disabled { background: #d4d4d8; color: #52525b; cursor: not-allowed; }
.stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  background: var(--accent-soft);
  border-radius: 12px;
  min-width: 0;
}
.stepper button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.stepper span { text-align: center; font-weight: 800; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.05rem;
}
.empty p { margin: 0; font-size: 0.92rem; line-height: 1.4; }

/* Barra del carrito */
.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
}
.cart-bar[hidden] { display: none; }
.cart-bar:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, #fff); outline-offset: 3px; }
.cart-bar-count {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  min-width: 28px;
  padding: 2px 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.cart-bar-label { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-bar-total { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Hojas (checkout, confirmación, cocción) */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  background: rgba(12, 10, 8, 0.62);
  /* Sin backdrop-filter: en Chromium deja un borde/hueco transparente en el sheet */
  overflow: hidden;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  min-width: 0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  isolation: isolate;
  transform: translateZ(0);
  overflow: hidden;
  overflow-x: clip;
}
.sheet-grab {
  width: 40px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(26, 23, 20, 0.18);
  flex-shrink: 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}
.sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: -4px -4px -4px 8px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sheet-close svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.sheet-close:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.sheet-close:active {
  transform: scale(0.94);
}
.sheet-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sheet-close:focus:not(:focus-visible) {
  outline: none;
}
.sheet-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px 18px;
  min-width: 0;
  width: 100%;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.line-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.line-price { font-weight: 700; white-space: nowrap; }
.line-qty { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.line-qty button {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  font-weight: 800; cursor: pointer;
}
.line-qty .line-unit { color: var(--muted); font-size: 0.82rem; }
.line-out { color: var(--no); font-size: 0.8rem; font-weight: 700; grid-column: 1 / -1; }
.totals {
  display: grid;
  gap: 6px;
  padding: 14px 12px;
  margin-top: 4px;
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
  border-radius: 14px;
}
.totals div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.totals .totals-main {
  color: var(--ink);
  font-size: 1.18rem;
  font-family: var(--font-display);
}
.totals .totals-main strong { font-variant-numeric: tabular-nums; }

.order-form { display: grid; gap: 12px; margin-top: 12px; }
.fulfillment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fulfillment[hidden] { display: none; }
.fulfillment label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0;
  cursor: pointer;
}
.fulfillment label span { overflow-wrap: anywhere; }
.fulfillment input { accent-color: var(--accent); flex-shrink: 0; }
.fulfillment label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-choice { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.pay-choice[hidden] { display: none; }
.pay-choice legend { padding: 0; margin-bottom: 6px; font-size: 0.86rem; font-weight: 700; }
.pay-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
  cursor: pointer;
}
.pay-choice label span { overflow-wrap: anywhere; }
.pay-choice input { accent-color: var(--accent); flex-shrink: 0; }
.pay-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field { display: grid; gap: 5px; font-size: 0.86rem; font-weight: 600; min-width: 0; }
.field[hidden] { display: none; }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  font-weight: 400;
  background: #fafafa;
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); background: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  margin: 0;
  color: var(--no);
  background: rgba(185, 28, 28, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.86rem;
}
.form-error[hidden] { display: none; }
.btn-primary, .btn-wa, .btn-ghost {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled, .btn-wa:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa[hidden] { display: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.pay-hint { margin: 0; text-align: center; color: var(--muted); font-size: 0.82rem; }

.done { align-items: center; text-align: center; padding: 26px 20px calc(20px + env(safe-area-inset-bottom)); gap: 10px; }
.done-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800;
}
.done-mark.is-wait { background: #a16207; color: #fff; }
.done-mark.is-bad { background: var(--no); color: #fff; }
.done h2 { margin: 4px 0 0; font-size: 1.5rem; }
.btn-primary[hidden] { display: none; }
.done-text { margin: 0; font-size: 1.02rem; line-height: 1.4; }
.done-code { margin: 0 0 6px; color: var(--muted); }

.cook-card {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
}
.cook-title { margin: 0; font-weight: 800; font-size: 1.05rem; }
.cook-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cook-actions button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 700;
  cursor: pointer;
}

/* Detalle del producto con galería */
.sheet-head h2 { min-width: 0; }
.sheet.detail {
  overflow: hidden;
  overflow-x: clip;
  padding-bottom: 0;
  max-height: 94vh;
  max-height: 94dvh;
  background: var(--panel);
}
.detail .sheet-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
}
.detail-body { padding: 0 0 8px; width: 100%; max-width: 100%; background: var(--panel); }
.gallery {
  position: relative;
  background: #ece8e1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.gallery-track {
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  min-width: 0;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  max-height: min(56vh, 520px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ece8e1;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  box-sizing: border-box;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-slide--empty span { font-size: 3.2rem; font-weight: 700; color: rgba(24, 24, 27, 0.2); }
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-size: 1.7rem;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
}
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-nav:disabled { opacity: 0; pointer-events: none; }
.gallery-nav:focus-visible, .gallery-dots button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.gallery-dots button {
  width: 22px;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: width 0.15s;
}
.gallery-dots button.active::before { width: 18px; background: var(--accent); }
.detail-info { display: grid; gap: 8px; padding: 12px 16px 4px; min-width: 0; }
.detail-cat {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.detail-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.detail-price strong { font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.detail-price .price-usd { font-size: 0.92rem; }
.detail-info .price-old-row { margin-bottom: -6px; }
.detail-info .price-old { font-size: 0.98rem; }
.detail-info .off-badge { font-size: 0.72rem; }
.detail-stock {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 9px;
}
.detail-stock.ok { color: var(--ok); background: rgba(21, 128, 61, 0.1); }
.detail-stock.no { color: #fff; background: var(--no); }
.detail-desc { margin: 0; white-space: pre-line; line-height: 1.45; font-size: 0.95rem; overflow-wrap: anywhere; }
.detail-units h3 { margin: 4px 0 6px; font-size: 0.88rem; }
.detail-units ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail-units li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.units-note { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }
.detail-actions {
  display: grid;
  gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  background: var(--panel);
  flex-shrink: 0;
}
.detail-actions:empty { display: none; }
.detail-add .btn-add { padding: 13px; font-size: 1rem; }
.detail-add .stepper { grid-template-columns: 48px minmax(0, 1fr) 48px; }
.detail-add .stepper button { height: 44px; }
.detail-actions .btn-wa, .detail-actions .btn-ghost { padding: 12px; font-size: 0.95rem; }

/* Mesa (QR) */
.table-bar {
  display: grid;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
.table-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.table-bar-label {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-bar-hint {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.table-bar-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.table-bar-actions button {
  min-width: 0;
  display: grid;
  gap: 4px;
  justify-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 14px;
  padding: 10px 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: transform 0.15s ease, background 0.2s ease;
}
.table-bar-actions button:hover { background: color-mix(in srgb, var(--accent-soft) 70%, #fff); }
.table-bar-actions button:active { transform: scale(0.97); }
.table-bar-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.table-bar-actions .tb-ico {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
}
.table-bar-actions button:disabled { opacity: 0.6; cursor: default; transform: none; }
body.is-table .hero-cover { height: 180px; }
.table-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(185, 28, 28, 0.08);
  color: var(--no);
  font-size: 0.88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.mt-order { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; min-width: 0; }
.mt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; min-width: 0; }
.mt-head strong { font-size: 0.92rem; min-width: 0; overflow-wrap: anywhere; }
.mt-state { flex-shrink: 0; border-radius: 999px; padding: 3px 9px; font-size: 0.75rem; font-weight: 700; }
.mt-state.is-wait { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.mt-state.is-ok { background: rgba(21, 128, 61, 0.1); color: var(--ok); }
.mt-order .cart-lines { margin: 0; }

@media (min-width: 640px) {
  .table-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); align-items: center; }
  .table-bar-actions button { font-size: 0.84rem; }
  .product--list .product-open { grid-template-columns: 110px minmax(0, 1fr); }
  .product-thumb { width: 110px; height: 110px; }
}

.foot { text-align: center; padding: 18px 12px 28px; color: var(--muted); font-size: 0.78rem; }
.foot a { color: inherit; font-weight: 600; }

@media (max-width: 639.98px) {
  .sheet,
  .sheet.detail,
  .cook-card {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
  }
}
@media (min-width: 640px) {
  .hero { padding: 0 16px 16px; }
  .hero-cover {
    height: 230px;
    border-radius: 0 0 28px 28px;
    margin: 0 auto;
    max-width: 980px;
  }
  body.is-table .hero-cover { height: 250px; }
  .product-grid:not(.product-grid--list) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .product-grid--list { max-width: 720px; margin: 0 auto; }
  .sheet-backdrop { align-items: center; padding: 16px; box-sizing: border-box; }
  .sheet,
  .sheet.detail {
    width: min(560px, calc(100% - 0px));
    max-width: 100%;
    border-radius: 22px;
  }
  .cook-card { border-radius: 22px; width: min(420px, 100%); max-width: 100%; }
  .sheet-grab { display: none; }
}
@media (min-width: 900px) {
  .product-grid:not(.product-grid--list) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stock-badge, .photo-count { z-index: 1; }
.stepper { animation: pop 0.28s ease-out; }
.btn-add { transition: transform 0.15s ease, filter 0.2s ease; }
.btn-add:not(:disabled):active { transform: scale(0.96); }
.btn-add:not(:disabled):hover { filter: brightness(1.08); }
@keyframes pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .product, .stepper, .product.hint .flip-inner, .status--loading::before { animation: none; }
  .flip-inner, .cat-pill, .face, .flip-hint, .table-bar-actions button { transition: none; }
}
