.wd-menu-portals {
  position: relative;
  z-index: 10050;
}

.wd-header-catalog-menu--portal,
.wd-header-catalog-hover--portal {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: fixed !important;
  left: 0;
  top: 92px;
  width: 100%;
  z-index: 10050;
  transform: none !important;
}

.wd-header-catalog-menu--portal.is-open,
.wd-header-catalog-hover--portal.is-open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

.wd-header-catalog-menu--portal .container,
.wd-header-catalog-hover--portal .container {
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.js-wd-catalog-trigger,
.js-open-collections-menu {
  cursor: pointer;
}

@media (max-width: 768px) {
  .wd-header-catalog-menu--portal,
  .wd-header-catalog-hover--portal {
    top: 70px;
  }

  .wd-header-catalog-menu--portal .container,
  .wd-header-catalog-hover--portal .container {
    max-height: calc(100vh - 70px);
  }

  .wd-footer {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
  }
}


/* -------------------------------------------------------
   Мобильная версия: выпадающий каталог/коллекции не используются
   ------------------------------------------------------- */
@media (max-width: 768px) {
  .wd-menu-portals,
  .wd-header-catalog-menu--portal,
  .wd-header-catalog-hover--portal {
    display: none !important;
  }

  .wd-header-nav__col.js-open-collections-menu {
    display: none !important;
  }
}


/* -------------------------------------------------------
   Главная страница: фиксированная тёмная верхняя плашка в адаптивной версии
   Делаем через fixed, потому что sticky может не срабатывать внутри текущей структуры.
   ------------------------------------------------------- */
@media (max-width: 768px) {
  body[data-page="index"],
  body.page-home {
    --wilder-mobile-header-height: 64px;
  }

  body[data-page="index"] .wd-header,
  body.page-home .wd-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 20000 !important;
    background: #1b1b1b !important;
    transform: none !important;
    transition: none !important;
  }

  body[data-page="index"] .wd-header > .container,
  body.page-home .wd-header > .container {
    background: #1b1b1b !important;
    max-width: 100% !important;
  }

  body[data-page="index"] .wd-header-block,
  body.page-home .wd-header-block {
    background: #1b1b1b !important;
    min-height: var(--wilder-mobile-header-height) !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Компенсируем высоту fixed-шапки, чтобы первый экран не уходил под меню */
  body[data-page="index"] .header-space,
  body.page-home .header-space {
    display: block !important;
    height: var(--wilder-mobile-header-height) !important;
    min-height: var(--wilder-mobile-header-height) !important;
  }

  /* На главной в мобильной версии используем верхнюю шапку, дубль fixed-header не нужен */
  body[data-page="index"] .wd-header-fixed,
  body.page-home .wd-header-fixed {
    display: none !important;
  }

  body[data-page="index"] .wd-header-logo,
  body.page-home .wd-header-logo {
    background: transparent !important;
  }

  body[data-page="index"] .wd-header-logo a,
  body.page-home .wd-header-logo a {
    display: flex !important;
    align-items: center !important;
  }

  body[data-page="index"] .wd-header-logo img,
  body.page-home .wd-header-logo img {
    display: block !important;
    height: auto !important;
  }
}
