/* ==========================================================================
   Шапка сайта (header.php). Цвета взяты из логотипа.
   ========================================================================== */
.sh {
  --sh-green: #30af21;
  --sh-green-dark: #145422;
  --sh-green-soft: #eef7ec;
  --sh-orange: #fc8100;
  --sh-orange-dark: #e07200;
  --sh-text: #1f2a24;
  --sh-muted: #66736b;
  --sh-line: #e6ece6;
  --sh-top-h: 36px;
  --sh-main-h: 88px;
  --sh-nav-h: 54px;
  position: sticky;
  top: calc(-1px - var(--sh-top-h) - var(--sh-main-h));  /* прокручиваются полоса и строка (+1px рамка), меню остаётся */
  z-index: 1000;
  background: #fff;
  font-family: "PT Sans", sans-serif;
  color: var(--sh-text);
}
.admin-bar .sh { top: calc(31px - var(--sh-top-h) - var(--sh-main-h)); }
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh a { text-decoration: none; }

/* ---------- иконки (SVG-маски, цвет = currentColor) ---------- */
.sh-ico {
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
          mask: var(--i) center / contain no-repeat;
}
.sh-ico--pin    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.sh-ico--clock  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 10.4 3.2 3.2-1.4 1.4L11 13.2V6h2z'/%3E%3C/svg%3E"); }
.sh-ico--chat   { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3C6.5 3 2 6.9 2 11.6c0 2.5 1.3 4.8 3.4 6.3L4.6 22l4.3-2.4c1 .3 2 .4 3.1.4 5.5 0 10-3.9 10-8.6S17.5 3 12 3z'/%3E%3C/svg%3E"); }
.sh-ico--search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.sh-ico--phone  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1A17 17 0 0 1 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.3 0 .7-.2 1z'/%3E%3C/svg%3E"); }

/* иконка MAX (фирменная картинка) */
.sh-max-ico { flex: 0 0 auto; display: block; width: 20px; height: 20px; border-radius: 6px; }

/* ---------- верхняя полоса ---------- */
.sh-topbar {
  height: var(--sh-top-h);
  background: var(--sh-green-dark);
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
}
.sh-topbar__in { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.sh-topbar__left, .sh-topbar__right { display: flex; align-items: center; gap: 8px; }
.sh-topbar__right { gap: 26px; }
.sh-topbar__item { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.sh-topbar__max { color: #fff; font-weight: 700; }
.sh-topbar .sh-ico { color: #8fd77f; }
.sh-topbar__link {
  margin-left: 10px;
  color: #fff;
  border-bottom: 1px dashed rgba(255, 255, 255, .5);
  line-height: 1.2;
}
.sh-topbar__link:hover, .sh-topbar__max:hover { color: #b7f0a8; border-color: #b7f0a8; }

/* ---------- основная строка ---------- */
.sh-main { border-bottom: 1px solid var(--sh-line); }
.sh-main__in { display: flex; align-items: center; gap: 24px; height: var(--sh-main-h); }
.sh-logo { flex: 0 0 auto; display: block; line-height: 0; }
.sh-logo img { width: 120px; height: auto; }
.sh-tagline {
  flex: 0 0 auto;
  padding-left: 22px;
  border-left: 1px solid var(--sh-line);
  font-size: 14px;
  line-height: 1.35;
  color: var(--sh-muted);
}
.sh-search { position: relative; flex: 1 1 auto; max-width: 380px; margin: 0 0 0 auto; }
.sh-search__input {
  width: 100% !important;
  max-width: none !important;
  height: 44px;
  margin: 0;
  padding: 0 52px 0 18px;
  border: 1px solid var(--sh-line);
  border-radius: 22px;
  background: #f5f8f5;
  font: inherit;
  font-size: 15px;
  color: var(--sh-text);
  box-shadow: none;
  -webkit-appearance: none;
          appearance: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.sh-search__input::placeholder { color: #8b958e; }
.sh-search__input:focus { outline: none; background: #fff; border-color: var(--sh-green); box-shadow: 0 0 0 4px rgba(48, 175, 33, .14); }
.sh-search__btn {
  position: absolute;
  top: 4px; right: 4px;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sh-green);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s;
}
.sh-search__btn:hover { background: var(--sh-green-dark); }
.sh-search__btn .sh-ico { width: 17px; height: 17px; }

.sh-contact { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.sh-phone { font-size: 23px; font-weight: 700; color: var(--sh-text) !important; white-space: nowrap; letter-spacing: .2px; }
.sh-phone:hover { color: var(--sh-green) !important; }
.sh-contact__note { margin-top: 3px; font-size: 13px; color: var(--sh-muted); }

.sh-btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 23px;
  background: var(--sh-orange);
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(252, 129, 0, .28);
  transition: background-color .2s, box-shadow .2s, transform .1s;
}
.sh-btn:hover { background: var(--sh-orange-dark); box-shadow: 0 8px 20px rgba(252, 129, 0, .36); }
.sh-btn:active { transform: translateY(1px); }
.sh-btn--block { display: flex; width: 100%; }

.sh-mobile-actions { display: none; }

/* ---------- меню (десктоп) ---------- */
.sh-nav { background: #fff; transition: box-shadow .2s; }
.sh.is-stuck .sh-nav { box-shadow: 0 6px 20px rgba(20, 50, 30, .08); }
.sh-nav__in { display: flex; align-items: center; height: var(--sh-nav-h); gap: 18px; }
.sh-nav__logo, .sh-nav__phone { display: none; flex: 0 0 auto; }
.sh.is-stuck .sh-nav__logo, .sh.is-stuck .sh-nav__phone { display: block; }
.sh-nav__logo img { width: 80px; height: auto; display: block; }
.sh-nav__phone { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--sh-text) !important; white-space: nowrap; }
.sh-nav__phone:hover { color: var(--sh-green) !important; }
.sh-nav__head, .sh-search--panel, .sh-nav__contacts { display: none; }

.sh-menu { display: flex; align-items: stretch; height: 100%; margin: 0; padding: 0; list-style: none; flex: 1 1 auto; justify-content: space-between; }
.sh.is-stuck .sh-menu { justify-content: center; gap: 0; }
/* в закреплённой полосе рядом с меню ещё логотип и телефон — пункты чуть плотнее, чтобы всё влезло в ширину контейнера */
.sh.is-stuck .sh-menu > li > a { padding: 0 9px; }
.sh.is-stuck .sh-menu > li > a::after { left: 9px; right: 9px; }
.sh-menu li { list-style: none; margin: 0; }
.sh-menu > li { position: relative; display: flex; align-items: center; }
.sh-menu > li > a {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  height: 100%;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--sh-text);
  white-space: nowrap;
  transition: color .2s;
}
.sh-menu > li > a::after {             /* полоска снизу при наведении */
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--sh-green);
  transform: scaleX(0);
  transition: transform .2s;
}
.sh-menu > li:hover > a, .sh-menu > li.current-menu-item > a, .sh-menu > li.current-menu-ancestor > a { color: var(--sh-green); }
.sh-menu > li:hover > a::after, .sh-menu > li.current-menu-item > a::after, .sh-menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }
.sh-menu > .menu-item-has-children > a::before {     /* стрелка */
  content: "";
  order: 2;
  width: 7px; height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .6;
}

/* выпадающие списки */
.sh-menu .sub-menu {
  position: absolute;
  top: 100%; left: 0;
  z-index: 20;
  min-width: 240px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--sh-line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(20, 50, 30, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.sh-menu > li:hover > .sub-menu, .sh-menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sh-menu .sub-menu a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.25;
  color: var(--sh-text);
  transition: background-color .15s, color .15s;
}
.sh-menu .sub-menu a:hover, .sh-menu .sub-menu .current-menu-item > a { background: var(--sh-green-soft); color: var(--sh-green-dark); }
/* большой список «Услуги» — в три колонки, заполняются сверху вниз, начиная с левой.
   Число строк (--rows) считает main.js; 9 — запасное значение для 25 пунктов. */
.sh-menu > li:has(> .sub-menu > li:nth-child(12)) > .sub-menu {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--rows, 9), auto);
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 6px;
  width: 800px;
  max-width: 100%;
  left: 50%;                 /* по центру полосы меню, а не от пункта «Услуги»: */
  transform: translate(-50%, 8px);   /* иначе на ноутбуках список вылезал за правый край и давал прокрутку вбок */
}
@media (min-width: 992px) {
  .sh-nav__in { position: relative; }
  .sh-menu > li:has(> .sub-menu > li:nth-child(12)) { position: static; }
  .sh-menu > li:has(> .sub-menu > li:nth-child(12)):hover > .sub-menu,
  .sh-menu > li:has(> .sub-menu > li:nth-child(12)):focus-within > .sub-menu { transform: translate(-50%, 0); }
}
.sh-menu > li:has(> .sub-menu > li:nth-child(12)) > .sub-menu > li > a { white-space: nowrap; }
.sh-menu .toggle-icon { display: none; }   /* кнопки раскрытия — только в мобильном меню */

/* третий уровень (например, «Вывоз строительного мусора» → «Вывоз грунта»): выезжает сбоку */
.sh-menu .sub-menu li { position: relative; }
.sh-menu .sub-menu .menu-item-has-children > a { padding-right: 26px; }
.sh-menu .sub-menu .menu-item-has-children > a::after {
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .5;
}
.sh-menu .sub-menu .sub-menu {
  top: -11px;
  left: calc(100% - 4px);
  min-width: 260px;
  transform: translateX(8px);
}
.sh-menu .sub-menu li:hover > .sub-menu,
.sh-menu .sub-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sh-menu .sub-menu li:hover > a { background: var(--sh-green-soft); color: var(--sh-green-dark); }
/* если справа не хватает места, список открывается влево (класс ставит main.js) */
.sh-menu .sub-menu li.is-flip > .sub-menu { left: auto; right: calc(100% - 4px); transform: translateX(-8px); }
.sh-menu .sub-menu li.is-flip:hover > .sub-menu { transform: none; }

.sh-overlay { display: none; }

/* ---------- 992–1199: убираем подпись, ужимаем ---------- */
@media (max-width: 1199px) {
  .sh-tagline { display: none; }
  .sh-main__in { gap: 18px; }
  .sh-search { max-width: 300px; }
  .sh-menu > li > a { padding: 0 9px; font-size: 15px; }
  .sh-menu > li > a::after { left: 9px; right: 9px; }
  .sh-nav__phone { font-size: 16px; }
  .sh.is-stuck .sh-menu > li > a { padding: 0 7px; font-size: 14px; }
  /* в меню 9 пунктов: на узких ноутбуках телефон в закреплённой полосе не помещается и даёт прокрутку вбок */
  .sh.is-stuck .sh-nav__phone { display: none; }
}

/* ==========================================================================
   Планшеты и телефоны (до 991 px)
   ========================================================================== */
@media (max-width: 991px) {
  .sh { --sh-main-h: 64px; top: 0; box-shadow: 0 2px 12px rgba(20, 50, 30, .08); }
  .admin-bar .sh { top: 32px; }
  .admin-bar .sh-nav { top: 32px; }
  .sh-topbar, .sh-tagline, .sh-main .sh-search, .sh-contact__note, .sh-main > .container > .sh-btn { display: none; }
  .sh-main { border-bottom: 0; }
  .sh-main__in { gap: 12px; }
  .sh-logo img { width: 92px; }
  .sh-contact { margin-left: auto; }
  .sh-phone { font-size: 18px; }

  .sh-mobile-actions { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
  .sh-round {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    overflow: hidden;
  }
  .sh-round--phone { background: var(--sh-green); color: #fff; }
  .sh-round--phone .sh-ico { width: 20px; height: 20px; }
  .sh-round--max img { width: 42px; height: 42px; display: block; }
  .sh-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: var(--sh-green-soft);
    cursor: pointer;
  }
  .sh-burger span { display: block; height: 2px; border-radius: 2px; background: var(--sh-green-dark); }

  /* выезжающая панель */
  .sh-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 1002;
    width: min(380px, 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: -10px 0 40px rgba(0, 0, 0, .18);
    transform: translateX(105%);
    transition: transform .28s ease;
    visibility: hidden;
  }
  .sh.is-open .sh-nav { transform: none; visibility: visible; }
  .sh.is-stuck .sh-nav { box-shadow: -10px 0 40px rgba(0, 0, 0, .18); }
  .sh-nav__in { display: block; height: auto; max-width: none; padding: 0 20px 30px; }
  .sh.is-stuck .sh-nav__logo, .sh.is-stuck .sh-nav__phone, .sh-nav__logo, .sh-nav__phone { display: none; }

  .sh-nav__head { display: flex; align-items: center; justify-content: space-between; height: 64px; margin: 0 -20px 6px; padding: 0 20px; border-bottom: 1px solid var(--sh-line); }
  .sh-nav__title { font-size: 20px; font-weight: 700; }
  .sh-nav__close {
    position: relative;
    width: 42px; height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--sh-green-soft);
    cursor: pointer;
  }
  .sh-nav__close::before, .sh-nav__close::after {
    content: ""; position: absolute; left: 11px; right: 11px; top: 50%;
    height: 2px; margin-top: -1px; border-radius: 2px; background: var(--sh-green-dark);
    transform: rotate(45deg);
  }
  .sh-nav__close::after { transform: rotate(-45deg); }

  .sh-search--panel { display: block; max-width: none; margin: 14px 0 8px; }

  .sh-menu, .sh.is-stuck .sh-menu { display: block; height: auto; }
  /* правила закреплённой полосы (уплотнённые пункты) — только для компьютера; в мобильном меню возвращаем обычные */
  .sh.is-stuck .sh-menu > li > a { height: auto; padding: 15px 44px 15px 0; font-size: 17px; }
  .sh-menu > li { display: block; border-bottom: 1px solid var(--sh-line); }
  .sh-menu > li > a { height: auto; padding: 15px 44px 15px 0; font-size: 17px; }
  .sh-menu > li > a::after, .sh-menu > .menu-item-has-children > a::before { display: none; }
  .sh-menu .sub-menu, .sh-menu > li:has(> .sub-menu > li:nth-child(12)) > .sub-menu {
    position: static;
    display: none;
    width: auto;
    min-width: 0;
    margin: -4px 0 12px;
    padding: 4px 0 4px 12px;
    border: 0;
    border-left: 2px solid var(--sh-green-soft);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .sh-menu li.is-open > .sub-menu { display: block !important; }
  .sh-menu .sub-menu .sub-menu { margin: 0 0 6px; padding-left: 12px; }
  .sh-menu .sub-menu .menu-item-has-children > a { padding-right: 44px; }
  .sh-menu .sub-menu .menu-item-has-children > a::after { display: none; }
  .sh-menu .sub-menu li:hover > a { background: none; color: var(--sh-text); }
  .sh-menu .sub-menu .toggle-icon { top: -2px; }
  .sh-menu .sub-menu a { padding: 8px 10px; font-size: 15px; white-space: normal !important; }
  .sh-menu .toggle-icon {
    display: block;
    position: absolute;
    top: 6px; right: 0;
    width: 40px; height: 40px;
    border-radius: 10px;
    cursor: pointer;
  }
  .sh-menu .toggle-icon::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 9px; height: 9px;
    margin: -7px 0 0 -4px;
    border-right: 2px solid var(--sh-text);
    border-bottom: 2px solid var(--sh-text);
    transform: rotate(45deg);
    transition: transform .2s, margin .2s;
  }
  .sh-menu li.is-open > .toggle-icon::after { transform: rotate(-135deg); margin-top: -2px; }

  .sh-nav__contacts { display: block; margin-top: 22px; }
  .sh-nav__phone-big { display: block; margin-bottom: 12px; font-size: 24px; font-weight: 700; color: var(--sh-text) !important; }
  .sh-nav__contacts .sh-btn { height: 50px; margin-bottom: 16px; }
  .sh-nav__row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; color: var(--sh-muted); }
  .sh-nav__row .sh-ico { color: var(--sh-green); width: 18px; height: 18px; }
  .sh-nav__row .sh-max-ico { width: 20px; height: 20px; margin: 0 -1px; }
  .sh-nav__row a { color: var(--sh-green-dark); border-bottom: 1px dashed rgba(20, 84, 34, .4); }

  .sh-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(15, 30, 20, .45);
    opacity: 0;
    transition: opacity .28s;
  }
  .sh.is-open .sh-overlay { opacity: 1; }
  .sh-overlay[hidden] { display: none; }
}

@media (max-width: 782px) {
  .admin-bar .sh, .admin-bar .sh-nav { top: 46px; }
}
@media (max-width: 600px) {          /* здесь панель WordPress уже не закреплена */
  .admin-bar .sh { top: 0; }
}

@media (max-width: 575px) {
  .sh-contact { display: none; }
  .sh-mobile-actions { margin-left: auto; }
  .sh-logo img { width: 84px; }
}

/* открытая панель — страница под ней не прокручивается, кнопка чата MAX не перекрывает меню */
html.sh-lock, html.sh-lock body { overflow: hidden; }
html.sh-lock #max-button-wrapper { display: none !important; }

/* старая мобильная шапка была фиксированной, и под неё у .site был отступ 50px — новой он не нужен */
@media (max-width: 991px) {
  .site { padding-top: 0 !important; }
}

/* «Резиновая» прокрутка (Firefox/Safari, тачпад): при оттягивании страницы вверх
   браузер показывает фон html — делаем его цветом верхней полосы, а не белым */
html { background-color: #145422; }
body { background-color: #fff; }
