:root {
  color-scheme: dark;

  /* Paleta del cliente (5 tonos, blanco a casi-negro) + azul marino aparte,
     reservado solo para botones. */
  --t1: #FFFFFF;
  --t2: #D6D6D6;
  --t3: #898A8C;
  --t4: #545A5B;
  --t5: #06151E;
  --white: #FFFFFF;

  --bg: var(--t5);
  --surface: rgba(38, 43, 44, 0.6);
  --surface-2: rgba(27, 31, 32, 0.6);
  --surface-hover: rgba(51, 57, 58, 0.7);
  --panel-glass: rgba(6, 21, 30, 0.72);
  --blur-amt: 18px;

  --text-primary: var(--t1);
  --text-secondary: var(--t2);
  --text-tertiary: var(--t3);
  --border: rgba(214, 214, 214, 0.16);
  --border-strong: rgba(214, 214, 214, 0.4);

  /* Azul marino (swatch del cliente): solo para botones. El resto de acentos
     (tabs, links, foco) usan --accent, más claro, porque el marino puro no
     da contraste suficiente como texto sobre este fondo oscuro. */
  --navy: #122861;
  --navy-light: #2C4A9E;
  --navy-pressed: #0E2050;
  --accent: #4C86FF;
  --blue-soft: rgba(76, 134, 255, 0.2);

  /* Azul de acción (swatch del cliente, mismo tono que --accent): relleno de
     los botones reales. Ese azul da ~3.4:1 de contraste con texto blanco (no
     pasa AA en texto normal), así que el texto va en --btn-ink, un tono casi
     negro — igual recurso que antes con el verde. --navy sigue solo en el
     resplandor de fondo (#glowBg); WhatsApp no se toca (--whatsapp*). */
  --btn-bg: var(--accent);
  --btn-bg-pressed: #3E6ED1;
  --btn-ink: var(--t5);

  --red: #FF453A;
  --whatsapp: #25D366;
  --whatsapp-ink: #063620;
  --whatsapp-pressed: #1EBE5A;

  /* Degradés reutilizables, construidos con la paleta de 5 tonos (translúcidos
     para el efecto vidrio: se combinan con backdrop-filter: blur). */
  --grad-card: linear-gradient(180deg, rgba(84, 90, 91, 0.5) 0%, rgba(42, 47, 48, 0.55) 100%);
  --grad-dark: linear-gradient(135deg, var(--t4) 0%, var(--t5) 100%);
  --grad-placeholder: linear-gradient(160deg, var(--t3) 0%, var(--t4) 100%);

  --font-title: "Montserrat", sans-serif;
  --font-body: "Poppins", sans-serif;
  --font-accent: "Dancing Script", cursive;

  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 12px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-float: 0 6px 16px rgba(76, 134, 255, 0.28);

  /* Aire vertical entre secciones (guía de estilo: 100 a 160 px) y entre categorías. */
  --air-section: 100px;
  --air-item: 64px;

  /* Layout fluido: el contenido ocupa todo el ancho hasta --max-w y se centra; --gx es el
     margen lateral (mínimo 16px, respeta la zona segura de celulares en horizontal). */
  --max-w: 1200px;
  --gx: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), calc((100% - var(--max-w)) / 2));

  --topbar-h: 64px;
  --tabs-h: 48px;
  --tap: 44px;

  --z-sticky: 20;
  --z-bar: 30;
  --z-toast: 40;
}

* {
  box-sizing: border-box;
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

/* Resplandor fijo detrás de toda la app: los paneles de vidrio (topbar, tabs,
   cards) se difuminan sobre esto, como en la referencia del cliente. */
#glowBg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

#glowBg::before {
  content: "";
  position: absolute;
  top: -18%;
  left: 50%;
  width: 85vw;
  height: 85vw;
  max-width: 560px;
  max-height: 560px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--navy-light) 0%, var(--navy) 55%, transparent 75%);
  filter: blur(60px);
  opacity: 0.75;
}

#glowBg::after {
  content: "";
  position: absolute;
  bottom: -12%;
  right: -18%;
  width: 70vw;
  height: 70vw;
  max-width: 460px;
  max-height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--t4) 0%, transparent 72%);
  filter: blur(70px);
  opacity: 0.55;
}

button, input, select, textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
}

button, a, summary, label {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

h1, h2, h3 {
  text-wrap: balance;
}

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: var(--z-toast);
  background: var(--btn-bg);
  color: var(--btn-ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 var(--gx);
  position: sticky;
  top: 0;
  background: var(--panel-glass);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  z-index: var(--z-sticky);
}

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.15s;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.search-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  height: var(--tap);
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-wrap input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  width: 100%;
  min-width: 0;
}

