/* WordPress port fixes. Подключается после main.css. */

html :where(img[class*=wp-image-]) {
  max-width: none;
}

.swiper-notification {
  display: none !important;
}

/* =========================================================
   COMMON SLIDERS
   ========================================================= */

@media (min-width: 769px) {
  .block-products-mini.swiper .swiper-slide {
    width: 35rem !important;
  }

  .our-projects__bottom-block.swiper .swiper-slide {
    width: 35rem !important;
  }
}

@media (max-width: 768px) {
  .block-products-mini.swiper .swiper-slide {
    width: 30rem !important;
  }

  .our-projects__bottom-block.swiper .swiper-slide {
    width: 26.6667rem !important;
  }
}

/* =========================================================
   FRONT PAGE / COMMON PAGE ALIGNMENT
   Не применяем к товарным страницам.
   ========================================================= */

@media (min-width: 769px) {
  body:not(.product-detail-page) .hero-container {
    margin-top: -4rem !important;
  }

  body:not(.product-detail-page) .block-products-mini {
    margin-top: 0 !important;
  }

  body:not(.product-detail-page) main.container > .info-block {
    margin-top: 6rem !important;
  }

  body:not(.product-detail-page) .big-photo {
    margin-top: 6rem !important;
  }

  body:not(.product-detail-page) .our-projects {
    margin-top: 3.75rem !important;
  }

  body:not(.product-detail-page) .comanies {
    margin-top: 3rem !important;
  }

  body:not(.product-detail-page) .footer {
    margin-top: -4rem !important;
  }
}

@media (max-width: 768px) {
  body:not(.product-detail-page) .hero-container {
    margin-top: -48px !important;
  }

  body:not(.product-detail-page) .hero-block .info-block {
    height: 18.5rem !important;
    min-height: 18.5rem !important;
    padding: 3rem !important;
    justify-content: space-between !important;
  }

  body:not(.product-detail-page) .hero-block .info-block .title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #fff !important;
    font-size: 3rem !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }

  body:not(.product-detail-page) .block-products-mini,
  body:not(.product-detail-page) main.container > .info-block {
    margin-top: 0 !important;
  }

  body:not(.product-detail-page) .big-photo {
    margin-top: 40px !important;
  }

  body:not(.product-detail-page) .our-projects {
    margin-top: 13px !important;
  }

  body:not(.product-detail-page) .comanies {
    margin-top: 36px !important;
  }

  body:not(.product-detail-page) .footer {
    margin-top: -48px !important;
  }
}

/* BEGIN HOME PAGE SERVER MATCH V4 */

/*
 * Homepage object cards.
 * Only normalize the title itself.  Previous revisions stretched the title
 * and changed alignment on the whole top block, which could make the card
 * appear shifted to the left.
 */
body:not(.about-page):not(.product-detail-page):not(.facility-detail-page)
  .our-projects__bottom-block
  .item-obj
  .item-obj__info-block__top
  .title {
  width: auto !important;
  max-width: 100% !important;
  align-self: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  text-align: left !important;
  transform: none !important;
}

/* Preserve the original city/description geometry independently of title. */
body:not(.about-page):not(.product-detail-page):not(.facility-detail-page)
  .our-projects__bottom-block
  .item-obj
  .item-obj__info-block__top
  .desc {
  width: auto !important;
  max-width: 100% !important;
  align-self: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: none !important;
}

/* The original hero phrase is an H1; keep the original appearance. */
.hero-block .info-block h1.title {
  margin: 0 !important;
  color: #fff !important;
}

/* Exact original floating phone typography without changing button geometry. */
a.button-form-link[href="tel:+78482557175"] {
  font-size: 1.5rem !important;
  line-height: 1.32 !important;
  letter-spacing: -0.02em !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

a.button-form-link[href="tel:+78482557175"] > span,
a.button-form-link[href="tel:+78482557175"] small {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: inherit !important;
  color: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

/* Remove the inline-image baseline gap without changing horizontal geometry. */
main.container > .big-photo > img,
main.container > .big-photo img {
  display: block !important;
}

/*
 * Partners marquee.
 * The comparator measured the local track 6.1–9.2 seconds ahead of the
 * original at every viewport, while width, height and all static styles match.
 * Keep the original 40-second movement and compensate only the initial phase.
 */
body:not(.about-page):not(.product-detail-page):not(.facility-detail-page)
  .comanies {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  transform: none !important;
  margin-bottom: 3px !important;
}

body:not(.about-page):not(.product-detail-page):not(.facility-detail-page)
  .comanies__track {
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  width: max-content !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  animation-name: comanies-marquee !important;
  animation-duration: 40s !important;
  animation-timing-function: linear !important;
  animation-iteration-count: infinite !important;
  animation-direction: normal !important;
  animation-fill-mode: none !important;
  animation-play-state: running !important;
  animation-delay: 8s !important;
  will-change: transform !important;
}

/* END HOME PAGE SERVER MATCH V4 */

/* TTS HOME HERO: final vertical rhythm */
@media (min-width: 769px) {
  body.home .hero-block .info-block .desc,
  body.home .hero-block .info-block .title {
    transform: translateY(-1rem);
  }
}

@media (max-width: 768px) {
  body.home .hero-block .info-block {
    top: 48.5rem !important;
  }

  body.home .hero-block .info-block .desc,
  body.home .hero-block .info-block .title {
    transform: translateY(-1rem);
  }
}

/* TTS HOME HERO: stable mobile position with browser bars */
@media (max-width: 768px) {

  body.home .hero-block .info-block {
    /*
     * Базово немного выше предыдущего положения.
     * На коротком visual viewport автоматически поднимается,
     * чтобы fixed-кнопка телефона не перекрывала hero-card.
     */
    top: min(47rem, calc(100dvh - 26.75rem)) !important;
  }

  /* Небольшой запас для нижней safe-area на iPhone */
  body.home a.button-form-link[href="tel:+78482557175"] {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}
