.delivery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 100px;
}

.delivery .title {
  margin-bottom: 0;
}

/* все три вкладки одной высоты, чтобы страница не прыгала при переключении */
.delivery_layout {
  display: grid;
  grid-template-columns: 785fr 780fr;
  column-gap: 74px;
  align-items: start;
  min-height: 475px;
}

@media (max-width: 1199px) {
  .delivery_layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 30px;
    min-height: 0;
  }
}

.delivery_cards {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.delivery_card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 0 25px;
  background: #16181a;
  border: 1px solid #8c8c8c;
  border-radius: 20px;
}

.delivery_card_h105 { height: 105px; }
.delivery_card_h130 { height: 130px; }
.delivery_card_h140 { height: 140px; padding-bottom: 6px; }
.delivery_card_h145 { height: 145px; padding-bottom: 10px; }
.delivery_card_h155 { height: 155px; }
.delivery_card_h160 { height: 160px; }
.delivery_card_h170 { height: 170px; }

@media (max-width: 1199px) {
  .delivery_card {
    height: auto;
    padding-block: 20px;
  }
}

.delivery_card h3 {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
  text-shadow: 0 12px 51px rgba(15, 89, 3, 0.1);
}

.delivery_card p,
.delivery_card li {
  font-size: 16px;
  line-height: 1.4;
}

.delivery_list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery_list li::before {
  content: "- ";
}

/* вводный текст вкладки «Гарантия» */
.delivery_text {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.4;
}

.delivery_text b {
  font-weight: 700;
  color: #e2fc04;
}

.delivery_photo {
  position: relative;
  aspect-ratio: 780 / 475;
}

.delivery_photo > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delivery_bike_logo {
  position: absolute;
  top: 42.05%;
  left: 31.44%;
  width: 2.75%;
  height: auto;
  transform: translate(-50%, -50%) rotate(-4.09deg) skewX(5.05deg);
}

.delivery_badge {
  position: absolute;
  left: 31.67%;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  width: 287px;
  height: 116px;
  padding-left: 34px;
  background: #16181a;
  border: 1px solid #e2fc04;
  border-radius: 20px;
}

.delivery_badge img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

/* прозрачные картинки вкладок «Оплата» и «Гарантия» стоят в тех же местах, что в макете */
.delivery_photo > img.delivery_art {
  position: absolute;
  height: auto;
  max-width: none;
  object-fit: fill;
}

.delivery_photo > img.delivery_art_oplata {
  top: -1.03%;
  left: 3.13%;
  width: 90.4%;
}

.delivery_photo > img.delivery_art_logo {
  position: absolute;
  top: 50.3%;
  left: 57.2%;
  width: 5.64%;
  height: auto;
  translate: -50% -50%;
}

.delivery_photo > img.delivery_art_garantiya {
  top: -11.03%;
  left: -0.85%;
  width: 100.6%;
}

.delivery_badge_divider {
  width: 1px;
  height: 40px;
  flex-shrink: 0;
  background: #8c8c8c;
}

.delivery_badge p {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
}

/* бейдж «Рассрочка» шире и с кнопкой */
.delivery_badge_wide {
  left: 22.56%;
  width: 430px;
  padding-left: 31px;
}

.delivery_badge_text {
  position: relative;
  top: 3px;
}

.delivery_badge_text strong {
  display: block;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
}

.delivery_badge_text span {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

.delivery_badge_button {
  margin: 0 30px 0 auto;
  min-width: 150px;
}

@media (max-width: 899px) {
  .delivery_badge {
    left: auto;
    right: 0;
    width: 260px;
    height: 100px;
    padding-left: 20px;
  }

  .delivery_badge_wide {
    width: 100%;
    max-width: 430px;
  }
}

/* порядок аренды (вместо «Преимуществ» в режиме проката) */
.rent_steps {
  margin-top: 67px;
}

.rent_steps_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 60px 20px;
  margin: 0;
  padding: 40px 0 0;
  list-style: none;
}

@media (max-width: 1199px) {
  .rent_steps_grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rent_steps_grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rent_step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  height: 280px;
  padding: 0 20px;
  text-align: center;
  background: #16181a;
  border: 1px solid #8c8c8c;
  border-radius: 20px;
}

