/*
 * Styles for Sky Law Reviews Carousel
 * Archivo: css/reviews-carousel.css
 * Basado en la estructura y propiedades de la página de origen.
 */

/* ========================================= */
/* Variables CSS de la página de origen      */
/* Se añaden variables para la animación */
/* ========================================= */
:root {
    --black: #1a1a1a; /* Color corporativo: negro */
    --black-divider: #1a1a1a1f; 
    --black-secondary: #1a1a1aA3; 
    --blue: #2869f6; 
    --green: #c6a96f; /* Color corporativo: ocre/dorado */
    --white: #ffffff; /* Color corporativo: blanco puro */
    --white-divider: #ffffff1f;
    --white-secondary: #b2b2b2; /* Color corporativo: gris claro para textos secundarios */

    /* VARIABLES DE ANIMACIÓN (Controladas por PHP) */
    --sl-duration: 100s; /* Valor de respaldo, la duración se inyecta por PHP */
    --sl-direction: normal; 
    /* Gap entre tarjetas y en la unión del loop */
    --track-item-gap: 24px;
    --track-seam-gap: var(--track-item-gap);
}

/* ========================================= */
/* Contenedor Principal (outer layout)       */
/* ========================================= */
.testimonials_layout {
    width: 100%;
    position: relative;
    padding: 20px 0; 
    background-color: transparent; 
    box-sizing: border-box;
    display: flex; 
    flex-direction: column;
    align-items: center; 
}

/* ========================================= */
/* Contenedor de las Columnas (mid layout)   */
/* ========================================= */
.testimonials_column {
    position: relative;
    width: 100%; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    gap: 64px;
    min-height: 400px; /* Asegurar altura mínima */
}

/* ========================================= */
/* Gradientes de desvanecimiento             */
/* ========================================= */
.testimonial21_gradient {
    position: absolute;
    top: 0;
    width: 250px; 
    height: 100%;
    z-index: 10; 
    pointer-events: none; 
}

.testimonial21_gradient.left {
    left: 0;
    background: linear-gradient(90deg, var(--black) 0%, transparent 100%); 
}

.testimonial21_gradient.right {
    right: 0;
    background: linear-gradient(270deg, var(--black) 0%, transparent 100%); 
}


/* ========================================= */
/* Sección de una Fila (section_testimonial21) */
/* ========================================= */
.section_testimonial21 {
    width: 100%;
    height: auto; 
}

/* ========================================= */
/* Componente del Carrusel (testimonial21_component) */
/* ========================================= */
.testimonial21_component {
    display: block;
    position: relative; 
    width: 100%;
    overflow: hidden; /* Oculta cualquier hueco y evita scrollbar */
}

/* Si la fila es 'reverse', ajusta la dirección del flex */
.testimonial21_component.reverse .testimonial21_mover {
    flex-direction: row-reverse; 
}

/* Wrapper de arrastre: acumula offset del usuario sin afectar la animación */
.testimonial21_drag {
    will-change: transform;
    transform: translateX(var(--drag-offset, 0px));
}

/* Elemento animado real: contiene los dos tracks clonados */
.testimonial21_mover {
    display: flex;
    align-items: stretch;
    width: max-content;
    column-gap: var(--track-seam-gap);
    animation-name: skylaw-loop;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: var(--sl-duration);
    animation-direction: var(--sl-direction);
}


/* ========================================= */
/* Contenedor de Bucle (testimonial21_loop-trigger) */
/* SOLUCIÓN DE ESPACIADO: Se usa !important para asegurar el gap */
/* ========================================= */
.testimonial21_loop-trigger {
    display: flex;
    flex-shrink: 0; 
    gap: var(--track-item-gap) !important; /* Espaciado consistente */
    align-items: stretch; 
    flex-wrap: nowrap; 
    height: 100%; 
    min-width: fit-content; 
}

/* La separación entre los dos tracks se controla con column-gap en .testimonial21_mover */


/* ========================================= */
/* Cada Tarjeta de Contenido (testimonial21_content) */
/* ¡AJUSTE UX CLAVE! Alineación centrada y Borde añadido */
/* ========================================= */
.testimonial21_content {
    flex-shrink: 0; 
    width: 350px; 
    background-color: var(--black); 
    border-radius: 13px; 
    padding: 24px; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    
    /* === CAMBIO 1: Centrar todo el contenido de la tarjeta === */
    align-items: center; 
    
    min-height: 200px; 
    max-height: 300px; /* Limitar altura máxima */
    overflow: hidden; /* Evitar desbordamiento */
    color: var(--white); 
    font-family: 'Uxum', sans-serif; 
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;

    /* === CAMBIO 2: Borde sutil y profesional (f1f1f1 al 25%) === */
    border: 1px solid rgba(241, 241, 241, 0.25); 
}

.testimonial21_client {
    display: flex;
    align-items: center; 
    margin-bottom: 16px; 
    width: 100%; 
}

.testimonial21_client-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1; 
    
    /* Ajuste para centrar el texto dentro del bloque info si es necesario */
    text-align: center; 
}

