/* ===== Carrusel de testimonios ===== */

.testimonials-carousel {
  position: relative;
}

.testimonials-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.testimonials-track::-webkit-scrollbar {
  display: none;
}

.testimonials-track:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

/* Escritorio: 3 tarjetas visibles */
.testimonials-track > .testimonial-card {
  flex: 0 0 calc((100% - 48px) / 3);
  scroll-snap-align: start;
  margin: 0;
  box-sizing: border-box;
}

/* Controles */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
  color: #F2EDE5;
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
  background-color: rgba(242, 237, 229, 0.12);
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.carousel-btn:focus-visible,
.carousel-dot:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background-color: currentColor;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.carousel-dot.is-active {
  opacity: 1;
  transform: scale(1.3);
}

/* Si todas las reseñas entran en pantalla, no hacen falta controles */
.testimonials-carousel.is-static .carousel-controls {
  display: none;
}

/* Tablet: 2 tarjetas */
@media (max-width: 1024px) {
  .testimonials-track > .testimonial-card {
    flex-basis: calc((100% - 24px) / 2);
  }
}

/* Mobile: 1 tarjeta y se asoma la siguiente para invitar a deslizar */
@media (max-width: 640px) {
  .testimonials-track {
    gap: 16px;
  }

  .testimonials-track > .testimonial-card {
    flex-basis: 86%;
  }

  .carousel-controls {
    margin-top: 24px;
    gap: 16px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-track {
    scroll-behavior: auto;
  }

  .carousel-btn,
  .carousel-dot {
    transition: none;
  }
}
