:root {
  --bg: #131315;          /* pizarra, como el fondo de la carta impresa */
  --bg-raised: #1c1c1f;
  --bg-sheet: #181819;
  /* Mismos colores de la carta impresa: pizarra, rojo y blanco */
  --red: #e01b22;
  --red-deep: #a8131a;
  --red-soft: #ff6b70;
  --gold: #ffc21a;
  --gold-deep: #f08a00;
  --ink: #1b0d05;
  --text: #f4f3f1;
  --text-muted: rgba(244, 243, 241, 0.66);
  --text-faint: rgba(244, 243, 241, 0.45);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --danger: #ff8a7a;
  --wa: #25d366;

  --radius: 14px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 112px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  background:
    radial-gradient(120% 40% at 50% 0%, #26262a 0%, rgba(38, 38, 42, 0) 70%),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body.is-locked { overflow: hidden; }

button,
input,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--red-soft);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(19, 19, 21, 0.96);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.top__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
  min-height: 56px;
  padding: 0 max(0.5rem, env(safe-area-inset-right)) 0 max(0.5rem, env(safe-area-inset-left));
}

.top__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.top__logo { width: 36px; height: 36px; margin-left: auto; margin-right: 0.25rem; border-radius: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.06); }

/* Category chips */
.cats {
  display: flex;
  gap: 0.5rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.25rem 1rem 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cats::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.chip[aria-current="true"] {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------- Menu ---------- */
.menu {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 7rem max(1rem, env(safe-area-inset-left));
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--line);
}
.notice__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--red-soft);
}
.notice p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.notice strong { color: var(--text); font-weight: 600; }

/* Segmented control built from radios */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}
.segmented__opt { position: relative; display: block; }
.segmented__opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.segmented__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 44px;
  padding: 0 0.5rem;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  transition: background-color 200ms ease, color 200ms ease;
}
.segmented__opt input:checked + span {
  background: var(--red);
  color: #fff;
  font-weight: 600;
}
.segmented__opt input:focus-visible + span {
  outline: 3px solid var(--red-soft);
  outline-offset: 2px;
}

.section { padding-top: 1.75rem; }

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.625rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}
.section__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 0.375rem;
  border-radius: 2px;
  background: var(--red);
}
.section__note {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.items {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }

.item__body { flex: 1; min-width: 0; }

.item__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.45rem;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.item__desc {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.item__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.item__price {
  margin: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.item__price small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0;
}

.item__action { flex-shrink: 0; }

/* Items with a photo: thumbnail on the left of the text */
.thumb {
  position: relative;
  flex-shrink: 0;
  display: block;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-raised);
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.thumb:active { transform: scale(0.97); }
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb__zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(10, 6, 4, 0.72);
  color: #fff;
}
@media (max-width: 360px) {
  .thumb { width: 84px; height: 84px; }
}

/* ---------- Photo viewer ---------- */
.viewer {
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0b0c;
  color: var(--text);
  opacity: 1;
  transform: none;
  transition: opacity 220ms var(--ease-out);
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #0b0b0c; }

@starting-style {
  .viewer[open] { opacity: 0; }
  .viewer[open] .viewer__media img { transform: scale(0.94); }
}
.viewer.is-closing { opacity: 0; transition: opacity 180ms var(--ease-out); }

.viewer__media {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 3.5rem) 0.75rem 0.75rem;
}
.viewer__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
  transition: transform 260ms var(--ease-out), filter 200ms ease;
}
/* While the full photo downloads, the small thumbnail is shown softly blurred */
.viewer__media img.is-loading { filter: blur(6px); }
.viewer__media img:not([src]) { visibility: hidden; }

.viewer__close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 0.5rem);
  right: 0.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.viewer__info {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1.25rem max(1rem, env(safe-area-inset-bottom));
}
.viewer__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
}
.viewer__desc {
  margin: 0.375rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.viewer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.875rem;
}
.viewer__price {
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
}
.viewer__price small { font-family: var(--font-body); font-weight: 400; font-size: 0.78rem; color: rgba(255, 255, 255, 0.8); }

