/* ESTT adaptive layer | 2026-11-11 | Step 9 A1
   Load AFTER bootstrap.css. No edits to Bootstrap, forms or calculators.
   Shared: page geometry, topbar, footer. Home/inner: responsive widths. */

/* The original page root was display:table / display:table-row.
   A fixed-width descendant could enlarge its intrinsic table width,
   moving the Calltouch phone past the visible viewport. Normal flex
   layout keeps the site shell equal to the viewport width. */
body.estt-home > .wrapper-height,
body.estt-inner > .wrapper-height {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}
body.estt-home > .wrapper-height > .content-height,
body.estt-inner > .wrapper-height > .content-height {
  display: block !important;
  flex: 1 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
}
body.estt-home > .wrapper-height > #estt-footer,
body.estt-inner > .wrapper-height > #estt-footer {
  flex: 0 0 auto !important;
  width: 100% !important;
}

/* (1) Contact strip. Only one Calltouch-swappable number in the header.
   Grid keeps the phone on the right independent of the contacts width. */
.estt-topbar {
  width: 100% !important;
  max-width: 100% !important;
  background: #31353d !important;
  color: #fff !important;
}
.estt-topbar > .container {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1170px !important;
  padding: 0 15px !important;
  margin: 0 auto !important;
}
.estt-topbar .estt-topbar__inner {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: center !important;
  column-gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 52px !important;
}
.estt-topbar .estt-topbar__contacts {
  display: flex !important;
  align-items: center !important;
  gap: 22px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
.estt-topbar .estt-topbar__address,
.estt-topbar .estt-topbar__email {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 7px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  color: #f1f4f9 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}
.estt-topbar .estt-topbar__address:hover,
.estt-topbar .estt-topbar__email:hover {
  color: #fff !important;
  text-decoration: underline !important;
}
.estt-topbar .estt-topbar__address img,
.estt-topbar .estt-topbar__email img {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  max-width: none !important;
  object-fit: contain !important;
}
.estt-topbar .estt-topbar__phones {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  justify-self: end !important;
  width: max-content !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  white-space: nowrap !important;
}
.estt-topbar a.estt-topbar__phone,
.estt-topbar a.estt-topbar__phone span {
  display: inline !important;
  position: static !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #fff !important;
  text-align: right !important;
  white-space: nowrap !important;
  text-decoration: none !important;
}
.estt-topbar .estt-topbar__phone:hover { text-decoration: underline !important; }
@media (max-width: 1199px) {
  .estt-topbar .estt-topbar__address { display: none !important; }
}
@media (max-width: 767px) {
  .estt-topbar .estt-topbar__contacts { display: none !important; }
  .estt-topbar .estt-topbar__inner { min-height: 46px !important; }
  .estt-topbar .estt-topbar__phone,
  .estt-topbar .estt-topbar__phone span { font-size: 17px !important; }
}
@media (max-width: 359px) {
  .estt-topbar .estt-topbar__phone,
  .estt-topbar .estt-topbar__phone span { font-size: 15px !important; }
}

/* (2) Footer grid previously embedded in index.php; extracted verbatim. */
/* 5-колоночная структура основного футера: бренд, услуги, компания, документы, контакты */
#estt-footer .estt-footer-grid {
    display: grid;
    grid-template-columns:
        minmax(250px, 1.45fr)
        minmax(150px, 0.85fr)
        minmax(150px, 0.85fr)
        minmax(210px, 1.10fr)
        minmax(230px, 1.20fr);
    column-gap: 34px;
    row-gap: 34px;
    align-items: start;
}

#estt-footer .estt-footer-documents a {
    line-height: 1.45;
}

@media (max-width: 1199px) {
    #estt-footer .estt-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 48px;
        row-gap: 32px;
    }

    #estt-footer .estt-footer-brand {
        grid-column: 1 / -1;
        max-width: 520px;
    }
}

@media (max-width: 767px) {
    #estt-footer .estt-footer-grid {
        grid-template-columns: 1fr;
        row-gap: 28px;
    }

    #estt-footer .estt-footer-brand {
        grid-column: auto;
        max-width: none;
    }
}

