/* ═══════════════════════════════════════════════════════════
   MEGA MENU — Каталог продукции
   Шрифт: Manrope (самодостаточный импорт)
   JS: js/mega-menu.js
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ── Trigger chevron ── */
.nav-btn-catalog .mm-chevron {
  transition: transform 0.22s ease;
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-btn-catalog.mm-open .mm-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   PANEL — флотирующее меню
══════════════════════════════════════════════════════════ */
.mm-panel {
  font-family: 'Manrope', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;

  position: fixed;
  left: 50%;
  top: 98px; /* JS перезаписывает через getBoundingClientRect */
  width: 980px;
  max-width: calc(100vw - 32px);
  z-index: 90;

  /* Скругления + клиппинг детей */
  border-radius: 18px;
  overflow: hidden;

  /* Матовое стекло */
  background: rgba(248, 249, 251, 0.82);
  backdrop-filter: blur(36px) saturate(170%) brightness(1.03);
  -webkit-backdrop-filter: blur(36px) saturate(170%) brightness(1.03);

  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 28px 56px rgba(0, 0, 0, 0.14),
    0 6px 20px rgba(0, 0, 0, 0.07);

  /* Скрытое состояние — left задаётся JS-ом, translateY анимирует */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.mm-panel.mm-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── Внутренний flex-контейнер: без горизонтальных отступов
      (изображения идут навылет к правому и верхнему краю панели) ── */
.mm-inner {
  display: flex;
  min-height: 460px;
  max-height: 82vh;
}

/* ══════════════════════════════════════════════════════════
   ЛЕВАЯ КОЛОНКА — список разделов
══════════════════════════════════════════════════════════ */
.mm-cats {
  width: 226px;
  flex-shrink: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  padding: 24px 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mm-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #3a3a3c;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.3;
  border-radius: 10px;
  transition: color 0.14s, background 0.14s;
  text-decoration: none;
}
.mm-cat:hover {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.04);
}
.mm-cat.mm-cat-active {
  color: #00aab5;
  background: rgba(0, 170, 181, 0.07);
  font-weight: 600;
}
.mm-cat-arrow {
  flex-shrink: 0;
  opacity: 0;
  color: #00aab5;
  transition: opacity 0.14s;
}
.mm-cat.mm-cat-active .mm-cat-arrow { opacity: 1; }
.mm-cat:not(.mm-cat-has-subs) .mm-cat-arrow { display: none; }

/* ══════════════════════════════════════════════════════════
   КОНТЕНТНАЯ ЗОНА
══════════════════════════════════════════════════════════ */
.mm-content {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

/* Субпанели — абсолютные, без своих отступов
   (изображение справа идёт навылет к верхнему и правому краям) */
.mm-subpanel {
  position: absolute;
  inset: 0;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.mm-subpanel.mm-sub-active {
  opacity: 1;
  pointer-events: all;
}

/* ──────────────────────────────────────────────────────────
   С подкатегориями: [список] + [превью навылет]
────────────────────────────────────────────────────────── */
.mm-subs {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 12px 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}
.mm-subs::-webkit-scrollbar { width: 4px; }
.mm-subs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
}

.mm-sub {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #00aab5;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-sub:hover,
.mm-sub.mm-sub-hovered {
  background: rgba(0, 170, 181, 0.09);
  color: #008690;
}

/* Dim — подуровень (Revilab SL / ML) */
.mm-sub-dim {
  color: #5a5a5e;
  font-weight: 400;
  font-size: 13px;
  padding-left: 20px;
}
.mm-sub-dim:hover { color: #00aab5; }

/* ── Превью-фото: навылет к верхнему + правому краю панели ──
   Панель обрезает через border-radius + overflow: hidden       */
.mm-preview {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  /* Нет border-radius — панель сама закругляет правый угол */
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
}
.mm-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.15s ease;
}
.mm-preview-img.mm-fading { opacity: 0; }

/* ──────────────────────────────────────────────────────────
   Без подкатегорий: прямоугольное фото навылет на всю ширину
────────────────────────────────────────────────────────── */
.mm-direct {
  /* без дополнительных отступов */
}
.mm-direct-link {
  flex: 1;
  display: flex;
  align-self: stretch;
  overflow: hidden;
  /* нет border-radius — панель сама закругляет */
}
.mm-direct-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s ease;
}
.mm-direct-link:hover .mm-direct-img {
  transform: scale(1.025);
}

/* ══════════════════════════════════════════════════════════
   МОБИЛЬНЫЙ АККОРДЕОН (в drawer)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mm-panel { display: none !important; }
}

.mm-drawer-section {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mm-drawer-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #1d1d1f;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.mm-drawer-cat-btn:hover { background: rgba(0, 0, 0, 0.04); }

/* Chevron на кнопке Каталога */
.mm-drawer-catalog-chevron {
  flex-shrink: 0;
  display: inline-flex;
  transition: transform 0.2s ease;
  margin-left: auto;
  opacity: 0.75;
}
.mm-drawer-cat-btn svg {
  flex-shrink: 0;
  color: #b0b0b8;
  transition: transform 0.2s ease;
}
.mm-drawer-cat-btn.mm-dopen svg { transform: rotate(180deg); }

.mm-drawer-cat-link {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #1d1d1f;
  text-decoration: none;
  transition: background 0.12s;
}
.mm-drawer-cat-link:hover { background: rgba(0, 0, 0, 0.04); }

/* Подкатегории — скрыты по умолчанию, раскрываются по клику */
.mm-drawer-subs {
  display: none;
  flex-direction: column;
  margin: 0 20px 8px 32px;
  border-left: 2px solid rgba(0, 170, 181, 0.28);
  border-radius: 0 6px 6px 0;
  background: rgba(0, 170, 181, 0.04);
}
.mm-drawer-subs.mm-dopen { display: flex; }

.mm-drawer-sub {
  display: block;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: #00aab5;
  text-decoration: none;
  transition: background 0.12s;
}
.mm-drawer-sub:hover { background: rgba(0, 170, 181, 0.09); }
