.reviews-section {
  --reviews-accent: var(--button);
  --reviews-wave-w: 180px;
  --reviews-wave-h: 64px;

  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  background: var(--button);
  padding-block: 100px 92px;
}

/* Same wave tile/curve as why-choose-us.css's .wcu-section (180x64 tile,
   35px dip) so the top/bottom edge matches that section exactly - keep
   the two in sync if the curve changes. The fill is --button (#d80e0e),
   matching this section's background. */
.reviews-section::before,
.reviews-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--reviews-wave-h);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 64'%3E%3Cpath fill='%23D80E0E' d='M0,0 C45,0 45,35 90,35 C135,35 135,0 180,0 L180,64 L0,64 Z'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: var(--reviews-wave-w) var(--reviews-wave-h);
  pointer-events: none;
}

.reviews-section::before {
  top: 0;
}

.reviews-section::after {
  bottom: 0;
  transform: scaleY(-1);
}

.reviews-container {
  position: relative;
  z-index: 1;
  max-width: 1160px;
}

/* ---------- Header ---------- */

/* Title + subtitle centred; the prev/next arrows keep their spot at the
   row's end (left in RTL), taken out of the flow so they don't pull the
   text off-centre */
.reviews-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 56px;
}

.reviews-header-text {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

@media (min-width: 861px) {
  .reviews-header .reviews-nav {
    position: absolute;
    /* physical left, not inset-inline-end: .reviews-nav is direction:ltr,
       so its "end" would be the right side */
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}

.reviews-title {
  margin: 0 0 10px;
  font-family: var(--font-primary);
  font-weight: var(--font-bold);
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.3;
  color: #fff;
}

.reviews-subtitle {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: var(--font-regular);
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.reviews-nav {
  display: flex;
  /* forced LTR so source order [prev, next] always renders prev-left,
     next-right regardless of the page's RTL direction */
  direction: ltr;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 6px;
}

.reviews-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: var(--bg-white);
  color: var(--button);
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.reviews-nav-btn--prev {
  opacity: 0.8;
}

.reviews-nav-btn:hover {
  opacity: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.reviews-nav-btn:active {
  transform: scale(0.94);
}

.reviews-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---------- Screenshot carousel ---------- */

.rs-track {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* room for the active card's scale + shadow */
  padding: 24px 4px 32px;
}

.rs-track::-webkit-scrollbar {
  display: none;
}

.rs-card {
  position: relative;
  flex: 0 0 320px;
  max-height: 440px;
  padding: 10px;
  border: none;
  border-radius: 18px;
  background: var(--bg-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  cursor: zoom-in;
  scroll-snap-align: center;
  opacity: 0.85;
  transform: scale(0.94);
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
}

.rs-card.is-active {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.rs-card:hover,
.rs-card:focus-visible {
  opacity: 1;
  transform: translateY(-6px) scale(1);
}

.rs-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* tall screenshots: capped by max-height, with a fade + hint chip */
.rs-card.is-tall::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
}

.rs-card-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--reviews-accent);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.rs-card.is-tall .rs-card-hint {
  display: inline-flex;
}

/* entrance: cards rise in, staggered, the first time the section is seen */
.rs-animate .rs-card {
  animation: rs-card-in 0.6s ease backwards;
  animation-delay: calc(min(var(--rs-index, 0), 5) * 90ms);
}

.rs-waiting .rs-card {
  visibility: hidden;
}

@keyframes rs-card-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.94);
  }
}

/* ---------- Lightbox ---------- */

.rs-lightbox .modal-content {
  background: transparent;
  border: none;
}

.rs-lightbox-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 50vh;
  touch-action: pan-y;
}

.rs-lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.rs-lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--reviews-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.rs-lightbox-btn--prev {
  right: -60px;
}

.rs-lightbox-btn--next {
  left: -60px;
}

.rs-lightbox-close {
  position: absolute;
  top: -48px;
  left: 0;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rs-lightbox-counter {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 14px;
  direction: ltr;
}

/* ---------- Responsive ---------- */

@media (max-width: 992px) {
  .rs-lightbox-btn--prev {
    right: 8px;
  }

  .rs-lightbox-btn--next {
    left: 8px;
  }
}

@media (max-width: 860px) {
  .reviews-header {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .reviews-nav {
    align-self: flex-end;
  }
}

@media (max-width: 700px) {
  .reviews-section {
    --reviews-wave-w: 120px;
    --reviews-wave-h: 43px;
    padding-block: 56px 48px;
  }

  .reviews-title {
    font-size: 24px;
  }

  .reviews-subtitle {
    font-size: 14px;
  }

  .reviews-header {
    margin-bottom: 16px;
  }

  .rs-track {
    gap: 14px;
  }

  .rs-card {
    flex-basis: 78vw;
    max-height: 400px;
  }

  .rs-lightbox-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rs-track {
    scroll-behavior: auto;
  }

  .rs-card,
  .rs-animate .rs-card {
    transition: none;
    animation: none;
  }
}
