/* Bloque de producto de afiliado (modulo productos de tdp-funciones). Diseño del piloto de AliExpress, 2026-11-26,
   validado por el usuario sobre una maqueta.
   Hoja propia: no depende de tdp-categoria.css ni de ninguna otra del tema, y solo la encola el modulo cuando
   la pagina tiene algo que pintar. Usa los tokens del sitio con valor de reserva por si la hoja global no esta.
   Todo va con el prefijo .tdpf- y colgado de su contenedor para ganar a las reglas de .prose (p, h3, a, img). */

html { scroll-behavior: smooth; }
#kit-afiliado { scroll-margin-top: 80px; }

/* ---------- Franja «¿Buscas el equipo...?», unida a la ola de la cabecera ---------- */
.page-hero:has(+ .tdpf-franja) .wave.bottom path { fill: url(#tdpf-ola); }
.tdpf-franja {
  position: relative;
  overflow: hidden;
  margin-top: -1px;
  padding: 6px 20px 46px;
  background: linear-gradient(90deg, #dff3ef 0%, #eef7f2 50%, #fdeedd 100%);
}
.tdpf-franja .tdpf-franja__ola { position: absolute; left: 0; bottom: -1px; width: 100%; height: 36px; display: block; }
.tdpf-franja .tdpf-franja__burbuja { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.tdpf-franja .tdpf-franja__burbuja--1 { width: 60px; height: 60px; left: 3%; top: 10%; }
.tdpf-franja .tdpf-franja__burbuja--2 { width: 26px; height: 26px; right: 4%; top: 14%; }
.tdpf-franja .tdpf-franja__dentro {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.tdpf-franja .tdpf-franja__texto { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tdpf-franja .tdpf-franja__pez { flex: 0 0 38px; width: 38px; height: 38px; color: var(--coral, #e8684a); }
.tdpf-franja .tdpf-franja__titulo { display: block; font-weight: 800; font-size: 1.08rem; color: var(--navy, #1f2d4a); }
.tdpf-franja .tdpf-franja__sub { display: block; margin-top: 2px; font-size: .92rem; color: #4a5a5a; }

.tdpf-franja .tdpf-franja__btn,
.tdpf-prods .tdpf-prod__btn,
.tdpf-boton-medio .tdpf-boton-medio__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tdpf-franja .tdpf-franja__btn {
  background: var(--coral, #e8684a);
  color: #fff;
  padding: 11px 20px;
}
.tdpf-franja .tdpf-franja__btn:hover,
.tdpf-prods .tdpf-prod__btn:hover,
.tdpf-boton-medio .tdpf-boton-medio__btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }

/* ---------- Boton intermedio ---------- */
.tdpf-boton-medio { text-align: center; margin-top: 26px; }
.tdpf-boton-medio .tdpf-boton-medio__btn {
  background: #fff;
  color: var(--coral, #e8684a);
  border: 2px solid var(--coral, #e8684a);
  padding: 10px 20px;
}

/* ---------- El bloque ---------- */
.tdpf-prods { margin: 1.2rem 0 0; position: relative; }
.tdpf-prods .tdpf-prods__titulo { font-weight: 800; font-size: 1.15rem; margin: 0 0 .6rem; color: var(--navy, #1f2d4a); }

.tdpf-prods .tdpf-aviso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 26px;
  max-width: 760px;
  text-align: center;
  font-size: .84rem;
  color: var(--muted, #666);
}
.tdpf-prods .tdpf-aviso__etiqueta {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #555;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.tdpf-prods .tdpf-aviso a.tdpf-aviso__enlace { color: inherit; text-decoration: underline; }

@media (max-width: 700px) {
  .tdpf-franja .tdpf-franja__dentro { flex-direction: column; align-items: stretch; }
  .tdpf-franja .tdpf-franja__btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tdpf-franja .tdpf-franja__btn, .tdpf-prods .tdpf-prod__btn, .tdpf-boton-medio .tdpf-boton-medio__btn { transition: none; }
}

/* ==========================================================================================================
   VARIANTE A2 (diseno 1-dic, elegida por el dueno sobre la A): tarjeta vertical compacta con «Ver mas».
   - Foto baja (16:10; 2:1 en movil), gama sobre la foto, credito «Imagen: X» dentro de la foto.
   - Nombre, nota en una linea con estrella, porque en 3 lineas y «Ver mas» (details/summary, sin JS): al abrirlo se
     ve el porque entero y los demas datos (medidas, fuente).
   - Tiendas: dos pastillas por fila; si son impares, la ultima a todo el ancho. 1.a coral rellena, 2.a marino
     rellena, 3.a contorno marino. El envio, debajo de su pastilla, pequeno.
   - Opcion economica como linea-enlace al pie.
   Alineacion por filas: alturas minimas fijas para nombre (2 lineas), nota (1) y porque (3), asi las pastillas
   caen a la misma altura en toda la fila. Al abrir un «Ver mas», solo crece esa tarjeta: la rejilla deja de estirar
   las demas (que conservan su altura) en vez de abrirles un hueco.
   Necesita el marcado de A2 (productos.php): .tdpf-prod__tiendas, .tdpf-prod__tienda, .tdpf-prod__ver,
   .tdpf-prod__dato--<etiqueta> y details.tdpf-prod__mas.
   ========================================================================================================== */
.tdpf-prods .tdpf-prods__rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 18px;
  align-items: stretch;
}
.tdpf-prods .tdpf-prods__rejilla:has(.tdpf-prod__mas[open]) { align-items: start; }

.tdpf-prods .tdpf-prod {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid #efe8dc;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(31, 45, 74, .05);
  transition: box-shadow .2s ease;
}
.tdpf-prods .tdpf-prod:hover { box-shadow: 0 10px 26px rgba(31, 45, 74, .10); }

/* Etiqueta de gama: pastilla pequena sobre la foto. */
.tdpf-prods .tdpf-prod__etiqueta {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: #fff;
  border: 1px solid #ece4d6;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.3;
  color: #2a5d9f;
  box-shadow: none;
}
.tdpf-prods .tdpf-prod__etiqueta--alta { color: #8a5a00; background: #fff7e6; border-color: #f3dfb4; }
.tdpf-prods .tdpf-prod__etiqueta--economica { color: #1d7a5f; background: #eaf6f0; border-color: #c9e7d9; }

/* Foto: baja (16:10), entera y sin recortar (contain); las de AliExpress no se tocan. */
.tdpf-prods .tdpf-prod__foto {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #fff;
  border-bottom: 1px solid #f3efe7;
  overflow: hidden;
}
.tdpf-prods .tdpf-prod__foto img {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  padding: 7% 8% 5%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
.tdpf-prods .tdpf-prod__foto:has(+ .tdpf-prod__credito) img { padding: 4% 6% 3%; }
.tdpf-prods .tdpf-prod__foto--cubre img { object-fit: cover; padding: 0; }

/* Credito «Imagen: X»: dentro de la zona de la foto, abajo a la derecha, sin ocupar sitio. */
.tdpf-prods p.tdpf-prod__credito {
  position: relative;
  z-index: 1;
  height: 0;
  margin: 0;
  padding: 0 10px 0 0;
  top: -17px;
  font-size: .62rem;
  line-height: 1;
  color: #9a9a9a;
  text-align: right;
  pointer-events: none;
}

.tdpf-prods .tdpf-prod__cuerpo { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 13px 16px 14px; }
.tdpf-prods h3.tdpf-prod__nombre {
  margin: 0;
  min-height: calc(2em * 1.28);
  font-size: 1rem;
  line-height: 1.28;
  color: var(--navy, #1f2d4a);
}

/* Datos: la nota a la vista (una linea con estrella); el resto, dentro de «Ver mas». */
.tdpf-prods .tdpf-prod__datos {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: .74rem;
  line-height: 1.45;
  color: #7d838d;
}
.tdpf-prods .tdpf-prod__datos li { display: block; margin: 0; padding: 0; border: 0; }
.tdpf-prods .tdpf-prod__datos li::before { content: none; }
.tdpf-prods .tdpf-prod__datos b { font-weight: 600; color: #5b6573; }
.tdpf-prods .tdpf-prod__datos b::after { content: ": "; }
.tdpf-prods .tdpf-prod__datos li.tdpf-prod__dato--valoracion {
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy, #1f2d4a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tdpf-prods .tdpf-prod__datos li.tdpf-prod__dato--valoracion::before {
  content: "\2605";
  margin-right: 4px;
  color: #f2a33a;
  font-size: .95em;
}
/* La etiqueta «Valoracion» y el «Ver en » de los botones quedan para los lectores de pantalla, no a la vista. */
.tdpf-prods .tdpf-prod__datos li.tdpf-prod__dato--valoracion b,
.tdpf-prods .tdpf-prod__ver {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* El porque: 3 lineas (siempre ocupa 3, para alinear la fila); entero al abrir «Ver mas». */
.tdpf-prods p.tdpf-prod__porque {
  margin: 7px 0 0;
  min-height: calc(3em * 1.45);
  font-size: .86rem;
  line-height: 1.45;
  color: #5b6573;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.tdpf-prods .tdpf-prod:has(.tdpf-prod__mas[open]) p.tdpf-prod__porque { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }

/* «Ver mas»: enlace pequeno con flecha que gira; dentro, los demas datos. */
.tdpf-prods details.tdpf-prod__mas { margin: 4px 0 0; padding: 0; border: 0; background: none; }
.tdpf-prods details.tdpf-prod__mas > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 2px 0;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.3;
  color: #2a5d9f;
  border-radius: 4px;
  user-select: none;
}
.tdpf-prods details.tdpf-prod__mas > summary::-webkit-details-marker { display: none; }
.tdpf-prods details.tdpf-prod__mas > summary::marker { content: ""; }
.tdpf-prods details.tdpf-prod__mas > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.tdpf-prods details.tdpf-prod__mas[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.tdpf-prods details.tdpf-prod__mas > summary:hover { color: var(--coral, #e8684a); }
.tdpf-prods details.tdpf-prod__mas > summary:focus-visible { outline: 2px solid #2a5d9f; outline-offset: 2px; }
.tdpf-prods .tdpf-prod__mas-cerrar,
.tdpf-prods details.tdpf-prod__mas[open] .tdpf-prod__mas-abrir { display: none; }
.tdpf-prods details.tdpf-prod__mas[open] .tdpf-prod__mas-cerrar { display: inline; }
.tdpf-prods .tdpf-prod__datos--mas {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #faf7f1;
}

/* Tiendas: dos pastillas por fila; impares, la ultima a todo el ancho; el envio debajo de cada una. */
/* Las pastillas, justo tras «Ver mas» (a la misma altura en toda la fila); la opcion economica, abajo del todo. */
.tdpf-prods .tdpf-prod__botones { flex: 1 1 auto; margin: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.tdpf-prods .tdpf-prod__tiendas {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px 6px;
}
.tdpf-prods .tdpf-prod__tiendas::before {
  content: "Ver en";
  flex: 0 0 100%;
  margin-bottom: -2px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #a39a8c;
}
.tdpf-prods .tdpf-prod__tienda { flex: 1 1 calc(50% - 3px); max-width: calc(50% - 3px); display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; }
.tdpf-prods .tdpf-prod__tienda:last-child:nth-child(odd) { flex-basis: 100%; max-width: 100%; }
.tdpf-prods a.tdpf-prod__btn {
  box-sizing: border-box;
  display: block;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 17px;
  letter-spacing: .01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  transform: none;
  box-shadow: none;
}
/* 1.a: coral rellena. 2.a: marino rellena. 3.a (y siguientes): contorno marino. */
.tdpf-prods .tdpf-prod__tienda a.tdpf-prod__btn { background: #fff; color: var(--navy, #1f2d4a); border: 1.5px solid rgba(31, 45, 74, .55); }
.tdpf-prods .tdpf-prod__tienda a.tdpf-prod__btn:hover { background: #f4f1ea; border-color: var(--navy, #1f2d4a); transform: none; box-shadow: none; }
.tdpf-prods .tdpf-prod__tienda:nth-child(1) a.tdpf-prod__btn { background: var(--coral, #e8684a); border-color: var(--coral, #e8684a); color: #fff; }
.tdpf-prods .tdpf-prod__tienda:nth-child(1) a.tdpf-prod__btn:hover { background: #d9573a; border-color: #d9573a; }
.tdpf-prods .tdpf-prod__tienda:nth-child(2) a.tdpf-prod__btn { background: var(--navy, #1f2d4a); border-color: var(--navy, #1f2d4a); color: #fff; }
.tdpf-prods .tdpf-prod__tienda:nth-child(2) a.tdpf-prod__btn:hover { background: #2c3e63; border-color: #2c3e63; }
.tdpf-prods .tdpf-prod__tienda span.tdpf-prod__envio {
  display: block;
  margin: 0;
  font-size: .62rem;
  line-height: 1.2;
  color: #a0a0a0;
  text-align: center;
  white-space: nowrap;
}
.tdpf-prods a.tdpf-prod__btn--interno { background: var(--coral, #e8684a); color: #fff; border: 1.5px solid var(--coral, #e8684a); }

/* Opcion economica: una linea-enlace al pie, separada por una raya fina. */
.tdpf-prods a.tdpf-prod__alt {
  order: 2;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: auto 0 0;
  padding: 9px 0 0;
  border-top: 1px dashed #ebe4d8;
  border-radius: 0;
  background: none;
  font-size: .76rem;
  line-height: 1.35;
  color: #6b7280;
  text-decoration: none;
}
.tdpf-prods a.tdpf-prod__alt > span:first-child { flex: 1; min-width: 0; }
.tdpf-prods a.tdpf-prod__alt b { font-weight: 700; color: #1d7a5f; text-decoration: underline; text-decoration-color: rgba(29, 122, 95, .35); text-underline-offset: 2px; }
.tdpf-prods a.tdpf-prod__alt:hover b { text-decoration-color: currentColor; }
.tdpf-prods a.tdpf-prod__alt > span[aria-hidden] { color: #1d7a5f; }

/* Movil: una columna; foto aun mas baja y sin alturas minimas (no hay fila que alinear). */
@media (max-width: 600px) {
  .tdpf-prods .tdpf-prod__foto { aspect-ratio: 2 / 1; }
  .tdpf-prods h3.tdpf-prod__nombre,
  .tdpf-prods p.tdpf-prod__porque { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tdpf-prods .tdpf-prod, .tdpf-prods a.tdpf-prod__btn, .tdpf-prods details.tdpf-prod__mas > summary::after { transition: none; }
}
