/* Local integration stylesheet; keep identical to _parts/_megamenu.scss. */
/* Megamenu dev2: шапка (7 пунктов), 3-колоночные панели, мобильный drawer. */
.nm-nav {
  --nm-blue: var(--primary-color, #1c6efe);
  --nm-ink: var(--main-text-color, #3a3939);
  --nm-muted: #70747d;
  --nm-line: rgba(58, 57, 57, .13);
  --nm-wash: #f5f7fb;
  --nm-soft: #eef3ff;
  display: flex;
  align-items: center;
  margin-left: auto;
  color: var(--nm-ink);
  font-family: var(--font, Montserrat, sans-serif);
}

.nm-nav *,
.nm-nav *::before,
.nm-nav *::after,
.nm-burger,
.nm-burger * {
  box-sizing: border-box;
}

.nm-nav [hidden],
.nm-burger[hidden] {
  display: none !important;
}

.nm-nav a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.nm-nav button {
  margin: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.nm-nav :is(a, button):focus-visible,
.nm-burger:focus-visible {
  outline: 2px solid var(--nm-blue, #1c6efe);
  outline-offset: 2px;
}

.nm-drawer {
  display: block;
}

.nm-drawer-bar {
  display: none;
}

.nm-root {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nm-root__item {
  display: flex;
}

.nm-root__button,
.nm-root__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.nm-root__button[aria-expanded="true"],
.nm-root__button[aria-expanded="true"]:hover,
.nm-root__link:hover,
.nm-root__link[aria-current="page"] {
  color: var(--nm-blue);
}

.nm-root__button[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nm-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: var(--nm-panel-h, auto);
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 24px 32px 22px;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 26px 60px rgba(14, 34, 98, .14);
}

.nm-panel__all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nm-panel__close {
  position: absolute;
  top: 18px;
  right: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--nm-line);
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.nm-panel__close:hover {
  color: var(--nm-blue);
  border-color: var(--nm-blue);
}

.nm-panel__cols {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.05fr) minmax(0, 1.05fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px 28px;
  flex: 1 1 auto;
  align-items: start;
  min-height: 0;
  overflow: hidden;
}

.nm-panel__col {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.nm-panel__col_promo {
  align-self: stretch;
}

.nm-panel__col_groups,
.nm-panel__col_children {
  display: block;
}

.nm-panel__col_categories {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nm-category {
  display: flex;
  align-items: center;
  border-radius: 10px;
}

.nm-category__link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: color .2s ease, background-color .2s ease;
}

.nm-category__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  flex: 0 0 24px;
  color: var(--nm-blue);
}

.nm-category__icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.nm-category__name {
  min-width: 0;
}

.nm-category.is-active .nm-category__link,
.nm-category__link[aria-current="true"] {
  color: var(--nm-blue);
  background: var(--nm-soft);
}

.nm-category__drill {
  display: none;
}

.nm-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.nm-group {
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.nm-group__link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  transition: color .2s ease, background-color .2s ease;
}

.nm-group.is-active > .nm-group__link {
  color: var(--nm-blue);
  background: #f2f6ff;
}

.nm-group__drill {
  display: none;
}

.nm-children__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nm-children__link {
  display: block;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  transition: color .2s ease, background-color .2s ease;
}

.nm-children__link:hover {
  color: var(--nm-blue);
  background: var(--nm-wash);
}

.nm-children__empty {
  margin: 0;
}

.nm-children__empty .nm-children__link {
  color: var(--nm-blue);
  font-size: 14px;
  font-weight: 500;
}

/* Четвёртая колонка: рекламный баннер панели. */
.nm-promo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 20px;
  border: 1px solid rgba(28, 110, 254, .16);
  border-radius: 18px;
  background: linear-gradient(160deg, #eef4ff 0%, #f7faff 62%, #fff 100%);
}

.nm-promo__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 14px;
  background: #fff;
  color: var(--nm-blue);
  box-shadow: 0 8px 20px rgba(28, 110, 254, .12);
}

.nm-promo__icon svg {
  width: 26px;
  height: 26px;
}

.nm-promo__eyebrow {
  margin: 2px 0 0;
  color: var(--nm-blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.nm-promo__title {
  margin: 0;
  color: var(--nm-ink);
  font-family: var(--h-font, "Bebas Neue Cyrillic", sans-serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
  text-transform: uppercase;
}

.nm-promo__text {
  margin: 0;
  color: var(--nm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.nm-promo__points {
  display: grid;
  gap: 7px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.nm-promo__point {
  position: relative;
  padding-left: 16px;
  color: var(--nm-ink);
  font-size: 12.5px;
  line-height: 1.4;
}

.nm-promo__point::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nm-blue);
}

.nm-nav .nm-promo__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: auto;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--nm-blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  transition: background-color .2s ease, box-shadow .2s ease;
}

.nm-nav .nm-promo__cta:hover {
  background: #0b57d6;
  color: #fff;
  box-shadow: 0 10px 22px rgba(28, 110, 254, .28);
}

/* Строка консультации внизу панели. */
.nm-panel__consult {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--nm-line);
}

.nm-panel__consult-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  background: var(--nm-soft);
  color: var(--nm-blue);
}

.nm-panel__consult-icon svg {
  width: 22px;
  height: 22px;
}

.nm-panel__consult-body {
  flex: 1;
  min-width: 0;
}

.nm-panel__consult-title {
  margin: 0;
  color: var(--nm-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.nm-panel__consult-text {
  margin: 2px 0 0;
  color: var(--nm-muted);
  font-size: 13px;
  line-height: 1.4;
}

.nm-nav .nm-panel__consult-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--nm-blue);
  border-radius: 10px;
  color: var(--nm-blue);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}

.nm-nav .nm-panel__consult-link:hover {
  background: var(--nm-blue);
  color: #fff;
}

@media (min-width: 1200px) {
  .nm-panel.is-two-col .nm-panel__cols {
    grid-template-columns: minmax(0, .95fr) minmax(0, 2.1fr) 300px;
  }

  .nm-panel.is-two-col .nm-panel__col_children {
    display: none;
  }

  .nm-panel.is-two-col .nm-groups {
    /* Второй столбец — единственный список подменю, без визуального деления на два столбца. */
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .nm-panel {
    padding: 20px 24px 18px;
  }

  .nm-panel__cols {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.05fr) minmax(0, 1.05fr) 270px;
    gap: 12px 22px;
  }

  .nm-panel.is-two-col .nm-panel__cols {
    grid-template-columns: minmax(0, .95fr) minmax(0, 2.1fr) 270px;
  }

  .nm-promo {
    padding: 16px;
    gap: 8px;
  }

  .nm-promo__title {
    font-size: 22px;
  }

  .nm-promo__point {
    font-size: 12px;
  }
}

.nm-burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--nm-line, rgba(58, 57, 57, .13));
  border-radius: 10px;
  background: #fff;
}

.nm-burger span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 3px 0;
  background: var(--main-text-color, #3a3939);
  transition: transform .2s ease, opacity .2s ease;
}

.nm-burger[aria-expanded="true"] span:first-child {
  transform: translateY(5px) rotate(45deg);
}

.nm-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nm-burger[aria-expanded="true"] span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

@media (hover: hover) and (pointer: fine) {
  .nm-root__button:hover,
  .nm-root__link:hover {
    color: var(--nm-blue);
  }

  .nm-category:not(.is-active):hover .nm-category__link,
  .nm-group:not(.is-active):hover .nm-group__link {
    color: var(--nm-blue);
    background: var(--nm-wash);
  }

  .nm-category__drill:hover,
  .nm-group__drill:hover {
    color: var(--nm-blue);
  }
}

@media (min-width: 1400px) {
  .nm-root__button,
  .nm-root__link {
    padding: 10px 13px;
    font-size: 15px;
  }
}

@media (max-width: 1199px) {
  /* Трансформы шапки создают containing block для fixed-меню и дают overflow. */
  .header:has(.nm-nav),
  .header__wrap:has(.nm-nav) {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .nm-nav {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: block;
    margin: 0;
    background: rgba(19, 25, 35, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
  }

  .nm-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .nm-nav .nm-drawer {
    display: flex;
    flex-direction: column;
    width: min(92vw, 440px);
    height: 100%;
    height: 100dvh;
    margin-left: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    transform: translateX(100%);
    transition: transform .24s ease;
  }

  .nm-nav.is-open .nm-drawer {
    transform: translateX(0);
  }

  /* Открытый drawer не должен зависеть от transform/animation шапки. */
  body.nm-lock {
    overflow: hidden;
  }

  body.nm-lock .header,
  body.nm-lock .header__wrap {
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .nm-drawer-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 64px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid var(--nm-line);
  }

  .nm-drawer-bar__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--nm-blue);
    font-size: 14px;
    font-weight: 500;
  }

  .nm-drawer-bar__back::before {
    content: "←";
    margin-right: 6px;
    font-size: 16px;
  }

  .nm-drawer-bar__title {
    flex: 1;
    min-width: 0;
    font-family: var(--h-font, "Bebas Neue Cyrillic", sans-serif);
    font-size: 24px;
    line-height: 1;
    text-transform: uppercase;
  }

  .nm-drawer-bar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--nm-line);
    font-size: 24px;
    line-height: 1;
  }

  .nm-root {
    display: block;
    flex: 0 0 auto;
    padding: 4px 16px 24px;
  }

  .nm-root__item {
    display: block;
    border-bottom: 1px solid var(--nm-line);
  }

  .nm-root__button,
  .nm-root__link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 4px;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: normal;
    text-align: left;
  }

  .nm-root__button::after {
    content: "›";
    margin-left: 12px;
    color: var(--nm-blue);
    font-size: 22px;
    line-height: 1;
  }

  .nm-root__button[aria-expanded="true"]::after {
    display: none;
  }

  .nm-panels {
    flex: 0 0 auto;
  }

  .nm-panel {
    position: static;
    display: block;
    height: auto;
    max-height: none;
    padding: 10px 16px 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .nm-panel__close {
    display: none;
  }

  .nm-panel__cols {
    display: block;
    height: auto;
    overflow: visible;
  }

  .nm-panel__col {
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  /* В мобильном drawer рекламного баннера и строки консультации нет. */
  .nm-panel__col_promo,
  .nm-panel__consult {
    display: none;
  }

  .nm-category {
    border-bottom: 1px solid var(--nm-line);
    border-radius: 0;
  }

  .nm-category__link {
    min-height: 52px;
    padding: 12px 4px;
    border-radius: 0;
    background: none;
  }

  .nm-category.is-active .nm-category__link,
  .nm-category__link[aria-current="true"] {
    background: none;
  }

  .nm-category__drill,
  .nm-group__drill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    border-radius: 8px;
    color: var(--nm-blue);
    font-size: 22px;
    line-height: 1;
  }

  .nm-groups {
    display: block;
    padding: 4px 0 10px;
  }

  .nm-group {
    border-bottom: 1px solid var(--nm-line);
    border-radius: 0;
  }

  .nm-group__link {
    min-height: 48px;
    padding: 12px 4px;
    border-radius: 0;
    font-size: 15px;
  }

  .nm-group.is-active > .nm-group__link {
    background: none;
  }

  .nm-children {
    padding: 4px 0 12px;
  }

  .nm-children__list {
    gap: 0;
  }

  .nm-children__link {
    min-height: 48px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--nm-line);
    border-radius: 0;
    font-size: 15px;
  }

  .nm-children__link:hover {
    background: none;
  }

  .nm-children__empty .nm-children__link {
    border: 0;
    padding-left: 4px;
  }

  .nm-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-nav,
  .nm-nav *,
  .nm-burger,
  .nm-burger * {
    transition: none !important;
    animation: none !important;
  }
}
