.cta {
  margin-inline: 20px;
}

.cta__container {
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  position: relative;
  z-index: 3;
  gap: 20px;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background-image: url("./../img/icons/cta-loop.svg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
}

.cta__content {
  width: 655px;
  position: relative;
  padding: 35px;
  margin-top: 15px;
}

.cta__title span {
  color: var(--whatsapp);
}

.buttons__detail--cta {
  color: var(--primary);
  top: calc(100% + 30px);
}

.buttons__detail--cta .buttons__arrow {
  margin-top: -20px;
}

/* Мессенджеры в CTA: задаём лазуритовый цвет для подписи и стрелки (через currentColor) */
.hero-messengers--cta {
  color: var(--primary);
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.hero-messengers--cta .hero-messengers__detail {
  position: static;
  right: auto;
  bottom: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: -36px;
  margin-left: 8px;
}
.hero-messengers--cta .hero-messengers__arrow {
  /* Зеркалим по X, чтобы тип стрелки смотрел на иконки (влево) */
  position: static;
  right: auto;
  bottom: auto;
  width: 60px;
  height: 54px;
  transform: rotate(-5deg);
  margin-left: -6px;
}

.hero-messengers--cta .hero-messengers__label {
  font-size: 22px;
  line-height: 0.95;
  max-width: 160px;
  margin: 0;
}

.hero-messengers--cta .hero-messengers__link,
.hero-messengers--cta .hero-messengers__icon {
  width: 48px;
  height: 48px;
}

.cta__image {
  width: 371px;
  height: auto;
  padding: 35px 35px 35px 56px;
  flex-shrink: 0;
  position: relative;
}

.cta__image img {
  height: 100%;
  width: 100%;
  border-radius: 15px;
  object-fit: cover;
}

.cta__image::before {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 20px;
  background-image: url("./../img/icons/cta.svg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  z-index: -1;
  height: 90%;
}

.cta__circles {
  position: absolute;
  height: 100%;
  width: 20px;
  top: 0;
  left: 0;
}

.cta__circles::after,
.cta__circles::before {
  width: 67px;
  height: 67px;
  background-color: var(--light-gray);
  border-radius: 50%;
  content: "";
  position: absolute;
  border: 1px solid var(--border-color);
  left: 50%;
  transform: translateX(-50%);
}

.cta__circles::before {
  top: -35px;
  clip-path: inset(49% 0 0 0);
}

.cta__circles::after {
  bottom: -35px;
  clip-path: inset(0% 0 49% 0);
}

@media (max-width: 990px) {
  .cta__content {
    width: auto;
    padding: 15px;
  }

  .cta__image {
    padding: 18px 20px 18px 50px;
    width: 290px;
  }
}

@media (max-width: 880px) {
  .cta__content {
    margin-top: 0;
  }

  .cta__container {
    flex-direction: column;
    background-image: none;
  }

  .cta__circles {
    height: 70px;
    width: 100%;
    top: -55px;
  }

  .cta__circles::before {
    left: -35px;
    clip-path: inset(0% 0 0 49%);
  }

  .cta__circles::after {
    right: -35px;
    left: initial;
    clip-path: inset(0% 49% 0 0);
  }

  .cta__circles::after,
  .cta__circles::before {
    top: 50%;
    transform: translateY(-50%);
  }

  .cta__image {
    width: 100%;
    height: 300px;
    padding: 20px;
    margin-top: 45px;
  }

  .cta__image::before {
    background-image: url("./../img/icons/cta-mobile.svg");
    width: 100%;
    height: 10px;
    top: -20px;
  }

  .cta__buttons {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
  }

  .cta__button {
    padding-inline: 10px;
  }

  .cta__button.btn--whatsapp {
    order: 1;
  }

  .cta__button.btn--telegram {
    order: 3;
  }

  .buttons__detail--cta {
    position: static;
    order: 2;
    margin-top: 20px;
    gap: 20px;
    margin-left: auto;
    max-width: 190px;
    margin-right: -70px;
  }

  .buttons__detail--cta .buttons__arrow {
    position: absolute;
    left: -90px;
  }

  .buttons__detail-text--cta {
    max-width: 350px;
    width: 100%;
  }

  .buttons__arrow {
    margin-top: 0;
  }

  .cta__button {
    width: 100%;
  }

  /* Мессенджеры после telegram-кнопки в column-раскладке */
  .hero-messengers--cta {
    order: 4;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }
}

@media (max-width: 576px) {
  /* В hero.css .hero-messengers__detail { display: none } — в CTA контексте возвращаем */
  .hero-messengers--cta .hero-messengers__detail {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-left: 62px;
  }

  .hero-messengers--cta {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  /* Иконки сверху, detail снизу → стрелка смотрит ВВЕРХ на иконки.
	   Из исходной ориентации (тип наверх-вправо) поворачиваем на -90deg, чтобы тип смотрел вверх-влево */
  .hero-messengers--cta .hero-messengers__arrow {
    width: 42px;
    height: 38px;
    transform: rotate(-90deg) scaleX(-1);
    margin: 0;
  }

  .hero-messengers--cta .hero-messengers__label {
    max-width: 200px;
    text-align: left;
    margin-bottom: -23px;
    font-size: 27px;
  }
}

@media (max-width: 390px) {
  .buttons__detail-text--cta {
    font-size: 27px;
  }

  .buttons__detail--cta .buttons__arrow {
    left: -35px;
    width: 70px;
    transform: rotate(20deg);
    top: 10px;
  }

  .cta__image {
    height: 250px;
  }
}
