/* Контейнер слайдера */
.service-slider-wrapper {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 20px 0;
  scroll-snap-type: x mandatory;
}

/* Обрезка и отступ для Swiper */
.service-swiper {
  padding-bottom: 24px;
}

/* Обёртка и слайды Swiper */
.swiper-wrapper {
  display: flex;
}
.swiper-slide {
  flex-shrink: 0;
  scroll-snap-align: center;
}

/* Карточка услуги */
.service-slide {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 40px;
  min-width: 256px;
  height: 91px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  scroll-snap-align: start;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Иконка внутри карточки */
.service-slide img {
  width: 30px;
  height: auto;
}

/* Заголовок услуги */
.service-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.4;        /* 140% */
  color: #ffffff;
  max-width: 100%;
  text-align: center;
  white-space: normal;     /* разрешаем переносы */
  overflow: hidden;        /* обрезка лишнего текста */
}

/* Цветные/серые иконки */
.icon-colored { display: block; }
.icon-gray    { display: none; }

/* Буллеты пагинации */
.swiper-pagination-bullet {
  background: #D9D9D9;
  opacity: 0.3;
  border-radius: 20px;
  width: 8px;
  height: 6px;
  margin: 4px !important;
}
.swiper-pagination-bullet-active {
  background: #CACACA;
  opacity: 1;
  width: 24px;
}

/* Позиционирование пагинации */
.swiper-pagination {
  bottom: 0    !important;
  top:    100px!important;
}

 @media (max-width: 767px) {
  .service-swiper .swiper-pagination {
    position: static !important;  /* убираем абсолютность */
    margin-top: 16px;             /* опускаем вниз от слайдов */
    width: auto;                  /* либо 100%, если нужно */
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 767px) {
  /* Контейнер со слайдами и пагинацией */
  .service-swiper {
    position: relative;
    padding-bottom: 40px; /* место под пагинацию */
  }
  /* Боковые (неактивные) слайды */
  .service-swiper .swiper-slide {
    width: 18%           !important;
    opacity: 0.5;
    transform: scale(0.9);
    transition: all 0.3s ease;
  }
  /* Центральный (активный) слайд */
  .service-swiper .swiper-slide-active {
    width: 60%           !important;
    opacity: 1;
    transform: scale(1);
  }
  /* Иконки и заголовок: скрываем у неактивных */
  .service-swiper .swiper-slide .icon-colored,
  .service-swiper .swiper-slide .service-title {
    display: none !important;
  }
  /* Только серая иконка у неактивных */
  .service-swiper .swiper-slide .icon-gray {
    display: block !important;
  }
  /* Активный: показываем цветную иконку и текст */
  .service-swiper .swiper-slide-active .icon-colored {
    display: none !important;
  }
  .service-swiper .swiper-slide-active .icon-gray,
  .service-swiper .swiper-slide-active .service-title {
    display: block !important;
  }
  /* Пагинация под слайдами */
  .service-swiper .swiper-pagination {
    position: static !important;
    margin-top: 16px;
    display: flex;
    justify-content: center;
  }
}

/* === Центровка при 1–2 слайдах, не ломая Swiper === */
@media (min-width: 768px) {
  /* центрируем трек и убираем смещение Swiper */
  .service-swiper.few-2 .swiper-wrapper {
    justify-content: center;
    transform: none !important;
  }
  /* две карточки ровно по центру; 16px = ваш gap/spaceBetween на десктопе */
  .service-swiper.few-2 .swiper-slide {
    width: calc((100% - 16px) / 2) !important;
  }
  /* чтобы пагинация не «уезжала» при отключённом transform */
  .service-swiper.few-2 .swiper-pagination {
    position: static !important;
    margin-top: 16px;
  }
}

/* === 2 слайда по центру: убираем лишние 16px и подрезание края === */
@media (min-width: 768px) {
  /* слегка добавим внутренние поля, чтобы не касаться краёв контейнера */
  .service-swiper.few-2 { padding-inline: 8px; } /* влияет только при few-2 */

  .service-swiper.few-2 .swiper-wrapper {
    justify-content: center;
    transform: none !important; /* чтобы не было сдвига трансформом */
  }

  /* две карточки занимают всю ширину с одним промежутком 16px */
  .service-swiper.few-2 .swiper-slide {
    width: calc((100% - 16px) / 2) !important;
  }

  /* ключевое: у последнего слайда убираем margin-right=16px от Swiper */
  .service-swiper.few-2 .swiper-wrapper .swiper-slide:last-child {
    margin-right: 0 !important;
  }
}

