/* Products mega menu — L1 + flyout L2 */
.main-nav .nav-dropdown { position: relative; }
.main-nav .nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-nav);
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.main-nav .nav-dropdown-toggle:hover,
.main-nav .nav-dropdown-toggle.active { color: var(--accent); }
.main-nav .nav-chev-down { transition: transform .2s; flex-shrink: 0; }

/* Mega panel */
.nav-mega-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  padding-top: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 300;
}

.nav-mega-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-mega-l1 {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--border, #e8e8e8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.nav-mega-l1-item {
  position: relative;
  margin: 0;
}

.nav-mega-l1-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.35;
}

.nav-mega-l1-link:hover,
.nav-mega-l1-item.is-active .nav-mega-l1-link {
  color: var(--accent);
  background: #fafafa;
}

.nav-chev-right {
  flex-shrink: 0;
  color: #bbb;
  transition: color .15s;
}

.nav-mega-l1-item.has-flyout:hover .nav-chev-right,
.nav-mega-l1-item.is-active .nav-chev-right {
  color: var(--accent);
}

/* L2 flyout */
.nav-mega-flyout {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 240px;
  padding-left: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 310;
}

.nav-mega-flyout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
}

.nav-mega-flyout ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--border, #e8e8e8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.nav-mega-flyout a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.nav-mega-flyout a:hover {
  color: var(--accent);
  background: #fafafa;
}

@media (min-width: 961px) {
  .nav-products-mega.is-open .nav-mega-panel,
  .nav-products-mega:hover .nav-mega-panel { display: block; }

  .nav-products-mega.is-open .nav-chev-down,
  .nav-products-mega:hover .nav-chev-down { transform: rotate(180deg); }

  .nav-mega-l1-item.has-flyout.is-open .nav-mega-flyout,
  .nav-mega-l1-item.has-flyout:hover .nav-mega-flyout,
  .nav-mega-l1-item.has-flyout.is-active .nav-mega-flyout { display: block; }
}

/* Sidebar accordion — one L1 open at a time (Alibaba-style) */
.sidebar .cat-tree { list-style: none; margin: 0; padding: 0; }
.sidebar .cat-tree > li { margin-bottom: 0; }

.sidebar .cat-group { margin-bottom: 0; }

.sidebar .cat-parent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #222;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar .cat-parent-toggle:hover {
  background: #f5f5f5;
  color: #222;
}

.sidebar .cat-parent-toggle.active {
  color: #222;
  background: #f5f5f5;
  font-weight: 500;
}

.sidebar .cat-chev {
  flex-shrink: 0;
  color: #999;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar .cat-group.is-expanded .cat-chev {
  transform: rotate(180deg);
  color: #666;
}

.sidebar .cat-group.is-expanded .cat-parent-toggle {
  color: #222;
  font-weight: 500;
}

.sidebar .cat-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

.sidebar .cat-group.is-expanded .cat-children { display: block; }

.sidebar .cat-children a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 400;
  color: #444;
  border-radius: 0;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar .cat-children a:hover {
  color: #222;
  background: #f5f5f5;
}

.sidebar .cat-children a.active {
  color: #222;
  background: #f5f5f5;
  font-weight: 500;
}

@media (max-width: 960px) {
  .main-nav .nav-dropdown { width: 100%; }

  .nav-products-mega.is-open .nav-mega-panel { display: block; }

  .nav-mega-panel {
    position: static;
    padding-top: 0;
  }

  .nav-mega-panel::before { display: none; }

  .nav-mega-l1 {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .nav-mega-flyout {
    position: static;
    padding-left: 0;
  }

  .nav-mega-flyout::before { display: none; }

  .nav-mega-flyout ul {
    border: 0;
    box-shadow: none;
    padding: 0 0 0 12px;
  }

  .nav-mega-l1-item.flyout-open .nav-mega-flyout { display: block; }

  .nav-mega-l1-item.has-flyout .nav-mega-l1-link {
    cursor: pointer;
  }

  .nav-chev-right {
    transition: transform .2s;
  }

  .nav-mega-l1-item.flyout-open .nav-chev-right {
    transform: rotate(90deg);
    color: var(--accent);
  }
}
