/* ============================================================
   Catálogo público · tema claro · mobile-first
   El color de cada negocio entra por la variable --marca
   ============================================================ */

:root{
  --marca: #2563eb;
  --tinta: #1a1a1a;
  --tinta-suave: #5b6069;
  --fondo: #f6f5f2;
  --tarjeta: #ffffff;
  --linea: #e7e5e0;
  --wa: #25d366;
  --radio: 16px;
  --sombra: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

*{ box-sizing: border-box; }

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

body{
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  line-height: 1.5;
}

img{ max-width: 100%; display: block; }

/* ---------- Cabecera ---------- */
.cab{
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--marca) 22%, #fff) 0%, #fff 100%);
  border-bottom: 1px solid var(--linea);
}
.cab__inner{
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
/* Logo: altura fija, ancho libre — legible y sin recortar */
.cab__logo{
  width: auto;
  height: 120px;
  max-width: 300px;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
.cab__texto{ flex: 1; min-width: 220px; }
.cab__nombre{
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.3rem);
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--tinta);
}
.cab__desc{
  margin: 0 0 10px;
  color: var(--tinta-suave);
  max-width: 60ch;
}
.cab__datos{
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .92rem;
  color: var(--tinta-suave);
}
.cab__datos li{ margin: 0; }
.cab__redes{ display: flex; gap: 14px; }
.cab__redes a{
  color: var(--marca);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
}
.cab__redes a:hover{ text-decoration: underline; }

/* ---------- Contenido ---------- */
.contenido{
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 90px;
}
.seccion{ margin-bottom: 40px; }
.seccion__titulo{
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid color-mix(in srgb, var(--marca) 25%, var(--linea));
  display: inline-block;
}

/* ---------- Grid de productos ---------- */
.grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px){
  .grid{ grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 980px){
  .grid{ grid-template-columns: repeat(4, 1fr); }
}

.producto{
  background: var(--tarjeta);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra);
  transition: transform .15s ease, box-shadow .15s ease;
}
.producto:hover{
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 34px rgba(0,0,0,.10);
}
.producto__foto{
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0efec;
}
.producto__foto img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.producto__sinfoto{
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #b8b5ae; font-size: .85rem;
}
.producto__badge{
  position: absolute;
  top: 10px; left: 10px;
  background: var(--marca);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.producto__cuerpo{
  padding: 12px 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.producto__nombre{
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}
.producto__desc{
  font-size: .85rem;
  color: var(--tinta-suave);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.producto__pie{
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.producto__precio{
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--tinta);
}
.producto__precio--consultar{
  font-size: .9rem;
  font-weight: 600;
  color: var(--tinta-suave);
}

/* Botón "Pedir" por WhatsApp */
.btn-wa{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: .85rem;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  transition: filter .15s ease;
}
.btn-wa:hover{ filter: brightness(.94); }
.btn-wa svg{ flex-shrink: 0; }

/* ---------- Estados ---------- */
.vacio{
  text-align: center;
  color: var(--tinta-suave);
  padding: 60px 20px;
}

/* ---------- Pie ---------- */
.pie{
  border-top: 1px solid var(--linea);
  padding: 24px 20px 40px;
  text-align: center;
  color: var(--tinta-suave);
  background: #fff;
}
.pie p{ margin: 2px 0; }
.pie__marca{ font-size: .8rem; opacity: .7; }

/* ---------- Botón flotante ---------- */
.wa-flotante{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(37,211,102,.45);
  z-index: 50;
  transition: transform .15s ease;
}
.wa-flotante:hover{ transform: scale(1.06); }

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}

/* ============================================================
   v2 · variantes, botón móvil corregido, galería y visor
   ============================================================ */

/* El pie ahora solo lleva el precio */
.producto__pie{ padding-top: 6px; }

/* Botón "Pedir" a fila completa, grande y fácil de tocar */
.btn-wa{
  width: 100%;
  justify-content: center;
  padding: 12px 14px;
  font-size: .92rem;
  margin-top: 10px;
  min-height: 44px;            /* área de toque cómoda en móvil */
  border-radius: 12px;
  white-space: normal;         /* que no se corte el texto */
}

/* Selectores de talla/color */
.producto__opcion{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--tinta-suave);
  margin-top: 4px;
}
.producto__opcion span{ min-width: 42px; }
.producto__opcion select{
  flex: 1;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: var(--tinta);
  padding: 8px 10px;
  border: 1px solid var(--linea);
  border-radius: 9px;
  background: #fff;
  min-height: 40px;
}
.producto__opcion select:focus{
  outline: none;
  border-color: var(--marca);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marca) 18%, transparent);
}
.opcion-error{
  border-color: #e5484d !important;
  box-shadow: 0 0 0 3px rgba(229,72,77,.18) !important;
}

