/* Colores, fuentes y radios de la carta. Los temas de cada restaurante (restaurantes/<slug>/web/css/tema.css,
   que se carga después) los redefinen; los colores de estado (avisos ámbar, errores rojos) y los de las
   etiquetas de dietas y alérgenos no forman parte del tema. */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-deep: #047857;
  --primary-ink: #065f46;
  --primary-ink-hover: #044332;
  --primary-soft: #ecfdf5;
  --primary-border: #6ee7b7;
  --primary-border-soft: #a7f3d0;
  /* Texto sobre --primary, --primary-ink y los fondos de color de botones y avisos */
  --on-primary: #ffffff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --danger: #ef4444;
  --radius: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Títulos (marca, familias, platos, modales) */
  --font-display: var(--font-sans);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

/* Con algo en la cesta se ve la barra del pedido (abajo, fija): se deja su hueco al final de la página */
body.con-cesta {
  padding-bottom: 90px;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Enlaces de la cabecera del tema (NAV_TEMA de js/tema.js): entre la marca y el idioma; en móvil, en una
   segunda fila. Sin enlaces (carta genérica) el contenedor está vacío y no ocupa nada. */
header:has(.nav-tema:not(:empty)) {
  flex-wrap: wrap;
  column-gap: 1.5rem;
  row-gap: 0.4rem;
}

.nav-tema {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem clamp(0.75rem, 2vw, 1.6rem);
  margin-left: auto;
  font-size: 0.95rem;
}

.nav-tema:empty {
  display: none;
}

.nav-tema a {
  padding: 0.25rem 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}

.nav-tema a:hover {
  color: var(--primary-dark);
}

.nav-tema a[aria-current="page"] {
  border-bottom-color: var(--primary);
}

@media (max-width: 640px) {
  .nav-tema {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
}

/* Logo con enlace a la landing: oculto salvo que el tema lo pinte (restaurantes/<slug>/web/css/tema.css) */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-logo {
  display: none;
  flex-shrink: 0;
}

/* Títulos con la fuente de display del tema (por defecto, la misma que el texto) */
.brand h1,
.family-title,
.card h3,
.modal-header h3,
.drawer-header h3,
.tracker-screen-brand h2 {
  font-family: var(--font-display);
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

/* Selector de idioma ES / CA */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 9999px;
  overflow: hidden;
}

.lang-btn {
  background: var(--surface);
  border: none;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}

.lang-btn.active {
  background: var(--primary-dark);
  color: var(--on-primary);
}

.alert-banner {
  background: #fee2e2;
  border-bottom: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}

.active-order-banner {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--primary-soft) 100%);
  border-bottom: 1px solid var(--primary-border-soft);
  color: var(--primary-ink);
  padding: 0.65rem 1.25rem;
  display: none;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 8%, transparent);
  position: sticky;
  top: 0;
  z-index: 40;
}

.active-order-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.active-order-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.tracker-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 70%, transparent);
  animation: trackerPulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes trackerPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 70%, transparent);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 0%, transparent);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent);
  }
}

