/* ═══════════════════════════════════════════════════════════════
   TESTIMONIOS — Google Reviews carrusel
   Sección 7 de Blindafon Landing Page
   ═══════════════════════════════════════════════════════════════ */

/* ── Sección contenedor ─────────────────────────────────────── */

#testimonios {
  position: relative;
  background-color: var(--cream);
  padding: var(--space-3xl) var(--pad-mobile);
  overflow: hidden;
}

/* Grain texture sutil sobre cream */
#testimonios::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/grain.png');
  background-repeat: repeat;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

#testimonios > * {
  position: relative;
  z-index: 1;
}

/* ── Encabezado ─────────────────────────────────────────────── */

.testimonios-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-xl);
}

.testimonios-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 var(--space-md);
  opacity: 0; /* GSAP anima */
}

.testimonios-titulo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin: 0 0 var(--space-md);
  opacity: 0; /* GSAP anima */
}

.testimonios-subtitulo {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.75rem, 1.3vw, 0.875rem);
  color: #5F6368;
  line-height: 1.6;
  margin: 0;
  opacity: 0; /* GSAP anima */
}

/* ── Carrusel wrapper ────────────────────────────────────────── */

.testimonios-carrusel {
  position: relative;
  /* Escapa el padding lateral de #testimonios para ocupar todo el ancho */
  margin-left: calc(-1 * var(--pad-desktop));
  margin-right: calc(-1 * var(--pad-desktop));
  padding: 0 calc(var(--pad-desktop) + 56px);
  overflow: visible;
}

@media (max-width: 767px) {
  .testimonios-carrusel {
    margin-left: calc(-1 * var(--pad-mobile));
    margin-right: calc(-1 * var(--pad-mobile));
    /* Solo el espacio para las flechas (28px) + 4px de respiro */
    padding: 0 32px;
  }
}

/* ── Track — altura mínima para evitar saltos durante crossfade ── */

.testi-track {
  border-radius: 12px;
  position: relative;
  min-height: 200px; /* JS la ajusta al alto real de la tarjeta activa */
}

/* ── Tarjeta base ────────────────────────────────────────────── */

.tarjeta-review {
  background: #ffffff;
  border: 1px solid rgba(31, 44, 76, 0.08);
  border-radius: 12px;
  padding: 28px 24px;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    0 1px 2px rgba(31, 44, 76, 0.04),
    0 4px 16px rgba(31, 44, 76, 0.06);
  cursor: default;
  /* Crossfade: todas visibles en el stack, opacity controla cuál se ve */
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease, transform 500ms ease;
  transform: translateY(6px);
  display: flex; /* siempre flex, crossfade via opacity */
}

.tarjeta-review.carrusel--activa {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  position: relative; /* la activa ocupa espacio real para que .testi-track tenga alto */
}

/* Tarjeta destacada — Laura Salazar */
.tarjeta--destacada {
  border-color: rgba(241, 139, 59, 0.20);
}

/* Tarjeta destacada: texto un poco más grande */
.tarjeta--destacada .tarjeta-texto {
  font-size: 0.875rem;
}

/* ── Flechas ─────────────────────────────────────────────────── */

.testi-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 200ms, transform 200ms, opacity 200ms;
  z-index: 2;
  padding: 0;
  opacity: 0.5;
}

.testi-btn svg {
  width: 24px;
  height: 24px;
}

.testi-btn:hover {
  opacity: 1;
  color: var(--orange);
  transform: translateY(-50%) scale(1.15);
}

.testi-btn--prev { left: -44px; }
.testi-btn--next { right: -44px; }

/* ── Dots ────────────────────────────────────────────────────── */

.testi-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.testi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(31, 44, 76, 0.20);
  transition: background 300ms, transform 300ms;
}

.testi-dot--activo {
  background: var(--orange);
  transform: scale(1.3);
}

/* ── Cabecera de tarjeta (avatar + nombre) ──────────────────── */

.tarjeta-cabecera {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tarjeta-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  flex-shrink: 0;
  user-select: none;
}

/* Foto real del cliente */
.tarjeta-avatar--foto {
  object-fit: cover;
  object-position: center top;
  display: block;
}

.tarjeta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tarjeta-nombre {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.2;
}

/* ── Estrellas + fecha ──────────────────────────────────────── */

.tarjeta-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.tarjeta-estrellas {
  display: flex;
  gap: 1px;
  color: #FBBC04;
  font-size: 1rem;
  line-height: 1;
}

.tarjeta-fecha {
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  color: #5F6368;
}

/* ── Texto de la reseña ─────────────────────────────────────── */

.tarjeta-texto {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  color: #202124;
  line-height: 1.55;
  flex: 1;
  margin: 0;
}

/* ── Footer de tarjeta — solo logo G ───────────────────────── */

.tarjeta-footer-g {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 4px;
}

.tarjeta-google-g {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── CTA dejar reseña + Badge Google ───────────────────────── */

.testimonios-cta-resena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-xl);
}

.testimonios-cta-texto {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #5F6368;
  margin: 0;
  text-align: center;
}

.testimonios-cta-ayuda {
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  color: rgba(95, 99, 104, 0.70);
  margin: 0;
  text-align: center;
  font-style: italic;
  white-space: nowrap;
}

/* ── Badge calificación global Google ───────────────────────── */

.testimonios-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(31, 44, 76, 0.10);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(31, 44, 76, 0.04),
    0 4px 16px rgba(31, 44, 76, 0.07);
  transition: box-shadow 400ms var(--ease-premium), transform 400ms var(--ease-premium);
  opacity: 1;
  justify-content: center;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-left: auto;
  margin-right: auto;
}

.testimonios-badge:hover {
  box-shadow:
    0 1px 2px rgba(31, 44, 76, 0.06),
    0 8px 32px rgba(31, 44, 76, 0.12);
  transform: translateY(-2px);
}

/* Shine diagonal al hover */
.testimonios-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.7) 50%,
    transparent 60%
  );
  transform: skewX(-15deg);
  transition: left 600ms var(--ease-premium);
  pointer-events: none;
}

.testimonios-badge:hover::after {
  left: 130%;
}

.badge-google-g {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.badge-puntuacion {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.badge-estrellas {
  display: flex;
  align-items: center;
  gap: 1px;
}

.badge-estrella {
  color: #FBBC04;
  font-size: 0.875rem;
  line-height: 1;
}

.badge-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #5F6368;
  white-space: nowrap;
}

/* ── Indicador 5 estrellas + Google ───────────────────────── */

.testi-estrellas-google {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--space-md);
}

.testi-estrellas-fila {
  display: flex;
  align-items: center;
  gap: 4px;
}

.testi-star {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  /* opacity la maneja GSAP — no poner aquí */
}

.testi-google-g {
  width: 32px;
  height: 32px;
  /* opacity la maneja GSAP — no poner aquí */
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Desktop
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  #testimonios {
    padding: var(--space-3xl) var(--pad-desktop);
  }
}

@media (max-width: 600px) {
  .testi-btn { width: 28px; height: 28px; }
  .testi-btn svg { width: 20px; height: 20px; }
  .testi-btn--prev { left: -4px; }
  .testi-btn--next { right: -4px; }
}

@media (max-width: 480px) {
  .badge-label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESIBILIDAD — reduce motion
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .tarjeta-review.carrusel--activa {
    animation: none;
  }

  .testimonios-badge::after {
    display: none;
  }

  .testi-star,
  .testi-google-g {
    opacity: 1;
  }
}
