/* Responsive repairs for the restored legacy layout. */
html,
body,
.page {
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

/* Semantic headings keep the exact legacy typography and spacing. */
h1.section-title,
h2.section-title,
h2.help__title,
.brand-box__header h2 {
  margin: 0;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
}

.privacy-consent {
  align-items: flex-start;
  color: #202328;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 9px;
  line-height: 1.35;
  margin: 3px 0 8px;
  text-align: left;
  width: 100%;
}

.privacy-consent input {
  accent-color: #202328;
  display: block !important;
  flex: 0 0 auto;
  height: 20px;
  margin: 0;
  min-height: 20px;
  min-width: 20px;
  opacity: 1 !important;
  position: static !important;
  width: 20px;
}

.privacy-consent a {
  color: #713000;
  text-decoration: underline;
}

.popup .privacy-consent {
  color: #202328;
  max-width: 420px;
}

.popup .privacy-consent a { color: #713000; }

.page-footer address a,
.page-footer .copy a {
  color: inherit;
}

/* Keep the contact stack stable when the header gets narrow. */
.page-header__inner .phone {
  white-space: nowrap;
}

.page-header__inner .contacts--2 {
  min-width: max-content;
}

.page-header__inner .contacts--2 .email {
  margin-top: 9px;
}

.legal-page,
.error-page {
  background: #f1f0ee;
  color: #202328;
  min-height: 55vh;
  padding: 80px 0;
}

.legal-page__inner,
.error-page__inner {
  background: #fff;
  box-sizing: border-box;
  max-width: 1040px;
  padding: clamp(28px, 5vw, 72px);
}

.legal-page h1,
.error-page h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.1; margin: 0 0 35px; }
.legal-page h2 { font-size: clamp(22px, 3vw, 30px); margin: 38px 0 14px; }
.legal-page p,
.legal-page li,
.error-page p { font-size: 17px; line-height: 1.65; }
.legal-page a { color: #9d3b00; text-decoration: underline; }
.error-page__code { color: #ff7d2f; font-size: clamp(70px, 15vw, 150px) !important; font-weight: 700; line-height: .8 !important; margin: 0 0 30px; }

/* More legible secondary text while preserving the orange/dark visual system. */
.section-sub-title,
.pluses-slider__text,
.scheme-item__desc,
.about-item__desc { color: #4b4b4b; }

.main-menu-btn,
.slider-nav__item,
.fancybox-close-small { min-height: 44px; min-width: 44px; }

/* Keep the help form inside its orange panel at every desktop width. */
.help .container {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.32fr);
}

.help__body,
.help__img-wrap {
  height: auto;
  min-width: 0;
  width: auto;
}

.help__body-inner {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  min-height: 555px;
  padding: clamp(46px, 6vw, 105px) clamp(34px, 5vw, 72px);
  position: relative;
  width: 100%;
}

.help__body-inner p {
  margin-bottom: 34px;
}

.help .popup-frm {
  background: transparent;
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
}

.help .popup-frm .input-wrap,
.help .help-frm__input,
.help .help-frm__submit {
  box-sizing: border-box;
  margin: 0;
  width: 100%;
}

.help .popup-frm .input-wrap {
  height: 58px;
  min-height: 58px;
}

.help .help-frm__input {
  background-color: #fff;
  background-image: none;
  border: 1px solid rgba(32, 35, 40, 0.2) !important;
  color: #202328 !important;
  font-size: 18px !important;
  height: 58px !important;
  line-height: 58px !important;
  margin: 0 !important;
  max-height: 58px;
  min-height: 58px;
  padding: 0 18px !important;
  -webkit-text-fill-color: #202328;
}

.help .help-frm__input::placeholder,
.help .help-frm__input:focus::placeholder {
  color: #8b8b8b;
  opacity: 1 !important;
}

.help .help-frm__submit {
  background: #202328;
  border: 2px solid #202328;
  color: #fff;
  height: 58px;
  min-height: 58px;
  padding: 10px 20px;
}

.help .help-frm__submit:hover,
.help .help-frm__submit:focus {
  background: #fff;
  color: #202328;
}

.help__img-wrap {
  overflow: hidden;
}

.help__img-wrap img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

/* Modern image formats with original JPEG/PNG fallbacks above. */
@supports (background-image: image-set(url("data:image/avif;base64,AAAA") type("image/avif"))) {
  .promo__inner {
    background-image: image-set(
      url('../assets/template/images/top-4.avif') type('image/avif'),
      url('../assets/template/images/top-4.webp') type('image/webp'),
      url('../assets/template/images/top-4.jpg') type('image/jpeg')
    );
  }

  .popup--with-pic .popup__wrap::before {
    background-image: image-set(
      url('../assets/template/images/popup-img.avif') type('image/avif'),
      url('../assets/template/images/popup-img.webp') type('image/webp'),
      url('../assets/template/images/popup-img.png') type('image/png')
    );
  }

  .brand-box__header::after {
    background-image: image-set(
      url('../assets/template/images/hands.avif') type('image/avif'),
      url('../assets/template/images/hands.webp') type('image/webp'),
      url('../assets/template/images/hands.png') type('image/png')
    );
  }
}

@media (max-width: 1100px) {
  .promo {
    padding-top: clamp(12px, 2vw, 22px);
  }

  .promo .container {
    padding-left: 0;
    padding-right: 0;
  }

  .promo__inner {
    background-image: url('../assets/template/images/top-4.jpg') !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    margin: 0;
    padding: 0;
    top: 0;
    width: 100%;
  }

  @supports (background-image: image-set(url("data:image/avif;base64,AAAA") type("image/avif"))) {
    .promo__inner {
      background-image: image-set(
        url('../assets/template/images/top-4-768.avif') type('image/avif'),
        url('../assets/template/images/top-4-768.webp') type('image/webp'),
        url('../assets/template/images/top-4.jpg') type('image/jpeg')
      ) !important;
    }
  }

  .promo__header {
    background: transparent;
    box-sizing: border-box;
    aspect-ratio: 983 / 635;
    min-height: 0;
    padding: 0;
    width: 100%;
  }

  /* The headline is already typeset in the approved light hero artwork. */
  .promo__header .promo__title,
  .promo__header .promo__sub-title {
    display: none !important;
  }

  .promo__features {
    box-sizing: border-box;
    display: grid;
    gap: 28px;
    padding: 44px clamp(26px, 6vw, 70px);
    position: static;
    min-width: 0;
    width: 100%;
  }

  .promo__features .features {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    min-width: 0;
    width: 100%;
  }

  .promo__features .features-item {
    margin: 0;
    min-width: 0;
  }

  .promo__features .features-item__text {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .promo__order-btn {
    margin-top: 4px;
    width: 100%;
  }

  .help .container {
    grid-template-columns: 1fr;
  }

  .help__body-inner {
    min-height: 0;
  }

  .help__img-wrap {
    display: block;
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .promo .container {
    padding-left: 0;
    padding-right: 0;
  }

  .promo__header {
    background: transparent;
    aspect-ratio: 983 / 635;
    min-height: 0;
    padding: 0;
  }

  .promo__inner {
    background-image: url('../assets/template/images/top-4-480.webp') !important;
    background-position: center top !important;
    background-size: 100% auto !important;
  }

  @supports (background-image: image-set(url("data:image/avif;base64,AAAA") type("image/avif"))) {
      .promo__inner {
        background-image: image-set(
          url('../assets/template/images/top-4-480.avif') type('image/avif'),
          url('../assets/template/images/top-4-480.webp') type('image/webp'),
          url('../assets/template/images/top-4.jpg') type('image/jpeg')
        ) !important;
    }
  }

  .promo__features .features {
    grid-template-columns: 1fr;
  }

  .promo__features {
    padding: 36px 24px;
  }

  .help {
    padding-bottom: 30px;
    padding-top: 30px;
  }

  .help__body-inner {
    padding: 38px 24px;
    text-align: left;
  }

  .help__title {
    font-size: clamp(30px, 10vw, 42px);
  }

  .help__body-inner p {
    font-size: 20px;
    line-height: 1.35;
  }

  .help__img-wrap {
    min-height: 250px;
  }

  .legal-page,
  .error-page { padding: 35px 0; }
}

@media (max-width: 460px) {
  /* The moved email adds one line to the contact stack. */
  .main-menu-wrap { top: 208px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Keep a plain JPEG fallback after the modern format rules. */
.promo__inner {
  background-image: url('../assets/template/images/top-4.jpg') !important;
}

@media (max-width: 640px) {
  .promo__inner {
    background-image: url('../assets/template/images/top-4.jpg') !important;
  }
}
