/* _header-overrides.css
 * Стили шапки. Скоупим всё через #heading, чтобы перебить main2024.css
 * по специфичности и НЕ задеть другие места.
 * Не используем: position:sticky, backdrop-filter, overflow-x:auto
 * на nav-bar — это создавало проблемы с dropdown'ами в прошлой версии. */

/* === Логотип SERVICE D. (текст вместо PNG-картинки) === */
.nav#heading .top-bar .logo.logo-text {
  background: none !important;        /* убираем PNG из main2024.css */
  width: auto !important;
  height: auto !important;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  padding: 0;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-family: var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
}
.nav#heading .logo.logo-text .logo__dim {
  font-weight: 600;
  color: var(--muted-2);
}
.nav#heading .logo.logo-text .logo__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 4px;
  align-self: flex-end;
  margin-bottom: 3px;
}

/* === Город с pin + caret иконками === */
.nav#heading .city-tip.hdr-city {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 0;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.nav#heading .city-tip.hdr-city:hover {
  background: var(--surface);
  color: var(--ink);
}
.nav#heading .city-tip.hdr-city svg { flex-shrink: 0; }
.nav#heading .city-tip.hdr-city .hdr-city__caret { opacity: 0.55; }

/* === Войти с user-иконкой === */
.nav#heading .enter-tip.hdr-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--font-sans);
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
  height: auto;
  line-height: 1;
}
.nav#heading .enter-tip.hdr-login:hover {
  background: var(--surface-2);
  border-color: #d6d4cd;
  color: var(--ink);
}
.nav#heading .enter-tip.hdr-login svg { flex-shrink: 0; }

/* === Top-bar layout: logo - tg - [spacer] - search - city - login === */
.nav#heading .top-bar .container.d-flex {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}
.nav#heading .hdr-spacer { flex: 1; order: 3; }

/* Принудительный порядок элементов в шапке.
   city-tip объявлен в HTML до if-блока menuType (общий для всех ролей),
   поэтому в DOM он стоит вторым после логотипа. Через flex order
   ставим его на нужную позицию между search и login. */
.nav#heading .top-bar .container.d-flex .logo       { order: 1; }
.nav#heading .top-bar .container.d-flex .hdr-tg     { order: 2; }
.nav#heading .top-bar .container.d-flex .hdr-search { order: 4; }
.nav#heading .top-bar .container.d-flex .city-tip   { order: 5; }
.nav#heading .top-bar .container.d-flex .admin-panel{ order: 6; }
.nav#heading .top-bar .container.d-flex .menu-icon  { order: 7; }

/* === Telegram pill === */
.nav#heading .hdr-tg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
  white-space: nowrap;
  height: auto;
  line-height: 1;
}
.nav#heading .hdr-tg:hover {
  background: var(--surface-2);
  border-color: #d6d4cd;
  color: var(--ink);
}
.nav#heading .hdr-tg svg { color: var(--tg); flex-shrink: 0; }

/* === Поиск === */
.nav#heading .hdr-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 280px;
  max-width: 420px;
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-sans);
  margin: 0;
  transition: border-color .15s ease;
}
.nav#heading .hdr-search:focus-within { border-color: var(--ink); }
.nav#heading .hdr-search svg { color: var(--muted); flex-shrink: 0; }
.nav#heading .hdr-search input {
  border: 0;
  background: transparent;
  outline: 0;
  flex: 1;
  color: var(--ink);
  font: inherit;
  min-width: 0;
}
.nav#heading .hdr-search input::placeholder { color: var(--muted); }

/* === Категории навигации как pill-плитки (nav-bar > menu-item > a) === */
.nav#heading .nav-bar {
  background: transparent;
  border-top: 1px solid var(--line-2);
  padding: 0;
  margin-top: 0;
}
.nav#heading .nav-bar .container.d-flex {
  display: flex;
  padding: 6px 28px 8px;
  max-width: 1320px;
  margin: 0 auto;
}
.nav#heading .nav-bar .menu.d-flex {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav#heading .nav-bar .menu > .menu-item {
  list-style: none;
  position: relative;
}
.nav#heading .nav-bar .menu > .menu-item > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
  height: auto;
  line-height: 1.2;
  border: 0;
  background: transparent;
}
.nav#heading .nav-bar .menu > .menu-item > a:hover {
  background: var(--surface);
  color: var(--ink);
}
/* caret уже добавлен main2024.css через .menu-item-has-children::after с
   arrow-down.svg — не добавляем свой, а лишь чуть «утяжеляем» его opacity
   для лучшей читаемости на pill-фоне */
.nav#heading .nav-bar .menu > .menu-item-has-children::after {
  opacity: 0.45;
  margin-left: 4px;
}
/* «+ Добавить центр» — жёлтая акцентная справа */
.nav#heading .nav-bar .menu-item--add {
  margin-left: auto;
}
.nav#heading .nav-bar .menu-item--add > a {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.nav#heading .nav-bar .menu-item--add > a:hover {
  background: #ffc935;
  color: var(--accent-ink);
}

/* === На мобиле прячем search и tg-label === */
@media (max-width: 1023px) {
  .nav#heading .hdr-tg .hdr-tg__label,
  .nav#heading .hdr-search,
  .nav#heading .nav-bar .menu-item--add { display: none; }
}