.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-pendent {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pill-cocina {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pill-listo {
  background: var(--primary-soft);
  color: var(--primary-deep);
  border: 1px solid var(--primary-border-soft);
}

.pill-completat {
  background: var(--surface-alt);
  color: var(--text-soft);
  border: 1px solid var(--border-strong);
}

.pill-cancelat {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.active-order-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ver-tracker {
  background: var(--primary-dark);
  color: var(--on-primary);
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px color-mix(in srgb, var(--primary-ink) 20%, transparent);
}

.btn-ver-tracker:hover {
  background: var(--primary-ink-hover);
  transform: translateY(-1px);
}

.btn-dismiss-tracker {
  background: transparent;
  border: none;
  color: var(--primary-ink);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.35rem;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.btn-dismiss-tracker:hover {
  opacity: 1;
}

/* Pantalla Completa Dedicada (Dedicated Full-Screen Order Tracker) */
.tracker-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tracker-screen-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  gap: 0.75rem;
}

.btn-tracker-back {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-tracker-back:hover {
  background: var(--border);
  color: var(--primary-dark);
  border-color: var(--border-strong);
}

.tracker-screen-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  flex: 1;
}

.tracker-screen-brand h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tracker-live-tag {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary-ink);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

.tracker-screen-content {
  max-width: 600px;
  width: 100%;
  margin: 1.25rem auto 3rem auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}

.tracker-screen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-back-menu-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.5rem 1rem;
  transition: color 0.15s ease;
}

.btn-back-menu-link:hover {
  color: var(--primary-dark);
}

@media (max-width: 640px) {
  .tracker-screen-header {
    padding: 0.65rem 0.85rem;
  }
  .btn-tracker-back {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }
  .tracker-screen-brand h2 {
    font-size: 0.95rem;
  }
  .tracker-live-tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
  .tracker-screen-content {
    margin: 0.75rem auto 2.5rem auto;
    padding: 0 0.75rem;
  }
  .tracker-screen-card {
    padding: 1rem;
    border-radius: 12px;
  }
}

.tracker-hero {
  background: linear-gradient(135deg, var(--surface-soft) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tracker-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.tracker-id-pill {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  font-family: monospace;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.tracker-headline {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.15rem 0;
}

.tracker-subheadline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.tracker-time-card {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
  text-align: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Stepper Container */
.stepper-container {
  margin: 0.65rem 0 0.4rem 0;
  position: relative;
}

.stepper-track {
  position: absolute;
  top: 16px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: var(--border);
  z-index: 1;
}

.stepper-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.4s ease;
  z-index: 1;
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 25%;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.step-item.completed .step-circle {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--on-primary);
}

.step-item.active .step-circle {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
  animation: pulseStep 2s infinite;
}

@keyframes pulseStep {
  0%,
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 45%, transparent);
  }
}

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.15;
}

.step-item.completed .step-label,
.step-item.active .step-label {
  color: var(--text);
}

/* Pickup Instructions Box */
.tracker-instructions {
  background: var(--primary-soft);
  border: 1px dashed var(--primary-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--primary-ink);
  line-height: 1.35;
}

.tracker-instructions.anulado {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.tracker-instructions-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Items Accordion / Summary */
.tracker-items-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.tracker-items-header {
  padding: 0.6rem 0.85rem;
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.tracker-items-header:hover {
  background: var(--surface-alt);
}

.tracker-items-list {
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  max-height: 140px;
  overflow-y: auto;
}

.tracker-item-row {
  display: flex;
  justify-content: space-between;
  color: var(--text);
}

/* Support / Help link */
.tracker-support-box {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.15rem 0 0 0;
}

.tracker-support-box a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

.controls {
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
}

.categories {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.cat-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
}

.cat-btn.active {
  background: var(--text);
  color: var(--on-primary);
  border-color: var(--text);
}

.menu-container,
.menu-grid {
  max-width: 1100px;
  margin: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.family-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.family-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  gap: 1rem;
}

.family-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.family-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}

.family-count-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.family-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  border-color: var(--border-strong);
}

.card-img-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  margin-bottom: 0.85rem;
  background: var(--surface-alt);
  position: relative;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card-img {
  transform: scale(1.05);
}

.modal-product-img-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.card-meta .family-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

/* Descripción escrita en el panel (subpestaña Descripciones) */
.card-desc {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: -0.45rem 0 0.75rem;
}

.modal-product-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Platos con tamaños: el precio está en cada botón de tamaño y abajo solo queda Añadir */
.card-footer.solo-boton {
  justify-content: flex-end;
}

.card .price {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.15rem;
}

.btn-add {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-add:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Selector de tamaño en productos con variantes (BOL M / BOL L) */
.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.variant-chip {
  min-width: 2.6rem;
  padding: 0.35rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.variant-chip:hover:not(:disabled) {
  border-color: var(--primary);
}

.variant-chip.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--on-primary);
}

.variant-chip:disabled {
  color: var(--text-muted);
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Talla y precio en el mismo botón: "L 8,90 €" */
.variant-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.variant-chip-precio {
  font-weight: 600;
  white-space: nowrap;
}

.variant-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-reset-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 0.75rem;
  transition: all 0.15s ease;
}

.btn-reset-filters:hover {
  background: var(--surface-alt);
}

/* ==========================================================================
       ETIQUETAS DIETÉTICAS, ALÉRGENOS Y LEYENDA (UI/UX)
       ========================================================================== */
.dietary-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

.dietary-filter-scroll {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  flex: 1;
}
.dietary-filter-scroll::-webkit-scrollbar {
  display: none;
}

.diet-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.diet-btn:hover {
  border-color: var(--text-faint);
  color: var(--text);
  transform: translateY(-1px);
}

.diet-btn.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--on-primary);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--text) 15%, transparent);
}