.search-wrap input::placeholder {
  color: var(--text-tertiary);
}

.portada {
  padding: 4px var(--gx) 6px;
}

.portada .segmented {
  max-width: 560px;
  margin-inline: auto;
}

.portada-banner {
  max-width: 960px;
  margin-inline: auto;
  aspect-ratio: 1200 / 457;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grad-placeholder);
}

.portada-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portada-negocio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 28px 0 22px;
  text-align: center;
}

.portada-datos {
  min-width: 0;
}

.portada-nombre {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.portada-nombre img {
  height: 38px;
  margin-inline: auto;
  width: auto;
  display: block;
}

.portada-eslogan {
  margin: 8px 0 0;
  font-style: italic;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.portada-info {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.portada-info li {
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.portada-info svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--t3);
}

.portada-nota {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-tertiary);
  text-align: center;
}

.portada-nota strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ---------- Producto del mes ---------- */

.destacado {
  margin-top: var(--air-section);
  padding: 0 var(--gx);
}

.destacado-link {
  position: relative;
  display: block;
  max-width: 960px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--white);
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.destacado-media {
  position: absolute;
  inset: 0;
  background: var(--grad-placeholder);
}

.destacado-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.destacado-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0) 100%);
}

.destacado-badge {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--t5);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.destacado-nombre {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 21px;
  line-height: 1.15;
  text-transform: uppercase;
  text-wrap: balance;
}

.destacado-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
  max-width: 44ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.destacado-precio {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.destacado-cta {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

@media (hover: hover) {
  .destacado-link:hover .destacado-media img {
    transform: scale(1.03);
  }
}

.destacado-media img {
  transition: transform 0.25s ease-out;
}

/* ---------- Tabs ---------- */

.tabs {
  margin-top: var(--air-section);
  display: flex;
  gap: 24px;
  padding: 0 var(--gx);
  overflow-x: auto;
  position: sticky;
  top: var(--topbar-h);
  height: var(--tabs-h);
  background: var(--panel-glass);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 15px;
  padding: 0 2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Catálogo ---------- */

#catalogView {
  padding: 4px var(--gx) 112px;
}

.category-section:first-child {
  padding-top: 32px;
}

.category-section {
  padding-top: var(--air-item);
  scroll-margin-top: calc(var(--topbar-h) + var(--tabs-h) + 4px);
}

.category-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  margin: 0 0 20px;
  text-align: center;
}

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  overflow: hidden;
}

.product-grid li > .product-card {
  height: 100%;
}

.product-grid li:not(:first-child) {
  border-top: 1px solid var(--border);
}

.product-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s;
}

a.product-card:active {
  background: var(--surface-hover);
}

@media (hover: hover) {
  a.product-card:hover {
    background: var(--surface-hover);
  }
}

.product-card-info {
  flex: 1;
  min-width: 0;
}

.product-card-nombre {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}

.product-card-desc {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-sin-stock {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}

.product-card.is-unavailable .product-card-nombre,
.product-card.is-unavailable .product-card-desc,
.product-card.is-unavailable .product-card-price > :first-child,
.product-card.is-unavailable .product-card-thumb {
  opacity: 0.5;
}

.product-card-thumb {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--grad-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t5);
  overflow: hidden;
}

.product-card-thumb svg {
  width: 34px;
  height: 34px;
}

.product-card-thumb img,
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0 0 6px;
}

.empty-state strong {
  color: var(--text-primary);
}

.empty-state .btn-secondary {
  margin-top: 14px;
}

/* ---------- Vistas de detalle y pedido ---------- */

.detail-view,
.cart-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--gx) minmax(0, 1fr) var(--gx);
  align-content: start;
}

.detail-view {
  grid-template-rows: auto auto 1fr auto;
}

.detail-view > *,
.cart-view > * {
  grid-column: 2;
}

.detail-view > .detail-topbar,
.cart-view > .detail-topbar,
.detail-view > .detail-footer {
  grid-column: 1 / -1;
}

.detail-view:not(.hidden),
.cart-view:not(.hidden) {
  animation: vista-in 0.35s ease-out;
}

@keyframes vista-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 var(--gx);
  position: sticky;
  top: 0;
  background: var(--panel-glass);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  z-index: var(--z-sticky);
}

