/* Home page: allow enlarged text to grow without shrinking service cards. */
@media (max-width: 550px) {
  body.front .vidy-kom ul { flex-direction: column; align-items: center; }
  body.front .vidy-kom ul li { width: 90%; min-width: 0; height: auto; min-height: 170px; margin: 10px auto; overflow-wrap: anywhere; }
  body.front .vidy-kom ul li a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  body.front #cat2 ul { display: flex; flex-wrap: wrap; gap: 5px; align-items: stretch; }
  body.front #cat2 ul li { flex: 1 1 calc(50% - 3px); width: auto; min-width: min-content; max-width: 100%; height: auto; min-height: 60px; margin: 0; }
  body.front #cat2 ul li a { height: 100%; min-height: 60px; padding: 4px; box-sizing: border-box; white-space: normal; overflow-wrap: normal; min-width: 0; max-width: 100%; }

}

/* Header uses its native mobile breakpoint; service cards keep 550px. */
@media (max-width: 800px) {
  body #header { margin-top: calc(var(--home-mobile-bar-height, 38px) + 12px) !important; }
  body #header .bottom_line,
  body #header .bottom_line .inner { height: auto !important; min-height: 36px; background: none; }
  body #header .bottom_line .inner .wrapper {
    display: grid; grid-template-columns: minmax(0, 1fr) 32px 32px;
    column-gap: 2px; align-items: start; height: auto !important; min-height: 36px; padding: 0 3px;
  }
  body #header .bottom_line .inner .phone1 {
    grid-column: 1; grid-row: 1; position: static !important;
    width: auto; min-width: 0; max-width: 100%; margin: 0;
  }
  body #header .bottom_line .inner .phone1 a {
    display: flex; align-items: center; justify-content: center;
    width: auto; max-width: 100%; min-height: 36px; margin: 0;
    line-height: 1.2 !important; white-space: nowrap; overflow-wrap: normal;
    font-size: clamp(12px, 4.2vw, 16px) !important;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  }
  body #header .bottom_line .openMenu { width: 32px; height: 36px; background-size: 22px 22px; background-position: center; background-repeat: no-repeat; }
  body #header .bottom_line .search .j-search-show { width: 32px; height: 36px; min-width: 0; padding: 0; }
  body #header .bottom_line .search .j-search-show svg { width: 22px; height: 22px; }
  body #header .bottom_line .openMenu { background-image: url(/sites/all/themes/a2ice/images/a2ice/hamburger--green.png); }
  body #header .bottom_line .open .openMenu { background-image: url(/sites/all/themes/a2ice/images/a2ice/hamburger-close--green.png); }
  body #header .bottom_line .mainmenu { grid-column: 3; grid-row: 1; float: none; width: 32px; height: 36px; }
  body #header .bottom_line .search { grid-column: 2; grid-row: 1; position: relative; top: auto; right: auto; width: 32px; height: 36px; }
  body #header .bottom_line .search:not(.active):hover { right: auto; margin: 0; }
  body #header .bottom_line .search.active { position: absolute; top: 0; left: 3px; right: 38px; width: auto; }
}

/* Keep fixed-width controls inside the narrow layout viewport used at high zoom. */
@media (max-width: 550px) {
  body .main_container { overflow-wrap: anywhere; }
  body .main_container .lang-switcher { flex-wrap: wrap; }
  body .zvonok1 {
    max-width: 100%; box-sizing: border-box;
    height: auto; white-space: normal; overflow-wrap: anywhere;
  }
  body #header .head-zv .zvonok1 {
    max-width: calc(100% - 18px); box-sizing: border-box;
    height: auto; white-space: normal; overflow-wrap: anywhere;
  }
  body footer .footer-contact .phone1,
  body footer .footer-contact .tlpphone {
    max-width: 100%; min-width: 0; box-sizing: border-box; overflow-wrap: anywhere;
  }
}
