/* will9.ru — how «Как это работает»
   desktop 2535:7437 / tablet 2441:15701 / mobile 2535:7938
*/

.block--how {
  padding: 0 0 140px;
}

.how {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.how__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: 1057px;
}

.how__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  color: var(--color-black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.how__slider {
  width: 100%;
  overflow: hidden;
}

.how__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-step {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  height: auto;
  min-height: 508px;
  padding: 16px;
  border-radius: 16px;
  background: var(--color-white);
  box-sizing: border-box;
}

.how-step__top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.how-step__badge {
  display: flex;
  gap: 4px;
  height: 64px;
}

.how-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border: 1px dashed var(--color-orange);
  border-radius: var(--radius-btn);
  box-sizing: border-box;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-h3);
  line-height: 1;
  color: var(--color-black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.how-step__track {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 1px dashed var(--color-orange);
  border-radius: var(--radius-btn);
  color: var(--color-orange);
  box-sizing: border-box;
}

.how-step__arrow {
  display: block;
  flex-shrink: 0;
  width: 99px;
  max-width: 70%;
  height: 15px;
}

.how-step__badge--final .how-step__num {
  width: 100%;
  border: 0;
  background: var(--color-orange);
  color: var(--color-white);
}

.how-step__text {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-black);
}

.how-step__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 292 / 280;
  object-fit: cover;
  border-radius: 16px;
}

/* Pagination — mobile only 2535:7977: active 24×8 orange, idle 8×8 gray, gap 10 */
.how__pagination {
  display: none;
  position: static;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 8px;
  margin: 0;
  padding: 0;
}

.how__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--color-gray);
  opacity: 1;
  cursor: pointer;
  appearance: none;
  transition:
    width 0.2s ease,
    background-color 0.2s ease;
}

.how__dot.is-active {
  width: 24px;
  background: var(--color-orange);
}

.how__dot:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .block--how {
    padding: 0 0 80px;
  }

  .block--how .container {
    width: calc(100% - (var(--header-pad-tablet) * 2));
  }

  .how__title {
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: 0.02em;
  }

  .how-step {
    min-height: 314px;
    gap: 10px;
  }

  .how-step__badge {
    height: 40px;
  }

  .how-step__num {
    width: 41px;
    height: 40px;
    font-size: 20px;
    line-height: 1.1;
  }

  .how-step__text {
    font-size: var(--fs-body-sm);
    line-height: 1.1;
  }

  .how-step__media {
    aspect-ratio: 210 / 120;
    border-radius: 8px;
  }
}

@media (max-width: 767px) {
  .block--how {
    padding: 0 0 64px;
  }

  .block--how .container {
    width: 100%;
    padding: 0;
  }

  .how {
    gap: 32px;
  }

  .how__head {
    gap: 32px;
    padding: 0 var(--header-pad-mobile);
    max-width: none;
  }

  .how__title {
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: 0.02em;
  }

  .how__slider {
    overflow: hidden;
    max-width: 100%;
  }

  .how__slider .how-step {
    width: 242px;
    justify-content: flex-start;
    gap: 16px;
    min-height: 296px;
  }

  .how-step__badge {
    height: 40px;
  }

  .how-step__num {
    width: 41px;
    height: 40px;
    font-size: 20px;
    line-height: 1.1;
  }

  .how-step__arrow {
    width: 98px;
    max-width: 80%;
  }

  .how-step__text {
    font-size: var(--fs-body-sm);
    line-height: 1.1;
  }

  .how-step__media {
    aspect-ratio: 210 / 120;
    border-radius: 8px;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
  }

  .how__pagination {
    display: flex;
    margin-top: 16px;
    padding: 0 var(--header-pad-mobile);
  }
}
