/* =========================================================================
   Дополнительные адаптивные исправления.
   Подключается ПОСЛЕ main.css — переопределяет только проблемные места,
   сохраняя существующий дизайн десктопной версии.
   ========================================================================= */

html {
  -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.page-header,
.main,
.page-footer,
.slider__wrap {
  max-width: 100%;
}

/* Оригинальный блок service имеет отрицательные отступы и на 1920px
   вылезает за экран на 4px — убираем только отрицательные margin. */
.service {
  margin-left: 0;
  margin-right: 0;
}

/* Адрес в правом верхнем углу шапки */
.page-header__top {
  height: auto;
  min-height: 110px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.header-address {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: flex-end;
  -webkit-justify-content: flex-end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  margin: 0 0 9px;
  padding: 4px 10px;
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-radius: 20px;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  color: #5a5a5a;
  text-align: right;
}

.header-address .icon {
  -webkit-flex: 0 0 auto;
          flex: 0 0 auto;
  color: #de143d;
  font-size: 17px;
  margin-right: 4px;
}

.header-address__metro {
  font-weight: 500;
  color: #444;
}

.header-address__dot {
  color: #bdbdbd;
  padding: 0 2px;
}

/* Кнопка старой формы без value имела высоту 15px */
.form_content_btn {
  min-height: 44px !important;
}

/* На 1025–1440 px часть текста задана в vw и становится слишком мелкой */
@media (min-width: 1025px) and (max-width: 1440px) {
  .nav__link,
  .page-header__menu-link {
    font-size: 14px !important;
  }

  .page-header__desc,
  .page-header__desc span {
    font-size: 14px !important;
  }

  .advantages__title {
    font-size: 15px !important;
  }

  .advantages__desc {
    font-size: 14px !important;
  }

  .page-footer__link,
  .page-footer__link span,
  .page-footer__schedule-title,
  .page-footer__schedule-item,
  .page-footer__schedule-item span {
    font-size: 13px !important;
  }

  .personal-price__item--header-desc {
    font-size: 14px !important;
  }
}

/* Ссылка политики в старой форме forma.php */
.iagree {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

/* Старая форма forma.php: Bootstrap-классы не подгружаются, задаём поля сами */
.forma .form-control,
.forma .form_content_select,
.forma .form_content_textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #c0c0c0;
  border-radius: 5px;
  background: #fff;
  color: #444;
  font-family: Arial, sans-serif;
  font-size: 16px;
}

.forma .form_content_textarea {
  min-height: 100px;
  resize: vertical;
}

.forma .form_content_btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 5px;
  background: #e53935;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.forma .form_content_btn:hover {
  background: #d32f2f;
}

/* --- Новые элементы форм: согласие, капча, статус --- */
.apf-form {
  max-width: 100%;
}

.apf-captcha {
  margin: 12px 0;
  text-align: left;
}

.apf-captcha label {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 5px;
}

.apf-captcha input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #c0c0c0;
  border-radius: 5px;
  background: #fff;
}

.apf-consent {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: flex-start;
  -webkit-align-items: flex-start;
      -ms-flex-align: start;
          align-items: flex-start;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  text-align: left;
}

.apf-consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0 10px 0 0;
  cursor: pointer;
}

.apf-consent a {
  color: #e53935;
  text-decoration: underline;
}

.apf-form-status {
  min-height: 1.2em;
  margin: 8px 0;
  font-size: 15px;
  line-height: 1.4;
}

.apf-form-status.apf-error {
  color: #c62828;
  font-weight: 700;
}

.apf-form-status.apf-ok {
  color: #2e7d32;
  font-weight: 700;
}

.new-privacy {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #555 !important;
}

/* --- Планшеты и Smaller desktop --- */
@media (max-width: 1024px) {
  .page-header__top {
    height: auto;
    min-height: 90px;
    padding: 14px 10px 14px 70px;
  }

  .header-address {
    margin-bottom: 7px;
    padding: 3px 9px;
    font-size: 14px;
  }

  /* В main.css эти размеры заданы в vw и на узких экранах падают до 3–7px */
  .list__li {
    font-size: 16px !important;
  }

  .slider__desc {
    font-size: 14px !important;
    line-height: 1.4;
  }

  .advantages__title {
    font-size: 15px !important;
  }

  .page-header__logo {
    width: 150px;
  }

  .page-header__menu {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .form__input,
  .form__textarea,
  .form__select,
  .new-input,
  .new-select,
  .new-textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  .btn,
  .form__submit,
  .new-btn-submit,
  .header-call-btn {
    min-height: 44px;
    padding: 12px 18px;
  }

  .contact__wrap {
    display: block;
  }
}

/* --- Телефоны и узкие планшеты --- */
@media (max-width: 768px) {
  .page-footer__content {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
        -ms-flex-direction: column;
            flex-direction: column;
  }

  .page-footer__bottom {
    height: auto;
    -webkit-flex-wrap: nowrap;
        -ms-flex-wrap: nowrap;
            flex-wrap: nowrap;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
        -ms-flex-direction: column;
            flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 14px 10px;
  }

  .page-footer__policy {
    padding: 6px 0;
  }

  .page-footer__policy a {
    font-size: 14px;
    text-decoration: underline;
  }

  .new-popup-flex {
    padding: 10px;
    -webkit-box-align: flex-start;
    -webkit-align-items: flex-start;
        -ms-flex-align: start;
            align-items: flex-start;
  }

  .new-popup-box {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
  }

  .form__input-wrap {
    display: block;
  }

  .form__input-wrap .form__input {
    width: 100%;
  }

  .text-box,
  .contact,
  .buy,
  .sale,
  .section {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  .header-address {
    font-size: 13px;
    line-height: 1.3;
    gap: 4px;
    margin-bottom: 6px;
  }

  .header-address .icon {
    font-size: 15px;
    margin-right: 2px;
  }

  .header-call-btn {
    width: 100%;
    margin-top: 10px;
  }

  .page-header__phone {
    display: block;
    font-size: 16px;
    line-height: 1.6;
  }

  .new-form-title {
    font-size: 20px;
  }

  .apf-consent {
    font-size: 13px;
  }
}
