/*
 * Estilos de los micrositios (L67): antes iban en línea en layout.php.
 * Los colores salen de las variables que layout.php define en cada página con la paleta del negocio.
 * Se carga después de $cssExtra, como cuando las reglas iban tras él en el mismo bloque.
 */

.text-muted {
    --bs-secondary-color: var(--t-muted);
}

html {
    scroll-padding-top: 80px;
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-app);
    color: var(--t-main);
}
/* Aviso de período de prueba: colores fijos, legible con cualquier paleta */
.franja-prueba {
    background-color: #1f2937;
    color: #f9fafb;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-align: center;
    padding: 6px 16px;
}
.wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}
footer {
    flex-shrink: 0;
}

.navbar {
    background-color: var(--bg-header) !important;
}
.navbar .nav-link,
.navbar .navbar-brand {
    color: var(--t-navbar) !important;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--c-secondary) !important;
}
.navbar .nav-link.active {
    font-weight: 700;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
/* Logo de la barra (L66): la imagen del negocio, de 3:2, con el nombre al lado */
.navbar-brand picture {
    display: block;
    flex-shrink: 0;
}
.navbar-logo {
    display: block;
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}
.navbar-brand             { order: 1; }
.navbar-toggler           { order: 2; }
.collapse.navbar-collapse { order: 3; }
.navbar-cart-btn          { order: 4; }

.btn-primary {
    background-color: var(--c-primary) !important;
    border-color: var(--c-primary) !important;
    color: var(--t-sobre-primary) !important;
}
.btn-primary:hover {
    filter: brightness(90%);
}
.btn-primary:focus-visible {
    outline: 3px solid var(--c-primary);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: var(--c-secondary) !important;
    border-color: var(--c-secondary) !important;
    color: var(--t-sobre-secondary) !important;
}
.btn-secondary:hover {
    filter: brightness(90%);
}
.btn-secondary:focus-visible {
    outline: 3px solid var(--c-secondary);
    outline-offset: 2px;
}

.section-title {
    color: var(--c-primary);
    text-align: center;
    margin-bottom: 3rem;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
}
.card-price {
    color: var(--c-primary);
    font-weight: bold;
    font-size: 1.2rem;
}

footer {
    background-color: var(--bg-footer);
    color: var(--t-sobre-footer);
}
footer a {
    color: inherit;
    opacity: 0.8;
    text-decoration: none;
}
footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

.bg-surface {
    background-color: var(--bg-surface);
}


/* ============================================
   Componentes compartidos: CategoryPills,
   ProductCard, StickyWhatsAppBar, animaciones
   ============================================ */

/* --- Category Pills --- */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 24px;
}
.category-pills::-webkit-scrollbar { height: 4px; }
.category-pills::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.pill-btn {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--t-main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.pill-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.pill-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.pill-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--t-sobre-primary);
}
.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 6px;
  background: rgba(255,255,255,0.25);
  color: inherit;
}
.pill-btn:not(.active) .pill-badge {
  background: var(--border);
  color: var(--t-muted);
}

/* --- Product Card (menú y catálogo) --- */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.product-card-img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  height: auto; /* sin esto manda el atributo height de la imagen, no el aspect-ratio (L67) */
  background: var(--bg-surface);
}
.product-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--t-main);
  margin: 0;
  line-height: 1.3;
}
/* Imagen y título de la tarjeta enlazan al detalle del producto (L63) */
.product-card-link {
  color: inherit;
  text-decoration: none;
}
.product-card > .product-card-link {
  display: block;
}
.product-card-title .product-card-link:hover,
.product-card-title .product-card-link:focus-visible,
.menu-item-title .product-card-link:hover,
.menu-item-title .product-card-link:focus-visible {
  text-decoration: underline;
}
.product-card-desc {
  font-size: 0.9rem;
  color: var(--t-muted);
  margin: 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-desc.is-expanded {
  -webkit-line-clamp: unset;
}
.product-card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  margin-top: 2px;
  color: var(--c-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  align-self: flex-start;
}
.product-card-more[hidden] {
  display: none;
}
.product-card-more:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.product-card-price {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-primary);
  margin: 0;
}
.product-card-original {
  text-decoration: line-through;
  color: var(--t-muted);
  font-family: var(--fuente-texto);
  font-weight: 400;
  font-size: 0.85rem;
}
/* La forma y la posición de la etiqueta, sobre la foto, están en «Tarjeta de producto» (L72) */
.product-card-promo {
  background: var(--c-primary);
  color: var(--t-sobre-primary);
}
.product-unavailable {
  display: inline-block;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.product-card-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: auto;
}
.product-card-wa:hover {
  background: var(--c-primary);
  color: var(--t-sobre-primary);
}
.product-card-wa:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.product-card-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: 0;
}
.product-card-share:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.product-card-share:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.menu-item-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--c-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-left: 12px;
  align-self: center;
}
.menu-item-share:hover {
  color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 10%, var(--bg-surface));
}
.menu-item-share:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* --- Category Badge --- */
.category-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-app);
  color: var(--t-muted);
  border: 1px solid var(--border);
}