.detail-topbar-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.topbar-spacer {
  width: var(--tap);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-hero {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: var(--grad-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t5);
  overflow: hidden;
}

.detail-hero svg {
  width: 64px;
  height: 64px;
}

.detail-body {
  padding: 18px 0 8px;
}

.detail-categoria {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  margin: 0 0 2px;
}

.detail-nombre {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.detail-descripcion {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 12px;
  max-width: 60ch;
}

.detail-precio {
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin: 0 0 20px;
}

/* Grupos de extras */

.extra-group {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
}

.extra-group summary {
  list-style: none;
  cursor: pointer;
  min-height: var(--tap);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.extra-group-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.extra-group-title {
  font-weight: 700;
  font-size: 15px;
}

.extra-group-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.extra-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.extra-group[open] .extra-chevron {
  transform: rotate(180deg);
}

.extra-group-body {
  border-top: 1px solid var(--border);
}

.extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.extra-group-body .extra-row:first-child {
  border-top: none;
}

div.extra-row {
  cursor: default;
}

.extra-row-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.extra-row-nombre {
  font-size: 15px;
}

.extra-row-precio {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.extra-hint {
  margin: 0;
  padding: 0 14px;
  font-size: 13px;
  color: var(--red);
}

.extra-hint:not(:empty) {
  padding-block: 10px;
  border-top: 1px solid var(--border);
}

.extra-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

.extra-checkbox:checked {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
}

.extra-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid var(--btn-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.mini-stepper,
.cart-qty,
.qty-stepper {
  display: flex;
  align-items: center;
}

.mini-stepper {
  gap: 4px;
  flex-shrink: 0;
}

.mini-stepper button,
.cart-qty button,
.qty-stepper button {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  transition: background-color 0.12s;
}

.mini-stepper button:disabled,
.cart-qty button:disabled,
.qty-stepper button:disabled {
  color: var(--text-tertiary);
  opacity: 0.6;
}

@media (hover: hover) {
  .mini-stepper button:not(:disabled):hover,
  .cart-qty button:not(:disabled):hover,
  .qty-stepper button:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.stepper-val,
.cart-qty-val,
#qtyValue {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.detail-nota {
  margin: 4px 0 20px;
}

.detail-nota label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.detail-nota textarea,
.field input {
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  padding: 12px 14px;
}

.detail-nota textarea {
  resize: none;
}

.detail-nota textarea::placeholder,
.field input::placeholder {
  color: var(--text-tertiary);
}

.detail-nota textarea:focus-visible,
.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.detail-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--gx) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border-top: 1px solid var(--border);
}

.qty-stepper {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary,
.btn-whatsapp {
  min-height: 52px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  padding: 0 22px;
  transition: transform 0.1s, background-color 0.15s;
}

.btn-primary:active,
.btn-secondary:active,
.btn-whatsapp:active,
.cart-bar:active {
  transform: scale(0.98);
}

.btn-primary {
  flex: 1;
  background: var(--btn-bg);
  color: var(--btn-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--btn-bg-pressed);
  }
  .btn-secondary:hover {
    background: var(--blue-soft);
  }
}

/* ---------- Pedido ---------- */

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

.cart-item {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
}

.cart-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cart-item-nombre {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.cart-item-subtotal {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  flex-shrink: 0;
}

.cart-item-extras {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.cart-item-nota {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.cart-qty {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.cart-item-quitar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 12px;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.cart-item-quitar svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .cart-item-quitar:hover {
    color: var(--red);
  }
}

.cart-summary {
  padding: 16px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 18px;
}

.cart-total-row #cartTotal {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--border);
  background: rgba(214, 214, 214, 0.06);
  border-radius: 999px;
  position: relative;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  transition: background-color 0.15s, color 0.15s;
}

.segmented input:checked + span {
  background: var(--btn-bg);
  color: var(--btn-ink);
}

.segmented label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 999px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input[aria-invalid="true"] {
  border-color: var(--red);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--red);
}

.btn-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--whatsapp);
  color: var(--whatsapp-ink);
  text-decoration: none;
  margin-top: 8px;
}

@media (hover: hover) {
  .btn-whatsapp:hover {
    background: var(--whatsapp-pressed);
  }
}

/* ---------- Barra de pedido, avisos y diálogo ---------- */

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(448px, calc(100% - 32px));
  transform: translateX(-50%);
  min-height: 56px;
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-float);
  z-index: var(--z-bar);
}