.testimonial21_client-info p {
    margin: 0; 
    color: var(--white); 
    font-size: 1em; 
    font-weight: 500; 
}

p.text-color-white-secondary.text-size-small {
    color: var(--white-secondary);
    font-size: 0.8em; 
    margin-top: 4px; 
}

.text-block {
    color: var(--white); 
    line-height: 1.5;
    margin-bottom: 0; 
    flex-grow: 1; 
    
    /* Ajuste para centrar el texto del contenido */
    text-align: center; 
    width: 100%;
}

/* ========================================= */
/* Estilos de nuestras estrellas (adaptados) */
/* ¡CORRECCIÓN CLAVE! Centrar las estrellas */
/* ========================================= */
.skylaw-star-rating {
    margin-top: 8px; 
    display: flex;
    gap: 3px;
    justify-content: center; /* <--- ¡CENTRADO CORRECTO! */
    width: 100%; 
}

.skylaw-star-icon {
    font-size: 1.1em; 
    color: var(--green); 
    line-height: 1; 
}

.skylaw-star-icon.filled {
    color: var(--green); 
}

.skylaw-star-icon.half-filled {
    color: rgba(198, 169, 111, 0.5); 
}

.skylaw-star-icon.empty {
    color: var(--white-secondary); 
}

/* ========================================= */
/* Estilos de texto globales (tomados del origen) */
/* ========================================= */
.heading-style-h6 {
    font-size: 1.1em; 
    font-weight: 600;
    color: var(--white-secondary); 
    margin-bottom: 8px;
}

.heading-style-h2 {
    font-size: 2.5em; 
    font-weight: 700;
    color: var(--white); 
    line-height: 1.2;
}

.heading-style-h2 .text-color-green {
    color: var(--green); 
}

/* ========================================= */
/* Keyframes de la Animación (OPTIMIZADO) */
/* ========================================= */
@keyframes skylaw-loop {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); 
    }
}

/* Pausar animación al hacer hover para mejor UX */
.testimonial21_component:hover .testimonial21_mover {
    animation-play-state: paused;
}

/* Eliminado estado de arrastre para no interferir con scroll */


/* ========================================= */
/* Media Queries para Responsividad          */
/* ========================================= */
@media (max-width: 991px) { 
    .testimonial21_gradient {
        width: 150px; 
    }
    .testimonial21_loop-trigger {
        gap: var(--track-item-gap) !important; /* Ajuste responsivo de espaciado */
    }
    :root { --track-item-gap: 16px; --track-seam-gap: var(--track-item-gap); }
    .testimonial21_content {
        width: 280px; 
        padding: 20px;
        min-height: 180px; 
    }
    .testimonials_column {
        gap: 40px; 
    }
}

@media (max-width: 767px) { 
    .testimonials_layout {
        padding: 10px 0;
    }
    .testimonials_column {
        gap: 32px; 
    }
    .section_testimonial21 {
        padding-bottom: 0; 
    }
    
    .testimonial21_component {
        flex-wrap: nowrap; 
    }
    .testimonial21_loop-trigger {
        flex-wrap: nowrap; 
        width: fit-content;
        gap: var(--track-item-gap) !important; /* Ajuste responsivo de espaciado */
    }
    .testimonial21_content {
        width: 250px; 
        padding: 16px;
        min-height: 150px; 
    }
    .testimonial21_gradient {
        width: 100px; 
    }
    .heading-style-h2 {
        font-size: 2em;
    }
}

@media (max-width: 479px) { 
    .testimonial21_content {
        width: 90vw; 
    }
    .testimonial21_gradient {
        width: 50px; 
    }
}

/* ========================================= */
/* Modo interactivo: scroll-snap y controles */
/* ========================================= */
.testimonial21_component.interactive-enabled {
  /* El contenedor ocupa 100% y oculta el overflow para evitar huecos */
  width: 100%;
  overflow: hidden;
  /* No capturar gestos para no interferir con el scroll vertical */
}

/* El track mantiene su comportamiento original; el scroll vive en el contenedor */

/* No usamos scroll-snap para no alterar el loop infinito */

/* Scrollbar estilizada (mantener accesibilidad) */
/* Sin scrollbars: el arrastre actúa por transform en el wrapper */

/* Controles de navegación */
.testimonial21_nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.testimonial21_nav .reviews_prev,
.testimonial21_nav .reviews_next {
  appearance: none;
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb; /* gray-200 */
  color: #111827; /* gray-900 */
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.testimonial21_nav .reviews_prev:hover,
.testimonial21_nav .reviews_next:hover {
  background: #d1d5db; /* gray-300 */
}
.testimonial21_nav .reviews_prev:active,
.testimonial21_nav .reviews_next:active {
  transform: scale(0.97);
}

/* Respetar gradientes pero permitir clics dentro del contenido */
.section_testimonial21 {
  position: relative;
}
.section_testimonial21 *[data-gradient-overlay="left"],
.section_testimonial21 *[data-gradient-overlay="right"] {
  pointer-events: none;
}
