/* =============================================================================
   ND SHELL — новая CSS-база (шапка + футер), общая для всех страниц сайта.

   ВАЖНО: этот файл НЕ использует rem. Старый сайт задаёт
   html { font-size: calc(100vw / 1920 * 10) } в styledent.css, поэтому любой rem
   на сайте «плавает» вместе с шириной вьюпорта. Новый дизайн свёрстан в px,
   поэтому он полностью независим от этой базы и не ломает старые страницы.

   Все правила заскоуплены под .nd — старые стили (style.css / styledent.css)
   внутрь этого скоупа не протекают, а новые не протекают наружу.
   ========================================================================== */

/* ---------- Onest (self-hosted, без Google Fonts) --------------------------
   Старый сайт подключает Onest как отдельные семейства (OnestBold, OnestRegular…).
   Новому дизайну нужно одно семейство с весами 400–800, поэтому объявляем его
   заново поверх тех же самых файлов шрифтов.                                */
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestLight1602-hint.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestRegular1602-hint.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestMedium1602-hint.woff") format("woff");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestBold1602-hint.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestExtraBold1602-hint.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "NdOnest";
  src: url("/fonts/OnestBlack1602-hint.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- токены + сброс внутри скоупа ---------------------------------- */
.nd {
  --nd-max: 1280px;
  --nd-pad: clamp(20px, 5vw, 40px);

  --nd-bg: #eaf1f5;
  --nd-surface: #ffffff;
  --nd-soft: #f4f8fa;
  --nd-soft-cyan: #e4f4f5;
  --nd-soft-violet: #ecebf6;

  --nd-cyan: #3ec4cd;
  --nd-cyan-600: #2fb0b8;
  --nd-cyan-700: #2caab0;
  --nd-violet: #7175b7;

  --nd-ink: #1c3448;
  --nd-ink-2: #223b4d;
  --nd-text: #2d3748;
  --nd-muted: #51617a;
  --nd-muted-2: #5a6b78;
  --nd-grey: #7c8896;

  --nd-line: rgba(45, 55, 72, 0.14);
  --nd-line-soft: rgba(45, 55, 72, 0.08);

  --nd-shadow: 0 6px 18px rgba(28, 52, 72, 0.06);
  --nd-shadow-lg: 0 12px 28px rgba(62, 196, 205, 0.36);

  --nd-r-lg: 28px;
  --nd-r-md: 22px;
  --nd-r-sm: 16px;
  --nd-r-pill: 999px;

  font-family: "NdOnest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--nd-text);
  -webkit-font-smoothing: antialiased;
}

/* на страницах старого дизайна контент шире 1280px — тянем шапку/футер
   до той же ширины, что и у старой сетки (177.6rem ≈ 92.5vw / 69.6rem ≈ 90.6vw) */
html.nd-legacy .nd {
  --nd-max: 92.5vw;
}
@media (max-width: 991.98px) {
  html.nd-legacy .nd {
    --nd-max: 90.6vw;
  }
}

.nd,
.nd *,
.nd *::before,
.nd *::after {
  box-sizing: border-box;
}

/* Сброс намеренно написан через :where() — селектор весит как один класс,
   поэтому он гасит element-правила старого CSS (h1{}, p,li{} в styledent.css),
   но НЕ перебивает классы самого нового дизайна (.nd-h2, .nd-lead и т.д.). */
.nd :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dd) {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-weight: inherit;
  color: inherit;
}

.nd :where(ul, ol) {
  list-style: none;
}

.nd :where(a) {
  color: inherit;
  text-decoration: none;
}

.nd :where(img) {
  display: block;
  max-width: 100%;
}

.nd :where(button, input, select, textarea) {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.nd [hidden] {
  display: none !important;
}

.nd ::selection {
  background: var(--nd-cyan);
  color: #fff;
}

/* ---------- общие элементы ------------------------------------------------ */
.nd-shell {
  width: 100%;
  max-width: var(--nd-max);
  margin: 0 auto;
}

.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: var(--nd-r-pill);
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nd-btn--cyan {
  background-color: var(--nd-cyan);
  color: #fff;
}
.nd-btn--cyan:hover {
  background-color: var(--nd-cyan-700);
  color: #fff;
}

.nd-btn--white {
  background: #fff;
  color: var(--nd-ink);
}
.nd-btn--white:hover {
  background: var(--nd-soft);
  color: var(--nd-ink);
}

.nd-btn--sm {
  font-size: 13.5px;
  padding: 9px 18px;
}
.nd-btn--md {
  font-size: 15px;
  padding: 13px 24px;
}
.nd-btn--lg {
  font-size: 17px;
  padding: 17px 34px;
}

/* контурные «таблетки» шапки */
.nd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--nd-r-pill);
  border: 1.5px solid currentColor;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 13px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nd-pill--cyan {
  color: var(--nd-cyan-700);
}
.nd-pill--cyan:hover {
  background: var(--nd-soft-cyan);
}
.nd-pill--violet {
  color: var(--nd-violet);
}
.nd-pill--violet:hover {
  background: var(--nd-soft-violet);
}
.nd-pill--ink {
  color: var(--nd-ink-2);
}
.nd-pill--ink:hover {
  background: var(--nd-soft);
}
.nd-pill img {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

/* =============================================================================
   ШАПКА
   ========================================================================== */
.nd-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: transparent;
}