.btn-open-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 9999px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-open-legend:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* Badges en la tarjeta del producto */
.card-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0.85rem 0;
}

.badge-diet {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  user-select: none;
  cursor: default;
}

.badge-diet.diet-vegetariano {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-deep);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.badge-diet.diet-vegano {
  background: color-mix(in srgb, var(--primary-dark) 15%, transparent);
  color: var(--primary-ink);
  border-color: color-mix(in srgb, var(--primary-dark) 35%, transparent);
}

.badge-diet.diet-sin_gluten {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-diet.diet-sin_lactosa {
  background: rgba(6, 182, 212, 0.12);
  color: #0e7490;
  border-color: rgba(6, 182, 212, 0.3);
}

.badge-diet.diet-picante {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.3);
}

.badge-diet.diet-especialidad {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
  border-color: rgba(234, 179, 8, 0.3);
}

.badge-diet.diet-nuevo {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.3);
}

.badge-diet.diet-halal {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
  border-color: rgba(20, 184, 166, 0.3);
}

.card-allergens-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.allergen-micro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  line-height: 1;
}

.allergen-micro-badge:hover {
  background: var(--border);
  transform: scale(1.12);
  border-color: var(--border-strong);
}

/* Pie de la carta: aviso de alergias en letra pequeña y enlace a la leyenda (ventana) */
.menu-legend-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 1.5rem;
}

.legend-info-badge {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  text-decoration: underline;
}

/* Iconos SVG del tema (js/tema.js): del tamaño y el color del texto que los rodea */
.icono-tema {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icono-tema svg {
  display: block;
  width: 1.15em;
  height: 1.15em;
}

.legend-footnote {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
}

/* Modal Completo de Leyenda */
.legend-modal-card {
  max-width: 680px;
  width: 92%;
}

.legend-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.legend-modal-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.legend-modal-box.highlighted {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--primary);
}

.legend-modal-box-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.legend-modal-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.legend-modal-box-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

/* Barra del pedido: solo con algo en la cesta (body.con-cesta, carta.js actualizarBarraCesta); entra desde abajo */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(110%);
  visibility: hidden;
  transition:
    transform 0.25s ease,
    visibility 0s linear 0.25s;
}

body.con-cesta .bottom-bar {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease;
}

