/* =========================================================
   Как проходит
   Десктоп: три карточки в ряд, линия прогресса заполняется,
   пока блок проходит экран.
   Мобильный: блок прилипает, вертикальный скролл листает
   карточки вместе с прогрессом по горизонтали
   (высоту секции задаёт JS).
   ========================================================= */

.steps {
  position: relative;
  padding-top: 100px;
}

.steps__sticky {
  display: flex;
  flex-direction: column;
  row-gap: 64px;
}

.steps__scroller {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  overflow: hidden;
}

.steps__inside {
  display: flex;
  flex-direction: column;
  row-gap: 48px;
}

.steps__track {
  display: flex;
  column-gap: 16px;
}

.step-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  row-gap: 24px;
  padding: 16px;
  border-radius: 24px;
}

.step-card__img {
  aspect-ratio: 437 / 320; /* пропорции исходных картинок, высота считается от ширины карточки */
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-surface);
}
.step-card__img img { width: 100%; height: 100%; object-fit: cover; }

.step-card__body { display: flex; flex-direction: column; row-gap: 8px; }
.step-card__title { font-size: 24px; line-height: 1.3; }
.step-card__text  { color: var(--c-muted); font-size: 16px; line-height: 1.3; }

/* ---------- Прогресс ---------- */
.progress {
  display: flex;
  align-items: center;
  column-gap: 12px;
}
.progress__pin {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-surface);
  transition: background-color 0.15s ease;
}
.progress__pin span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c-muted);
  box-shadow: 0 0 10px 0 rgba(255, 255, 255, 0.25);
  transition: background-color 0.15s ease;
}
.progress__pin.is-on { background: var(--c-blue); }
.progress__pin.is-on span { background: #fff; }

.progress__line {
  flex: 1 1 0;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--c-blue) var(--p, 0%), var(--c-surface) var(--p, 0%));
}
.progress__btn { margin-left: 4px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1519px) {
  .step-card__title { font-size: 20px; }
}
@media (max-width: 1199px) {
}

@media (max-width: 959px) {
  .steps { padding-top: 0; }

  /* Прилипающий экран с горизонтальной лентой */
  .steps__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    justify-content: center;
    row-gap: 40px;
  }
  .steps__head { text-align: center; }

  .steps__scroller { max-width: none; padding: 0; }
  .steps__inside {
    width: max-content;
    row-gap: 32px;
    padding: 0 calc((100vw - var(--card-w)) / 2);
  }
  .step-card { flex: 0 0 var(--card-w); }

  .steps { --card-w: 608px; }
}
@media (max-width: 639px) {
  .steps { --card-w: 464px; }
}
@media (max-width: 479px) {
  .steps { --card-w: 352px; }
  .step-card__title { font-size: 18px; }
  .progress__btn { padding: 12px 20px; font-size: 16px; }
  .progress { column-gap: 8px; }
  .progress__pin { width: 32px; height: 32px; }
  .progress__pin span { width: 12px; height: 12px; }
}
@media (max-width: 359px) {
  .steps { --card-w: 312px; }
}
