/* Прайм — шапка, мегаменю, мобильное меню и панель, подвал, модалка, куки, «Наверх» */

/* ─── Шапка ─── */
.site-header {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-ink);
}
.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: calc(var(--header-h) - 1px);
  padding: 0 var(--gutter);
}
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--c-ink);
  text-decoration: none;
}
.site-logo:hover { color: var(--c-ink); }

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: none;
  border: 0;
  font-family: var(--f-text);
  font-size: 15px;
  color: var(--c-ink);
  text-decoration: none;
  text-underline-offset: 6px;
  white-space: nowrap;
}
.site-nav .nav-link:hover,
.site-nav .nav-item.active > .nav-link,
.site-nav .mega-toggle[aria-expanded="true"] {
  color: var(--c-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.mega-toggle .bi {
  font-size: 11px;
  transition: transform .15s;
}
.mega-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.header-msg-group {
  display: flex;
  gap: 8px;
}
.header-msg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  color: var(--c-ink);
  transition: border-color .15s;
}
.header-msg:hover { border-color: var(--c-ink); color: var(--c-ink); }
.header-phone {
  font-size: 16px;
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; }
.btn-header-cta {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  white-space: nowrap;
}

/* ─── Мегаменю (десктоп) ─── */
.menu-mega { position: static; }
.mega {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 1px);
  padding: 40px var(--gutter) 32px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 24px 48px rgba(20, 22, 25, .12);
}
.menu-mega.is-open > .mega { display: block; }
.mega__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.mega__col-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-label);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.mega__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mega__list a {
  display: block;
  padding: 6px 0;
  font-size: 16px;
  color: var(--c-ink);
  text-decoration: none;
  text-underline-offset: 4px;
}
.mega__list a:hover { color: var(--c-ink); text-decoration: underline; }
.mega__more,
.mega__all a {
  display: inline-block;
  font-weight: 500;
  color: var(--c-accent);
  text-decoration: none;
}
.mega__more { margin-top: 16px; }
.mega__more:hover,
.mega__all a:hover { color: var(--c-accent-hover); }
.mega__all {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--c-line);
}

/* Узкий десктоп: всё в одну строку */
@media (min-width: 992px) and (max-width: 1279.98px) {
  .site-header__inner { gap: 24px; }
  .site-nav__list { gap: 20px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .header-msg-group--desktop,
  .site-logo span { display: none; }
}

/* ─── Мобильная шапка и меню ─── */
.site-burger {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--c-line);
  border-radius: 50%;
}
.site-burger span,
.site-burger span::before,
.site-burger span::after {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 1.5px;
  margin-left: -9px;
  background: var(--c-ink);
  transition: transform .2s, opacity .2s;
}
.site-burger span { top: 50%; }
.site-burger span::before,
.site-burger span::after { content: ""; left: 0; margin-left: 0; }
.site-burger span::before { top: -6px; }
.site-burger span::after { top: 6px; }
.site-burger[aria-expanded="true"] span { background: transparent; }
.site-burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.site-burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 991.98px) {
  .site-header__inner { justify-content: space-between; gap: 16px; }
  .site-header__actions { display: none; }
  .site-logo { font-size: 20px; }

  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px var(--sec-pad-x) calc(var(--mobile-bar-h) + 24px);
    background: var(--c-bg);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .site-header.is-menu-open .site-nav { display: flex; }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav .nav-item { border-bottom: 1px solid var(--c-line); }
  .site-nav .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 500;
  }
  .site-nav .nav-link:hover,
  .site-nav .mega-toggle[aria-expanded="true"] { text-decoration: none; }

  .mega {
    position: static;
    padding: 0 0 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .mega__cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .mega__col-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 0 10px 16px;
    background: none;
    border: 0;
    font-size: 16px;
    color: var(--c-text-2);
    text-align: left;
  }
  .mega__col-toggle .bi { font-size: 11px; transition: transform .15s; }
  .mega__col-toggle[aria-expanded="true"] .bi { transform: rotate(180deg); }
  .mega__col-body { display: none; padding: 0 0 8px 32px; }
  .mega__col.is-open .mega__col-body { display: block; }
  .mega__list a { padding: 8px 0; color: var(--c-text-2); }
  .mega__more { margin-top: 8px; }
  .mega__all { margin: 8px 0 0 16px; padding-top: 12px; }

  .site-nav__contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
  }
  .site-nav__phone {
    font-size: 22px;
    font-weight: 500;
    color: var(--c-ink);
    text-decoration: none;
  }

  html.menu-open { overflow: hidden; }

  /* Липкая нижняя панель */
  body { padding-bottom: var(--mobile-bar-h); }
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1035;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--mobile-bar-h);
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--c-bg);
    border-top: 1px solid var(--c-ink);
  }
  .mobile-bar__phone {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 500;
    color: var(--c-ink);
    text-decoration: none;
    white-space: nowrap;
  }
  .mobile-bar__cta {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 15px;
    white-space: nowrap;
  }
}

/* ─── Подвал ─── */
.site-footer {
  padding: 64px var(--gutter) 40px;
  background: var(--c-ink);
  color: var(--c-dark-muted);
  font-size: 14px;
}
.site-footer a {
  color: var(--c-dark-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--c-bg); }
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.site-footer__brand,
.site-footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.site-footer__brand p { margin: 0; }
.site-logo--footer,
.site-logo--footer:hover {
  font-size: 20px;
  color: var(--c-bg);
}
.site-footer__title {
  font-weight: 500;
  color: var(--c-bg);
}
.site-footer .site-footer__phone { color: var(--c-bg); }
.site-footer__msg a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.site-footer__msg .icon { color: var(--c-bg); }
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--c-dark-line);
  font-size: 13px;
}
@media (max-width: 900px) {
  .site-footer { padding: 48px var(--gutter) 32px; }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* ─── Модалка «Обсудить проект» ─── */
#auditModal .modal-content { background: var(--c-bg); }
#auditModal .modal-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.01em;
}
#auditModal .modal-body > p { color: var(--c-text-2) !important; }
#auditModal .modal-messengers .header-msg { opacity: 1; } /* значки как в шапке, без приглушения из service.css */

/* ─── Куки-баннер ─── */
.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1050;
  max-width: 880px;
  margin: 0 auto;
  background: var(--c-surface);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 22, 25, .08);
  font-size: 14px;
}
.cookie-notice a { color: var(--c-ink); text-decoration: underline; }
.cookie-notice a:hover { color: var(--c-accent); }
.btn-cookie { min-height: 44px; padding: 8px 20px; font-size: 15px; }

/* ─── Кнопка «Наверх» ─── */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1040;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--c-ink);
  color: var(--c-bg);
  border: 0;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background .15s;
}
.scroll-top:hover { background: var(--c-ink-hover); }
.scroll-top { box-shadow: 0 0 0 1px rgba(250, 250, 247, .3); }
.cookie-notice[style*="block"] ~ .scroll-top { bottom: 120px; }

@media (max-width: 991.98px) {
  .cookie-notice { bottom: calc(var(--mobile-bar-h) + 12px); }
  .scroll-top { right: 16px; bottom: calc(var(--mobile-bar-h) + 16px); }
  .cookie-notice[style*="block"] ~ .scroll-top { bottom: calc(var(--mobile-bar-h) + 200px); }
}
