/* ============================================
   TESTIMONIALS SECTION - Refined
   ============================================ */

.testimonials {
    padding: var(--space-xl) 0;
    background-color: #0e1216; /* O QUE DIZEM NOSSOS PARCEIROS - Dark Mode */
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .testimonials {
    background-color: #6c92bd; /* O QUE DIZEM NOSSOS PARCEIROS - Light Mode */
}

.testimonials::before {
    content: '';
    position: absolute;
    top: -25%;
    left: -15%;
    width: 55%;
    height: 85%;
    background-image: url('../img/background.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top left;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .testimonials::before {
    opacity: 0.10;
}

.testimonials__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    position: relative;
    z-index: 1;
}

.testimonials__header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.testimonials__carousel-wrapper {
    position: relative;
}

.testimonials__slider {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    transition: transform 0.4s ease-in-out;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Carousel Desktop - mostra 3 cards por vez quando há mais de 3 */
@media (min-width: 1024px) {
    .testimonials__slider.testimonials__slider--carousel {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
        gap: var(--space-md);
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .testimonials__slider.testimonials__slider--carousel .testimonial-card {
        display: none;
    }
    
    .testimonials__slider.testimonials__slider--carousel .testimonial-card.testimonial-card--visible {
        display: flex;
        opacity: 1;
        transform: scale(1);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Garantir que apenas os primeiros 3 cards (visíveis) ocupem espaço no grid */
    .testimonials__slider.testimonials__slider--carousel .testimonial-card:nth-child(n+4) {
        display: none !important;
    }
    
    .testimonials__carousel-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: none;
        background: rgba(65, 107, 153, 0.9);
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .testimonials__carousel-btn:hover {
        background: var(--primary);
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 6px 16px rgba(65, 107, 153, 0.4);
    }
    
    .testimonials__carousel-btn:active {
        transform: translateY(-50%) scale(0.95);
    }
    
    .testimonials__carousel-btn--prev {
        left: -60px;
    }
    
    .testimonials__carousel-btn--next {
        right: -60px;
    }
    
    .testimonials__carousel-btn svg {
        width: 20px;
        height: 20px;
    }
    
    [data-theme="light"] .testimonials__carousel-btn {
        background: rgba(255, 255, 255, 0.95);
        color: var(--primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 2px solid rgba(65, 107, 153, 0.2);
    }
    
    [data-theme="light"] .testimonials__carousel-btn:hover {
        background: var(--primary);
        color: #ffffff;
        border-color: var(--primary);
    }
    
    /* Ajuste para telas menores que 1400px */
    @media (max-width: 1400px) {
        .testimonials__carousel-btn--prev {
            left: -50px;
        }
        
        .testimonials__carousel-btn--next {
            right: -50px;
        }
    }
    
    /* Se a tela for muito pequena, colocar botões dentro do container */
    @media (max-width: 1200px) {
        .testimonials__carousel-btn--prev {
            left: 10px;
            background: rgba(65, 107, 153, 0.95);
        }
        
        .testimonials__carousel-btn--next {
            right: 10px;
            background: rgba(65, 107, 153, 0.95);
        }
    }
}

/* Card */
.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2.5rem;
    position: relative;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    min-height: 320px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Modo claro - cards azul clarinho */
[data-theme="light"] .testimonial-card {
    background: #ffffff;
    border: 2px solid rgba(65, 107, 153, 0.15);
    box-shadow: 0 4px 16px rgba(65, 107, 153, 0.1);
}

[data-theme="light"] .testimonial-card:hover {
    background: rgba(65, 107, 153, 0.03);
    box-shadow: 0 8px 32px rgba(65, 107, 153, 0.15);
    border-color: var(--primary);
}

/* Quote Icon - Background decorativo */
.testimonial-card__quote {
    font-family: 'DM Serif Display', serif;
    font-size: 6rem;
    color: var(--primary);
    opacity: 0.08;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    line-height: 1;
    z-index: 0;
    pointer-events: none;
}

/* Text Content */
.testimonial-card__text {
    font-style: italic;
    font-size: 1.0625rem;
    color: var(--text-primary);
    margin-bottom: auto;
    position: relative;
    z-index: 1;
    line-height: 1.75;
    padding-top: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow: hidden;
}

[data-theme="dark"] .testimonial-card__text {
    color: #e8eef3;
}

/* Years Badge - Hidden */
.testimonial-card__years {
    display: none;
}

/* Author Section */
.testimonial-card__author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.testimonial-card__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-section);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
    border: 2px solid var(--border-light);
}

.testimonial-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.testimonial-card__name {
    font-family: 'Neue Montreal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

[data-theme="dark"] .testimonial-card__name {
    color: #e8eef3;
}

/* .testimonial-card__cro - Removido (CRO não é mais exibido) */

.testimonial-card__specialty {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 600;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Modo claro - textos mais contrastados */
[data-theme="light"] .testimonial-card__text {
    color: #2a363d !important;
}

[data-theme="light"] .testimonial-card__name {
    color: #0f1418 !important;
}

/* [data-theme="light"] .testimonial-card__cro - Removido (CRO não é mais exibido) */

[data-theme="light"] .testimonial-card__specialty {
    color: #2c4a6e !important;
    font-weight: 700;
}

[data-theme="light"] .testimonial-card__quote {
    opacity: 0.06;
    color: #416b99;
}

[data-theme="light"] .testimonial-card__avatar {
    background: rgba(65, 107, 153, 0.08);
    border-color: rgba(65, 107, 153, 0.2);
    color: #2c4a6e !important;
}

/* Responsive */
@media (max-width: 1023px) {
    .testimonials__slider {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .testimonial-card {
        min-height: auto;
    }
}

/* Mobile - carousel: apenas 1 card visível por vez */
@media (max-width: 767px) {
    .testimonials__container {
        padding: 0 1rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        margin: 0 auto;
    }
    
    .testimonials {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        padding-left: 0;
        padding-right: 0;
    }
    
    .testimonials__slider {
        position: relative;
        gap: var(--space-md);
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .testimonial-card {
        display: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 2rem;
        transform: none;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 8px;
        border: 1px solid var(--border-light);
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }

    .testimonial-card.is-active {
        display: flex;
        cursor: grab;
    }
    
    .testimonial-card.is-active:active {
        cursor: grabbing;
    }
    
    .testimonial-card__quote {
        font-size: 4rem;
        top: 0.5rem;
        left: 1rem;
    }
    
    .testimonial-card__text {
        font-size: 1rem;
    }

    /* Setas do carrossel no mobile */
    .testimonials__carousel-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(65, 107, 153, 0.25) !important; /* Ainda mais transparente: 25% de opacidade */
        color: #ffffff !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 5;
        font-size: 1.15rem !important; /* Aumentado para destacar mais a seta */
        line-height: 1;
        font-weight: 700 !important; /* Seta ainda mais grossa para melhor legibilidade */
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important; /* Sombra mais forte no texto para destacar a seta */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important; /* Sombra ainda mais suave */
        transition: all 0.3s ease;
        backdrop-filter: blur(4px);
    }

    .testimonials__carousel-arrow:hover {
        background: rgba(65, 107, 153, 0.45) !important; /* Hover mais visível mas ainda transparente: 45% */
        transform: translateY(-50%) scale(1.05);
    }

    .testimonials__carousel-arrow:active {
        transform: translateY(-50%) scale(0.95);
    }

    [data-theme="light"] .testimonials__carousel-arrow {
        background: rgba(255, 255, 255, 0.3) !important; /* Ainda mais transparente: 30% de opacidade */
        color: var(--primary) !important;
        font-weight: 700 !important; /* Seta ainda mais grossa para melhor legibilidade */
        text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9) !important; /* Sombra mais forte no texto */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important; /* Sombra ainda mais suave */
        border: 1px solid rgba(65, 107, 153, 0.1) !important; /* Borda ainda mais suave */
    }

    [data-theme="light"] .testimonials__carousel-arrow:hover {
        background: rgba(255, 255, 255, 0.55) !important; /* Hover mais visível mas ainda transparente: 55% */
        color: var(--primary) !important;
    }

    .testimonials__carousel-arrow--prev {
        left: 8px;
    }

    .testimonials__carousel-arrow--next {
        right: 8px;
    }
}
