:root {
  --bg: #faf7f3;
  --surface: #ffffff;
  --border: #eae6df;
  --text: #101828;
  --muted-2: #475467;
  --muted: #667085;
  --brand-red: #ee373d;
  --brand-yellow: #ffa600;
  --brand-brown: #6f5a45;
  --shadow-sm: 0 6px 18px -12px rgba(16, 24, 40, .10);
  --shadow-md: 0 18px 44px -30px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 60px -38px rgba(16, 24, 40, .16);
}

* {
  box-sizing: border-box
}

body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg)
}

/* Patrón sutil de comida (SVG embebido) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'><g fill='%238b5e3c'><path d='M20 18c6 0 10 4 10 10s-4 10-10 10-10-4-10-10 4-10 10-10z' fill-opacity='.15'/><rect x='38' y='10' rx='6' ry='6' width='16' height='12' fill-opacity='.12'/><rect x='42' y='34' rx='8' ry='8' width='18' height='12' fill-opacity='.1'/><circle cx='10' cy='50' r='6' fill-opacity='.12'/></g></svg>");
  background-size: 48px 48px;
  background-repeat: repeat;
}

/* Hero */
.hero {
  position: relative;
  background: var(--bg)
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: transparent
}

.featured-plate {
  margin-bottom: 3rem
}

/* Ajuste del badge del combo destacado (hero) */
.hero-badge {
  left: 1rem;
  right: auto;
  bottom: -2rem;
  max-width: clamp(220px, 70%, 320px);
}

@media (min-width:640px) {
  .hero-badge {
    left: -1rem;
    max-width: 320px;
  }
}

@media (min-width:1024px) {
  .hero-badge {
    left: -1.5rem;
  }
}

@media (min-width:640px) {
  .featured-plate {
    margin-bottom: 4rem
  }
}

@media (min-width:1024px) {
  .featured-plate {
    margin-bottom: 5rem
  }
}

/* UI */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 9999px;
  padding: .35rem .9rem;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: #ffd166;
  color: #3f2f1f;
  border: 1px solid #fde68a
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 9999px;
  padding: .9rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, background .18s, color .18s;
  min-width: 0;
  white-space: nowrap;
}

.btn svg {
  transition: transform .18s
}

.btn:hover svg {
  transform: translateX(.2rem)
}

/* Botón principal estilo WhatsApp */
.btn-primary {
  background: #25D366;
  border: 1px solid #1ebe5d;
  color: #fff;
  box-shadow: 0 16px 40px -22px rgba(37, 211, 102, .45)
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px -20px rgba(18, 140, 126, .45)
}

/* Botón rojo estilo KFC para "Solicitar" */
.btn-danger {
  background: #ee373d;
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px -20px rgba(228, 0, 43, .55);
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text)
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -18px rgba(2, 6, 23, .25)
}

/* (btn-outline eliminado por no usarse) */

/* Botón hero para ir al menú */
.btn-accent {
  background: #ffba08;
  border: 1px solid #f59e0b;
  color: #3f2f1f;
  box-shadow: 0 16px 40px -24px rgba(245, 158, 11, .55);
}

.btn-accent:hover {
  transform: translateY(-2px);
}

.btn-tertiary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: .6rem 1.1rem
}

.btn--small {
  padding: .6rem 1.1rem;
  font-size: .9rem
}

.btn-link {
  padding: 0;
  background: none;
  color: var(--brand-brown);
  font-weight: 700
}

.btn-link:hover {
  color: #75482b;
  transform: translateX(.12rem)
}

.glass-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm)
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.75rem;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg)
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--muted-2)
}

.section-subtitle {
  color: var(--muted);
  font-size: .98rem
}

.step-card {
  position: relative;
  padding: 1.4rem 1.2rem;
  border-radius: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  min-height: 150px;
  box-shadow: 0 20px 44px -32px rgba(2, 6, 23, .16)
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 800;
  margin-bottom: 1rem
}

/* Cart */
.cart-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  transition: transform .2s
}

.cart-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1rem 1.2rem;
  box-shadow: 0 24px 50px -30px rgba(2, 6, 23, .2);
  position: relative;
}

.cart-details {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: calc(100% + .5rem);
  /* despliega hacia arriba */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: .9rem;
  box-shadow: 0 30px 60px -35px rgba(2, 6, 23, .28);
  color: var(--text);
  font-size: .9rem;
  max-height: 40vh;
  overflow: auto;
  z-index: 60;
}

.cart-table {
  display: grid;
  grid-template-columns: 86px 1fr 90px 100px;
  align-items: center;
  gap: .5rem .8rem;
}

.cart-table__head {
  font-weight: 700;
  color: var(--muted-2);
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: .4rem;
}