/* --- Result Counter --- */
.result-counter {
  font-size: 0.85rem;
  color: var(--t-muted);
  text-align: center;
  margin-bottom: 16px;
}

/* --- Sticky WhatsApp Bar --- */
.sticky-wa-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  display: none;
}
.sticky-wa-bar.visible {
  display: block;
}
.sticky-wa-bar .btn-wa-sticky {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: var(--c-primary);
  color: var(--t-sobre-primary);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  text-decoration: none;
  transition: filter 0.2s;
}
.sticky-wa-bar .btn-wa-sticky:hover {
  filter: brightness(90%);
}

/* --- Fade transition para filtro --- */
.fade-enter {
  opacity: 0;
  transform: translateY(8px);
}
.fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.fade-exit {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* --- Mobile view toggle tabs --- */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-app);
  border-radius: 10px;
  padding: 4px;
}
.view-toggle .toggle-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--t-muted);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.view-toggle .toggle-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.view-toggle .toggle-btn.active {
  background: var(--bg-surface);
  color: var(--t-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* --- Accordion menu item highlight --- */
.menu-item.highlighted {
  background-color: color-mix(in srgb, var(--c-primary) 8%, var(--bg-surface));
  border-left: 3px solid var(--c-primary);
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--t-muted);
}
.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 1rem;
  margin: 0;
}

/* --- Shimmer placeholder --- */
.shimmer {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-app) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- WhatsApp FAB (desktop) --- */
.wa-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1040;
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--t-sobre-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  text-decoration: none;
  transition: all 0.25s ease;
}
.wa-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  color: var(--t-sobre-primary);
}
.wa-fab-tooltip {
  position: absolute;
  right: 64px;
  background: var(--bg-surface);
  color: var(--t-main);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.wa-fab:hover .wa-fab-tooltip {
  opacity: 1;
}

/* --- Carrito: botón navbar y badge --- */
.navbar-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--t-navbar);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.navbar-cart-btn:hover {
  color: var(--c-secondary);
}
.navbar-cart-btn:focus-visible {
  outline: 2px solid var(--c-secondary);
  outline-offset: 2px;
}
.navbar-cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc3545;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}
.navbar-cart-badge[hidden] { display: none; }
.navbar-cart-badge.bump { animation: cartBump 0.3s ease; }
@keyframes cartBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* --- Carrito: botón "Añadir" (partial boton-carrito) --- */
.product-card-carrito {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1.5px solid var(--c-primary);
  background: var(--c-primary);
  color: var(--t-sobre-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: auto;
}
.product-card-carrito:hover {
  filter: brightness(90%);
}
.product-card-carrito:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
.product-card-carrito.carrito-btn-grande {
  padding: 14px;
  font-size: 1.05rem;
  border-radius: 10px;
}
.product-card-carrito.carrito-btn-mini {
  width: auto;
  padding: 6px 12px;
  font-size: 0.75rem;
  margin-left: 12px;
  border-radius: 6px;
  flex-shrink: 0;
  align-self: center;
}

/* --- Carrito: offcanvas --- */
.offcanvas {
  background-color: var(--bg-surface);
  color: var(--t-main);
}
.offcanvas .btn-close {
  display: none;
}
.offcanvas-btn-cerrar {
  background: none;
  border: none;
  color: var(--t-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}
.offcanvas-btn-cerrar:hover {
  opacity: 0.7;
}
.carrito-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.carrito-item {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.carrito-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.carrito-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-app);
  flex-shrink: 0;
}
.carrito-item-info {
  flex: 1;
  min-width: 0;
}
.carrito-item-nombre {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
}
.carrito-item-precio {
  font-size: 0.8rem;
  color: var(--t-muted);
  margin: 2px 0 6px;
}
.carrito-cantidad {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.carrito-cantidad-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-app);
  color: var(--t-main);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.carrito-cantidad-btn:hover {
  background: var(--c-primary);
  color: var(--t-sobre-primary);
}
.carrito-cantidad-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}
.carrito-cantidad-num {
  min-width: 28px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.carrito-item-derecha {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
}
.carrito-item-subtotal {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-primary);
}
.carrito-item-eliminar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--t-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.carrito-item-eliminar:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
}
.carrito-item-eliminar:focus-visible {
  outline: 2px solid #dc3545;
  outline-offset: 2px;
}
.carrito-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.carrito-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.05rem;
}
#carritoTotal {
  color: var(--c-primary);
}

