/**
 * Шапка карточки услуг: заголовок + иконка в grid (без absolute-перекрытия).
 * Не вешать container-type на .services-card — ломает ширину swiper-slide.
 */
.services-swiper .swiper-slide.services-card {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
}

.services-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.services-card-head .services-card-title {
  min-width: 0;
  margin-bottom: 12px;
  padding-right: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  -webkit-hyphens: manual;
  grid-column: 1;
  grid-row: 1;
}

.services-card-head .services-card-icon {
  position: static !important;
  top: auto !important;
  right: auto !important;
  width: 48px;
  height: auto;
  max-width: none;
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
  grid-column: 2;
  grid-row: 1;
}

.services-card-head .services-card-discount {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 1;
}

.services-card-head + .services-card-descr,
.services-card-head ~ .services-card-descr {
  padding-right: 0 !important;
}

/* Fallback: старая разметка без .services-card-head */
.services-card:not(:has(.services-card-head)) > .services-card-title {
  padding-right: calc(48px + 16px);
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.services-card:not(:has(.services-card-head)) > .services-card-descr {
  padding-right: calc(48px + 16px);
}

@media screen and (max-width: 1199px) {
  .services-card-head .services-card-icon {
    width: 40px;
  }
  .services-card:not(:has(.services-card-head)) > .services-card-title,
  .services-card:not(:has(.services-card-head)) > .services-card-descr {
    padding-right: calc(40px + 16px);
  }
}

@media screen and (max-width: 576px) {
  .services-card-head {
    column-gap: 12px;
  }
  .services-card-head .services-card-title {
    margin-bottom: 10px;
  }
  .services-card-head .services-card-icon {
    width: 36px;
  }
  .services-card:not(:has(.services-card-head)) > .services-card-title,
  .services-card:not(:has(.services-card-head)) > .services-card-descr {
    padding-right: calc(36px + 12px);
  }
}

@media screen and (max-width: 370px) {
  .services-card-head .services-card-icon {
    width: 28px;
  }
  .services-card:not(:has(.services-card-head)) > .services-card-title,
  .services-card:not(:has(.services-card-head)) > .services-card-descr {
    padding-right: calc(28px + 12px);
  }
}
