.tw-testimonials {
  --tw-marquee-gap: 16px;
  --tw-marquee-card: 383px;
  --tw-marquee-duration: 40s;
  padding: 114px 0;
  overflow: hidden;
}

.tw-testimonials__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
}

.tw-testimonials__marquee {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tw-testimonials__row {
  overflow: hidden;
  /* Force LTR so RTL page dir does not reverse flex / translate loop */
  direction: ltr;
}

.tw-testimonials__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--tw-marquee-duration);
}

.tw-testimonials__group {
  display: flex;
  flex-shrink: 0;
  gap: var(--tw-marquee-gap);
  /* Trailing gap so seam between cloned groups matches item spacing */
  padding-inline-end: var(--tw-marquee-gap);
}

/* Top: infinite → right */
.tw-testimonials__row--right .tw-testimonials__track {
  animation-name: tw-marquee-right;
}

/* Bottom: infinite → left */
.tw-testimonials__row--left .tw-testimonials__track {
  animation-name: tw-marquee-left;
}

.tw-testimonials__row.is-ready .tw-testimonials__track {
  animation-play-state: running;
}

.tw-testimonials__row:not(.is-ready) .tw-testimonials__track {
  animation-play-state: paused;
}

.tw-testimonials__row:hover .tw-testimonials__track,
.tw-testimonials__row.is-paused .tw-testimonials__track {
  animation-play-state: paused;
}

.tw-testimonial-card {
  width: var(--tw-marquee-card);
  min-height: 220px;
  background: var(--tw-color-white);
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(17, 15, 15, 0.04);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  direction: rtl;
  text-align: right;
}

.tw-testimonial-card__stars {
  color: #e11d2e;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.tw-testimonial-card__stars span {
  opacity: 0.25;
}

.tw-testimonial-card__stars span.is-on {
  opacity: 1;
}

.tw-testimonial-card__text {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--tw-color-text-soft);
  flex: 1;
}

.tw-testimonial-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #ededed;
}

.tw-testimonial-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.tw-testimonial-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--tw-color-testimonial-name);
}

.tw-testimonial-card__role {
  font-size: 12px;
  color: var(--tw-color-text-soft);
}

.tw-testimonial-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.tw-testimonial-card__avatar--placeholder {
  display: inline-block;
  background: #ddd;
}

/*
 * Seamless loop: each .tw-testimonials__group is identical.
 * JS sets --tw-shift to one group width (incl. trailing gap).
 */
@keyframes tw-marquee-left {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(var(--tw-shift, 50%) * -1), 0, 0);
  }
}

@keyframes tw-marquee-right {
  from {
    transform: translate3d(calc(var(--tw-shift, 50%) * -1), 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .tw-testimonials {
    --tw-marquee-card: 320px;
    --tw-marquee-gap: 14px;
    --tw-marquee-duration: 36s;
    padding: 56px 0 64px;
  }

  .tw-testimonials__heading {
    margin-bottom: 32px;
    gap: 6px;
    padding-inline: 8px;
  }

  .tw-testimonials__marquee {
    gap: 16px;
  }

  .tw-testimonial-card {
    min-height: 200px;
    padding: 20px;
    border-radius: 10px;
  }

  .tw-testimonial-card__stars {
    font-size: 13px;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
  }

  .tw-testimonial-card__text {
    font-size: 15px;
    line-height: 22px;
  }

  .tw-testimonial-card__footer {
    gap: 10px;
    padding-top: 14px;
  }

  .tw-testimonial-card__name {
    font-size: 13px;
  }

  .tw-testimonial-card__role {
    font-size: 11px;
  }

  .tw-testimonial-card__avatar,
  .tw-testimonial-card__avatar--placeholder {
    width: 34px;
    height: 34px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .tw-testimonials {
    --tw-marquee-card: min(300px, calc(100vw - 48px));
    --tw-marquee-gap: 12px;
    --tw-marquee-duration: 28s;
    padding: 40px 0 48px;
  }

  .tw-testimonials__heading {
    margin-bottom: 24px;
    gap: 4px;
    padding-inline: 4px;
  }

  .tw-testimonials__marquee {
    gap: 12px;
  }

  .tw-testimonial-card {
    min-height: 180px;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(17, 15, 15, 0.05);
  }

  .tw-testimonial-card__stars {
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }

  .tw-testimonial-card__text {
    font-size: 14px;
    line-height: 21px;
  }

  .tw-testimonial-card__footer {
    gap: 10px;
    padding-top: 12px;
  }

  .tw-testimonial-card__meta {
    gap: 1px;
    min-width: 0;
  }

  .tw-testimonial-card__name {
    font-size: 13px;
    line-height: 1.3;
  }

  .tw-testimonial-card__role {
    font-size: 11px;
    line-height: 1.3;
  }

  .tw-testimonial-card__avatar,
  .tw-testimonial-card__avatar--placeholder {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tw-testimonials__track {
    animation: none !important;
    transform: none !important;
  }

  .tw-testimonials__row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
