/* Дополнительные стили шаблона (подключаются ядром Битрикс). Основная вёрстка — styles.min.css */

.cta__flash {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
}

.cta__flash--ok {
  color: #1a7f37;
}

.cta__flash--err {
  color: #c62828;
}

.cta__captcha {
  min-height: 100px;
}

.cta__optional {
  font-weight: 400;
  color: var(--color-text-grey, #918f99);
  font-size: 0.92em;
}

/* Красная обводка при ошибке валидации (дубль с верстки, если styles.min устарел) */
.cta__input.is-error {
  box-shadow: 0 0 0 2px #e53e3e;
}

/* Карточки «Для каких объектов»: вся карточка — ссылка */
a.objects__card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

a.objects__card:hover .objects__card-arrow,
a.objects__card:focus-visible .objects__card-arrow {
  background: var(--color-accent);
}

a.objects__card:hover .objects__card-arrow svg path,
a.objects__card:focus-visible .objects__card-arrow svg path {
  stroke: #fff;
}

/* Контакты в шапке: телефон и почта справа от поиска */
.header__actions {
  gap: 10px;
  min-width: 0;
}

.header__contacts {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 1;
  min-width: 0;
}

.header__contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font, 'Onest', sans-serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: normal;
  color: var(--color-black, #2B2A32);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.header__contact svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.header__contact:hover,
.header__contact:focus-visible {
  color: #FF9F00;
}

/* Уплотняем шапку, чтобы на 100% вмещались телефон и почта без обрезки */
@media (min-width: 1200px) {
  .header__inner {
    gap: 8px;
    padding: 12px 18px;
  }

  .header__nav {
    gap: 8px;
  }

  .header__nav .nav-btn {
    padding: 12px 16px;
    font-size: 15px;
    height: 44px;
  }

  .header__nav .nav-btn--dropdown {
    padding: 12px 12px 12px 16px;
  }

  .header__search {
    height: 44px;
    padding: 12px 14px 12px 12px;
    font-size: 14px;
  }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .header__contacts {
    gap: 12px;
  }

  .header__contact {
    font-size: 13px;
  }

  .header__nav {
    gap: 4px;
  }

  .header__nav .nav-btn {
    padding: 10px 10px;
    font-size: 13px;
  }

  .header__nav .nav-btn--dropdown {
    padding: 10px 8px 10px 10px;
  }

  .header__contacts {
    flex-shrink: 0;
  }

  .header__search span {
    display: none;
  }

  .header__search {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

/* Карточки услуг на главной: весь блок — ссылка */
a.services__item {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

a.services__item:hover .btn--primary,
a.services__item:focus-visible .btn--primary {
  background: var(--color-accent, #FDA206);
  color: #fff;
}

a.services__item:hover .services__item-image img,
a.services__item:focus-visible .services__item-image img {
  transform: scale(1.02);
}

.services__item-image img {
  transition: transform 0.3s ease;
}

/* Промежуточная точка захвата после услуг */
.capture-banner {
  width: 100%;
  padding: 0 32px;
}

.capture-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 32px;
  background: var(--color-white-second, #F3F3F3);
  border: 0.3px solid var(--color-secondary-grey, #D9D9DB);
}

.capture-banner__text {
  margin: 0;
  max-width: 640px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.32px;
  color: var(--color-black, #2B2A32);
}

.capture-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.capture-banner__btn {
  width: auto;
  min-width: 180px;
  padding-left: 28px;
  padding-right: 28px;
}

/* Плавающая кнопка звонка */
.float-phone {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 550;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent, #FDA206);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(43, 42, 50, 0.22);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.float-phone:hover,
.float-phone:focus-visible {
  background: var(--color-black, #2B2A32);
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(43, 42, 50, 0.28);
}

.float-phone svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* Адаптив: аккуратные переносы в заголовках */
.hero__title,
.objects__title,
.facts__title,
.cta__title,
.services__item-heading {
  text-wrap: balance;
}

/* br скрываем только в описаниях услуг — в заголовках это склеивает слова */
.services__item-desc br {
  display: none;
}

.hero__title,
.hero__subtitle,
.services__item-heading,
.services__item-desc,
.objects__title,
.facts__title,
.cta__title,
.capture-banner__text {
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Футер: весь блок CTA кликабелен, текст не слипается */
a.footer__cta {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.footer__cta-heading {
  white-space: nowrap;
  word-spacing: normal;
  text-wrap: nowrap;
}

a.footer__cta:hover .footer__cta-button,
a.footer__cta:focus-visible .footer__cta-button {
  background: var(--color-bg, #FAFAFB);
}

a.footer__cta:hover .footer__cta-button svg path,
a.footer__cta:focus-visible .footer__cta-button svg path {
  stroke: var(--color-black, #2B2A32);
}

/* Шапка на узких экранах: клики по поиску/бургеру не перехватывает скрытое мегаменю */
@media (max-width: 1199px) {
  .header {
    position: relative;
    z-index: 600;
  }

  .header__inner {
    position: relative;
    z-index: 1;
  }

  .header__mobile-actions {
    position: relative;
    z-index: 2;
  }

  .header__mobile-search {
    -webkit-tap-highlight-color: transparent;
  }

  #megaMenu:not(.is-open) {
    visibility: hidden;
    pointer-events: none;
  }

  #megaMenu.is-open {
    visibility: visible;
  }

  .header__contacts {
    display: none;
  }
}

@media (min-width: 481px) and (max-width: 1100px) {
  .hero__subtitle br {
    display: none;
  }
}

@media (max-width: 992px) {
  .blocks {
    gap: 48px !important;
  }

  .capture-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }

  .capture-banner__actions {
    width: 100%;
    flex-direction: column;
  }

  .capture-banner__btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .blocks {
    gap: 32px !important;
  }

  .hero {
    margin-bottom: 0;
  }

  .objects,
  .cases,
  .cta,
  .stages {
    margin-top: 0;
  }

  .facts {
    gap: 16px;
    margin-top: 0;
  }

  .services__item {
    margin-top: 0;
  }

  .objects__grid-wrapper {
    margin-top: 20px;
  }

  .capture-banner {
    padding: 0 16px;
  }

  .capture-banner__inner {
    border-radius: 20px;
    padding: 20px 16px;
    gap: 16px;
  }

  .capture-banner__text {
    font-size: 16px;
    line-height: 1.35;
  }

  .footer__cta-heading {
    font-size: 28px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .float-phone {
    right: 12px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
}

/* 1.2 Заголовок главной: «под ключ» остаётся на второй строке */
.hero__title-suffix {
  white-space: nowrap;
}

/* 1.3 Основные услуги: блок на ширину секции, фото чуть уже */
@media (min-width: 993px) {
  .services {
    align-items: stretch;
  }

  .services__item,
  .services__divider {
    max-width: none;
    width: 100%;
    margin-inline: 0;
  }

  .services__item {
    gap: 28px;
    align-items: center;
    justify-content: space-between;
  }

  .services__item-info {
    align-self: center;
    justify-content: flex-start;
    gap: 24px;
    width: min(480px, 42%);
    flex: 0 1 480px;
  }

  .services__item-image {
    flex: 0 1 640px;
    max-width: 640px;
    height: 300px;
    min-width: 0;
  }
}

/* 2. Описания: тот же Onest, но Regular вместо Medium — лаконичнее, заголовки не трогаем */
.hero__subtitle,
.services__item-desc,
.sd-hero__desc,
.sd-hero__desc p,
.cr-hero__desc,
.drainage-hero__desc,
.drainage-hero__desc p,
[class$="-detail__desc"],
[class$="-detail__desc"] p {
  font-weight: 400;
}

/* Проектирование */

.menu-new {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 50px;
  background: #E7F6EC;
  color: #157A3E;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 16px;
  vertical-align: middle;
}

.ds-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 50px;
  background: #E7F6EC;
  color: #157A3E;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ds-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-flow li {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 10px 14px;
  border-radius: 50px;
  background: #FDA206;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.ds-flow li + li::before {
  content: "→";
  position: absolute;
  top: 50%;
  left: -30px;
  transform: translateY(-50%);
  color: #2B2A32;
  font-size: 18px;
  font-weight: 600;
}

.ds-home {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 32px 0;
}

.ds-home__title,
.ds-page h1,
.ds-page h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2B2A32;
}

.ds-home__title {
  font-size: 40px;
  line-height: 46px;
}

.ds-home__lead,
.ds-home__text,
.ds-page p {
  margin: 0;
  max-width: 860px;
  font-size: 18px;
  line-height: 28px;
  color: #3A3940;
}

.ds-home__lead,
.ds-home__text {
  max-width: none;
}

.ds-home__lead {
  font-weight: 600;
  color: #2B2A32;
}

.ds-home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ds-home__actions .btn,
.ds-hero .btn,
.ds-why > .btn {
  width: auto;
  padding: 14px 32px;
  white-space: nowrap;
}

.services__item .ds-badge {
  margin-bottom: 8px;
}

.ds-plaque {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 32px 0;
  padding: 28px 32px;
  border-radius: 28px;
  background: #F7F7F8;
}

.ds-plaque h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ds-plaque p {
  margin: 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 24px;
  color: #5C5A63;
}

.ds-page {
  gap: 48px !important;
}

.ds-hero,
.ds-ask,
.ds-why,
.ds-steps {
  padding: 0 32px;
}

.ds-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 8px 12px 8px 6px;
  border-radius: 50px;
  background: #F3F3F3;
  color: #918F99;
  text-decoration: none;
  font-weight: 500;
}

.ds-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 32px;
  align-items: center;
}

.ds-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.ds-page h1 {
  font-size: 48px;
  line-height: 54px;
}

.ds-hero__sub {
  font-size: 22px !important;
  line-height: 30px !important;
  font-weight: 600;
  color: #2B2A32 !important;
}

.ds-hero__photo {
  margin: 0;
  border-radius: 32px;
  overflow: hidden;
  background: #eee;
}

.ds-hero__photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: cover;
}

.ds-note,
.ds-note__tags {
  background: #F7F7F8;
  border-radius: 28px;
}

.ds-note {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 32px;
  padding: 32px;
}

.ds-page h2 {
  font-size: 32px;
  line-height: 40px;
}

.ds-note__tags {
  margin: 0;
  padding: 14px 18px;
  background: #FDA206;
  font-weight: 600;
  color: #fff !important;
}

.ds-ask,
.ds-why,
.ds-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ds-ask__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ds-ask__list article {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 24px;
  background: #F7F7F8;
}

.ds-ask__list span,
.ds-steps__list span {
  font-size: 20px;
  font-weight: 700;
  color: #FDA206;
}

.ds-ask__list h3,
.ds-page h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 26px;
  text-transform: uppercase;
}

.ds-why__note,
.ds-page .ds-case {
  font-weight: 600;
  color: #2B2A32;
}

.ds-why > .btn {
  align-self: flex-start;
  margin-top: -4px;
}

.ds-steps__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-steps__list li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  margin: 0;
  padding: 20px;
  border-radius: 24px;
  background: #F7F7F8;
  font-size: 18px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .ds-home,
  .ds-hero,
  .ds-ask,
  .ds-why,
  .ds-steps {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ds-note,
  .ds-plaque {
    margin-left: 16px;
    margin-right: 16px;
  }

  .ds-home__title,
  .ds-page h1 {
    font-size: 30px;
    line-height: 36px;
  }

  .ds-page h2,
  .ds-plaque h2 {
    font-size: 24px;
    line-height: 30px;
  }

  .ds-hero__grid,
  .ds-steps__list {
    grid-template-columns: 1fr;
  }

  .ds-plaque {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .ds-home__text,
  .ds-page p {
    font-size: 16px;
    line-height: 24px;
  }

  .ds-flow {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }

  .ds-flow li + li::before {
    content: "↓";
    top: -26px;
    left: 22px;
    transform: none;
    line-height: 22px;
  }
}

@media (max-width: 480px) {
  .ds-home__actions .btn,
  .ds-hero .btn,
  .ds-why > .btn {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    white-space: normal;
    text-align: center;
  }
}

/* ds-plaque button fit */
.ds-plaque .btn {
  width: auto;
  flex-shrink: 0;
  padding: 14px 32px;
}

@media (max-width: 480px) {
  .ds-plaque .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}
