/**
 * Подключается nginx sub_filter только на legacy Nuxt-кейсах
 * (/case/all/<slug> и /case/<slug>, кроме статики конструктора).
 * На OSNOVA / Miramar / Darkrain этот файл не грузится.
 *
 * Статический конструктор: шапка position:fixed, логотип прячется при скролле.
 * Nuxt-кейсы без этого файла оставляли wordmark в потоке документа.
 */
header.header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 100 !important;
}

/*
 * Слои без смены right/width крестика: позиция остаётся как в Nuxt/проде.
 * .header__container (z-index:999999) иначе перехватывает тап.
 */
header.header.active {
  z-index: 10000 !important;
  height: 100dvh !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

.header.active .header__top-line,
.header.active .header__container {
  pointer-events: none !important;
  z-index: 0 !important;
}

.header.active .new-static-menu,
.header.active .new-static-menu-surface {
  z-index: 20 !important;
  pointer-events: auto !important;
}

header.header:not(.active) .new-static-menu,
header.header:not(.active) .new-static-menu-surface {
  display: none !important;
  pointer-events: none !important;
}

.header.active .navigation-new__close {
  z-index: 2147483647 !important;
  pointer-events: auto !important;
}

.header.active .navigation-new__close::before {
  content: "";
  position: absolute;
  inset: -24px;
}

.header.active .menu-icon__wrapper,
.header.active .menu-icon__wrapper_main {
  pointer-events: none !important;
}

/*
 * Nuxt рисует полноэкранный canvas.isLoaded / .page-constructor__bg.
 * Слой постоянно перерисовывается (в инспекторе «мигает») и перехватывает тап по крестику.
 */
html:has(header.header.active) .page.nuxt,
html:has(header.header.active) .page-constructor__bg,
html:has(header.header.active) .page-constructor__bg canvas,
html:has(header.header.active) canvas.isLoaded {
  pointer-events: none !important;
}

.page-constructor__bg,
.page-constructor__bg canvas {
  pointer-events: none !important;
}

.header.compressed:not(.page-top):not(.active) .header__logo,
.header.compressed:not(.page-top):not(.active) .header__logo a,
.header.compressed:not(.page-top):not(.active) .header__logo img,
.header.compressed:not(.page-top):not(.active) .header__logo svg {
  display: none !important;
}

.sa-legacy-menu-fallback { display: none; position: fixed; inset: 0; background: rgba(28, 28, 30, .98); color: #fff; }
.header.active .sa-legacy-menu-fallback { display: block; }
.sa-legacy-menu-fallback__inner { box-sizing: border-box; width: min(100% - 156px, 1576px); min-height: 100%; margin: 0 auto; padding: 150px 0 64px; position: relative; }
.sa-legacy-menu-fallback nav { display: grid; gap: 20px; max-width: 480px; }
.sa-legacy-menu-fallback nav a { color: #fff; font-size: clamp(28px, 3vw, 48px); line-height: 1.1; text-decoration: none; }
.sa-legacy-menu-fallback .navigation-new__button { margin-top: 56px; min-width: 280px; }
.sa-legacy-menu-fallback .navigation-new__close { position: absolute; top: 48px; right: 0; width: 34px; height: 34px; background: transparent; border: 0; cursor: pointer; }
.sa-legacy-menu-fallback .navigation-new__close::before, .sa-legacy-menu-fallback .navigation-new__close::after { content: ""; position: absolute; top: 16px; left: 1px; width: 32px; height: 2px; background: #fff; transform: rotate(45deg); }
.sa-legacy-menu-fallback .navigation-new__close::after { transform: rotate(-45deg); }
@media (max-width: 768px) { .sa-legacy-menu-fallback__inner { width: calc(100% - 72px); padding-top: 118px; } }
