/* =========================
   SERVICE SINGLE: Gallery / Prices / CTA / Related
   ========================= */

/* ---------- Services photos (gallery) ---------- */

/* Внешний контейнер галереи = grid */
.services-photos > div > div > .gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* мобильные: 2 колонки */
  gap: 12px;
  margin-top: 24px;
}

.services-photos > div > div > .service-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.services-photos > div > div > .service-gallery--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.services-photos > div > div > .service-gallery--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.services-photos > div > div > .service-gallery--cols-3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.services-photos > div > div > .service-gallery--cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ВАЖНО: внутренние dl.gallery не должны быть grid */
.services-photos .gallery dl.gallery {
  display: block !important;
  width: 100%;
  margin: 0;
}

.services-photos .gallery dt.gallery-icon,
.services-photos .gallery .gallery-icon a {
  display: block;
  width: 100%;
  margin: 0;
}

/* Ровные превью */
.services-photos .gallery .gallery-icon a {
  aspect-ratio: 4 / 3; /* можно поменять на 16/9 */
  overflow: hidden;
  border-radius: 18px;
}

.services-photos .gallery .gallery-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Планшеты/десктоп */
@media (min-width: 768px) {
  .services-photos > div > div > .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .services-photos > div > div > .service-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .services-photos > div > div > .service-gallery--cols-1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .services-photos > div > div > .service-gallery--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .services-photos > div > div > .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }

  .services-photos > div > div > .service-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .services-photos > div > div > .service-gallery--cols-1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .services-photos > div > div > .service-gallery--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-photos > div > div > .service-gallery--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Our prices (packages grid) ---------- */

.our-prices .price-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.package-price-row__value {
  color: var(--service-single-accent-hover);
}

/* ---------- CTA buttons row ---------- */

.service-cta__row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.service-cta__btn {
  flex: 1 1 260px;
  text-align: center;
}

/* ---------- Related services (carousel3) ---------- */

.related-services {
  position: relative;
  padding: 40px 0;
}

.relative-wrapper {
  position: relative;
}

.related-services h2 {
  text-align: center;
  margin: 0 0 24px;
}

/* Кнопки как “донор” */
.related-services .carousel3-prev-button,
.related-services .carousel3-next-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;

  width: 44px;
  height: 44px;
  border-radius: 999px;

  border: 0;
  background: var(--service-single-accent);
  color: #fff;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.related-services .carousel3-prev-button {
  left: 10px;
}
.related-services .carousel3-next-button {
  right: 10px;
}

.related-services .carousel3-prev-button span,
.related-services .carousel3-next-button span {
  font-size: 26px;
  line-height: 1;
  transform: translateY(-1px);
}

.related-services .carousel3-prev-button:hover,
.related-services .carousel3-next-button:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  transform: translateY(-50%) scale(1.04);
}

.related-services .carousel3-prev-button:disabled,
.related-services .carousel3-next-button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

/* Трек (скроллбар скрыт, двигается transform через твой JS) */
.related-services .carousel3-container {
  overflow: hidden;
  position: relative;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.related-services .carousel3-wrapper {
  display: flex;
  gap: 22px;
  flex-wrap: nowrap;
  padding: 10px 0;

  will-change: transform;
  transition: transform 0.3s ease;
}

/* 3 / 2 / 1 карточки на экран */
.related-services .carousel3-item {
  flex: 0 0 calc((100% - 44px) / 3); /* 2 gap * 22 = 44 */
  cursor: pointer;
  scroll-snap-align: start;
}

/* Карточка */
.related-services .service-card {
  height: 100%;
  background: var(--service-single-soft);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-services .carousel3-item:hover .service-card {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

/* Превью */
.related-services .service-card__img {
  height: 140px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 12px;
}

/* Текст */
.related-services .service-card__title {
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
}

.related-services .service-card__text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.85;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.45em * 2);
}

/* Адаптив для related */
@media (max-width: 960px) {
  .related-services .carousel3-item {
    flex: 0 0 calc((100% - 22px) / 2);
  }
}

@media (max-width: 768px) {
  .related-services .carousel3-item {
    flex: 0 0 100%;
  }

  .related-services .carousel3-prev-button {
    left: 6px;
  }
  .related-services .carousel3-next-button {
    right: 6px;
  }

  .before-after {
    padding: 80px 0;
  }

  .services-photos,
  .our-prices,
  .our-services,
  .faq {
    padding: 40px 15px;
  }
}

/* misc */
.before-after {
  text-align: center;
}
