/**
 * ============================================================================
 * GORILLA NUTRITION SINALOA - Testimonials CSS
 * ============================================================================
 *
 * Slider de testimonios con crossfade. Las cards se apilan en la misma
 * celda CSS Grid y se muestran/ocultan con opacity + visibility.
 *
 * @package Gorilla_Nutrition
 * @since   2.0.0
 */

.testimonials {
  padding: 100px 0;
  background: #0a0a0a;
  overflow: hidden;
}

.testimonials__header {
  text-align: center;
  margin-bottom: 60px;
}

/* ─── Slider wrapper ──────────────────────────────────────────────────── */

.testimonials__slider {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Track: fila flex — muestra el grupo de slides activos */
.testimonials__track {
  display: flex;
  gap: 16px;
  min-height: 1px; /* Evita colapso cuando todos están ocultos */
}

/* ─── Slide ───────────────────────────────────────────────────────────── */

.testimonial-slide {
  display: none;           /* Oculto por defecto */
  flex: 0 0 100%;          /* Ancho base = 100% del track */
  opacity: 0;
  transition: opacity 0.55s ease;
}

/* En grupos de 3: cada slide ocupa un tercio */
.testimonials__track[data-per-page="3"] .testimonial-slide {
  flex: 0 0 calc( (100% - 32px) / 3 );
}

/* Slide activo (pertenece a la página actual) */
.testimonial-slide--active {
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: tslideFadeIn 0.55s ease forwards;
}

@keyframes tslideFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Card de Testimonio ──────────────────────────────────────────────── */

.testimonial-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-gold);
  border-radius: var(--radius-md);
  padding: 36px 32px;         /* Reducido de 50px 52px para caber 3 en fila */
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  position: relative;
  transition: var(--transition-card);
  height: 100%;               /* Iguala alturas entre las 3 cards */
  box-sizing: border-box;
}

/* Línea dorada superior al hover */
.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  transition: width 0.5s ease;
}

.testimonial-slide--active .testimonial-card::before {
  width: 60%;
}

/* ─── Comilla decorativa ──────────────────────────────────────────────── */

.testimonial-card__quote {
  font-size: 88px;
  color: var(--color-gold);
  opacity: 0.12;
  line-height: 1;
  margin-bottom: -24px;
  font-family: Georgia, serif;
}

/* ─── Estrellas ───────────────────────────────────────────────────────── */

.testimonial-card__stars {
  font-size: 22px;
  letter-spacing: 6px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.star--filled { color: var(--color-gold); }
.star--empty  { color: rgba(201, 169, 79, 0.18); }

/* ─── Título de la reseña ────────────────────────────────────────────── */

.testimonial-card__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--color-text-primary);
  letter-spacing: 1px;
  line-height: 1.2;
  margin: 0;
}

/* ─── Texto ───────────────────────────────────────────────────────────── */

.testimonial-card__text {
  font-size: 14px;           /* Reducido de 16px para 3-columnas */
  color: #b8b0a8;
  line-height: 1.75;
  font-style: italic;
  margin: 0 auto;
}

/* ─── Autor ───────────────────────────────────────────────────────────── */

.testimonial-card__author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

.testimonial-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(201, 169, 79, 0.4);
  background: linear-gradient(135deg, var(--color-red), var(--color-gold));
  display: flex;
  align-items: center;
  justify-content: center;
}

.testimonial-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.testimonial-card__avatar-initial {
  font-family: var(--font-display);
  font-size: 24px;
  color: #fff;
  line-height: 1;
}

.testimonial-card__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
  text-align: left;
}

.testimonial-card__role {
  font-size: 10px;
  color: var(--color-gold);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 3px;
  text-align: left;
}

/* ─── Navegación: dots + flechas ─────────────────────────────────────── */

/* ─── Controles del slider unificados ─────────────────────────────────── */

.testimonials__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 36px;
}

/* Dots (usamos el mismo estilo de dots redondos y estirados de galería) */
.testimonials__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Contador */
.testimonials__counter {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 1px;
  min-width: 40px;
  text-align: center;
}

.testimonials__counter-sep {
  margin: 0 2px;
  color: var(--color-text-muted);
}

/* Barra de progreso */
.testimonials__progress {
  margin-top: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.testimonials__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold-light));
  border-radius: 2px;
  transition: width 0.4s var(--ease-reveal);
}

/* Flechas unificadas */
.testimonials__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid rgba(201, 169, 79, 0.3);
  border-radius: var(--radius-lg);
  color: var(--color-gold);
  cursor: pointer;
  transition:
    background     0.25s ease,
    border-color   0.25s ease,
    color          0.25s ease,
    transform      0.2s ease,
    opacity        0.2s ease;
  outline: none;
  flex-shrink: 0;
  z-index: 2;
}

.testimonials__arrow:hover:not(:disabled) {
  background: rgba(201, 169, 79, 0.12);
  border-color: rgba(201, 169, 79, 0.7);
  color: var(--color-gold-light);
  transform: scale(1.08);
}

.testimonials__arrow:active:not(:disabled) {
  transform: scale(0.95);
}

.testimonials__arrow:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* ─── Estado vacío ────────────────────────────────────────────────────── */

.testimonials__empty {
  text-align: center;
  color: rgba(201, 169, 79, 0.4);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 60px 0;
}

/* ═══ Responsive ══════════════════════════════════════════════════════════ */

/* Tablet: 2 por página si caben */
@media ( max-width: 1024px ) and ( min-width: 768px ) {
  .testimonials__track[data-per-page="3"] .testimonial-slide {
    flex: 0 0 calc( (100% - 16px) / 2 );
  }
  /* El JS sigue mandando 3, pero en tablet mostramos 2 visualmente.
     Si se quiere 2 en tablet hay que ajustar el breakpoint en JS también.
     Por ahora solo reducimos tamaño de texto/padding para que quepan bien. */
  .testimonial-card {
    padding: 30px 24px;
  }
  .testimonial-card__text {
    font-size: 13px;
  }
}

/* Mobile (≤ 767px): 1 por página — el JS ya lo maneja, el CSS lo refuerza */
@media ( max-width: 767px ) {
  .testimonials__slider {
    max-width: 100%;
  }

  .testimonials__track {
    gap: 0;
  }

  .testimonials__track[data-per-page="1"] .testimonial-slide {
    flex: 0 0 100%;
  }

  .testimonial-card {
    padding: 32px 24px;
  }

  .testimonial-card__text {
    font-size: 14px;
    line-height: 1.7;
  }

  .testimonial-card__quote {
    font-size: 64px;
    margin-bottom: -16px;
  }

  .testimonials__controls {
    gap: 12px;
    margin-top: 28px;
  }

  .testimonials__arrow {
    width: 40px;
    height: 40px;
  }
}