.btn-checkout {
  background: var(--primary-dark);
  color: var(--on-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-checkout:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.15rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Sin esto, con muchas opciones el flex encoge la foto (overflow: hidden) a 0px y solo queda su margen */
.modal-body > * {
  flex-shrink: 0;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Grupos de opciones y complementos (Salsa, Toppings, etc.) */
.opt-grupo {
  display: flex;
  flex-direction: column;
}

.opt-grupo + .opt-grupo {
  margin-top: 1.15rem;
}

/* Secciones interactivas de grupos de opciones (Pokes, Bowls, etc.) */
.opt-seccion {
  margin-top: 0.85rem;
  margin-bottom: 0.4rem;
}

.opt-seccion + .opt-seccion {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
}

.opt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.opt-section-title {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary, #b3531b);
}

.opt-section-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.opt-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.opt-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.opt-pill:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--surface-alt, #faf7f2);
  transform: translateY(-1px);
}

.opt-pill input {
  display: none;
}

.opt-pill.checked,
.opt-pill:has(input:checked) {
  background: var(--primary-light, #fbf4ea);
  border-color: var(--primary, #b3531b);
  color: var(--primary-dark, #7e350b);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(179, 83, 27, 0.15);
}

.opt-pill.disabled,
.opt-pill:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

.opt-pill-name {
  line-height: 1.2;
}

.opt-pill-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #b3531b);
}

.opt-grupo-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.opt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.opt-row:hover {
  background: var(--surface-alt);
}

.opt-row span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.opt-row input[type="radio"],
.opt-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  accent-color: var(--primary-dark);
  flex-shrink: 0;
}

.opt-row.has-img {
  padding: 0.4rem 0.65rem;
}

.opt-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.opt-row .opt-text {
  line-height: 1.25;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.req {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.4rem;
}

.cart-subopt {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.payment-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: all 0.15s ease;
  user-select: none;
}

.payment-btn input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.payment-btn:has(input:checked) {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* Pago en línea: ocupa toda la fila por encima de las formas de pago al recoger */
.payment-btn.pago-online {
  grid-column: 1 / -1;
}

.aviso-pago-online {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.aviso-pago-online a {
  color: var(--primary-dark);
}

/* Modal Lateral (Side Drawer) para Checkout */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text) 45%, transparent);
  backdrop-filter: blur(2px);
  display: none;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 60;
  padding: 0;
}

.drawer {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.12);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.btn-close-drawer {
  background: var(--surface-alt);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-close-drawer:hover {
  background: var(--border);
  color: var(--text);
}

.drawer-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cart-items-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.cart-items-container .cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.65rem;
}

.cart-items-container .cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.cart-item-title {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
}

.cart-subopt {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cart-item-unitprice {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cart-qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-qty {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  transition:
    background 0.15s ease,
    color 0.15s ease;
  padding: 0;
  user-select: none;
}

.btn-qty:hover {
  background: var(--border);
  color: var(--primary-dark);
}

.btn-qty.btn-qty-del {
  font-size: 0.8rem;
}

.btn-qty.btn-qty-del:hover {
  background: #fee2e2;
  color: var(--danger);
}

.qty-num {
  min-width: 22px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 2px;
}

.cart-item-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
  min-width: 55px;
  text-align: right;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.6rem;
  padding: 4px;
  margin: -4px;
}

.slot-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.3rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  transition: all 0.15s ease;
  user-select: none;
  text-align: center;
  box-sizing: border-box;
}

.slot-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.slot-chip:has(input:checked) {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.slot-chip.disabled,
.slot-chip:has(input:disabled) {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.65;
  text-decoration: line-through;
}

.slot-chip.disabled span.slot-badge,
.slot-chip:has(input:disabled) span.slot-badge {
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
  color: var(--text-faint);
}

/* --- Selectores de Combo / Menú en Modal y Cesta --- */
.combo-offer-card {
  margin-top: 0.15rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
  transition: all 0.25s ease;
}

.combo-offer-card.active {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.18);
}

.combo-header-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 0.98rem;
  color: #92400e;
}

.combo-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.combo-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #d97706;
  cursor: pointer;
}

.combo-badge-price {
  background: #d97706;
  color: var(--on-primary);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.combo-subtext {
  font-size: 0.8rem;
  color: #b45309;
  margin: 0.35rem 0 0 1.9rem;
}

.combo-steps-wrapper {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #fcd34d;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.combo-step-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.combo-step-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.combo-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background-color: var(--surface);
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.combo-select:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.combo-select.has-error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

/* Badge en la cesta de la compra */
.cart-item-combo-tag {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 3px;
}

.cart-item-combo-list {
  margin: 4px 0 0 0;
  padding-left: 1rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   CREA TU MENÚ: BANNER PROMO, BADGE EN TARJETA Y UPSELL EN CESTA
   ========================================================================== */

/* Banner Promocional "CREA TU MENÚ" en la Carta (estilo elegante integrado con la carta web) */
.combo-promo-banner {
  background: var(--surface);
  border: 1px solid #fed7aa;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin: 0.5rem 0 1.5rem 0;
  box-shadow:
    0 4px 16px -2px rgba(245, 158, 11, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.combo-promo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.combo-promo-title-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.combo-promo-title-block h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}

.combo-promo-price-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: var(--on-primary);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.28rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
  white-space: nowrap;
}

.combo-promo-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.combo-promo-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 620px;
  margin: 0;
}

.combo-promo-btn {
  background: var(--text);
  color: var(--on-primary);
  border: none;
  border-radius: 9999px;
  padding: 0.5rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--text) 12%, transparent);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.combo-promo-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* Badge en cabecera de Familia/Categoría */
.family-combo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 0.22rem 0.65rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.combo-step-empty-warning {
  font-size: 0.8rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px dashed #fde68a;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  margin-top: 0.25rem;
}

.combo-disabled-note {
  font-size: 0.78rem;
  color: #b45309;
  font-weight: 600;
  margin-top: 0.35rem;
}

/* Badge en la tarjeta del producto */
.card-combo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 750;
  padding: 0.12rem 0.55rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  animation: pulseComboBadge 2.5s infinite;
}

@keyframes pulseComboBadge {
  0%,
  100% {
    border-color: #fde68a;
  }
  50% {
    border-color: #f59e0b;
  }
}

/* Upsell en la Cesta */
.cart-combo-upsell {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px dashed #f59e0b;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cart-combo-upsell-content {
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.35;
}

.cart-combo-upsell-content strong {
  color: #92400e;
}

.btn-upsell-menu {
  background: #d97706;
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-full);
  padding: 0.4rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.btn-upsell-menu:hover {
  background: #b45309;
  transform: translateY(-1px);
}

/* Avisos: toasts y diálogos que sustituyen a alert()/confirm() (js/carta-avisos.js) */
#toastContainer {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 420px;
  pointer-events: none;
}

