
.testimonials-section {
  --testimonial-gap: clamp(16px, 1.8vw, 26px);
  --testimonial-avatar-size: clamp(105px, 8.5vw, 140px);
  --testimonial-card-width: 310px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--color-white, #fff);
  overflow: hidden;
}

.testimonials-section * {
  box-sizing: border-box;
}

.testimonials-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0;
}

.testimonials-heading .section-eyebrow {
  margin-bottom: var(--space-3, 12px);
}

.testimonials-heading .section-title {
  margin: 0 0 var(--space-3, 12px);
}

.testimonials-heading .section-title span {
  color: var(--color-primary, #ff5900);
}

.testimonials-heading .section-description {
  max-width: 850px;
  margin: 0;
  color: var(--color-muted, #697386);
}

.testimonials-carousel {
  position: relative;
  width: 100%;
  max-width: 1480px;
  margin: clamp(16px, 2vw, 28px) auto 0;
  padding-inline: clamp(48px, 5vw, 76px);
}

.testimonials-viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  container-type: inline-size;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.testimonials-viewport::-webkit-scrollbar {
  display: none;
}

.testimonials-track {
  display: flex;
  align-items: stretch;
  gap: var(--testimonial-gap);
  width: max-content;
  min-width: 100%;
  padding-top: calc(var(--testimonial-avatar-size) * 0.52);
  padding-bottom: 16px;
}

.testimonial-item {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 min(
    var(--testimonial-card-width),
    calc((100cqw - 3 * var(--testimonial-gap)) / 4)
  );
  min-width: 0;
  padding-top: calc(var(--testimonial-avatar-size) * 0.48);
}

.testimonial-avatar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: var(--testimonial-avatar-size);
  height: var(--testimonial-avatar-size);
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-primary, #ff5900) 0deg 85deg,
    #ffdfd0 85deg 230deg,
    #dedede 230deg 360deg
  );
  transform: translateX(-50%);
}

.testimonial-avatar::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.testimonial-avatar img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.testimonial-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 275px;
  padding:
    calc(var(--testimonial-avatar-size) * 0.52)
    clamp(18px, 1.5vw, 24px)
    24px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(20, 25, 35, 0.025);
  text-align: left;
}

.testimonial-quote {
  display: block;
  align-self: flex-start;
  height: 30px;
  color: var(--color-primary, #ff5900);
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}

.testimonial-message {
  flex: 1;
  margin: 0 0 var(--space-4, 16px);
  color: var(--color-muted, #697386);
  line-height: var(--line-body, 1.6);
  overflow-wrap: break-word;
  text-align: left;
}

.testimonial-person {
  padding-top: var(--space-4, 16px);
  border-top: 1px solid var(--color-border, #e5e7eb);
  text-align: left;
}

.testimonial-person h3 {
  margin: 0 0 var(--space-1, 4px);
  color: var(--color-dark, #161b24);
  font-size: var(--font-feature-title, inherit);
  font-weight: var(--font-weight-extrabold, 800);
  line-height: var(--line-heading, 1.2);
}

.testimonial-person p {
  margin: 0;
  color: var(--color-text, #252b35);
}

.testimonials-arrow {
  position: absolute;
  z-index: 5;
  top: 53%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(38px, 4vw, 54px);
  height: clamp(38px, 4vw, 54px);
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary, #ff5900);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.testimonials-arrow:hover {
  background: var(--color-primary, #ff5900);
  color: #fff;
}

.testimonials-arrow svg {
  width: 48%;
  height: 48%;
}

.testimonials-arrow-prev {
  left: clamp(4px, 1vw, 18px);
}

.testimonials-arrow-next {
  right: clamp(4px, 1vw, 18px);
}

.testimonials-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--space-3, 12px);
}

.testimonials-dot {
  display: block;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d9d9d9;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.testimonials-dot.is-active {
  background: var(--color-primary, #ff5900);
  transform: scale(1.2);
}

@media (max-width: 1200px) {
  .testimonial-item {
    flex-basis: min(
      var(--testimonial-card-width),
      calc((100cqw - var(--testimonial-gap)) / 2)
    );
  }
}

@media (max-width: 767px) {
  .testimonials-section {
    --testimonial-avatar-size: 105px;
    --testimonial-gap: 0px;
  }

  .testimonials-heading .section-title {
    margin-bottom: var(--space-2, 8px);
  }

  .testimonials-carousel {
    max-width: 100%;
    margin-top: 12px;
    padding-inline: 0;
  }

  .testimonials-viewport {
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
  }

  .testimonials-track {
    padding-bottom: 12px;
  }

  .testimonial-item {
    flex: 0 0 100cqw;
    padding-inline: clamp(16px, 5vw, 24px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .testimonial-card {
    min-height: 265px;
    padding:
      calc(var(--testimonial-avatar-size) * 0.52)
      clamp(20px, 6vw, 30px)
      22px;
  }

  .testimonials-arrow {
    top: 55%;
    width: 34px;
    height: 34px;
  }

  .testimonials-arrow-prev {
    left: 2px;
  }

  .testimonials-arrow-next {
    right: 2px;
  }

  .testimonials-dots {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-arrow,
  .testimonials-dot {
    transition: none;
  }
}
