/* zb-mega-menu — desktop catalog dropdown */

html.zb-mega-ready {
  --zb-mega-top: calc(var(--zb-top-h, 48px) + var(--zb-main-h, 80px));
  --zb-mega-left: 0px;
  --zb-mega-width: min(100%, var(--zb-max, 1400px));
  --zb-mega-sidebar: 300px;
  --zb-mega-accent: #2563eb;
  --zb-mega-border: #e8ebf0;
  --zb-mega-text: #1b2a4a;
  --zb-mega-muted: #667085;
}

#zb-mega-menu-portal {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--zb-mega-top, 128px);
  bottom: 0;
  z-index: 1300;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

#zb-mega-menu-portal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.zb-mega-menu__backdrop {
  position: absolute;
  inset: 0;
  top: 0;
  background: rgba(15, 23, 42, 0.18);
}

.zb-mega-menu__panel {
  position: relative;
  z-index: 1;
  width: var(--zb-mega-width);
  margin-left: var(--zb-mega-left);
  margin-right: auto;
  background: #fff;
  box-shadow: 0 24px 48px rgba(27, 42, 74, 0.18);
  border-top: 1px solid var(--zb-mega-border);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.zb-mega-menu__inner {
  width: 100%;
  min-height: 360px;
  max-height: min(72vh, 640px);
  display: flex;
  align-items: stretch;
  overscroll-behavior: contain;
}

.zb-mega-menu__sidebar {
  flex: 0 0 var(--zb-mega-sidebar);
  width: var(--zb-mega-sidebar);
  border-right: 1px solid var(--zb-mega-border);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
  scrollbar-gutter: stable;
}

.zb-mega-menu__content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 28px 28px;
}

.zb-mega-menu__cat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  color: var(--zb-mega-text);
  font: 500 15px/1.3 Inter, system-ui, sans-serif;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.zb-mega-menu__cat:visited {
  color: var(--zb-mega-text);
}

.zb-mega-menu__cat:hover,
.zb-mega-menu__cat.is-active,
.zb-mega-menu__cat:visited:hover,
.zb-mega-menu__cat:visited.is-active {
  background: #f4f7ff;
  color: var(--zb-mega-accent);
}

.zb-mega-menu__cat-thumb {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}

.zb-mega-menu__cat-label {
  flex: 1 1 auto;
  min-width: 0;
}

.zb-mega-menu__cat-arrow {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.45;
}

.zb-mega-menu__cat.is-active .zb-mega-menu__cat-arrow {
  opacity: 1;
}

.zb-mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
}

.zb-mega-menu__group {
  min-width: 0;
}

.zb-mega-menu__group-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.zb-mega-menu__group-img {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
}

.zb-mega-menu__group-title {
  display: inline-block;
  color: var(--zb-mega-text);
  font: 700 16px/1.25 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.zb-mega-menu__group-title:hover {
  color: var(--zb-mega-accent);
}

.zb-mega-menu__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.zb-mega-menu__links li + li {
  margin-top: 6px;
}

.zb-mega-menu__links a {
  color: var(--zb-mega-muted);
  font: 400 14px/1.35 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.zb-mega-menu__links a:hover {
  color: var(--zb-mega-accent);
}

.zb-mega-menu__empty,
.zb-mega-menu__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 24px;
}

.zb-mega-menu__empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  max-width: 420px;
}

.zb-mega-menu__empty-title {
  color: var(--zb-mega-muted);
  font: 400 16px/1.4 Inter, system-ui, sans-serif;
}

.zb-mega-menu__empty-link {
  color: var(--zb-mega-accent);
  font: 600 15px/1.3 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.zb-mega-menu__empty-link:hover {
  text-decoration: underline;
}

.zb-mega-menu__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--zb-mega-accent);
  font: 600 14px/1.3 Inter, system-ui, sans-serif;
  text-decoration: none;
}

.zb-mega-menu__all:hover {
  text-decoration: underline;
}

.zb-mega-menu__loading {
  color: var(--zb-mega-muted);
  font: 400 15px/1.4 Inter, system-ui, sans-serif;
}

/* Trigger item in header */
html.zb-mega-ready #main-menu > .j-menu > li.zb-catalog-mega > a::after {
  content: "" !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  width: 10px !important;
  height: 6px !important;
  min-width: 10px !important;
  min-height: 6px !important;
  margin-left: 8px !important;
  border: 0 !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0 0h10L5 6z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 10px 6px !important;
}

html.zb-mega-ready #main-menu > .j-menu > li.zb-catalog-mega.zb-mega-open > a {
  background: var(--zb-navy-2, #364667) !important;
}

@media (max-width: 1099px) {
  #zb-mega-menu-portal {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .zb-mega-menu__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .zb-mega-menu__grid {
    grid-template-columns: 1fr;
  }
}

/* ZB_CATALOG_SIDEBAR — loaded via zb-header.js / filter.js boot / style.css, not @import */
