/* Навигация: мега-меню «Услуги» ([nu_mega], child/inc/nav.php) и закреплённая шапка.
   Префикс :is(.elementor,#nu-mega) даёт правилам вес id: стили меню темы (menuzord) для списков и ссылок внутри
   .megamenu их не перебивают, а в редакторе Elementor панель выглядит так же, как в шапке. */

/* ---------- закреплённая шапка: на широких экранах, где видна основная шапка ----------
   Фон при прокрутке рисует ::before: blur на самой шапке сделал бы её рамкой для боковой панели
   (панель выводится внутри шапки с position: fixed) и обрезал бы панель по высоте шапки. */
@media (min-width: 1025px) {
  #elementor-header-top {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
  }
  body.admin-bar #elementor-header-top { top: 32px; }
  #elementor-header-top::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(7, 8, 6, .9);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  body.nu-scrolled #elementor-header-top::before { opacity: 1; }
  /* при прокрутке шапка ниже: 104 → 84 px */
  #elementor-header-top .menuzord-menu > li { transition: padding .3s ease; }
  body.nu-scrolled #elementor-header-top .menuzord-menu > li { padding-top: 10px; padding-bottom: 10px; }
  /* отдельная шапка темы «при прокрутке» не нужна */
  #elementor-header-top-sticky { display: none !important; }
}

/* ---------- окно мега-меню темы: без белой рамки, отступ от шапки ---------- */
.menuzord-menu > li > .megamenu.elementor-megamenu-wrapper { padding-top: 14px; }
.menuzord-menu > li > .megamenu.elementor-megamenu-wrapper .megamenu-row {
  display: block;
  border: 0;
  background: none;
  box-shadow: none;
}

/* ---------- панель ---------- */
:is(.elementor, #nu-mega) .nu-mega {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: #0d0e0b;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  color: #fff;
  text-align: left;
  font-family: var(--body-font-family);
}