.rent_step_number {
  position: absolute;
  top: -41px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 80px;
  height: 80px;
  padding-bottom: 3px;
  translate: -50% 0;
  background: #16181a;
  border: 2px solid #e2fc04;
  border-radius: 50%;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  color: #e2fc04;
}

.rent_step h3 {
  font-weight: 700;
  font-size: 28px;
  line-height: 1.4;
  text-shadow: 0 12px 51px rgba(15, 89, 3, 0.1);
}

.rent_step p {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 400;
  line-height: 36px;
  color: #8c8c8c;
}

/* плавная смена вкладок: блок и заголовок гаснут и проявляются */
.delivery_layout,
.delivery_title {
  transition: opacity 0.28s ease;
}

.delivery_layout.is_fading,
.delivery_title.is_fading {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .delivery_layout,
  .delivery_title,
  .price {
    transition: none;
  }
}

/* мобильная версия: сверху фото, под ним карточки на всю ширину */
@media (max-width: 767px) {
  .delivery {
    gap: 0;
    margin-top: 39px;
  }

  .delivery_title {
    margin-top: 14.4px;
  }

  .delivery_layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    row-gap: 0;
    min-height: 0;
    margin-inline: -10px;
  }

  .delivery_photo {
    order: 1;
    flex: none;
    height: calc((100vw - 20px) * 0.617);
    margin-top: -11.1px;
    aspect-ratio: auto;
  }

  /* картинка вкладки «Оплата» начинается выше, чем фургон, поэтому её не поднимаем под заголовок */
  #delivery-panel-oplata .delivery_photo {
    margin-top: 4px;
  }

  .delivery_cards {
    order: 2;
    gap: 10px;
    margin-top: 38.9px;
  }

  .delivery_card {
    height: auto;
    justify-content: flex-start;
    gap: 5px;
    padding: 14px;
    border-color: transparent;
    border-radius: 15px;
  }

  .delivery_card h3 {
    font-size: 18px;
    line-height: 25px;
  }

  .delivery_card p,
  .delivery_card li {
    font-size: 14px;
    line-height: 20px;
  }

  .delivery_card br {
    display: none;
  }

  .delivery_text {
    padding-inline: 10px;
    font-size: 14px;
    line-height: 20px;
  }

  /* плашка висит по центру и выступает за нижний край фото */
  .delivery_badge {
    left: 50%;
    right: auto;
    bottom: -23.6px;
    gap: 10px;
    width: 150px;
    height: 55px;
    padding-left: 16px;
    translate: -50% 0;
    border-radius: 15px;
  }

  .delivery_badge img {
    width: 21px;
    height: 21px;
  }

  .delivery_badge_divider {
    height: 17px;
  }

  .delivery_badge p {
    font-size: 14px;
    line-height: 17px;
  }

  .delivery_badge_wide {
    gap: 10px;
    width: 320px;
    max-width: none;
    height: 60px;
    padding-left: 14px;
  }

  .delivery_badge_text {
    top: 0;
  }

  .delivery_badge_text strong {
    font-size: 14px;
    line-height: 17px;
  }

  .delivery_badge_text span {
    font-size: 11px;
    line-height: 14px;
  }

  .delivery_badge_button {
    min-width: 0;
    width: 90px;
    height: 32px;
    margin: 0 12px 0 auto;
    padding-inline: 0;
  }

  /* порядок аренды: лента карточек, листается сама, под ней точки с заполнением */
  .rent_steps {
    margin-top: 40.4px;
  }

  .rent_steps_grid {
    display: flex;
    gap: 10px;
    margin: 0 -20px;
    padding: 44px 10px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 10px;
    scrollbar-width: none;
  }

  .rent_steps_grid::-webkit-scrollbar {
    display: none;
  }

  .rent_step {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 200px;
    padding: 0 20px;
    border-color: #8c8c8c;
    border-radius: 15px;
  }

  /* кружок с номером сидит на верхней кромке карточки */
  .rent_step_number {
    top: -34px;
    width: 68px;
    height: 68px;
    padding-bottom: 3px;
    font-size: 34px;
  }

  .rent_step h3 {
    font-size: 20px;
    line-height: 28px;
  }

  .rent_step p {
    margin-top: 4.5px;
    font-size: 15px;
    line-height: 22.5px;
  }
}