/* --- Carrito: toast de feedback --- */
.toast-carrito-ver {
  border: none;
  background: var(--c-primary);
  color: var(--t-sobre-primary);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.toast-carrito-ver:hover {
  filter: brightness(90%);
}
.toast-carrito-ver:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ============================================
   Diseño por plantillas (L72)
   Variables de diseño: cada plantilla las cambia en public/assets/css/plantillas/<clave>.css,
   que se carga después de este archivo. Los colores siguen saliendo de la paleta (layout.php).
   ============================================ */
:root {
  --fuente-titulos: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radio: 12px;
  --radio-grande: 20px;
  --radio-boton: 12px;
  --sombra: 0 8px 24px rgba(15, 23, 42, 0.06);
  --sombra-alta: 0 16px 40px rgba(15, 23, 42, 0.12);
  --espacio-seccion: clamp(56px, 9vw, 96px);
  --alto-barra: 72px;
}

body {
  font-family: var(--fuente-texto);
}
h1, h2, h3,
.navbar-brand,
.product-card-price,
.contacto-accion-dato {
  font-family: var(--fuente-titulos);
}
.btn {
  border-radius: var(--radio-boton);
}
.btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  font-size: 1.05rem;
  font-weight: 600;
}
/* Botón de contorno que toma el color del texto de su bloque (blanco sobre la foto) */
.btn-contorno {
  border: 1.5px solid currentColor;
  color: inherit;
  background: transparent;
}
.btn-contorno:hover,
.btn-contorno:focus-visible {
  border-color: currentColor;
  color: inherit;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* --- Barra --- */
.navbar {
  min-height: var(--alto-barra);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.navbar .nav-link {
  font-weight: 500;
}
@media (min-width: 992px) {
  .navbar .nav-link {
    margin-left: 12px;
    border-bottom: 2px solid transparent;
  }
  .navbar .nav-link.active {
    border-bottom-color: var(--c-secondary);
  }
}
/* En el inicio con foto, la barra va transparente sobre ella mientras la página está arriba.
   La clase .barra-arriba la pone el script de layout.php: sin JavaScript la barra queda con su color. */
.barra-sobre-hero .hero-inicio {
  margin-top: calc(-1 * var(--alto-barra));
}
.barra-sobre-hero .navbar.barra-arriba {
  background-color: transparent !important;
  box-shadow: none;
}
.barra-sobre-hero .navbar.barra-arriba .nav-link,
.barra-sobre-hero .navbar.barra-arriba .navbar-brand,
.barra-sobre-hero .navbar.barra-arriba .navbar-cart-btn {
  color: #ffffff !important;
}
.barra-sobre-hero .navbar.barra-arriba .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
}
.barra-sobre-hero .navbar.barra-arriba .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Imagen principal del inicio --- */
.hero-inicio {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(80vh, 720px);
  padding: calc(var(--alto-barra) + 56px) 0 64px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-header);
  color: var(--t-hero);
}
.hero-inicio.con-foto {
  color: #ffffff;
}
/* El degradado oscurece solo la parte baja, donde va el texto: la foto se ve */
.hero-inicio.con-foto::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 15, 25, 0.9) 0%, rgba(8, 15, 25, 0.5) 45%, rgba(8, 15, 25, 0.3) 100%);
}
.hero-inicio-contenido {
  position: relative;
}
.hero-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 0.875rem;
  font-weight: 500;
}
.hero-inicio-titulo {
  max-width: 800px;
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.hero-inicio-texto {
  max-width: 620px;
  margin: 0 0 32px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  opacity: 0.92;
}
.hero-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Variante «completo» (hero-completo.php): la foto llena la pantalla y el texto va centrado */
.hero-completo {
  align-items: center;
  min-height: min(94vh, 860px);
  padding-bottom: 96px;
  text-align: center;
}
.hero-completo.con-foto::before {
  background: linear-gradient(rgba(12, 10, 8, 0.55), rgba(12, 10, 8, 0.75));
}
.hero-completo .hero-etiqueta {
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero-completo .hero-inicio-titulo,
.hero-completo .hero-inicio-texto {
  margin-left: auto;
  margin-right: auto;
}
.hero-completo .hero-acciones {
  justify-content: center;
}

/* Variante «dividido» (hero-dividido.php): un bloque con el texto a un lado y la foto al otro */
.hero-dividido {
  padding: 24px 0;
}
.hero-dividido-caja {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  overflow: hidden;
  border-radius: var(--radio-grande);
  background: var(--bg-surface);
}
.hero-dividido-texto {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 64px);
}
.hero-dividido-foto {
  flex: 1 1 420px;
  min-height: 300px;
}
.hero-dividido-foto picture {
  display: block;
  height: 100%;
}
.hero-dividido-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fichas de categoría del inicio (plantillas con 'categorias_inicio') */
.fichas-categoria {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.fichas-categoria .pill-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

/* --- Encabezado de las páginas internas (catálogo y menú) --- */
.hero {
  position: relative;
  padding: 60px 0 40px;
  background-size: cover;
  background-position: center;
  text-align: center;
  color: var(--t-hero);
}
.hero.no-image {
  background: var(--bg-header);
}
.hero.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bg-header) 85%, transparent), color-mix(in srgb, var(--bg-header) 70%, transparent));
}
.hero > .container {
  position: relative;
  z-index: 1;
}
.hero h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.hero .lead {
  font-size: 0.95rem;
  opacity: 0.9;
}
@media (min-width: 768px) {
  .hero { padding: 80px 0 50px; }
  .hero h1 { font-size: 2.25rem; }
}
/* La descripción y el precio tachado iban en el color primario, que costaba leer */
.menu-item-desc {
  color: var(--t-muted);
}
.menu-item-original {
  color: var(--t-muted);
}

