/* ============================================================
   Iron Beast — Testimonios (/testimonios.html)
   Se carga después de styles.css, tienda.css y catalogo.css y
   reutiliza sus variables. Una rejilla de tarjetas: cada una es la
   foto (o el antes y después, o el video) de una persona, con su
   nombre, lo que cuenta y el producto con el que lo hizo.
   ============================================================ */

/* ---------- Filtros ----------
   Solo aparecen cuando hay de las dos cosas —fotos y videos— o más de
   un producto enlazado. Los llena y los enseña testimonios.js. */
.te-controles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.te-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.te-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: none;
  border: 1px solid rgba(var(--plata-rgb), 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.te-chip:hover { color: var(--ink); border-color: rgba(var(--plata-rgb), 0.4); }
.te-chip.on {
  color: var(--sobre-acento);
  background: linear-gradient(100deg, var(--acento), var(--acento-2));
  border-color: transparent;
}
.te-chip b { font-weight: 700; opacity: 0.75; }

.te-producto select {
  min-height: 40px;
  padding: 8px 36px 8px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(var(--hondo-rgb), 0.6);
  border: 1px solid rgba(var(--plata-rgb), 0.2);
  border-radius: 999px;
  appearance: none;
  cursor: pointer;
}
.te-producto select:focus { outline: none; border-color: var(--acento); }

.te-resumen {
  margin: 0 0 0 auto;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Rejilla ---------- */
.te-rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  align-items: start;
}

.te-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius);
  transition: border-color 0.18s;
}
.te-card:hover { border-color: rgba(var(--plata-rgb), 0.34); }

/* ---------- La imagen ----------
   Todas las tarjetas miden 4:5 (testimonios.js lo pone en --prop), para
   que fotos y videos queden a la misma altura; la foto se recorta centrada
   y entera se ve en el visor. Al reproducir, --prop pasa a la del
   reproductor. */
.te-media {
  position: relative;
  aspect-ratio: var(--prop, 4 / 5);
  overflow: hidden;
  background: rgba(var(--hondo-rgb), 0.6);
  border-bottom: 1px solid var(--panel-br);
}
.te-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* La foto entera es el botón que abre el visor. */
.te-media-boton {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  color: inherit;
  text-align: left;
}
.te-media-boton:focus-visible { outline: 3px solid var(--acento); outline-offset: -3px; }

/* Antes y después: dos mitades, cada una con su etiqueta. */
.te-comparar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  height: 100%;
}
.te-comparar figure {
  position: relative;
  margin: 0;
  height: 100%;
  overflow: hidden;
}
.te-etiqueta {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plata-brillo);
  background: rgba(var(--bg-rgb), 0.78);
  border: 1px solid rgba(var(--plata-rgb), 0.3);
  border-radius: 999px;
  pointer-events: none;
}
.te-etiqueta.despues {
  color: var(--sobre-acento);
  background: linear-gradient(100deg, var(--acento), var(--acento-2));
  border-color: transparent;
}

/* «+2 fotos», abajo a la derecha, cuando hay más de una y no es comparación. */
.te-mas {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 10px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(var(--bg-rgb), 0.8);
  border: 1px solid rgba(var(--plata-rgb), 0.25);
  border-radius: 999px;
  pointer-events: none;
}

/* ---------- El video ----------
   Hasta que se toca, es una portada con el botón de reproducir: la foto
   que subió el cliente o, si no hay, un panel oscuro con el nombre de
   donde vive el video. Al tocar, el marco del proveedor ocupa el sitio. */
.te-video-sin {
  display: grid;
  place-items: center;
  height: 100%;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(var(--acento-rgb), 0.22), transparent 70%),
    linear-gradient(180deg, var(--bg-3), var(--hondo));
}
.te-video-sin span {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transform: translateY(58px);
}
.te-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0) 55%, rgba(var(--bg-rgb), 0.7));
  color: var(--sobre-acento);
  cursor: pointer;
}
.te-play i {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  background: linear-gradient(140deg, var(--acento), var(--acento-2));
  border-radius: 50%;
  box-shadow: 0 10px 34px rgba(var(--acento-2-rgb), 0.5), 0 0 0 8px rgba(var(--acento-rgb), 0.16);
  transition: transform 0.18s;
}
.te-play:hover i { transform: scale(1.06); }
.te-play:focus-visible { outline: 3px solid var(--acento); outline-offset: -3px; }
.te-play svg { width: 28px; height: 28px; margin-left: 4px; }
.te-play span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plata-brillo);
}
.te-marco { width: 100%; height: 100%; }
.te-marco iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--hondo);
}