.toast-carta {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 18%, transparent);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: auto;
  cursor: pointer;
  animation: toastEntra 0.25s ease-out;
}

.toast-carta.toast-error {
  border-left-color: var(--danger);
}

.toast-carta.saliendo {
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

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

.dialogo-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--text) 55%, transparent);
  backdrop-filter: blur(2px);
}

.dialogo {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px color-mix(in srgb, var(--text) 30%, transparent);
  text-align: center;
  animation: toastEntra 0.2s ease-out;
}

.dialogo-icono {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.dialogo-texto {
  margin: 0 0 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.dialogo-botones {
  display: flex;
  gap: 0.6rem;
}

.dialogo-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialogo-btn.principal {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.dialogo-btn.principal:hover {
  background: var(--primary-dark);
}

.dialogo-error .dialogo-btn.principal {
  background: var(--danger);
  border-color: var(--danger);
}

/* Nota de alergias y contaminación cruzada del modal de la leyenda */
.legend-nota {
  margin-top: 1.25rem;
  padding: 0.85rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.76rem;
  color: #92400e;
  line-height: 1.4;
}

/* --- MODO CARTA CONSULTIVA VS TAKE AWAY --- */
.banner-takeaway-promo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1rem auto;
  max-width: 1200px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.banner-takeaway-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  flex-wrap: wrap;
}

.btn-banner-takeaway {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary, #ffffff);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-banner-takeaway:hover {
  background: var(--primary-dark);
}

.link-volver-carta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0;
  transition: color 0.15s ease;
}

.link-volver-carta:hover {
  color: var(--primary-dark);
}

.badge-disponible-takeaway {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  letter-spacing: 0.02em;
}

.btn-ver-opciones {
  background: var(--surface-soft, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.btn-ver-opciones:hover {
  background: var(--primary-light, rgba(59, 130, 246, 0.1));
  border-color: var(--primary);
  color: var(--primary-dark);
}

.detalle-opciones-wrapper {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.detalle-opciones-lista {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.detalle-opcion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--surface-soft, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}

.detalle-opcion-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.detalle-opcion-supl {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.82rem;
}

body.modo-carta .bottom-bar,
body.modo-carta #bannerPedidoActivo {
  display: none !important;
}