/* Add button & stepper */
.add {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.95rem 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.add svg { width: 18px; height: 18px; }
.add:active { transform: scale(0.96); background: var(--red-deep); }
.add__count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  font-size: 0.78rem;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
}
.stepper button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.stepper button:active { transform: scale(0.9); }
.stepper svg { width: 18px; height: 18px; }
.stepper output {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stepper--dark {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.menu__foot {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Cart bar ---------- */
.cartbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 0.75rem max(1rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(19, 19, 21, 0.98) 55%, rgba(19, 19, 21, 0));
  transform: translateY(110%);
  transition: transform 320ms var(--ease-drawer);
  pointer-events: none;
}
.cartbar.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.cartbar__btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 688px;
  margin: 0 auto;
  min-height: 58px;
  padding: 0 1.1rem 0 0.7rem;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(180deg, #f3262d 0%, var(--red) 45%, var(--red-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 24px rgba(168, 19, 26, 0.45);
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out);
}
.cartbar__btn:active { transform: scale(0.98); }

.cartbar__count {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: #fff;
  color: var(--red);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cartbar__count.is-bumping { animation: bump 260ms var(--ease-out); }

.cartbar__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cartbar__total {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- Sheets ---------- */
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--bg-sheet);
  color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 320ms var(--ease-drawer);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet--tall { height: 92dvh; max-height: 92dvh; }

@starting-style {
  .sheet[open] { transform: translateY(100%); }
}
.sheet.is-closing {
  transform: translateY(100%);
  transition: transform 200ms var(--ease-out);
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: 20px; }
  .sheet--tall { height: auto; max-height: 88dvh; }
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.sheet__title {
  margin: 0;
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.25rem 1.25rem;
}

.sheet__foot {
  padding: 0.75rem 1.25rem max(0.75rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-sheet);
}
.sheet__note {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f3262d 0%, var(--red) 45%, var(--red-deep) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: transform 160ms var(--ease-out), opacity 200ms ease;
}
.cta:active { transform: scale(0.98); }
.cta:disabled { opacity: 0.45; }
.cta svg { width: 24px; height: 24px; }
.cta--wa { background: var(--wa); color: #06270f; }

.ghost {
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--red);
  background: transparent;
  color: #fff;
  font-weight: 600;
}

.text-btn {
  display: block;
  margin: 1rem auto 0;
  min-height: 44px;
  padding: 0 1rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Options sheet */
.opt-desc { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.9rem; }

.choices { display: grid; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; border: 0; }
.choices legend { margin-bottom: 0.5rem; font-weight: 600; font-size: 0.95rem; padding: 0; }

.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  transition: border-color 200ms ease, background-color 200ms ease;
}
.choice span::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.choice b { flex: 1; font-weight: 500; }
.choice em { font-style: normal; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.choice input:checked + span { border-color: var(--red); background: rgba(224, 27, 34, 0.12); }
.choice input:checked + span::before { border-color: var(--red); box-shadow: inset 0 0 0 4px var(--bg-sheet), inset 0 0 0 10px var(--red); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

/* Cart lines */
.lines { list-style: none; margin: 0; padding: 0; }

.line {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--line);
}
.line__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.line__info { flex: 1; min-width: 0; }
.line__name { margin: 0; font-weight: 600; line-height: 1.3; }
.line__meta { margin: 0.15rem 0 0; font-size: 0.8125rem; color: var(--text-muted); }
.line__price {
  margin: 0.2rem 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.line__note {
  width: 100%;
  margin-top: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.875rem;
}
.line__note::placeholder { color: var(--text-faint); }

.cart-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.group {
  margin: 1.5rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.group__title {
  padding: 0;
  margin-bottom: 0.625rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.field { display: block; margin-top: 0.875rem; }
.group__title + .segmented + .field,
.group__title + .field { margin-top: 0; }

.field__label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.field__label small { color: var(--text-faint); font-weight: 400; }

.field__input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.875rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.3);
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  transition: border-color 200ms ease;
  resize: vertical;
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:focus { border-color: var(--red-soft); outline: none; }
.field__input[aria-invalid="true"] { border-color: var(--danger); }

.field__error {
  display: block;
  min-height: 0;
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--danger);
}
.field__error:empty { display: none; }

.summary {
  margin: 1.5rem 0 0;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}
.summary dt { color: var(--text-muted); }
.summary dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.summary__total {
  margin-top: 0.375rem;
  padding-top: 0.625rem !important;
  border-top: 1px solid var(--line);
}
.summary__total dt,
.summary__total dd {
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.noscript { padding: 2rem 1rem; text-align: center; }

@media (hover: hover) and (pointer: fine) {
  .add:hover { background: var(--red-deep); }
  .chip:not([aria-current="true"]):hover { border-color: var(--red); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet.is-closing,
  .cartbar { transition: opacity 200ms ease; }
  @starting-style { .sheet[open] { transform: none; } }
  .sheet.is-closing { transform: none; opacity: 0; }
  @starting-style { .viewer[open] .viewer__media img { transform: none; } }
  .cartbar { transform: none; opacity: 0; }
  .cartbar.is-visible { opacity: 1; }
  .cartbar__count.is-bumping { animation: none; }
}