/* Encabezado plano (plantillas con 'foto_de_fondo' en false: layout.php pone la clase en <body>):
   sin foto ni color de fondo, con el título a la izquierda sobre el fondo de la página */
.encabezado-plano .hero {
  padding: 40px 0 20px;
  background: none !important;
  color: var(--t-main);
  text-align: left;
}
.encabezado-plano .hero.has-image::before {
  display: none;
}
.encabezado-plano .hero .lead {
  max-width: 640px;
  color: var(--t-muted);
  opacity: 1;
}
.encabezado-plano .page-header {
  text-align: left !important;
}
.encabezado-plano .page-header .section-title {
  text-align: left;
  color: var(--t-main);
}

/* --- Controles de las páginas internas: toman las formas de la plantilla --- */
.accordion {
  --bs-accordion-bg: var(--bg-surface);
  --bs-accordion-color: var(--t-main);
  --bs-accordion-border-color: var(--border);
  --bs-accordion-border-radius: var(--radio);
  --bs-accordion-inner-border-radius: calc(var(--radio) - 1px);
}
.accordion-button {
  font-family: var(--fuente-titulos);
}
.accordion-button:not(.collapsed) {
  color: var(--t-sobre-primary);
}
.product-card-carrito,
.product-card-carrito.carrito-btn-grande,
.product-card-carrito.carrito-btn-mini {
  border-radius: var(--radio-boton);
}
.product-card-carrito.carrito-btn-grande {
  min-height: 52px;
}
.view-toggle {
  border-radius: min(var(--radio-boton), 12px);
}
.view-toggle .toggle-btn {
  border-radius: min(var(--radio-boton), 10px);
}
.form-select.category-select-mobile {
  min-height: 46px;
  border-color: var(--border);
  border-radius: min(var(--radio-boton), 14px);
}

