/* Services / 3 / — Figma */

body:has(.sp-services) .page,
body:has(.sp-services) .content {
  overflow: visible;
}

.sp-services {
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 160px 240px 80px;
  background: #fff;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

.sp-services *,
.sp-services *::before,
.sp-services *::after {
  box-sizing: border-box;
}

.sp-services__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.sp-services__title {
  margin: 0;
  padding: 0;
  width: auto;
  max-width: 100%;
  height: 52px;
  font-weight: 500;
  font-size: 48px;
  line-height: 52px;
  color: #000;
  white-space: nowrap;
}

.sp-services__layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.sp-services__cards {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  max-width: 832px;
  flex: 0 1 832px;
  min-width: 0;
}

.sp-services__swiper {
  width: 100%;
  overflow: visible;
}

.sp-services__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

/* Desktop: Swiper CSS ставит flex — возвращаем сетку */
@media (min-width: 777px) {
  .sp-services .sp-services__swiper .swiper-wrapper.sp-services__grid {
    display: grid !important;
    transform: none !important;
  }

  .sp-services .sp-services__swiper .swiper-slide {
    width: auto !important;
    margin: 0 !important;
  }
}

.sp-services__swiper .swiper-slide {
  height: auto;
  width: auto;
}

.sp-services__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  height: 100%;
  min-height: 400px;
  padding: 32px;
  background: #f5f6f8;
  border-radius: 20px;
}

.sp-services__icon {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
}

.sp-services__icon svg {
  display: block;
  max-width: 32px;
  max-height: 32px;
  width: auto;
  height: auto;
}

.sp-services__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.sp-services__card-title {
  margin: 0;
  padding: 0;
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: #131927;
}

.sp-services__card-text {
  margin: 0;
  padding: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #4d5461;
}

.sp-services__media {
  position: relative;
  flex: 0 0 590px;
  width: 590px;
  height: 820px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: #e8eaee;
}

.sp-services__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sp-services__scrollbar {
  display: none;
}

.sp-services__scrollbar.swiper-scrollbar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  width: 79px;
  height: 6px;
  margin: 0;
  background: #ebedf0;
  border-radius: 12px;
  overflow: hidden;
}

.sp-services__scrollbar .swiper-scrollbar-drag {
  background: #6d717f;
  border-radius: 12px;
  height: 100%;
  left: 0;
  top: 0;
}

@media (max-width: 1599px) {
  .sp-services {
    padding: 120px 64px 64px;
  }

  .sp-services__media {
    flex: 0 1 420px;
    width: auto;
    min-width: 320px;
    height: auto;
    align-self: stretch;
    min-height: 640px;
  }
}

@media (max-width: 1199px) {
  .sp-services {
    padding: 80px 32px 48px;
  }

  .sp-services__layout {
    flex-direction: column;
  }

  .sp-services__cards {
    max-width: none;
    flex: 1 1 auto;
  }

  .sp-services__media {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 480px;
    min-height: 0;
  }

  .sp-services__title {
    height: auto;
    font-size: 36px;
    line-height: 40px;
    white-space: normal;
  }
}

/* Mobile — Figma Services / 3 / */
@media (max-width: 776px) {
  .sp-services {
    padding: 40px 16px;
    border-radius: 0;
    overflow: visible;
  }

  .sp-services__inner {
    gap: 24px;
    max-width: none;
    overflow: visible;
  }

  .sp-services__title {
    height: auto;
    font-size: 32px;
    line-height: 40px;
    white-space: normal;
  }

  .sp-services__layout {
    flex-direction: column;
    align-items: stretch;
    gap: 40px;
    overflow: visible;
  }

  .sp-services__cards {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    max-width: none;
    flex: none;
    /* слайдер выходит за правый padding — peek следующей карточки */
    width: calc(100% + 16px);
    align-self: stretch;
    margin-right: -16px;
  }

  .sp-services__swiper {
    width: 100%;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
  }

  .sp-services__swiper:active {
    cursor: grabbing;
  }

  .sp-services__grid {
    display: flex;
    gap: 0;
  }

  .sp-services__swiper .swiper-slide {
    width: 320px;
    height: auto;
  }

  .sp-services__card {
    min-height: 252px;
    height: auto;
    padding: 16px;
    gap: 40px;
    border-radius: 12px;
  }

  .sp-services__icon {
    width: 44px;
    height: 44px;
    padding: 12px;
    border-radius: 8px;
  }

  .sp-services__icon svg {
    max-width: 20px;
    max-height: 20px;
    width: 20px;
    height: 20px;
  }

  .sp-services__body {
    gap: 12px;
  }

  .sp-services__card-title {
    font-size: 18px;
    line-height: 24px;
  }

  .sp-services__card-text {
    font-size: 14px;
    line-height: 20px;
  }

  .sp-services__scrollbar,
  .sp-services__scrollbar.swiper-scrollbar {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: 79px !important;
    height: 6px !important;
    flex: none;
    /* центр по контентной колонке (без bleed +16) */
    margin-left: calc((100% - 16px - 79px) / 2);
    margin-right: auto;
  }

  .sp-services__media {
    flex: none;
    width: 100%;
    height: 280px;
    min-height: 0;
    border-radius: 12px;
  }
}
