/* ==========================================================================
   Fichas de producto reales del catálogo
   --------------------------------------------------------------------------
   Los datos (nombre, precio, ficha técnica y foto) salen del InDesign del
   catálogo. El movimiento se apoya en --v, que escribe escenas.js: 0 cuando
   el elemento asoma por abajo, 1 cuando sale por arriba.
   ========================================================================== */

@property --v { syntax: "<number>"; inherits: true; initial-value: 0.5; }

/* --- Historia de la sección, tomada del propio catálogo --- */

.relato {
  max-width: 34rem;
  margin-block: clamp(2rem, 4vw, 3.5rem);
  padding-left: clamp(1rem, 2vw, 1.75rem);
  border-left: var(--trazo) solid var(--acento);
  font-size: var(--texto-lg);
  font-style: italic;
  color: var(--color-texto);
}

/* --- Rejilla de productos --- */

.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  /* Igualadas: el precio va anclado abajo con margin-top auto, así las tres
     fichas cierran a la misma altura y las sombras duras quedan alineadas. */
  align-items: stretch;
}

.producto {
  --v: 0.5;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  background: var(--color-superficie);
  border: var(--trazo) solid var(--c-tinta);
  border-radius: var(--radio-xl) var(--radio-xl) var(--radio-lg) var(--radio-lg);
  box-shadow: 0.55rem 0.55rem 0 var(--c-tinta);
  transition:
    transform var(--dur-normal) var(--ease-rebote),
    box-shadow var(--dur-normal) var(--ease-salida);
}

.producto:hover,
.producto:focus-within {
  transform: translate(-0.3rem, -0.4rem);
  box-shadow: 0.95rem 1rem 0 var(--c-tinta);
}

/* La foto flota: sube un poco según pasa por la pantalla. */
.producto__foto {
  width: 100%;
  max-width: 13rem;
  margin: 0 auto clamp(1rem, 2vw, 1.5rem);
  translate: 0 calc((0.5 - var(--v)) * 1.6rem);
  filter: drop-shadow(0 0.9rem 1.1rem rgb(34 34 33 / 0.22));
  transition: rotate var(--dur-normal) var(--ease-rebote);
}

.producto:hover .producto__foto { rotate: -2.5deg; }

.producto__nombre {
  font-size: var(--texto-lg);
  color: var(--acento-texto);
}

.producto__desc {
  margin-top: 0.6rem;
  font-size: var(--texto-sm);
  color: var(--color-texto-suave);
}

/* --- Ficha técnica --- */

.especificaciones {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--texto-sm);
}

.especificaciones div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.35rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--c-tinta) 25%, transparent);
}

.especificaciones dt { color: var(--color-texto-suave); }
.especificaciones dd { margin: 0; font-weight: 700; }

/* --- Precio --- */

.producto__precio {
  margin-top: auto;
  padding-top: 1.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--fuente-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem);
  color: var(--acento-texto);
  font-variant-numeric: tabular-nums;
}

.producto__moneda {
  font-size: 0.55em;
  font-weight: 700;
  opacity: 0.7;
}

/* --- Lo que incluye cada kalimba (del catálogo) --- */

.incluye {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--c-tinta);
  color: #fff;
  border-radius: var(--radio-xl);
}

.incluye__titulo {
  font-size: var(--texto-lg);
  color: var(--c-amarillo);
  margin-bottom: 1.1rem;
}

.incluye__lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.incluye__lista li {
  padding: 0.45em 1em;
  border: 2px solid color-mix(in srgb, #fff 40%, transparent);
  border-radius: 999px;
  font-size: var(--texto-sm);
  font-weight: 600;
}

/* --- Franja de vegetación animada entre secciones --- */

.vegetacion {
  --v: 0.5;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(4rem, 9vw, 9rem);
  pointer-events: none;
  overflow: hidden;
}

.vegetacion img {
  position: absolute;
  bottom: 0;
  width: 34%;
  min-width: 14rem;
}

/* Cada mata va a su ritmo: la de delante se mueve más. */
.vegetacion img:nth-child(1) { left: -3%;  translate: calc(var(--v) * 3rem) 0; }
.vegetacion img:nth-child(2) { right: -3%; translate: calc(var(--v) * -4rem) 0; scale: -1 1; }

@media (prefers-reduced-motion: reduce) {
  .producto__foto,
  .vegetacion img { translate: none; }
}
