/* ==========================================================================
   Primible — Testimonios (section-testimonios.php)
   ========================================================================== */

html.dark-mode .tst,
.tst { padding: clamp(56px, 8vw, 110px) 0; background: transparent !important; }

.tst__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.tst__head .sec-title { margin-bottom: 0 !important; }

.tst__note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  color: #fff !important;
  font-size: 14px;
  text-decoration: none !important;
}

.tst__stars { display: inline-flex; gap: 2px; }
.tst__stars svg { fill: rgba(255, 255, 255, .18); }
.tst__stars svg.is-on { fill: #f5c542; }

/* ---------- Escenario ---------- */
.tst__stage {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 28px;
  background: #303032;
}

.tst__photos { position: relative; min-height: clamp(340px, 34vw, 480px); background: #1f1f21; }

.tst__photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .7s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1);
}
.tst__photo.is-active { opacity: 1; transform: none; }
.tst__photo img { width: 100%; height: 100%; object-fit: cover; }
.tst__photo::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(48, 48, 50, 0) 60%, rgba(48, 48, 50, .9));
  content: "";
}
.tst__photo-ini {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c547ff, #8d0dcc);
  color: #fff;
  font-size: 48px;
  font-weight: 600;
}

.tst__counter {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(24, 24, 24, .6);
  color: #fff;
  font-size: 12px;
  letter-spacing: .08em;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.tst__quotes {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px);
}

.tst__mark { width: 52px; height: 44px; margin-bottom: 18px; fill: #b114ff; opacity: .9; }

.tst__quote { margin: 0; }
.tst__quote[hidden] { display: none; }
.tst__quote.is-active { animation: tstIn .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tstIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.tst__quote blockquote { margin: 14px 0 22px !important; padding: 0 !important; border: 0 !important; }
.tst__quote blockquote p {
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(19px, 1.8vw, 26px) !important;
  font-weight: 400;
  line-height: 1.45 !important;
  letter-spacing: -.01em;
}
.tst__quote figcaption { display: grid; gap: 2px; }
.tst__quote figcaption strong { color: #fff; font-size: 16px; }
.tst__quote figcaption span { color: #d66bff; font-size: 14px; }

.tst__controls { display: flex; gap: 8px; margin-top: 28px; }
.tst__arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.tst__arrow:hover { border-color: #b114ff; background: #b114ff; }

/* ---------- Fila de personas ---------- */
.tst__people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tst__person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  text-align: left;
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.tst__person:hover { border-color: rgba(255, 255, 255, .2); color: #fff; }
.tst__person.is-active { border-color: rgba(214, 107, 255, .45); background: rgba(177, 20, 255, .12); color: #fff; }

.tst__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 50%;
  background: #8d0dcc;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.tst__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tst__person.is-active .tst__avatar { box-shadow: 0 0 0 2px #232325, 0 0 0 4px #d66bff; }

.tst__person-txt { display: grid; min-width: 0; }
.tst__person-txt strong { overflow: hidden; color: inherit; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.tst__person-txt span { overflow: hidden; font-size: 12px; opacity: .75; text-overflow: ellipsis; white-space: nowrap; }

/* Barra de progreso del avance automático */
.tst__bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; }
.tst__bar span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #8d0dcc, #d66bff); }
.tst__person.is-active .tst__bar span { animation: tstBar var(--tst-delay, 7000ms) linear forwards; }
.tst.is-paused .tst__person.is-active .tst__bar span { animation-play-state: paused; }
@keyframes tstBar { to { width: 100%; } }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .tst__stage { grid-template-columns: 1fr; }
  .tst__photos { min-height: 260px; }
  .tst__photo::after { background: linear-gradient(180deg, rgba(48, 48, 50, 0) 60%, rgba(48, 48, 50, .95)); }
  .tst__people { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tst__people::-webkit-scrollbar { display: none; }
  .tst__person { flex: 0 0 72%; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .tst__photo, .tst__quote.is-active { transition: none; animation: none; }
  .tst__person.is-active .tst__bar span { animation: none; width: 100%; }
}

/* Imagen del producto comprado (sin imagen: ícono de caja) */
.tst__photo-empty { display: grid; place-items: center; width: 100%; height: 100%; color: rgba(214, 107, 255, .55); background: radial-gradient(circle at 50% 45%, rgba(177, 20, 255, .18), transparent 60%); }

/* «Compró: …» con enlace al producto */
.tst__buy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(214, 107, 255, .35);
  border-radius: 999px;
  background: rgba(177, 20, 255, .12);
  color: rgba(255, 255, 255, .85) !important;
  font-size: 13px;
  text-decoration: none !important;
}
.tst__buy strong { color: #fff; font-weight: 600; }
a.tst__buy:hover { border-color: #b114ff; background: rgba(177, 20, 255, .25); }
