/* ===== Новая шапка «капсула» (Бухгалтерия Просто, 11.2026) =====
   Чанк header, скрипт assets/template/js/shapka.js.
   Старые правила .header из style.css перекрываются здесь. */

.header.bp-hdr {
  position: fixed; top: 10px; left: 0; right: 0; z-index: 20;
  background: transparent; box-shadow: none;
  pointer-events: none; /* прозрачные поля вокруг капсулы не мешают кликам по странице */
}
.menu-open .header.bp-hdr { background: transparent; }

.bp-hdr__wrap { max-width: 1400px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }

.bp-hdr__bar {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px;
  min-height: 76px; padding: 0 10px 0 26px; box-sizing: border-box;
  border-radius: 40px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 14px 34px rgba(27, 28, 46, .10);
  font-family: "Montserrat", Arial, sans-serif; font-size: 15px; line-height: 1.3; color: #1b1c2e;
}
.bp-hdr a, .bp-hdr a:hover { text-decoration: none; }
.bp-hdr a:focus-visible, .bp-hdr button:focus-visible { outline: 3px solid #ffa684; outline-offset: 2px; }

.bp-hdr__logo { flex: none; display: block; line-height: 0; }
.bp-hdr__logo img { display: block; width: 146px; height: auto; }

/* --- меню --- */
.bp-nav { display: flex; align-items: center; gap: 2px; }
.bp-nav__group { display: block; }
.bp-nav__btn, .bp-nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 10px; box-sizing: border-box;
  border: 0; border-radius: 22px; background: transparent;
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; color: #1b1c2e;
  white-space: nowrap; cursor: pointer; transition: background-color .2s;
}
.bp-nav__btn:hover, .bp-nav__link:hover { background: #fff4f0; color: #1b1c2e; }
.bp-nav__btn[aria-expanded="true"] { background: #ffede6; }

.bp-chev {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: #b5461a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s;
}
[aria-expanded="true"] > .bp-chev { transform: rotate(180deg); }

/* --- выпадающие панели --- */
.bp-mega {
  position: absolute; left: 0; right: 0; top: calc(100% + 12px); z-index: 30;
  background: #fff; border-radius: 28px;
  box-shadow: 0 24px 48px rgba(27, 28, 46, .16);
  max-height: calc(100vh - 130px); overflow: auto;
}
.bp-mega[hidden], .bp-pop[hidden] { display: none; }
.bp-mega__inner { display: flex; flex-wrap: wrap; gap: 30px; padding: 30px 30px 36px; }
.bp-mega__main { flex: 2 1 560px; min-width: 0; }
.bp-mega__aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bp-mega__label {
  margin: 0 0 8px 14px;
  font-size: 13px; line-height: 1.3; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6b6c75;
}
.bp-mega__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px;
}
.bp-mega__link {
  display: block; height: 100%; box-sizing: border-box;
  padding: 13px 14px; border-radius: 16px; color: #1b1c2e;
  transition: background-color .2s, border-color .2s;
}
.bp-mega__link:hover { background: #fff4f0; color: #1b1c2e; }
.bp-mega__t { display: block; font-size: 16px; line-height: 1.3; font-weight: 600; }
.bp-mega__d { display: block; margin-top: 3px; font-size: 14px; line-height: 1.4; color: #5e5f69; }
.bp-mega__list--cards { gap: 16px; }
.bp-mega__list--cards .bp-mega__link { padding: 22px 24px; border: 1px solid #f0e3de; border-radius: 20px; }
.bp-mega__list--cards .bp-mega__link:hover { border-color: #ffd2c2; }
.bp-mega__list--cards .bp-mega__t { font-size: 17px; line-height: 1.35; }
.bp-mega__list--cards .bp-mega__d { margin-top: 6px; line-height: 1.45; }
.bp-mega__all { display: inline-block; margin: 14px 0 0 14px; }

.bp-card { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 20px; box-sizing: border-box; }
.bp-card--soft { background: #ffede6; }
.bp-card--line { border: 1px solid #f0e3de; gap: 14px; }
.bp-card__t { font-size: 19px; line-height: 1.3; font-weight: 600; }
.bp-card__d { margin: 0; font-size: 15px; line-height: 1.5; color: #4a4b57; }

.bp-more {
  align-self: flex-start;
  padding: 0 0 2px; border: 0; border-bottom: 1px solid #ffa684; background: none;
  font: inherit; font-size: 15px; line-height: 1.4; font-weight: 500; color: #1b1c2e;
  cursor: pointer; text-align: left;
}
.bp-more:hover { color: #b5461a; }

/* --- кнопка --- */
.bp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 56px; padding: 0 22px; box-sizing: border-box;
  border: 0; border-radius: 57px; background: #ffa684; color: #1b1c2e;
  font: inherit; font-size: 15px; line-height: 1.2; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: background-color .2s;
}
.bp-btn:hover { background: #ffb89e; color: #1b1c2e; }
.bp-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bp-btn--sm { align-self: flex-start; min-height: 48px; padding: 0 26px; }

/* --- правая часть: мессенджеры, телефоны, звонок --- */
.bp-hdr__right { display: flex; align-items: center; gap: 10px; flex: none; }
.bp-hdr__social, .bp-pop__soc { display: flex; align-items: center; gap: 6px; }
.bp-soc {
  width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff4f0;
  display: flex; align-items: center; justify-content: center; transition: background-color .2s;
}
.bp-soc:hover { background: #ffede6; }
.bp-soc img { display: block; width: 22px; height: 22px; }

.bp-hdr__phones { display: flex; align-items: center; gap: 2px; }
.bp-hdr__nums { display: flex; flex-direction: column; line-height: 1.15; }
.bp-hdr__tel { font-size: 17px; font-weight: 600; color: #1b1c2e; white-space: nowrap; }
.bp-hdr__tel2 { margin-top: 3px; font-size: 13px; font-weight: 500; color: #5e5f69; white-space: nowrap; }
.bp-hdr__tel:hover, .bp-hdr__tel2:hover { color: #b5461a; }
.bp-hdr__more {
  width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .2s;
}
.bp-hdr__more:hover { background: #fff4f0; }
.bp-hdr__more[aria-expanded="true"] { background: #ffede6; }

.bp-hdr__call-ico, .bp-hdr__burger { display: none; }

/* --- окно «часы, адрес, почта» --- */
.bp-pop {
  position: absolute; right: 190px; top: calc(100% + 12px); z-index: 30;
  width: 350px; box-sizing: border-box; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-radius: 24px; box-shadow: 0 24px 48px rgba(27, 28, 46, .16);
}
.bp-pop__row { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; color: #33343f; }
.bp-pop__row svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: #1b1c2e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bp-pop__mail { font-weight: 500; color: #1b1c2e; }
.bp-pop__mail:hover { color: #b5461a; }

.bp-nav__contacts { display: none; }

/* розовая полоса под капсулой на главной (первый экран розовый) */
body:has(.hero) .page { background: #fff linear-gradient(#ffede6, #ffede6) no-repeat 0 0 / 100% 140px; }

/* при переходе к разделу заголовок не прячется под шапкой */
#about, #services, #calc, #how, #contacts, #besplatnaya-konsultaciya { scroll-margin-top: 100px; }

body.bp-lock { overflow: hidden; }

/* не помещаются иконки мессенджеров — они остаются в окне «часы, адрес, почта» */
@media (max-width: 1319px) {
  .bp-hdr__social { display: none; }
}

/* ===== Планшет и телефон: меню в выезжающей панели ===== */
@media (max-width: 1230px) {
  .header.bp-hdr { top: 8px; }
  .bp-hdr__wrap { padding: 0 8px; }
  /* размытие фона отключаем: иначе выезжающее меню (position: fixed) сжимается до высоты капсулы */
  .bp-hdr__bar { min-height: 60px; padding: 0 8px 0 18px; border-radius: 30px; -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .bp-hdr__logo img { width: 124px; }

  .bp-hdr__more, .bp-pop, .bp-hdr__tel2 { display: none !important; }
  .bp-hdr__burger {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%;
    background: #fff4f0; cursor: pointer;
  }
  .bp-hdr__burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #1b1c2e; transition: transform .2s, opacity .2s; }
  .bp-hdr.is-open .bp-hdr__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .bp-hdr.is-open .bp-hdr__burger span:nth-child(2) { opacity: 0; }
  .bp-hdr.is-open .bp-hdr__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .bp-hdr__cta { min-height: 48px; padding: 0 18px; }

  .bp-nav {
    display: none;
    position: fixed; top: 76px; left: 8px; right: 8px; bottom: 8px; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 12px 20px; box-sizing: border-box;
    background: #fff; border-radius: 24px; box-shadow: 0 24px 48px rgba(27, 28, 46, .18);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .bp-hdr.is-open .bp-nav { display: flex; }
  .bp-nav__btn, .bp-nav__link {
    width: 100%; justify-content: space-between;
    min-height: 52px; padding: 0 14px; border-radius: 16px;
    font-size: 17px; font-weight: 600;
  }
  .bp-chev { width: 18px; height: 18px; }

  .bp-mega { position: static; box-shadow: none; border-radius: 0; max-height: none; overflow: visible; }
  .bp-mega__inner { flex-direction: column; flex-wrap: nowrap; gap: 12px; padding: 4px 0 14px; }
  .bp-mega__main, .bp-mega__aside { flex: none; }
  .bp-mega__list { grid-template-columns: minmax(0, 1fr); }
  .bp-mega__list--cards { gap: 8px; }
  .bp-mega__list--cards .bp-mega__link { padding: 14px 16px; border-radius: 16px; }
  .bp-mega__all { margin-top: 10px; }
  .bp-card { padding: 18px; border-radius: 16px; }
  .bp-card__t { font-size: 17px; }

  .bp-nav__contacts {
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    margin-top: 12px; padding: 20px 14px 4px; border-top: 1px solid #f0e3de;
  }
  .bp-nav__phone { font-size: 20px; line-height: 1.25; font-weight: 600; color: #1b1c2e; }
  .bp-nav__soc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
  .bp-nav__soc-link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
    border-radius: 22px; background: #fff4f0; color: #1b1c2e; font-size: 15px; font-weight: 500;
  }
  .bp-nav__soc-link img { display: block; width: 22px; height: 22px; }
  .bp-nav__contacts .bp-btn { align-self: stretch; margin-top: 6px; }
}

@media (max-width: 767px) {
  .bp-hdr__phones, .bp-hdr__cta { display: none; }
  .bp-hdr__call-ico {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: none; border-radius: 50%; background: #ffa684; color: #1b1c2e;
  }
  .bp-hdr__call-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bp-hdr__right { gap: 6px; }
  .bp-hdr__logo img { width: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  .bp-hdr *, .bp-hdr *::before, .bp-hdr *::after { transition: none !important; }
}