/* (3) Width system for HOME. No global Bootstrap .container changes. */
@media (min-width: 1440px) {
  body.estt-home .estt-topbar > .container,
  body.estt-home .estt-site-nav > .container,
  body.estt-home .mainpage-menu-block .container,
  body.estt-home .estt-home-about-section .container,
  body.estt-home .estt-home-dc-section .container,
  body.estt-home #estt-footer .container {
    width: calc(100% - 48px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body.estt-home .estt-home-hero-wrap .estt-hero-content {
    max-width: 1280px !important;
  }
  body.estt-home .estt-home-about-grid {
    grid-template-columns: minmax(0, 1fr) 350px !important;
    gap: 24px !important;
  }
  body.estt-home .estt-home-dc-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (min-width: 1920px) {
  body.estt-home .estt-topbar > .container,
  body.estt-home .estt-site-nav > .container,
  body.estt-home .mainpage-menu-block .container,
  body.estt-home .estt-home-about-section .container,
  body.estt-home .estt-home-dc-section .container,
  body.estt-home #estt-footer .container {
    max-width: 1440px !important;
  }
  body.estt-home .estt-home-hero-wrap .estt-hero-content {
    max-width: 1440px !important;
  }
  body.estt-home .estt-home-about-grid {
    grid-template-columns: minmax(0, 1fr) 380px !important;
    gap: 28px !important;
  }
  body.estt-home .estt-home-dc-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 16px !important;
  }
}
/* The Bootstrap .row on the four-service catalog can otherwise carry an
   obsolete 1170px max width even when its new .container grows wider. */
@media (min-width: 1440px) {
  body.estt-home .mainpage-menu-block .row {
    max-width: none !important;
  }
}

/* (4) Protect section contents from overflow at middle widths. */
@media (min-width: 992px) and (max-width: 1199px) {
  body.estt-home .mainpage-menu-block .container,
  body.estt-home .estt-home-about-section .container,
  body.estt-home .estt-home-dc-section .container {
    max-width: 970px !important;
    width: 100% !important;
  }
}

/* (5) Widescreen hero text stays readable instead of spanning the image. */
@media (min-width: 1440px) {
  body.estt-home .estt-home-hero-wrap .estt-hero-title { max-width: 630px !important; }
  body.estt-home .estt-home-hero-wrap .estt-hero-subtitle { max-width: 610px !important; }
}


/* =============================================================
   STEP 9 — INNER template only
   Wider, centered composition mirrors the home page but avoids
   generic .container changes that might alter a Joomla component.
   Forms, tables, calculators keep their own responsive behavior.
   ============================================================= */
body.estt-inner .estt-inner-breadcrumbs,
body.estt-inner .estt-inner-page {
  min-width: 0 !important;
  box-sizing: border-box !important;
}
body.estt-inner .estt-inner-page {
  padding-top: 12px !important;
  padding-bottom: 26px !important;
}
body.estt-inner .estt-inner-component {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.estt-inner .estt-inner-component > img,
body.estt-inner .estt-inner-component picture > img,
body.estt-inner .estt-inner-component > figure > img {
  max-width: 100% !important;
  height: auto !important;
}
body.estt-inner .estt-inner-component iframe,
body.estt-inner .estt-inner-component video {
  max-width: 100% !important;
}
@media (max-width: 767px) {
  body.estt-inner .estt-inner-page { padding-top: 6px !important; padding-bottom: 22px !important; }
}
@media (min-width: 1440px) {
  body.estt-inner .estt-topbar > .container,
  body.estt-inner .estt-site-nav > .container,
  body.estt-inner .mainpage-menu-block > .container,
  body.estt-inner .estt-inner-breadcrumbs,
  body.estt-inner .estt-inner-page,
  body.estt-inner #estt-footer .container {
    width: calc(100% - 48px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body.estt-inner .mainpage-menu-block > .container > .row {
    max-width: none !important;
  }
}
@media (min-width: 1920px) {
  body.estt-inner .estt-topbar > .container,
  body.estt-inner .estt-site-nav > .container,
  body.estt-inner .mainpage-menu-block > .container,
  body.estt-inner .estt-inner-breadcrumbs,
  body.estt-inner .estt-inner-page,
  body.estt-inner #estt-footer .container {
    max-width: 1440px !important;
  }
}
