.testimonials {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 50px 0px;
    background: linear-gradient(to right, #36C166 70%, rgba(242, 238, 26, 0.75));
    overflow: hidden;
    border-radius: 0 0 200px 0;
    /* Prevent flickering during initialization and resize */
    contain: layout style paint;
    opacity: 1;
    visibility: visible;
    /* Ensure stable rendering during GSAP operations */
    will-change: transform;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.testimonials__header {
   text-align: left;
   margin-bottom: 50px;
}

.testimonials__title {
   color: #F2EE1A;
   margin: 0 !important;
}

.testimonials__container {
   position: relative;
   width: 100%;
   /* Ensure stable layout during GSAP initialization */
   contain: layout;
   overflow: hidden;
}

.testimonials .container {
   width: 100%;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
}

.testimonials__inner {
   width: 100%;
   max-width: 100%;
}

.testimonials__list {
   display: flex;
   flex-direction: row;
   gap: 150px;
   margin: 0;
   padding: 0;
   list-style: none;
   width: max-content;
   transform: translateX(0);
   will-change: transform;
   /* Hardware acceleration and stability */
   transform-style: preserve-3d;
   backface-visibility: hidden;
   /* Prevent flickering during ScrollTrigger updates */
   contain: layout style;
}

.testimonials__separator {
   display: flex;
   align-items: start;
   justify-content: center;
   flex-shrink: 0;
}

.testimonials__separator-line {
   width: 2px;
   height: 200px;
   background-color: #FFF;
}

.testimonials__item {
   padding: 0;
   overflow: visible;
   width: 815px;
   flex-shrink: 0;
}

.testimonials__content {
   display: flex;
   flex-direction: column;
   gap: 30px;

}

.testimonials__text-container {
   flex: 1;
   display: flex;
   flex-direction: column;
   padding: 0;
}

.testimonials__quote {
   color: #fff;
   font-size: 30px;
   font-weight: 300;
   margin-bottom: 35px;
}

.testimonials__quote::before {
   display: none;
}

.testimonials__client-info {
   display: flex;
   align-items: center;
   gap: 20px;
}

.testimonials__client-image {
   width: 100px;
   height: 100px;
   border-radius: 50%;
   object-fit: cover;
   flex-shrink: 0;
}

.testimonials__client-details {
   text-align: left;
}

.testimonials__client-name {
   font-weight: 500;
   text-align: left;
   margin-bottom: 0px;
   color: #F2EE1A;
}

.testimonials__client-location {
   font-weight: 400;
   text-align: left;
   color: #fff;
   margin: 0;
}

/* Responsive styles */
@media (max-width: 1440px) {
   .testimonials {
     border-radius: 0 0 150px 0;
  }
  
   .testimonials__item {
       width: 700px;
   }
   
   .testimonials__quote {
       font-size: 26px;
   }
}

@media (max-width: 1024px) {
   .testimonials {
      border-radius: 0 0 100px 0;
  }
   .testimonials__header {
       margin-bottom: 35px;
   }
   .testimonials__item {
       width: 600px;
   }
   
   .testimonials__client-image {
       width: 80px;
       height: 80px;
   }
   
   .testimonials__quote {
       font-size: 24px;
   }
   .testimonials__list{
       gap: 100px;
   }
}

@media (max-width: 768px) {
   .testimonials {
       padding: 60px 0px;
       /* Remove min-height and flexbox centering */
       min-height: auto;
       display: block;
   }

   .testimonials__container {
       /* Remove horizontal overflow behavior */
       overflow: visible;
   }

   .testimonials__list {
       /* Stack testimonials vertically on mobile */
       flex-direction: column;
       gap: 40px;
       width: 100%;
       /* Remove horizontal scroll width */
       max-width: none;
   }

   .testimonials__item {
       width: 100%;
       /* Remove fixed width to allow full width stacking */
       max-width: none;
   }
   
   .testimonials__separator {
       /* Hide separator lines on mobile since we're stacking vertically */
       display: none;
   }
   
   .testimonials__client-image {
       width: 70px;
       height: 70px;
   }
   
   .testimonials__client-details {
       text-align: center;
   }
   
   .testimonials__quote {
       font-size: 1.1rem;
   }
}

@media (max-width: 767px) {
   .testimonials {
       /* Remove the min-height and flex centering that was causing issues */
       min-height: auto;
       display: block;
   }
   
   .testimonials .container {
       width: 100%;
   }
}

@media (max-width: 660px) {
   .testimonials__item {
       /* Ensure testimonials use full width with padding */
       width: 100%;
       padding: 0 15px;
   }
}

@media (max-width: 480px) {
   .testimonials__client-image {
       width: 60px;
       height: 60px;
   }
}

/* Accessibility */
.sr-only {
   position: absolute;
   width: 1px;
   height: 1px;
   padding: 0;
   margin: -1px;
   overflow: hidden;
   clip: rect(0, 0, 0, 0);
   white-space: nowrap;
   border: 0;
}