/* ===== How We Work ===== */
#how-we-work {
  position: relative;
  overflow: hidden;
  background-color: var(--color-gray-light);
  padding-top: 40px;
  padding-bottom: 40px;

  @media (max-width: 767px) {
    background-color: var(--color-orange-bg);
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

/* Decorative background image (desktop only) */
.how-we-work__decor {
  position: absolute;
  right: -200px;
  top: -32px;
  width: 948px;
  height: 517px;
  pointer-events: none;

  @media (max-width: 1200px) {
    display: none;
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.26;
    transform: scaleX(-1);
  }
}

/* Heading row */
.how-we-work__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 60px;

  @media (max-width: 1200px) {
    margin-bottom: 40px;
  }

  @media (max-width: 767px) {
    margin-bottom: 20px;
  }
}

.how-we-work__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 40px;
  line-height: 48px;
  text-transform: uppercase;

  @media (max-width: 1200px) {
    font-size: 32px;
    line-height: 40px;
  }

  @media (max-width: 767px) {
    font-size: 22px;
    line-height: 28px;
  }
}

/* Nav arrows (tablet only: ≤1200px and >767px) */
.how-we-work__nav {
  display: none;
  gap: 4px;

  @media (max-width: 1200px) {
    display: flex;
  }

  @media (max-width: 767px) {
    display: none;
  }
}

.how-we-work__nav-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  img {
    display: block;
    width: 32px;
    height: 32px;
  }
}

/* ===== Card ===== */
.how-we-work__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  /* min-height, а не height: длинный текст растягивает карточку, номер не вылезает.
     Слайды Swiper одной высоты — карточки тянутся до самой высокой. */
  min-height: 260px;
  align-self: stretch;
  background-color: var(--color-white-48);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 4px;
  padding: 20px 16px 16px;
  width: 270px;

  @media (max-width: 767px) {
    width: 220px;
    min-height: 235px;
  }
}

.how-we-work__card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.how-we-work__card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 28px;
  line-height: 32px;
  letter-spacing: -0.56px;
  color: var(--color-black);

  @media (max-width: 1200px) {
    font-size: 22px;
    line-height: 32px;
    letter-spacing: 0;
  }
}

.how-we-work__card-text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  color: var(--color-black);
}

.how-we-work__card-num {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 22px;
  line-height: 32px;
  color: var(--color-gray);
  text-align: right;

  @media (max-width: 1200px) {
    font-size: 15px;
    line-height: 24px;
  }
}

/* ===== Desktop: static 4-card layout ===== */
.how-we-work__cards-desktop {
  display: flex;
  align-items: center;

  @media (max-width: 1200px) {
    display: none;
  }
}

.how-we-work__cards-desktop .how-we-work__card {
  flex: 1 0 0;
  min-width: 0;
}

/* Arrow separator (>>>) between cards */
.how-we-work__arrow {
  width: 40px;
  height: 24px;
  flex-shrink: 0;

  img {
    width: 100%;
  }
}

/* ===== Tablet / Mobile: Swiper ===== */
.how-we-work__swiper {
  /* display: none; */
  overflow: visible;

  @media (max-width: 1200px) {
    display: block;
  }
}

.how-we-work__swiper .swiper-slide {
  width: 310px;
  height: auto;
  display: flex;
  align-items: center;

  &:last-child {
    &::after {
      content: none;
    }
  }

  &::after {
    content: "";
    width: 40px;
    height: 24px;
    background: center / contain no-repeat
      url("../../../assets/icons/three-arrow.svg");
    flex-shrink: 0;
  }

  @media (max-width: 767px) {
    width: 260px;
  }
}

/* Pagination pills (mobile only) */
.how-we-work__pagination {
  display: none;
  margin-top: 8px;
  position: static !important;

  @media (max-width: 767px) {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
}

.how-we-work__pagination .swiper-pagination-bullet {
  width: 16px;
  height: 4px;
  background: var(--color-gray-light);
  opacity: 1;
  border-radius: 100px;
  transition: all 0.3s;
}

.how-we-work__pagination .swiper-pagination-bullet-active {
  width: 32px;
  background: var(--color-orange);
}

/* ===== Мобильный вид «список»: карточки столбиком, стрелка вниз между ними ===== */
@media (max-width: 767px) {
  .how-we-work--list .how-we-work__swiper .swiper-wrapper {
    flex-direction: column;
  }

  .how-we-work--list .how-we-work__swiper .swiper-slide {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;

    &::after {
      width: 24px;
      height: 40px;
      transform: rotate(90deg);
    }
  }

  .how-we-work--list .how-we-work__card {
    width: 100%;
    min-height: 0;
  }

  .how-we-work--list .how-we-work__card-title {
    font-size: 20px;
    line-height: 1.4;
    letter-spacing: -0.4px;
  }

  .how-we-work--list .how-we-work__card-text {
    font-size: 14px;
    line-height: 1.4;
  }

  .how-we-work--list .how-we-work__card-num {
    font-size: 20px;
    line-height: 32px;
  }

  .how-we-work--list .how-we-work__pagination {
    display: none;
  }
}

/* ===== Описание под заголовком ===== */
.how-we-work__heading-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-we-work__desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-gray);

  @media (max-width: 767px) {
    font-size: 14px;
  }
}

.how-we-work--has-desc .how-we-work__heading {
  align-items: flex-end;
  margin-bottom: 30px;
}

/* ===== Бежевые карточки (на белом фоне) ===== */
.how-we-work--cards-beige .how-we-work__card {
  background-color: rgba(251, 241, 227, 0.5);
}

/* ===== Растянуть карточки на всю ширину (десктоп) ===== */
@media (min-width: 1201px) {
  .how-we-work--stretch .how-we-work__swiper .swiper-slide {
    flex: 1 1 0;
  }

  .how-we-work--stretch .how-we-work__card {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 0;
  }
}
