/* === TESTIMONIALS V2 - PREMIUM SAAS THEME === */
:root {
    --testi-bg: #F1F5F9;
    /* Darker, slightly more blue tint for contrast */
    --testi-text-primary: #0F172A;
    /* Darker navy for better legibility */
    --testi-text-secondary: #475569;
    /* Darker gray */
    --testi-accent: #8B5CF6;
    --testi-grad: linear-gradient(135deg, #EC4899, #8B5CF6, #0EA5E9);
    --testi-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* More defined shadow */
    --testi-shadow-deep: 0 40px 80px rgba(0, 0, 0, 0.12);
    /* Much deeper shadow */
    --testi-card-white: #FFFFFF;
    /* Using solid white for better contrast */
}

.testimonials-block-v2 {
    background: var(--testi-bg) !important;
    position: relative !important;
    padding: clamp(4rem, 10vw, 8rem) 0 !important;
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
    /* IMPORTANTE: NO usar overflow-x: hidden aquí.
       Bloquea el scrollBy() en el .carousel-scroll-container hijo.
       Usamos clip-path o el wrapper interno para contener visualmente. */
    overflow: visible !important;
    color: var(--testi-text-primary) !important;
    z-index: 5;
}

/* --- Background layers --- */
.testimonials-bg-layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.glow-radial {
    position: absolute;
    width: 60%;
    height: 80%;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
}

.glow-left {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #8B5CF6, transparent);
}

.glow-right {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #0EA5E9, transparent);
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.015;
    mix-blend-mode: overlay;
}

/* --- Container --- */
.testimonials-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 4rem;
    position: relative;
    z-index: 10;
}

/* --- Header --- */
.testimonials-header {
    text-align: center;
    margin-bottom: 8rem;
}

.testimonials-block-v2 .section-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(2.5rem, 6vw, 4.5rem) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    color: var(--testi-text-primary) !important;
    text-transform: uppercase !important;
    letter-spacing: -0.04em !important;
    margin-bottom: 1.5rem !important;
}

.headline-highlight {
    background: var(--testi-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.testimonials-block-v2 .section-subtitle {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.125rem !important;
    font-weight: 400 !important;
    color: var(--testi-text-secondary) !important;
    max-width: 600px;
    margin: 0 auto !important;
    line-height: 1.7 !important;
}

/* --- Layout --- */
.testimonials-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
    min-height: 500px;
    /* Ensure space for content even if JS is slow */
}

/* --- Featured Google Card (The "Hero") --- */
.testimonials-featured {
    flex-shrink: 0;
    width: 420px;
    opacity: 1;
    /* Default visibility */
}

.featured-card-glass {
    background: var(--testi-card-white);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 32px;
    padding: 4rem 3rem;
    box-shadow: var(--testi-shadow-deep);
    transition: all 0.5s var(--ease-cinematic);
    position: relative;
    z-index: 5;
}

.featured-card-glass:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
}

.google-brand-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--testi-text-primary);
}

.rating-visual {
    margin-bottom: 3.5rem;
}

.rating-big {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 7rem !important;
    font-weight: 950 !important;
    line-height: 1;
    color: var(--testi-text-primary);
    display: block;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.stars-glow-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stars-row-glow {
    color: #FBBF24;
    font-size: 2rem;
    letter-spacing: 0.2rem;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}

.reviews-count-soft {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--testi-text-secondary);
    opacity: 0.8;
}

.btn-gradient-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 2.5rem;
    background: var(--testi-grad);
    border-radius: 16px;
    color: white !important;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
    width: 100%;
}

.btn-gradient-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
}

/* --- Carousel Area --- */
.testimonials-carousel-area {
    flex: 1;
    position: relative;
    padding: 2rem 0;
    min-height: 480px;
    /* overflow: hidden aquí oculta visualmente el desbordamiento lateral
       sin bloquear el scrollBy() programático en el contenedor hijo */
    overflow: hidden;
}

.carousel-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 2.5rem;
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 2rem 0 4rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.carousel-scroll-container::-webkit-scrollbar {
    display: none;
}

.premium-review-card {
    flex: 0 0 440px;

    width: 440px;
    flex: 0 0 440px;
    background: var(--testi-card-white);
    padding: 3.5rem;
    border-radius: 28px;
    box-shadow: var(--testi-shadow-soft);
    position: relative;
    transition: all 0.5s var(--ease-cinematic);
    scroll-snap-align: start;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Slightly darker border */
    opacity: 1;
    /* Default visibility for GSAP fallback */
}

.premium-review-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--testi-shadow-deep);
    border-color: rgba(139, 92, 246, 0.1);
}

.card-gradient-line {
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: var(--testi-grad);
    opacity: 0.2;
    transition: opacity 0.4s ease;
}

.premium-review-card:hover .card-gradient-line {
    opacity: 1;
}

.card-quote-icon {
    position: absolute;
    top: 2rem;
    right: 3rem;
    width: 28px;
    height: 28px;
    opacity: 0.2;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.premium-review-card:hover .card-quote-icon {
    opacity: 1;
    transform: scale(1.1);
}

.review-user-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.user-avatar-wrap {
    position: relative;
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.google-badge-mini {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--testi-text-primary);
}

.user-time {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--testi-text-secondary);
    opacity: 0.7;
}

.review-body p {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: var(--testi-text-secondary) !important;
    font-weight: 400 !important;
    margin: 0 0 2rem 0 !important;
}

.review-stars-mini {
    color: #FBBF24;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

/* --- Modern Navigation --- */
.carousel-nav-modern {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3.5rem;
    width: 100%;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 20;
    box-sizing: border-box;
    padding: 0 1rem;
}

.nav-arrow-btn {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #E2E8F0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--testi-text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.nav-arrow-btn:hover {
    border-color: var(--testi-accent);
    color: var(--testi-accent);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15);
}

.nav-progress-container {
    flex: 1;
    height: 4px;
    background: #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.nav-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--testi-grad);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .testimonials-layout {
        flex-direction: column;
        align-items: center;
    }

    .testimonials-featured {
        width: 100%;
        max-width: 500px;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .testimonials-container {
        padding: 0 1.5rem;
    }

    .testimonials-header {
        margin-bottom: 3rem;
    }

    .rating-big {
        font-size: 4rem !important;
    }

    .testimonials-carousel-area {
        margin: 0 -1.5rem;
        width: calc(100% + 3rem);
        overflow: visible !important;
    }

    .carousel-scroll-container {
        padding: 2rem calc((100vw - 310px) / 2) 4rem;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        scroll-padding: 0;
    }

    .premium-review-card {
        flex: 0 0 310px;
        width: 310px;
        scroll-snap-align: center;
        padding: 2.25rem;
        border-radius: 20px;
    }

    .carousel-nav-modern {
        justify-content: center;
        gap: 2rem;
        margin-top: 2rem;
    }

    .nav-arrow-btn {
        width: 52px !important;
        height: 52px !important;
        flex: 0 0 52px !important;
        aspect-ratio: 1/1 !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-progress-container {
        display: none !important;
    }
}