/* ============================================
   RATINGS / TESTIMONIALS SLIDER
   Infinite scroll with elegant typography
   ============================================ */

/* ---------- RATINGS SECTION ---------- */
#ratings {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: var(--space-section) 0;
  background-color: var(--color-black);
  overflow: hidden;
}

/* ---------- RATING WRAPPER ---------- */
.rating-wrapper {
  max-width: 1600px;
  width: 100%;
  text-align: center;
  color: var(--color-white);
}

/* ---------- SECTION HEADER ---------- */
.rating-header {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-12);
}

/* ---------- SLIDER CONTAINER WITH ARROWS ---------- */
.rating-slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

/* ---------- SLIDER CONTAINER ---------- */
.slider {
  width: 100%;
  overflow: hidden;
}

.slides {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4) var(--space-6) var(--space-8);

  /* Hide scrollbar by default, show on hover */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.slides::-webkit-scrollbar {
  height: 6px;
}

.slides::-webkit-scrollbar-track {
  background: transparent;
}

.slides::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
}

.slides::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ---------- INDIVIDUAL SLIDE ---------- */
.slide {
  flex: 0 0 auto;
  width: min(800px, 80vw);
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-xl);
  scroll-snap-align: center;
  background: var(--color-dark-elevated);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-base);
}

.slide:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ---------- RATING STARS ---------- */
.rating-stars {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.rating-stars img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* ---------- RATING CONTENT ---------- */
.rating-title {
  font-family: var(--font-body);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  line-height: var(--leading-relaxed);
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.rating-text {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-normal);
  font-style: italic;
  line-height: var(--leading-relaxed);
  color: var(--color-gray-400);
  margin-bottom: var(--space-6);
}

/* Decorative quote icon */
.slide {
  position: relative;
}

.slide::before {
  content: "“";
  font-family: Georgia, serif;
  font-size: 8rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.06);
  position: absolute;
  top: 0.15em;
  left: 0.2em;
  line-height: 1;
  pointer-events: none;
}

/* ---------- RATING AUTHOR ---------- */
.rating-author {
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-4);
}

.rating-author::before {
  content: "— ";
}

/* ---------- WRAPPER H1 (fallback) ---------- */
.rating-wrapper h1 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

/* ---------- INFINITE SLIDER ---------- */
.infinite-slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

.infinite-slider .slides {
  display: flex;
  gap: var(--space-8);
  animation: scrollLeft 30s linear infinite;
  overflow: visible;
}

.infinite-slider .slides:hover {
  animation-play-state: paused;
}

.infinite-slider .slide {
  box-shadow: var(--shadow-lg);
}

/* ---------- LOOP SLIDER ---------- */
.loop-slider {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

.loop-track {
  display: flex;
  gap: var(--space-8);
  animation: scroll-left 40s linear infinite;
}

.loop-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--scroll-distance, -50%));
  }
}

/* ---------- RESPONSIVE ---------- */

/* Large desktop */
@media (min-width: 1440px) {
  .slide {
    width: 900px;
    padding: var(--space-12) var(--space-10);
  }
}

/* Desktop */
@media (max-width: 1200px) {
  .rating-wrapper {
    padding: 0 var(--space-6);
  }

  .slide {
    width: min(700px, 75vw);
    padding: var(--space-8) var(--space-6);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  #ratings {
    padding: var(--space-section-sm) 0;
  }

  .rating-header {
    margin-bottom: var(--space-10);
  }

  .slides {
    gap: var(--space-6);
  }

  .slide {
    width: min(600px, 85vw);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .rating-wrapper {
    padding: 0 var(--space-4);
  }

  .rating-slider-container {
    gap: var(--space-2);
  }

  .rating-slider-container .nav-arrow {
    width: 36px;
    height: 36px;
  }

  .rating-slider-container .nav-arrow svg {
    width: 18px;
    height: 18px;
  }

  .slides {
    padding: var(--space-3) var(--space-4) var(--space-6);
    gap: var(--space-4);
  }

  .slide {
    width: min(500px, 90vw);
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
  }

  .rating-stars img {
    width: 22px;
    height: 22px;
  }

  .rating-title {
    font-size: var(--text-body);
  }

  .rating-text {
    font-size: var(--text-body-sm);
  }

  .rating-author {
    font-size: var(--text-xs);
  }
}

/* Small mobile */
@media (max-width: 400px) {
  .rating-slider-container .nav-arrow {
    display: none;
  }

  .slide {
    width: 85vw;
    padding: var(--space-5) var(--space-4);
  }

  .rating-stars {
    gap: var(--space-1);
    margin-bottom: var(--space-4);
  }

  .rating-stars img {
    width: 18px;
    height: 18px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .infinite-slider .slides,
  .loop-track {
    animation: none;
  }

  .slides {
    scroll-behavior: auto;
  }

  .slide:hover {
    transform: none;
  }
}