/* на старых страницах сохраняем отступ, который давала прежняя шапка
   (.style2 { margin-bottom: 2rem }) — иначе rem-контент прилипает к шапке */
html.nd-legacy .nd-header {
  margin-bottom: 20px;
}

.nd-header__inner {
  width: 100%;
  max-width: var(--nd-max);
  margin: 0 auto;
  background: var(--nd-surface);
  box-shadow: 0 4px 20px rgba(28, 52, 72, 0.06);
  border-radius: 0 0 var(--nd-r-lg) var(--nd-r-lg);
  overflow: hidden;
}

/* --- десктоп --- */
.nd-header__desk {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  flex-wrap: nowrap;
  padding: 14px var(--nd-pad) 12px;
}

.nd-header__logo {
  flex: 0 0 auto;
  align-self: center;
}
.nd-header__logo img {
  height: 74px;
  width: auto;
}

.nd-header__right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* переносим строку, если на узком десктопе (1180–1340px) всё не помещается */
.nd-header__toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.nd-header__pills,
.nd-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.nd-header__pills {
  gap: 8px;
}
.nd-header__actions {
  gap: 12px;
}

.nd-icon-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  border-radius: 50%;
  background: var(--nd-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.2s ease;
}
.nd-icon-btn:hover {
  background: var(--nd-soft-cyan);
}

.nd-header__phone {
  color: var(--nd-ink-2);
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
}

.nd-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  row-gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nd-grey);
  border-top: 1px solid rgba(45, 55, 72, 0.06);
  padding-top: 10px;
}
.nd-header__nav a {
  white-space: nowrap;
  flex: 0 0 auto;
  transition: color 0.2s ease;
}
.nd-header__nav a:hover {
  color: var(--nd-cyan-700);
}
.nd-header__nav .nd-header__loyalty {
  color: var(--nd-violet);
  font-weight: 800;
}

/* --- мобильная шапка --- */
.nd-header__mob {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px var(--nd-pad);
}
.nd-header__mob .nd-header__logo img {
  height: 40px;
}
.nd-header__mob-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nd-header__mob .nd-header__phone {
  font-size: 14.5px;
}

.nd-burger {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--nd-line);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--nd-ink);
  padding: 0;
}

.nd-menu {
  border-top: 1px solid var(--nd-line-soft);
  padding: 16px var(--nd-pad) 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nd-menu__row {
  display: flex;
  gap: 10px;
}
.nd-menu__row > * {
  flex: 1;
}
.nd-menu__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 13.5px;
  padding: 10px 8px;
  border-radius: var(--nd-r-pill);
}
.nd-menu__chip--cyan {
  color: var(--nd-cyan-700);
  background: var(--nd-soft-cyan);
}
.nd-menu__chip--violet {
  color: var(--nd-violet);
  background: var(--nd-soft-violet);
}
.nd-menu__chip--ghost {
  border: 1px solid var(--nd-line);
  background: #fff;
  color: #3a4756;
  font-weight: 600;
  cursor: pointer;
}
.nd-menu__sep {
  height: 1px;
  background: var(--nd-line-soft);
  margin: 6px 0;
}
.nd-menu__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nd-menu__links a {
  color: #3a4756;
  font-size: 14.5px;
  font-weight: 600;
  padding: 6px 0;
}
.nd-menu__max {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--nd-cyan-700);
  border: 1.5px solid var(--nd-cyan-700);
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--nd-r-pill);
}
.nd-menu__max img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.nd-menu .nd-btn {
  width: 100%;
  font-size: 15px;
  padding: 13px 20px;
}

/* узкий десктоп: поджимаем логотип и отступы, чтобы шапка осталась в одну строку */
@media (max-width: 1360px) {
  .nd-header__desk {
    gap: 20px;
  }
  .nd-header__logo img {
    height: 62px;
  }
  .nd-header__actions {
    gap: 10px;
  }
  .nd-header__nav {
    column-gap: 16px;
  }
}

@media (max-width: 1180px) {
  .nd-header__desk {
    display: none;
  }
  .nd-header__mob {
    display: flex;
  }
}

/* =============================================================================
   ФУТЕР
   ========================================================================== */
.nd-footer {
  color: rgba(255, 255, 255, 0.75);
  background-color: #313131;
}

.nd-footer__top {
  width: 100%;
  max-width: var(--nd-max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 48px) var(--nd-pad);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.nd-footer__logo {
  height: 42px;
  width: auto;
  margin-bottom: 16px;
}

.nd-footer__about {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.nd-footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
}
.nd-footer__contacts a {
  color: rgba(255, 255, 255, 0.75);
}
.nd-footer__contacts a:hover {
  color: #8fd3d8;
}

.nd-footer__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fd3d8;
  margin-bottom: 14px;
}

.nd-footer__links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
}
.nd-footer__links a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s ease;
}
.nd-footer__links a:hover {
  color: #fff;
}

.nd-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.nd-footer__social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.nd-footer__social a:hover {
  background: rgba(255, 255, 255, 0.18);
}
.nd-footer__social img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.nd-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.nd-footer__bottom-in {
  width: 100%;
  max-width: var(--nd-max);
  margin: 0 auto;
  padding: 18px var(--nd-pad);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}
.nd-footer__bottom-in p + p {
  margin-top: 4px;
}