/* Indicadores sobre la foto */
.producto__foto{ cursor: zoom-in; }
.producto__contador{
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(20,20,20,.72);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.producto__zoom{
  position: absolute;
  bottom: 8px; right: 8px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(20,20,20,.55);
  color: #fff;
  border-radius: 50%;
}

/* ---------- Visor de imágenes (lightbox) ---------- */
.lb{
  position: fixed; inset: 0;
  background: rgba(15,15,18,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.lb.is-abierto{ display: flex; }
.lb__img{
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0,0,0,.5);
}
.lb__cerrar{
  position: absolute;
  top: 16px; right: 20px;
  background: none; border: none;
  color: #fff; font-size: 2.4rem; line-height: 1;
  cursor: pointer; opacity: .85;
}
.lb__cerrar:hover{ opacity: 1; }
.lb__nav{
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 2rem; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.lb__nav:hover{ background: rgba(255,255,255,.28); }
.lb__nav--prev{ left: 14px; }
.lb__nav--next{ right: 14px; }
.lb__puntos{
  position: absolute;
  bottom: 22px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px;
}
.lb__punto{
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.4);
}
.lb__punto.is-activo{ background: #fff; }

@media (max-width: 640px){
  .lb__nav{ width: 40px; height: 40px; font-size: 1.6rem; }
}

/* ============================================================
   v2.1 · Correcciones para móvil
   ============================================================ */

/* Foto SIEMPRE cuadrada, centrada y llena — a prueba de navegadores viejos */
.producto__foto{
  position: relative;
  aspect-ratio: auto;          /* anulamos aspect-ratio y usamos el truco de abajo */
  overflow: hidden;
  background: #f0efec;
}
.producto__foto::before{
  content: "";
  display: block;
  padding-top: 100%;           /* cuadrado 1:1 garantizado en cualquier móvil */
}
.producto__img,
.producto__sinfoto{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.producto__img{ object-fit: cover; display: block; }
.producto__sinfoto{ display: grid; place-items: center; }

/* Indicadores SOBRE la foto (no debajo) */
.producto__badge,
.producto__contador,
.producto__zoom{ z-index: 2; }

/* Botón "Pedir": que el texto nunca se desborde */
.btn-wa{
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  font-size: .9rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  min-height: 46px;
}
.btn-wa svg{ flex: 0 0 auto; }

/* La imagen del visor cierra al tocarla en móvil */
.lb__img{ cursor: zoom-out; }

/* ============================================================
   v2.2 · Filtro por categoría + flechas del visor visibles
   ============================================================ */

/* Barra de categorías (pestañas) */
.filtros{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  margin-bottom: 14px;
  background: var(--fondo);
  border-bottom: 1px solid var(--linea);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filtros::-webkit-scrollbar{ display: none; }
.filtro{
  flex: 0 0 auto;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: #fff;
  color: var(--tinta);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.filtro:hover{ border-color: color-mix(in srgb, var(--marca) 40%, var(--linea)); }
.filtro.is-activo{
  background: var(--marca);
  color: #fff;
  border-color: var(--marca);
}

/* Flechas del visor: bien visibles en móvil */
.lb__nav{
  background: rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.7);
  color: #fff;
  width: 54px;
  height: 54px;
  box-shadow: 0 2px 12px rgba(0,0,0,.45);
  font-size: 2rem;
}
.lb__nav:hover{ background: rgba(0,0,0,.75); }
.lb__nav--prev{ left: 10px; }
.lb__nav--next{ right: 10px; }

/* La imagen no se debe poder arrastrar (fantasma) al hacer swipe */
.lb__img{
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Pista de "desliza" bajo los puntos, solo cuando hay varias fotos */
.lb__puntos{ bottom: 30px; }
.lb__puntos::after{
  content: "Desliza o usa las flechas";
  position: absolute;
  top: 16px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: .74rem;
}
.lb__puntos:empty::after{ content: ""; }

@media (max-width: 640px){
  .lb__nav{ width: 46px; height: 46px; font-size: 1.7rem; }
}

/* ============================================================
   v3 · Carrito
   ============================================================ */

/* Botón "Agregar al carrito" en la tarjeta (reemplaza al de WhatsApp) */
.btn-cart{
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 12px;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: var(--marca);
  color: #fff;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  transition: filter .12s ease;
}
.btn-cart:hover{ filter: brightness(.93); }
.btn-cart svg{ flex: 0 0 auto; }

/* Botón flotante del carrito */
.cart-flotante{
  position: fixed;
  right: 18px; bottom: 18px;
  width: 58px; height: 58px;
  border: none; border-radius: 50%;
  background: var(--marca);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.28);
  z-index: 60; cursor: pointer;
}
.cart-flotante__badge[hidden]{ display: none !important; }
.cart-flotante__badge{
  position: absolute;
  top: -4px; right: -4px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  background: #e5484d; color: #fff;
  border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
}
@keyframes rebote { 0%{transform:scale(1)} 30%{transform:scale(1.15)} 100%{transform:scale(1)} }
.cart-flotante.rebote{ animation: rebote .3s ease; }

/* Panel del carrito */
.cart{
  position: fixed; inset: 0;
  background: rgba(15,15,18,.5);
  display: none;
  justify-content: flex-end;
  z-index: 90;
}
.cart.is-abierto{ display: flex; }
.cart__panel{
  width: 100%;
  max-width: 420px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 30px rgba(0,0,0,.25);
  animation: entrar .2s ease;
}
@keyframes entrar { from{ transform: translateX(30px); opacity: .6 } to{ transform: translateX(0); opacity: 1 } }
.cart__head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--linea);
}
.cart__head h2{ margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: 1.3rem; }
.cart__cerrar{ background: none; border: none; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--tinta-suave); }
.cart__items{ flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart__vacio{ color: var(--tinta-suave); text-align: center; padding: 40px 10px; }

.cart-item{ display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.cart-item__img{ width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: #f0efec; }
.cart-item__img--vacia{ background: #f0efec; }
.cart-item__cuerpo{ flex: 1; min-width: 0; }
.cart-item__top{ display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cart-item__top strong{ font-size: .95rem; line-height: 1.2; }
.cart-item__quitar{ background: none; border: none; font-size: 1.3rem; line-height: 1; color: var(--tinta-suave); cursor: pointer; flex: 0 0 auto; }
.cart-item__var{ font-size: .82rem; color: var(--tinta-suave); margin-top: 2px; }
.cart-item__fila{ display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cart-item__precio{ font-weight: 700; }
.cart-qty{ display: flex; align-items: center; gap: 10px; }
.cart-qty__b{
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--linea); background: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--tinta);
}
.cart-item__nota{
  width: 100%; box-sizing: border-box; margin-top: 8px;
  padding: 7px 10px; border: 1px solid var(--linea); border-radius: 8px;
  font-family: inherit; font-size: .84rem;
}
.cart__datos{ padding: 14px 16px; border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: 10px; }
.cart__datos label{ display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--tinta-suave); }
.cart__datos input, .cart__datos textarea{
  font-family: inherit; font-size: .92rem; font-weight: 400; color: var(--tinta);
  padding: 10px 12px; border: 1px solid var(--linea); border-radius: 10px; resize: vertical;
}
.cart__pie{ padding: 14px 16px 18px; border-top: 1px solid var(--linea); }
.cart__total{ text-align: right; font-size: 1.05rem; margin-bottom: 10px; }
.btn-cart-enviar{
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: var(--wa); color: #fff; font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn-cart-enviar:disabled{ background: #c7cbd1; cursor: not-allowed; }
.btn-cart-enviar:not(:disabled):hover{ filter: brightness(.95); }

@media (max-width: 480px){
  .cart__panel{ max-width: 100%; }
  .cab__logo{ height: 96px; max-width: 70%; }
}

/* Campo obligatorio sin llenar en el carrito */
.cart__datos .campo-error{
  border-color: #e5484d !important;
  box-shadow: 0 0 0 3px rgba(229,72,77,.18) !important;
}


/* Línea de precios por cantidad en la tarjeta */
.producto__escalones{
  margin-top: 6px;
  font-size: .8rem;
  color: var(--tinta-suave);
  background: color-mix(in srgb, var(--marca) 8%, #fff);
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: 6px 9px;
  line-height: 1.35;
}