/* Шапка, навигация, липкая панель, подвал.
   Три находки аудита закрываются именно здесь: кликабельный телефон,
   бургер на мобильных (раньше было видно 4 пункта меню из 8) и
   постоянно доступное действие «записаться». */

/* ─────────────────────────  Шапка  ───────────────────────── */

.topbar {
  background: var(--deep);
  color: var(--on-deep);
  font-size: 14px;
}
.topbar__in {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 40px;
  flex-wrap: wrap;
}
.topbar a { color: var(--on-deep); }
.topbar a:hover { color: #fff; }
.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.topbar__item svg { width: 15px; height: 15px; opacity: .8; }
.topbar__spacer { margin-left: auto; }

/* Переключатель темы — иконка без подписи, поэтому размер задаём явно:
   в аудите старого сайта 26 элементов были мельче 44 px. */
.topbar__toggle {
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.topbar__toggle svg { width: 17px; height: 17px; }

@media (max-width: 860px) {
  .topbar__in { min-height: 0; padding-block: 7px; }
  .topbar__hide-sm { display: none; }
}

.header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.header__in {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: var(--header-h);
  /* Шапке даём больше ширины, чем колонке контента: логотип, меню,
     телефон и кнопка записи в 1200 px не помещались, и кнопка уезжала
     за край экрана. */
  max-width: 1400px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.logo__mark { width: 38px; height: 38px; flex: none; }
.logo__name {
  font: 700 20px/1 var(--sans);
  letter-spacing: -.02em;
}
.logo__sub {
  display: block;
  font: 400 11px/1.3 var(--text);
  color: var(--muted);
  letter-spacing: .01em;
  margin-top: 3px;
}

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: 500 15px/1.2 var(--sans);
  text-decoration: none;
  /* пункт не должен переноситься на две строки: это ломает высоту шапки */
  white-space: nowrap;
}
.nav__link:hover { background: var(--sunken); color: var(--ink); }
.nav__link[aria-current='page'] {
  color: var(--brand-ink);
  box-shadow: inset 0 -2px 0 var(--brand);
}
.nav__link svg { width: 14px; height: 14px; opacity: .55; }

/* выпадающее подменю */
.nav__item { position: relative; }
.nav__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 264px;
  padding: var(--s2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  margin: 0;
  display: none;
  z-index: 95;
}
.nav__item:hover > .nav__panel,
.nav__item:focus-within > .nav__panel { display: block; }
.nav__panel a {
  display: block;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
}
.nav__panel a:hover { background: var(--brand-wash); color: var(--brand-dark); }

.header__cta { display: flex; align-items: center; gap: var(--s2); flex: none; }

.header__phone {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--sans);
}
.header__phone b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.header__phone span { font-size: 12px; color: var(--muted); font-weight: 400; }

.burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
}
.burger svg { width: 22px; height: 22px; }
.burger__close { display: none; }
.burger[aria-expanded='true'] .burger__open { display: none; }
.burger[aria-expanded='true'] .burger__close { display: block; }

@media (max-width: 1400px) {
  .nav__link { padding: 0 9px; font-size: 14.5px; }
  .header__in { gap: var(--s3); }
}
@media (max-width: 1240px) {
  .nav__link { padding: 0 7px; font-size: 14px; }
  .header__phone b { font-size: 15.5px; }
}
@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .header__in { gap: var(--s3); }
  .header__phone { margin-left: auto; }
  .header__cta .btn { display: none; }
}
@media (max-width: 560px) {
  .header__phone b { font-size: 15px; }
  .header__phone span { display: none; }
  .logo__sub { display: none; }
}

/* ─────────────────────────  Мобильное меню  ───────────────────────── */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}
.drawer[open] { display: block; }
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 30, 38, .55);
  border: 0;
  width: 100%;
  cursor: pointer;
}
.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 88vw);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: var(--s3) var(--s3) calc(var(--s6) + env(safe-area-inset-bottom));
  animation: drawer-in .22s ease;
}
@keyframes drawer-in {
  from { transform: translateX(14px); opacity: .4; }
  to { transform: none; opacity: 1; }
}
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--s3);
}
.drawer__title { font: 700 17px/1 var(--sans); margin: 0; }

.drawer details { border-bottom: 1px solid var(--line-soft); }
.drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 50px;
  padding: 6px 4px;
  font: 600 16px/1.3 var(--sans);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary svg { width: 18px; height: 18px; color: var(--muted); transition: transform .2s ease; }
.drawer details[open] summary svg { transform: rotate(180deg); }
.drawer__sub { list-style: none; margin: 0; padding: 0 0 var(--s2); }
.drawer__sub a,
.drawer__flat {
  display: block;
  min-height: 46px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15.5px;
  line-height: 1.35;
}
.drawer__sub a:hover,
.drawer__flat:hover { background: var(--brand-wash); color: var(--brand-dark); }
.drawer__flat {
  font: 600 16px/1.3 var(--sans);
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  min-height: 50px;
  padding: 14px 4px;
}
.drawer__actions { display: grid; gap: var(--s2); margin-top: var(--s4); }

/* ─────────────────────  Липкая панель действий  ───────────────────── */

/* Главное следствие аудита: с любого экрана доступны звонок и запись.
   Раньше кнопка «Онлайн запись» на мобильном перекрывалась плашкой
   «версия для слабовидящих». */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.actionbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--bar-h);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font: 600 12px/1.1 var(--sans);
}
.actionbar a svg { width: 21px; height: 21px; }
.actionbar .is-go { background: var(--go); color: var(--on-go); }
.actionbar .is-call { color: var(--brand-ink); }

@media (max-width: 1100px) {
  .actionbar { display: grid; }
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
}

/* ─────────────────────────  Хлебные крошки  ───────────────────────── */

/* На старом сайте все 795 адресов лежали в корне без всякой навигации
   по уровням. Адреса мы не трогаем, но путь показываем. */
.crumbs {
  padding: var(--s3) 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before {
  content: '';
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--line-strong);
  border-top: 1.5px solid var(--line-strong);
  transform: rotate(45deg);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }
.crumbs [aria-current='page'] { color: var(--ink-soft); }

/* ─────────────────────────  Подвал  ───────────────────────── */

.footer {
  margin-top: var(--s7);
  background: var(--deep);
  color: var(--on-deep);
  font-size: 15px;
}
[data-theme='dark'] .footer { border-top: 1px solid var(--line); }

.footer a { color: var(--on-deep); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s5) var(--s4);
  padding: var(--s6) 0 var(--s5);
}
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; gap: var(--s4); } }

.footer h3 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--s3);
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer li a {
  display: block;
  padding: 7px 0;
  min-height: 34px;
  line-height: 1.4;
}

.footer__contact { display: grid; gap: var(--s3); }
.footer__phone {
  display: block;
  font: 700 22px/1.15 var(--sans);
  color: #fff;
  letter-spacing: -.01em;
}
.footer__phone:hover { color: #fff; }

.footer__social { display: flex; gap: var(--s2); flex-wrap: wrap; }
.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius-sm);
}
.footer__social a:hover { background: rgba(255, 255, 255, .12); }
.footer__social svg { width: 21px; height: 21px; }

.footer__legal {
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding: var(--s4) 0 calc(var(--s5) + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--on-deep-soft);
  display: grid;
  gap: var(--s2);
}
@media (max-width: 1100px) {
  .footer__legal { padding-bottom: calc(var(--bar-h) + var(--s5)); }
}