/* --- Ficha del producto (productos.php) --- */
.detalle-volver {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-primary);
  text-decoration: none;
}
.detalle-volver:hover {
  text-decoration: underline;
}
.detalle-producto picture {
  display: block;
}
.detalle-foto {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radio-grande);
  box-shadow: var(--sombra);
}
.detalle-titulo {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.detalle-descripcion {
  margin: 16px 0 0;
  font-size: 1.1rem;
  color: var(--t-muted);
}
.detalle-precios {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 24px;
}
.detalle-precio {
  font-family: var(--fuente-titulos);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-primary);
}
.detalle-precio-original {
  font-size: 1.1rem;
  text-decoration: line-through;
  color: var(--t-muted);
}
.detalle-promo {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--c-secondary);
  color: var(--t-sobre-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

/* --- Secciones del inicio --- */
.seccion {
  padding: var(--espacio-seccion) 0;
}
.seccion-alterna {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.seccion-cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}
.seccion-etiqueta {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.seccion-titulo {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.seccion-titulo::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 16px;
  border-radius: 2px;
  background: var(--c-secondary);
}
.seccion-enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.seccion-enlace {
  padding: 10px 0;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
}
.seccion-enlace:hover {
  text-decoration: underline;
}

/* --- Productos del inicio: grilla, y carrusel en el celular --- */
.productos-grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}
@media (max-width: 767.98px) {
  .productos-carrusel {
    display: flex;
    gap: 16px;
    margin: 0 calc(-0.5 * var(--bs-gutter-x, 1.5rem));
    padding: 4px calc(0.5 * var(--bs-gutter-x, 1.5rem)) 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: calc(0.5 * var(--bs-gutter-x, 1.5rem));
    -webkit-overflow-scrolling: touch;
  }
  .productos-carrusel > .productos-grilla-item {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  /* Una sola tarjeta no necesita carrusel */
  .productos-carrusel > .productos-grilla-item:only-child {
    flex-basis: 100%;
  }
}

/* --- Tarjeta de producto (partials/tarjeta-producto.php) --- */
.product-card {
  border-radius: var(--radio-grande);
  box-shadow: var(--sombra);
}
.product-card:hover {
  box-shadow: var(--sombra-alta);
}
.product-card-media {
  position: relative;
}
.product-card-sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t-muted);
}
.product-card-sin-foto svg {
  opacity: 0.4;
}
.product-card-etiquetas {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}
.product-card-descuento,
.product-card-promo {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.product-card-descuento {
  background: var(--c-secondary);
  color: var(--t-sobre-secondary);
}
.product-card-body {
  padding: 20px;
}
.product-card-title {
  font-size: 1.15rem;
}
.product-card-pie {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
}
.product-card-price {
  display: flex;
  flex-direction: column;
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--t-main);
}
.product-card-pie .product-card-carrito {
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
  border-radius: var(--radio-boton);
  font-size: 0.9rem;
}
.product-card-wa,
.product-card-share {
  border-radius: var(--radio-boton);
}

/* --- Sobre nosotros --- */
.nosotros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px 56px;
}
.nosotros-fotos {
  position: relative;
  flex: 1 1 340px;
  min-width: 0;
}
.nosotros-texto {
  flex: 1 1 380px;
  min-width: 0;
}
.nosotros-fotos picture {
  display: block;
}
.nosotros-foto {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radio-grande);
  box-shadow: var(--sombra);
}
/* Dos fotos: la segunda se monta sobre la esquina inferior derecha de la primera */
.nosotros-fotos-2 {
  padding-bottom: 16%;
}
.nosotros-fotos-2 picture:first-child {
  width: 76%;
}
.nosotros-fotos-2 picture:last-child {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56%;
}
.nosotros-fotos-2 picture:last-child .nosotros-foto {
  border: 6px solid var(--bg-surface);
  box-shadow: var(--sombra-alta);
}
.nosotros-tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.nosotros-tarjeta {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radio);
  background: var(--bg-app);
}
.nosotros-tarjeta h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}
.nosotros-tarjeta p,
.nosotros-descripcion {
  margin: 0;
  color: var(--t-muted);
}
.nosotros-descripcion {
  margin-top: 28px;
  font-size: 1.05rem;
}