.cart-bar:active {
  transform: translateX(-50%) scale(0.98);
}

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-bar-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--white);
  color: var(--btn-ink);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.cart-bar-total {
  font-variant-numeric: tabular-nums;
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: min(448px, calc(100% - 32px));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
  background: var(--grad-dark);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.toast-action {
  min-height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--white);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.info-dialog {
  width: min(400px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  color: var(--text-primary);
  overscroll-behavior: contain;
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.info-dialog-body {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-dialog h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 24px;
  color: var(--text-primary);
}

.info-dialog p {
  margin: 0;
  color: var(--text-secondary);
}

.btn-text {
  min-height: var(--tap);
  padding: 0 14px;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

@media (hover: hover) {
  .btn-text:hover {
    background: var(--blue-soft);
  }
}

.programado-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
}

.programado-row svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--t3);
}

.programado-row p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.programado-row strong {
  color: var(--text-primary);
}

.programar-body {
  text-align: center;
  align-items: stretch;
}

.programar-icono {
  width: 76px;
  height: 76px;
  margin: 4px auto 4px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.programar-icono svg {
  width: 34px;
  height: 34px;
}

.programar-acciones,
.programar-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.programar-form[hidden],
.programar-acciones[hidden] {
  display: none;
}

.programar-form label {
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.programar-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 16px;
}

.programar-centro {
  justify-content: center;
  margin-top: 6px;
}

.info-link {
  margin-top: 4px;
}

/* Movimiento: fade + desplazamiento suave al entrar en pantalla (300–600 ms, sin rebotes). */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ----------
   Base = celular. Tablet desde 720px, escritorio desde 900px (detalle y pedido en 2 columnas)
   y pantallas grandes desde 1280px (menú en 3 columnas). */

@media (min-width: 720px) {
  :root {
    --air-item: 80px;
  }

  .topbar {
    gap: 14px;
  }

  .search-wrap {
    max-width: 640px;
    margin-inline: auto;
  }

  .tabs {
    justify-content: safe center;
  }

  .portada-nombre img {
    height: 52px;
  }

  .portada-eslogan {
    font-size: 14px;
  }

  .portada-info li {
    font-size: 16px;
  }

  .portada-nota {
    font-size: 17px;
  }

  .destacado-link {
    aspect-ratio: 21 / 9;
  }

  .destacado-nombre {
    font-size: 30px;
  }

  .destacado-desc {
    font-size: 15px;
  }

  .category-title {
    font-size: 28px;
  }

  .product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-grid li:not(:first-child) {
    border-top: 0;
  }

  .product-grid li:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .product-grid li:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .product-card {
    padding: 18px;
  }

  .product-card-nombre {
    font-size: 16px;
  }

  .product-card-desc {
    font-size: 14px;
  }

  .product-card-thumb {
    width: 104px;
    height: 104px;
  }
}

@media (min-width: 900px) {
  .detail-view {
    grid-template-columns: var(--gx) minmax(0, 1.05fr) 48px minmax(0, 1fr) var(--gx);
    grid-template-rows: auto 1fr auto;
  }

  .detail-view > .detail-hero {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
    margin-top: 24px;
  }

  .detail-view > .detail-body {
    grid-column: 4;
    grid-row: 2;
    padding-top: 24px;
  }

  .detail-view > .detail-footer {
    grid-row: 3;
    justify-content: center;
  }

  .detail-footer .btn-primary {
    max-width: 420px;
  }

  .detail-nombre {
    font-size: 36px;
  }

  .detail-precio {
    font-size: 24px;
  }

  .detail-descripcion {
    font-size: 16px;
  }

  .cart-view {
    grid-template-columns: var(--gx) minmax(0, 1.1fr) 48px minmax(0, 1fr) var(--gx);
  }

  .cart-view > .cart-items {
    grid-column: 2;
    grid-row: 2;
    padding-top: 24px;
  }

  .cart-view > .cart-summary {
    grid-column: 4;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: calc(var(--topbar-h) + 24px);
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--grad-card);
  }

  .cart-view:has(> .cart-summary.hidden) > .cart-items {
    grid-column: 2 / 5;
  }
}

@media (min-width: 1024px) {
  :root {
    --air-section: 140px;
    --air-item: 96px;
  }
}

@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-grid li:nth-child(n + 3) {
    border-top: 0;
  }

  .product-grid li:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

  .product-grid li:nth-child(even) {
    border-left: 0;
  }

  .product-grid li:not(:nth-child(3n + 1)) {
    border-left: 1px solid var(--border);
  }
}

/* Celulares en horizontal: menos aire vertical y diálogos que hacen scroll. */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --air-section: 64px;
    --air-item: 48px;
  }

  .detail-hero {
    aspect-ratio: 16 / 9;
  }
}

/* Ajustes finos de la grilla y del resplandor en pantallas grandes. */
@media (min-width: 720px) {
  #glowBg::before {
    opacity: 0.5;
  }

  .product-grid li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1280px) {
  .product-grid li:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .product-grid li:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
  }

  .product-grid li:last-child:nth-child(3n + 2) {
    grid-column: 2 / -1;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .portada-banner {
    max-width: 560px;
  }
}