.cart-table__row {
  border-bottom: 1px dashed var(--border);
  padding: .35rem 0;
}

.cart-table__row:last-child {
  border-bottom: none;
}

.cart-table__qty {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.qty-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 .5rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  font-weight: 700;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: .5rem;
  border: 1px solid var(--border);
  background: #fff;
  line-height: 1;
  font-weight: 700;
}

/* .remove-btn eliminada: al llegar a 0 con (−) se quita el ítem */
.cart-table__unit,
.cart-table__subtotal {
  text-align: right;
  white-space: nowrap;
}

.cart-details__footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: .6rem;
  font-weight: 700;
}

/* Mobile tweaks: ocultar precio unitario y ajustar columnas */
@media (max-width: 640px) {
  .cart-table {
    grid-template-columns: 86px 1fr 100px;
  }

  .cart-table__unit {
    display: none;
  }

  .qty-btn,
  .remove-btn {
    width: 34px;
    height: 34px;
  }

  .qty-chip {
    min-width: 36px;
    height: 32px;
  }
}

/* Toggle tipo pestaña centrado arriba de la barra */
#cartToggle {
  position: static;
  margin-left: auto;
  background: transparent;
  color: #e4002b;
  border: none;
  padding: 0;
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
}
.cart-info { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cart-info #cartSummary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }

@media (max-width: 640px) {
  .cart-info #cartSummary { max-width: 60vw; }
  #cartToggle { width: 100%; text-align: right; margin-left: 0; font-size: 12px; }
}

.cart-info { display: flex; align-items: center; gap: .4rem; }
.cart-info #cartSummary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }

/* .cart-toggle-row eliminado: el toggle vuelve dentro de la barra */

.cart-details__footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: .6rem;
  font-weight: 700;
}

/* Cards */
.menu-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1.1rem;
  box-shadow: var(--shadow-md);
  transition: transform .15s, box-shadow .15s, border-color .15s
}

/* Espacio interno para el grid de tarjetas */
#itemsGrid {
  padding-top: .75rem;
  padding-bottom: 2rem;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: #fcd34d;
  box-shadow: 0 28px 70px -48px rgba(2, 6, 23, .18)
}

.menu-card__image {
  position: relative;
  border-radius: 1.2rem;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #f8fafc
}

.menu-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

/* .menu-card__tag eliminado por no usarse */

.menu-card__body h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.01em
}

.menu-card__body p {
  color: var(--muted);
  font-size: .92rem
}

/* Etiqueta de categoría en tarjetas */
.category-badge {
  display: inline-block;
  margin-bottom: .35rem;
  padding: .2rem .55rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted-2);
  background: #fff;
}

/* Precio destacado */
.price-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .2rem .6rem;
  border-radius: .6rem;
  font-weight: 800;
  font-size: 1rem;
  color: #ee373d;
  border: 1px solid #ee373d;
  box-shadow: 0 8px 20px -14px rgba(16, 185, 129, .7);
}

.menu-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .7rem
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #fff
}

.quantity-control button {
  padding: .45rem .8rem;
  font-size: 1.2rem;
  color: var(--text);
  background: transparent;
  border: none
}

.quantity-control span {
  padding: .4rem .9rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text)
}

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 1.5rem;
  padding: 3rem 1.2rem;
  background: #fff;
  color: var(--muted)
}

.empty-state strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: .35rem;
  color: var(--brand-brown)
}

/* Destacados */
.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 22px 60px -44px rgba(2, 6, 23, .16)
}

.featured-card__tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .45rem .85rem;
  background: #ffd166;
  color: #333;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid #ffd166
}

.featured-card__image {
  position: relative;
  border-radius: 1.2rem;
  overflow: hidden;
  aspect-ratio: 16/11;
  background: #f8fafc;
  box-shadow: 0 20px 60px -42px rgba(2, 6, 23, .16)
}

.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.featured-card__body h3 {
  font-size: 1.12rem;
  font-weight: 800
}

.featured-card__body p {
  color: var(--muted);
  font-size: .92rem;
  margin-top: .45rem
}

/* Alinear acciones al fondo en destacados */
.featured-card {
  display: flex;
  flex-direction: column;
}

.featured-card__body {
  flex: 1 1 auto;
}

.featured-actions {
  margin-top: auto;
}

/* Featured grid responsive fix */
#featuredList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  gap: 1rem;
}

@media (min-width: 1024px) {
  #featuredList {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.featured-card {
  min-width: 0;
  height: 100%;
}

.featured-card__body h3,
.featured-card__body p {
  overflow-wrap: anywhere;
}

/* Featured actions: evitar desbordes */
.featured-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.featured-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.featured-actions__btns .btn--small {
  max-width: 100%;
}

