/* infinite-testimonial-slider.css - replace existing content with this */

.infinite-slider-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  /* visible-count default fallback */
  --visible-count: 3;
  --scroll-duration: 25s;
  box-sizing: border-box;
}

.infinite-slider {
  width: 100%;
  display: block;
}

.infinite-track {
  display: flex;
  align-items: stretch;
  /* prevent gaps caused by whitespace */
  margin: 0;
  padding: 0;
  /* animation is applied to the track */
  animation: scroll-infinite var(--scroll-duration) linear infinite;
  will-change: transform;
  box-sizing: border-box;
}

/* Each slide occupies (100% / visible-count) of the viewport width */
/* Use box-sizing so padding doesn't change the computed width */
.slide-item {
  flex: 0 0 calc(100% / var(--visible-count));
  box-sizing: border-box;
  padding: 0; /* NO horizontal padding here: move spacing inside card */
  display: flex;
  align-items: stretch;
}

/* Card uses internal padding so slide width remains exact */
.testimonial-card {
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  background: #fff;
  padding: 23px; /* configurable via Elementor - default value */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

/* Icon (top) */
.testimonial-icon {
  margin-bottom: 12px;
}
.testimonial-icon img {
  width: 36px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Text */
.testimonial-text {
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  margin: 0 0 18px 0;
  flex: 1 1 auto;
}

/* Bottom row: person info */
.testimonial-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-shrink: 0;
}

.person-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.person-info {
  display: flex;
  flex-direction: column;
}
.person-name {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}
.person-country {
  font-size: 13px;
  color: #777;
}

/* Animation directions: normal / reverse */
.infinite-slider-wrapper.normal .infinite-track {
  animation-name: scroll-infinite;
}
.infinite-slider-wrapper.reverse .infinite-track {
  animation-name: scroll-infinite-reverse;
}

/* Keyframes: translate by -50% (works if track has duplicate content) */
@keyframes scroll-infinite {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes scroll-infinite-reverse {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Responsive fallback: small screens show 1 item unless overridden by JS */
@media (max-width: 767px) {
  :root { /* no-op, JS will set the var on wrapper */
  }
}

/* small visual utility to avoid images stretching parent */
.infinite-track img {
  max-width: 100%;
  height: auto;
  display: block;
}