/* --- Contacto --- */
.contacto-acciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.contacto-accion {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radio);
  background: var(--bg-surface);
  color: var(--t-main);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
a.contacto-accion:hover,
a.contacto-accion:focus-visible {
  border-color: var(--c-primary);
  box-shadow: var(--sombra);
  color: var(--t-main);
}
.seccion-alterna .contacto-accion,
.seccion-alterna .contacto-formulario {
  background: var(--bg-app);
}
.contacto-accion-tipo {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.contacto-accion-dato {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
/* Ciudad y departamento bajo la dirección: ninguna plantilla la oculta */
.contacto-accion-lugar {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}
.contacto-accion-pie {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--t-muted);
}
.contacto-bloques {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.contacto-formulario {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radio-grande);
  background: var(--bg-surface);
}
.contacto-formulario-titulo {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.contacto-privacidad {
  color: var(--c-primary);
}
/* Con tope: un botón de píldora (999px) no puede dar esa forma a la caja del mensaje */
.contacto-formulario .form-control {
  min-height: 46px;
  border-radius: min(var(--radio-boton), 14px);
}
.contacto-mapa {
  flex: 2 1 380px;
  min-height: 380px;
  border-radius: var(--radio-grande);
  overflow: hidden;
  /* El mapa crea su propia capa: sin esto queda por encima de la barra al bajar */
  isolation: isolate;
}
.contacto-redes {
  margin: 24px 0 0;
  color: var(--t-muted);
}
.contacto-redes a {
  margin-left: 12px;
  font-weight: 600;
  color: var(--c-primary);
}

/* --- Pie --- */
.pie {
  padding: 48px 0 28px;
}
.pie-principal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.pie-negocio {
  flex: 1 1 280px;
  max-width: 420px;
}
.pie-nombre {
  margin: 0 0 8px;
  font-family: var(--fuente-titulos);
  font-size: 1.35rem;
  font-weight: 600;
}
.pie-descripcion {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
}
.pie-enlaces {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px 24px;
}
.pie-enlaces a {
  padding: 8px 0;
}
.pie-legal {
  margin: 20px 0 0;
  font-size: 0.8125rem;
}

/* --- Aparición al bajar: la clase .aparecer la pone el script de layout.php --- */
.aparecer {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.aparecer.visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  .navbar > .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .navbar-brand {
    flex: 1 1 0%;
    flex-shrink: 0;
    min-width: 0;
    order: 1;
  }
  /* La elipsis va en el nombre: en .navbar-brand también recortaría el logo (L66) */
  .navbar-nombre {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .navbar-cart-btn {
    flex-shrink: 0;
    order: 2;
  }
  .navbar-toggler {
    margin-left: 12px;
    flex-shrink: 0;
    order: 3;
  }
  .collapse.navbar-collapse,
  .navbar-collapse.collapsing {
    order: 4;
    flex-basis: 100%;
    flex-grow: 1;
    width: 100%;
  }
}
@media (max-width: 359.98px) {
  .navbar-logo {
    width: 48px;
    height: 32px;
  }
}
@media (max-width: 767.98px) {
  .category-pills { display: none; }
  .category-select-mobile { display: block; }
  .product-card { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
  .product-card:hover { transform: none; }
  .sticky-wa-bar { display: none !important; }
  .wa-fab { display: flex; }
}
@media (min-width: 768px) {
  .category-select-mobile { display: none; }
  .category-pills { display: flex; }
  .wa-fab { display: flex; }
  .sticky-wa-bar { display: none !important; }
}
@media (hover: none) {
  .product-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .product-card, .product-card:hover,
  .pill-btn, .product-card-wa,
  .fade-enter-active, .fade-exit,
  .wa-fab, .wa-fab:hover,
  .navbar-cart-btn, .navbar-cart-badge,
  .product-card-carrito,
  .carrito-cantidad-btn, .carrito-item-eliminar {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .shimmer {
    animation: none !important;
  }
  .navbar, .contacto-accion {
    transition: none !important;
  }
}
