.services-carousel {
  width: min(1380px, 92vw);
  margin: 0 auto;
  padding: 34px 0 22px;
  overflow: hidden;
  position: relative;
  z-index: 5;
  scroll-margin-top: 240px;
}

.services-carousel::before,
.services-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(120px, 14vw);
  z-index: 2;
  pointer-events: none;
}

.services-carousel::before {
  left: 0;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.services-carousel::after {
  right: 0;
  background: linear-gradient(270deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.services-track {
  display: flex;
  gap: clamp(18px, 2.4vw, 34px);
  width: max-content;
  padding-left: max(24px, 4vw);
  animation: services-scroll 30s linear infinite;
  will-change: transform;
}

.services-carousel:hover .services-track,
.services-carousel:focus-within .services-track {
  animation-play-state: paused;
}

.service-slide {
  flex: 0 0 clamp(290px, 30vw, 390px);
  margin: 0;
}

.service-slide img {
  width: 100%;
  aspect-ratio: 1122 / 1402;
  height: auto;
  display: block;
  border-radius: 30px;
  box-shadow: 0 18px 40px rgba(31, 50, 68, .10);
}

@keyframes services-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - clamp(9px, 1.2vw, 17px)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-track {
    animation: none;
    width: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
  }

  .service-slide {
    scroll-snap-align: center;
  }
}

@media (max-width: 700px) {
  .services-carousel {
    width: 100%;
    margin-top: 12px;
    padding: 26px 0 32px;
    scroll-margin-top: 410px;
  }

  .services-carousel::before,
  .services-carousel::after {
    width: 34px;
  }

  .services-track {
    --service-slide: min(82vw, 340px);
    --service-gap: 16px;
    gap: 16px;
    padding-left: calc((100vw - var(--service-slide)) / 2);
    animation: services-mobile-slide 18s ease-in-out infinite;
  }

  .service-slide {
    flex-basis: var(--service-slide);
  }

  .service-slide img {
    border-radius: 24px;
  }
}

@keyframes services-mobile-slide {
  0%,
  18% {
    transform: translateX(0);
  }

  25%,
  43% {
    transform: translateX(calc(-1 * (var(--service-slide) + var(--service-gap))));
  }

  50%,
  68% {
    transform: translateX(calc(-2 * (var(--service-slide) + var(--service-gap))));
  }

  75%,
  93% {
    transform: translateX(calc(-3 * (var(--service-slide) + var(--service-gap))));
  }

  100% {
    transform: translateX(calc(-4 * (var(--service-slide) + var(--service-gap))));
  }
}