@media (max-width: 768px) {
  .featured-actions__btns {
    width: 100%;
  }

  .featured-actions__btns .btn--small {
    flex: 1 1 auto;
  }
}

/* Responsive */
@media (max-width:1024px) {
  .section-card {
    padding: 2rem
  }
}

@media (max-width:768px) {
  .cart-shell {
    flex-direction: column;
    align-items: flex-start
  }

  .menu-card__price {
    flex-direction: column;
    align-items: flex-start
  }

  .quantity-control {
    width: 100%;
    justify-content: space-between
  }

  .btn--small {
    width: 100%;
    justify-content: center
  }
}

@media (max-width:640px) {
  .section-card {
    padding: 1.25rem;
  }

  .menu-card {
    padding: 1rem
  }

  .menu-card__image {
    border-radius: 1rem;
    aspect-ratio: 3/2
  }

  .featured-card__image {
    aspect-ratio: 4/3
  }
}

/* Tabs horizontales móviles */
.categories-scroll {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .25rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory
}

.categories-scroll::-webkit-scrollbar {
  height: 0
}

#categoryTabs>button {
  scroll-snap-align: start;
  white-space: nowrap
}

/* Hover del tab activo: mantener texto rojo */
#categoryTabs>button.bg\[\#fff5f5\]:hover {
  color: #b91c1c;
}

/* Desktop: ancho adaptable del buscador con límites */
@media (min-width: 1024px) {
  /* Ocultar el buscador en PC */
  .search-wrap { display: none; }
  #categoryTabs { min-width: 0; flex: 1 1 auto; }
}

/* Cuando el menú está "stuck", fondo rojo para destacar */
#menuSticky.is-stuck {
  background: var(--brand-red) !important;
  border-color: #b91c1c !important;
  backdrop-filter: none;
}

/* Tabs sobre fondo rojo: por defecto texto/borde blanco */
#menuSticky.is-stuck #categoryTabs>button {
  border-color: rgba(255,255,255,.6);
  color: #fff;
}

#menuSticky.is-stuck #categoryTabs>button:hover {
  background: rgba(255,255,255,.08);
}

/* Estado activo sobre rojo: asegurar texto rojo legible */
#menuSticky.is-stuck #categoryTabs>button.is-active,
#menuSticky.is-stuck #categoryTabs>button.bg\[\#fff5f5\],
#menuSticky.is-stuck #categoryTabs>button.text\[\#b91c1c\] {
  background: #fff !important;
  border-color: #fff !important;
  color: var(--brand-red) !important;
}

#menuSticky.is-stuck #categoryTabs>button.is-active:hover,
#menuSticky.is-stuck #categoryTabs>button.bg\[\#fff5f5\]:hover {
  color: var(--brand-red) !important;
}

/* En pantallas muy amplias, permite crecer un poco más */
@media (min-width: 1536px) {
  .search-wrap { flex-basis: clamp(560px, 40vw, 760px); max-width: 760px; }
}

/* Caja de búsqueda: mantener legible sobre rojo */
#menuSticky.is-stuck #search {
  background: #fff;
  border-color: transparent;
  color: #0f172a; /* slate-900 */
}

#menuSticky.is-stuck #search::placeholder {
  color: rgba(15,23,42,.6);
}

.consent-banner {
  position: fixed;
  z-index: 9999;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 1rem;
  box-shadow: 0 20px 45px -20px rgba(15, 23, 42, 0.45);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
}

.consent-banner.hidden {
  display: none;
}

.consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .consent-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* Modal Navidad */
.navidad-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navidad-modal.hidden {
  pointer-events: none;
  opacity: 0;
}

.navidad-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
}

.navidad-modal__body {
  position: relative;
  z-index: 1;
  width: min(960px, 96vw);
  max-height: min(90vh, 900px);
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.navidad-modal__media {
  max-height: 70vh;
  overflow: auto;
  background: #0f172a;
}

.navidad-modal__img {
  width: 100%;
  display: block;
  object-fit: contain;
}

.navidad-modal__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.85);
  color: #0f172a;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px -18px rgba(0,0,0,.45);
}

.navidad-modal__caption {
  padding: 1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: flex-start;
}

.navidad-modal__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .5rem;
  margin-top: .75rem;
}

.navidad-modal__cta {
  flex-shrink: 0;
}

/* Ajuste A4 para tarjetas navideñas (imágenes verticales) */
.navidad-card img {
  width: 100%;
  height: clamp(16rem, 70vw, 28rem);
  max-height: 90vh;
  aspect-ratio: 0.707 / 1;
  object-fit: cover;
}

@media (max-width: 640px) {
  .navidad-modal__caption {
    flex-direction: column;
    align-items: flex-start;
  }
  .navidad-modal__cta {
    width: 100%;
  }
}