/* карточка слева */
:is(.elementor, #nu-mega) .nu-mega-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 28px 28px;
  border-radius: 20px;
  background: var(--theme-color1);
  color: #0b0c09;
}
:is(.elementor, #nu-mega) .nu-mega-card::after {
  content: "";
  position: absolute;
  right: -96px;
  bottom: -118px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(11, 12, 9, .22);
  border-radius: 50%;
  pointer-events: none;
}
:is(.elementor, #nu-mega) .nu-mega-eyebrow {
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .62;
}
:is(.elementor, #nu-mega) .nu-mega-title {
  margin-top: 16px;
  font-family: var(--heading-font-family);
  font-size: 30px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.01em;
  text-wrap: balance;
}
:is(.elementor, #nu-mega) .nu-mega-text {
  margin: 14px 0 28px;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(11, 12, 9, .74);
}
:is(.elementor, #nu-mega) .nu-mega-btn {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 22px;
  border: 1.5px solid #0b0c09;
  border-radius: 999px;
  color: #0b0c09;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
:is(.elementor, #nu-mega) .nu-mega-btn:hover { background: #0b0c09; color: var(--theme-color1); }
:is(.elementor, #nu-mega) .nu-mega-btn svg { transition: transform .2s ease; }
:is(.elementor, #nu-mega) .nu-mega-btn:hover svg { transform: translateX(3px); }

/* группы справа */
:is(.elementor, #nu-mega) .nu-mega-body { min-width: 0; padding: 16px 14px 8px 16px; }
:is(.elementor, #nu-mega) .nu-mega-label {
  display: block;
  margin-bottom: 22px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--theme-color1);
}
:is(.elementor, #nu-mega) .nu-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
:is(.elementor, #nu-mega) .nu-mega--n4 .nu-mega-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
:is(.elementor, #nu-mega) .nu-mega--n2 .nu-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.elementor, #nu-mega) .nu-mega-group,
:is(.elementor, #nu-mega) .nu-mega-list li {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  clear: none;
  list-style: none;
}
:is(.elementor, #nu-mega) .nu-mega-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  color: #fff;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}
:is(.elementor, #nu-mega) .nu-mega-ic {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(188, 234, 62, .1);
  color: var(--theme-color1);
  transition: background-color .2s ease, color .2s ease;
}
:is(.elementor, #nu-mega) .nu-mega-ic svg { width: 21px; height: 21px; }
:is(.elementor, #nu-mega) a.nu-mega-head:hover,
:is(.elementor, #nu-mega) a.nu-mega-head[aria-current] { color: var(--theme-color1); }
:is(.elementor, #nu-mega) a.nu-mega-head:hover .nu-mega-ic { background: var(--theme-color1); color: #0b0c09; }
:is(.elementor, #nu-mega) .nu-mega-list { margin: 10px 0 0 58px; padding: 0; list-style: none; }
:is(.elementor, #nu-mega) .nu-mega-list a {
  display: inline-block;
  padding: 5px 0;
  color: rgba(255, 255, 255, .62);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 400;
  text-decoration: none;
  transition: color .2s ease;
}
:is(.elementor, #nu-mega) .nu-mega-list a:hover { color: #fff; }
:is(.elementor, #nu-mega) .nu-mega-list a[aria-current] { color: var(--theme-color1); }
:is(.elementor, #nu-mega) .nu-mega a:focus-visible {
  outline: 2px solid var(--theme-color1);
  outline-offset: 3px;
  border-radius: 8px;
}
:is(.elementor, #nu-mega) .nu-mega-hint { grid-column: 1 / -1; color: rgba(255, 255, 255, .6); font-size: 15px; }

/* узкий ноутбук: колонки уже, у четырёх групп две колонки */
@media (min-width: 1025px) and (max-width: 1279px) {
  :is(.elementor, #nu-mega) .nu-mega { grid-template-columns: 250px minmax(0, 1fr); gap: 14px; padding: 14px; }
  :is(.elementor, #nu-mega) .nu-mega-card { padding: 26px 22px 22px; }
  :is(.elementor, #nu-mega) .nu-mega-title { font-size: 25px; }
  :is(.elementor, #nu-mega) .nu-mega-head { gap: 10px; font-size: 15px; }
  :is(.elementor, #nu-mega) .nu-mega-ic { flex-basis: 38px; width: 38px; height: 38px; }
  :is(.elementor, #nu-mega) .nu-mega-list { margin-left: 48px; }
  :is(.elementor, #nu-mega) .nu-mega-list a { font-size: 14px; }
  :is(.elementor, #nu-mega) .nu-mega--n4 .nu-mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* мобильное меню: без карточки, группы списком под пунктом «Услуги» */
@media (max-width: 1024px) {
  :is(.elementor, #nu-mega) .nu-mega {
    display: block;
    padding: 8px 0 16px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  :is(.elementor, #nu-mega) .nu-mega-card,
  :is(.elementor, #nu-mega) .nu-mega-label { display: none; }
  :is(.elementor, #nu-mega) .nu-mega-body { padding: 0; }
  :is(.elementor, #nu-mega) .nu-mega .nu-mega-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  :is(.elementor, #nu-mega) .nu-mega-head { gap: 12px; font-size: 16px; }
  :is(.elementor, #nu-mega) .nu-mega-ic { flex-basis: 36px; width: 36px; height: 36px; }
  :is(.elementor, #nu-mega) .nu-mega-ic svg { width: 18px; height: 18px; }
  :is(.elementor, #nu-mega) .nu-mega-list { margin: 6px 0 0 48px; }
  .menuzord-responsive .menuzord-menu > li > .megamenu.elementor-megamenu-wrapper { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #elementor-header-top::before,
  #elementor-header-top .menuzord-menu > li,
  :is(.elementor, #nu-mega) .nu-mega * { transition: none !important; }
}
