/* Carousel Wrapper */
.testimonial-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 1400px; /* Expanded for larger images */
  margin: 2rem auto;
}

/* Hide all slides by default */
.carousel-slide {
  display: none;
}

/* Show active slide */
.carousel-slide.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: slide-in 0.3s ease-out forwards;
}

@media (min-width: 992px) {
  .carousel-slide.active {
    flex-direction: row;
    justify-content: center;
    gap: 4rem;
  }
}

@keyframes slide-in {
  from { transform: translateX(15px); }
  to { transform: translateX(0); }
}
.comparison-slider-container {
  flex: 1;
  width: 100%;
  max-width: 800px; /* Wider image box for better resolution/readability */
  border-radius: var(--radius-xl, 1.5rem);
  overflow: hidden;
  background: var(--bg-dark, #0b0b0f);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  cursor: ew-resize; /* Horizontal resize cursor */
  touch-action: pan-y; /* Prevent horizontal scroll when dragging on mobile */
}

.comparison-slider-container:hover {
  box-shadow: 0 15px 40px rgba(110, 79, 231, 0.25);
  transform: translateY(-5px);
}

.comparison-slider {
  position: relative;
  width: 100%;
  /* Eliminamos aspect-ratio para que se adapte al tamaño real de la imagen */
  overflow: hidden;
  user-select: none;
  --position: 50%;
}

.comparison-img-after {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.comparison-img-before-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, var(--position) 0, var(--position) 100%, 0 100%);
  -webkit-clip-path: polygon(0 0, var(--position) 0, var(--position) 100%, 0 100%);
  pointer-events: none;
}

.comparison-img-before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 40px;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* Mouse events handled by container */
}

.comparison-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #fff;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

.comparison-handle-button {
  width: 40px;
  height: 40px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 2;
  color: #000;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.comparison-slider-container:hover .comparison-handle-button {
  transform: scale(1.1);
}

.comparison-slider-container:active .comparison-handle-button {
  transform: scale(0.95);
  background-color: #f0f0f0;
}

.comparison-handle-button svg {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.comparison-labels {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.comparison-label {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
}

/* Carousel Controls */
.carousel-control {
  position: absolute;
  top: 40%; /* Above the testimonial text */
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.3s;
}

.carousel-control:hover {
  background: rgba(110, 79, 231, 0.8);
}

.carousel-control.prev {
  left: -24px;
}

.carousel-control.next {
  right: -24px;
}

.carousel-control svg {
  width: 24px;
  height: 24px;
}

/* Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a3a3a3; /* Gris para inactivos */
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
  background: var(--primary-light, #c4b5fd);
  transform: scale(1.3);
}

/* Testimonial Content */
.testimonial-content {
  flex: 1;
  text-align: center;
  padding: 1.5rem 1rem 0;
}

@media (min-width: 992px) {
  .testimonial-content {
    text-align: left;
    padding: 0;
  }
  
  .carousel-control.next {
    right: auto;
    left: calc(50% - 2rem - 24px); /* Stick to the right edge of the image box */
  }
}

.testimonial-text {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #000; /* Letras negras solicitadas */
  font-style: italic;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.testimonial-btn {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 30px;
}

@media (max-width: 768px) {
  .carousel-control.prev {
    left: -10px;
  }
  
  .carousel-control.next {
    right: -10px;
  }
}

/* User Request: Scale up the Pruebas section by 180% */
#pruebas .container {
  max-width: 100% !important;
  padding: 0 4rem;
}
#pruebas .testimonial-carousel-wrapper {
  max-width: 2500px;
}
#pruebas .comparison-slider-container {
  max-width: 1440px; /* 800 * 1.8 */
}
#pruebas .testimonial-text {
  font-size: 2.25rem; /* 1.25 * 1.8 */
  line-height: 1.5;
}
#pruebas .testimonial-btn {
  font-size: 1.8rem;
  padding: 21px 43px;
  border-radius: 54px;
}
#pruebas .carousel-control {
  width: 86px; /* 48 * 1.8 */
  height: 86px;
}
#pruebas .carousel-control svg {
  width: 43px;
  height: 43px;
}
#pruebas .carousel-dot {
  width: 21px; /* 12 * 1.8 */
  height: 21px;
}
#pruebas .comparison-label {
  font-size: 1.53rem;
  padding: 10px 25px;
}
#pruebas .comparison-handle-button {
  width: 72px; /* 40 * 1.8 */
  height: 72px;
}
#pruebas .comparison-handle-button svg {
  width: 36px;
  height: 36px;
}

@media (min-width: 992px) {
  #pruebas .carousel-slide.active {
    gap: 7.2rem; /* 4rem * 1.8 */
  }
  #pruebas .carousel-control.next {
    left: calc(50% - 3.6rem - 43px); /* Updated calculation based on new gap and button size */
  }
}
