.testimonials {
    padding: 4rem 1rem;
    background-color: #f9fafb;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .testimonials {
        padding: 8rem 2rem;
        min-height: 500px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.testimonials h2 {
    font-size: 1.8rem;
    color: var(--primary-green);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .testimonials h2 {
        font-size: 2.5rem;
    }
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}


.testimonials h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--secondary-green), transparent);
}

.testimonials::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
}

.testimonials::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
}

.testimonials-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
    perspective: 1000px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 500px;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.testimonials-grid:active {
    cursor: grabbing;
}



@media (min-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr 1.2fr 1fr;
        max-width: 1200px;
        gap: 3rem;
    }
}

.grid-slot {
    position: relative;
    height: 400px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

@media (max-width: 767px) {
    .grid-slot.left,
    .grid-slot.right {
        display: none;
    }
}

@media (min-width: 768px) {
    .grid-slot.left,
    .grid-slot.right {
        opacity: 0.6;
        filter: blur(1px);
    }
    
    .grid-slot.left {
        transform: scale(0.85) translateX(-10%) rotateY(8deg);
    }
    
    .grid-slot.right {
        transform: scale(0.85) translateX(10%) rotateY(-8deg);
    }
    
    .grid-slot.center {
        transform: scale(1) translateZ(0);
        z-index: 2;
        filter: none;
    }
}



.testimonial-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 8px 24px rgba(45, 109, 98, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(46, 168, 145, 0.1);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    overflow-y: auto;
}

.testimonial-card.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.testimonial-card.fade-out {
    opacity: 0;
    transform: translateY(-30px);
    transition-duration: 0.4s;
}

@media (min-width: 768px) {
    .grid-slot.center .testimonial-card.active {
        transform: translateY(0) translateZ(20px);
        box-shadow: 0 20px 40px rgba(45, 109, 98, 0.15);
    }
}

@media (min-width: 768px) {
    .grid-slot.center .testimonial-card {
        box-shadow: 0 20px 40px rgba(45, 109, 98, 0.15);
        transform: translateY(0);
    }
}

.testimonial-slide.prev {
    opacity: 0.5;
    transform: scale(0.9) translateX(-100%);
    z-index: 1;
}

.testimonial-slide.active {
    opacity: 1;
    transform: scale(1) translateX(0);
    z-index: 2;
    pointer-events: auto;
    position: relative;
}

.testimonial-slide.next {
    opacity: 0.5;
    transform: scale(0.9) translateX(100%);
    z-index: 1;
}

@media (min-width: 768px) {
    .testimonial-slide {
        min-width: 400px;
        width: 400px;
        margin: 0 2rem;
    }

    .testimonial-slide.prev {
        transform: scale(0.85) translateX(-120%) rotateY(10deg);
    }

    .testimonial-slide.active {
        transform: scale(1) translateX(0) rotateY(0);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }

    .testimonial-slide.next {
        transform: scale(0.85) translateX(120%) rotateY(-10deg);
    }

    .testimonials-container {
        overflow: visible;
        max-width: 1400px;
        margin: 0 auto;
    }
}

.testimonial-slide.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(45, 109, 98, 0.1);
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(46, 168, 145, 0.1);
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-green);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

@media (min-width: 768px) {
    .carousel-button.prev {
        left: 0;
    }
    
    .carousel-button.next {
        right: 0;
    }
}

.carousel-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.carousel-button:hover svg {
    transform: scale(1.2);
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

@media (min-width: 768px) {
    .carousel-button.prev {
        left: calc(50% - 500px);
    }
    
    .carousel-button.next {
        right: calc(50% - 500px);
    }
}

.carousel-button:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.carousel-button:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767px) {
    .carousel-button {
        opacity: 0.8;
        background: rgba(45, 109, 98, 0.9);
    }
}

.carousel-button:hover {
    background: var(--secondary-green);
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

.carousel-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.testimonial-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(45, 109, 98, 0.1);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--secondary-green);
}

.testimonial-card:hover {
    transform: translateY(-5px);
}



.testimonial-content {
    position: relative;
    z-index: 1;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 1.5rem;
    position: relative;
    font-style: italic;
    padding: 1rem 0;
}

.testimonial-text::before {
    content: '\201C';
    position: absolute;
    top: -2rem;
    left: -1rem;
    font-size: 6rem;
    color: var(--primary-green);
    opacity: 0.1;
    font-family: Georgia, serif;
    line-height: 1;
}

@media (min-width: 768px) {
    .testimonial-text {
        font-size: 1.2rem;
        line-height: 1.9;
    }
    
    .testimonial-text::before {
        font-size: 8rem;
        top: -3rem;
    }
}

.testimonial-text::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    color: var(--secondary-green);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.testimonial-author::before {
    content: '—';
    margin-right: 0.5rem;
    color: var(--secondary-green);
}

.testimonial-rating {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
}

.star {
    width: 18px;
    height: 18px;
    color: #FFB400;
}

.testimonials-loading {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--primary-green);
}

.testimonials-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #fff;
    border-radius: 8px;
    margin: 1rem auto;
    max-width: 600px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

@media (max-width: 768px) {
    .testimonials {
        padding: 3rem 1rem;
    }

    .testimonials h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }
}
