/* ==========================================================================
   EL ESCONDITE GOURMET - FICHA DE PRODUCTO (/producto/<slug>)
   Página propia por producto (SEO + aspecto profesional). Usa los tokens y
   reutiliza botones y etiquetas de base.css / tienda.css. Esquinas casi rectas,
   crema + tinta + terracota, sin emojis en la interfaz.
   ========================================================================== */

.producto-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem var(--container-pad) 3rem;
}

/* Miga de pan */
.producto-breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.5rem 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.producto-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.producto-breadcrumb a:hover { color: var(--color-terracotta-dark); text-decoration: underline; }
.producto-breadcrumb .sep { color: var(--color-border); }
.producto-breadcrumb [aria-current] { color: var(--text-secondary); font-weight: 600; }

/* Rejilla principal: foto | información */
.producto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* Foto */
.producto-media {
  position: sticky;
  top: 1.25rem;
}
.producto-figure {
  position: relative;
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.producto-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform var(--transition-fast);
}
.producto-figure img:hover { transform: scale(1.03); }
.producto-ribbon {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  background: var(--color-olive);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

/* Información */
.producto-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-terracotta-dark);
  margin: 0 0 0.5rem;
}
.producto-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4.2vw, 2.3rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 0.8rem;
}
.producto-priceline {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 0.9rem;
}
.producto-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-terracotta-dark);
}
.producto-price-note { font-size: 0.82rem; color: var(--text-muted); }

/* Disponibilidad */
.producto-availability {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
.producto-availability.in-stock { color: var(--color-success); background: var(--color-success-bg); }
.producto-availability.out-stock { color: var(--color-danger); background: var(--color-danger-bg); }

/* Etiquetas (reutiliza .badge-tag de tienda.css; añadimos la valenciana) */
.producto-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.2rem; }
.badge-valenciano {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.76rem; font-weight: 600;
  padding: 0.28rem 0.6rem; border-radius: var(--radius-pill);
  color: var(--color-olive-dark); background: var(--color-olive-soft);
}

/* Compra: cantidad + botones */
.producto-buy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: stretch;
  margin: 0.4rem 0 1.1rem;
}
.producto-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  overflow: hidden;
}
.producto-qty button {
  width: 44px;
  height: 48px;
  border: none;
  background: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.producto-qty button:hover { background: var(--bg-soft); color: var(--text-primary); }
.producto-qty input {
  width: 42px;
  height: 48px;
  text-align: center;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: none;
  -moz-appearance: textfield;
}
.producto-qty input::-webkit-outer-spin-button,
.producto-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.producto-buy .btn-add {
  flex: 1 1 220px;
  min-height: 48px;
  font-size: 1rem;
}
.producto-buy .btn-add.is-out-of-stock { opacity: 0.6; cursor: not-allowed; }
.producto-consulta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-whatsapp);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem 0;
  margin-bottom: 1.2rem;
}
.producto-consulta:hover { color: var(--color-whatsapp-dark); text-decoration: underline; }

/* Ventajas (envío, recogida, club) */
.producto-perks {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  margin: 0.4rem 0 1.4rem;
}
.producto-perks div { display: flex; gap: 0.6rem; align-items: center; font-size: 0.88rem; color: var(--text-secondary); }
.producto-perks i { color: var(--color-terracotta-dark); width: 20px; text-align: center; }

/* Descripción / Qué incluye */
.producto-section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin: 1.6rem 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.producto-specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.producto-specs li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.producto-specs li i { color: var(--color-olive); margin-top: 0.2rem; flex-shrink: 0; }

/* Aviso legal +18 */
.producto-legal {
  margin: 1.2rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--color-accent-bg);
  border-left: 3px solid var(--color-terracotta);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.producto-legal i { color: var(--color-terracotta-dark); margin-right: 0.3rem; }

/* Relacionados */
.producto-related { margin-top: 3rem; }

/* Carrusel: una sola fila que se desliza con flechas (o arrastrando en móvil) */
.producto-carousel { position: relative; margin-top: 1rem; }
.producto-related-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: 0.25rem 0.25rem 0.75rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.producto-related-grid::-webkit-scrollbar { display: none; }
.carousel-arrow {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.carousel-arrow:hover { background: var(--bg-soft); }
.carousel-arrow.prev { left: -10px; }
.carousel-arrow.next { right: -10px; }
.carousel-arrow[hidden] { display: none; }

.producto-related-card {
  flex: 0 0 185px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.producto-related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.producto-related-card .rel-img {
  flex: 0 0 auto;        /* cuadrado fijo: no se estira aunque el nombre sea más largo */
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  padding: 0.7rem;
  border-bottom: 1px solid var(--color-border-subtle);
}
.producto-related-card .rel-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.producto-related-card .rel-body { padding: 0.6rem 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.producto-related-card .rel-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text-primary); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.14em;   /* 2 líneas: todas las tarjetas igual de altas */
}
.producto-related-card .rel-price { font-size: 0.9rem; font-weight: 700; color: var(--color-terracotta-dark); margin-top: auto; }

/* Visor de imagen a pantalla completa */
.producto-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 15, 13, 0.85);
  cursor: zoom-out;
}
.producto-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  background: #fff;
}

/* Responsive */
@media (max-width: 860px) {
  .producto-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .producto-media { position: static; }
  .producto-figure { aspect-ratio: 4 / 3; padding: 1rem; }
}
@media (max-width: 420px) {
  .producto-buy .btn-add { flex-basis: 100%; }
}