/* ---------- El pie de la tarjeta ---------- */
.te-pie {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.te-texto {
  margin: 0;
  padding-left: 12px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-dim);
  border-left: 2px solid var(--acento);
}
.te-texto p { margin: 0 0 8px; }
.te-texto p:last-child { margin-bottom: 0; }
.te-quien { display: flex; flex-direction: column; gap: 3px; }
.te-nombre {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.te-detalle {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acento);
}
/* Centrado: el sello «Testimonio validado» va en el medio de la tarjeta,
   con la pastilla del producto al lado si la hay. */
.te-enlaces { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 2px; }

/* El producto con el que lo hizo: una pastilla con su foto, que lleva a la página de venta. */
/* 40 px de alto como mínimo: es lo que necesita el dedo. */
.te-prod {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 12px 4px 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: rgba(var(--panel-alto-rgb), 0.8);
  border: 1px solid rgba(var(--plata-rgb), 0.2);
  border-radius: 999px;
  transition: border-color 0.18s;
}
.te-prod:hover { border-color: var(--acento); }
.te-prod img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
}
.te-prod i {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(var(--acento-rgb), 0.18);
}
/* El sello plateado «Testimonio validado», el mismo componente que los
   sellos junto al precio (styles.css). Va en todas las tarjetas, centrado. */

/* ---------- Sin testimonios todavía ---------- */
.te-vacio {
  grid-column: 1 / -1;
  padding: 34px 22px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--panel-br);
  border-radius: var(--radius);
}
.te-vacio p { margin: 0 0 10px; color: var(--ink-dim); }
.te-vacio p:last-child { margin-bottom: 0; }

/* ---------- El cierre: manda el tuyo ---------- */
.te-cierre {
  margin-top: 40px;
  padding: 30px 22px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-br);
  border-radius: var(--radius);
}
.te-cierre h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.te-cierre p {
  max-width: 56ch;
  margin: 0 auto 18px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-dim);
}

/* ---------- El visor ----------
   Un <dialog> a pantalla completa. El fondo oscuro es el propio diálogo
   —no ::backdrop, que en navegadores viejos no hereda las variables—. */
.te-visor {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: rgba(var(--hondo-rgb), 0.94);
}
.te-visor::backdrop { background: transparent; }
.te-visor-cuerpo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 56px 64px 64px;
  box-sizing: border-box;
}
.te-visor-cuerpo figure { position: relative; margin: 0; max-width: 100%; max-height: 100%; }
.te-visor-cuerpo img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  object-fit: contain;
  border-radius: 8px;
}
.te-visor-cuerpo .te-etiqueta { top: 12px; left: 12px; font-size: 11px; }
.te-visor-cerrar,
.te-visor-flecha {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--ink);
  background: rgba(var(--panel-alto-rgb), 0.85);
  border: 1px solid rgba(var(--plata-rgb), 0.25);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.te-visor-cerrar:hover,
.te-visor-flecha:hover { border-color: var(--acento); }
.te-visor-cerrar { top: 14px; right: 14px; }
.te-visor-flecha { top: 50%; transform: translateY(-50%); }
.te-visor-izq { left: 12px; }
.te-visor-der { right: 12px; }
.te-visor-flecha[hidden] { display: none; }
.te-visor-pie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  margin: 0;
  padding: 0 70px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-dim);
}

/* ---------- Celular ----------
   Una tarjeta por fila: el antes y después necesita el ancho entero para
   que las dos mitades se vean. Las flechas del visor bajan junto al pie,
   donde no tapan la foto. */
@media (max-width: 700px) {
  .te-rejilla { grid-template-columns: 1fr; gap: 14px; }
  .te-controles { gap: 10px; margin-bottom: 18px; }
  .te-resumen { width: 100%; margin-left: 0; }
  .te-pie { padding: 12px 14px 14px; }
  .te-nombre { font-size: 17px; }
  .te-cierre { padding: 24px 16px; }
  .te-visor-cuerpo { padding: 56px 12px 70px; }
  .te-visor-cuerpo img { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
  .te-visor-flecha { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .te-visor-pie { bottom: 26px; padding: 0 64px; }
}
