/* =================================================================
   BC MEGA MENU – VOLLSTÄNDIGES CSS

   Update:
   - Nested sub-categories are now collapsible on MOBILE as well (offcanvas)
   - Desktop look/behaviour stays the same
   ================================================================= */

/* --- Mehr / Weniger ------------------------------------------------- */
ul.bc-mega-links > li.bc-extra-subcat,
ul.bc-subcategories > li.bc-extra-subcat,
ul.bc-subcategories-child > li.bc-extra-subcat {
  display: none !important;
}

ul.bc-mega-links.bc-open > li.bc-extra-subcat,
ul.bc-subcategories.bc-open > li.bc-extra-subcat,
ul.bc-subcategories-child.bc-open > li.bc-extra-subcat {
  display: block !important;
}

.bc-more-toggle-wrap { margin-top: 4px; }
.bc-more-toggle {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  color: inherit;
}
.bc-more-toggle:focus { outline: none; }

/* --- Base ----------------------------------------------------------- */
.bc-mega-menu { width: 100%; }
.bc-mega-column { text-align: left; font-size: 14px; }

.bc-mega-thumb {
  display: block;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 14px;
}
.bc-mega-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}
.bc-mega-thumb:hover img { transform: scale(1.03); }

.bc-mega-title { font-size: 15px; margin: 0 0 6px; }
.bc-mega-title a { text-decoration: none; }

.bc-mega-links { list-style: none; margin: 0; padding: 0; }
.bc-mega-links li { margin-bottom: 3px; }
.bc-mega-links li > a { text-decoration: none; font-size: 13px; display: block; }

/* --- Nested accordion (desktop + mobile) --------------------------- */
.bc-mega-nested-links {
  list-style: none;
  margin: 5px 0 0 15px;
  padding: 0;
}
.bc-mega-nested-links li { margin-bottom: 1px; }
.bc-mega-nested-links li > a { font-size: 12px; text-decoration: none; display: inline-block; }

/* Hide nested lists ONLY after JS processed the item (so it still works without JS). */
.bc-mega-menu.bc-mega-tiles li.has-nested-toggle > .bc-mega-nested-links {
  display: none !important;
}
.bc-mega-menu.bc-mega-tiles li.bc-nested-open > .bc-mega-nested-links {
  display: block !important;
}

.bc-mega-menu .bc-mega-title.lv0,
.bc-mega-menu .bc-mega-title.lv0 a { font-weight: 700 !important; }
.bc-mega-menu a.lv1,
.bc-mega-menu a.lv1 .bc-subcat-label { font-weight: 700 !important; letter-spacing: 0.00em !important; margin-left: 0 !important; }
.bc-mega-menu a.lv2,
.bc-mega-menu a.lv2 .bc-subcat-label { font-weight: 600 !important; letter-spacing: 0.05em !important; }
.bc-mega-menu a.lv3,
.bc-mega-menu a.lv3 .bc-subcat-label { font-weight: 200 !important; letter-spacing: 0.05em !important; margin-left: 0.3em !important; display: inline-block !important; }
.bc-mega-menu a.lv4,
.bc-mega-menu a.lv4 .bc-subcat-label { font-weight: 100 !important; letter-spacing: 0.05em !important; margin-left: 0.32em !important; display: inline-block !important; }
.bc-mega-menu a.lv5,
.bc-mega-menu a.lv5 .bc-subcat-label { font-weight: 100 !important; letter-spacing: 0.05em !important; margin-left: 0.38em !important; display: inline-block !important; }

/* --- Desktop grid (unchanged) -------------------------------------- */
.bc-mega-menu.bc-mega-tiles {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 26px !important;
  padding: 18px 22px 22px !important;
  background: #fff !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
  border-radius: 10px !important;
}
.bc-mega-tile { text-align: left; }
.bc-mega-row { display: flex !important; align-items: flex-start !important; gap: 14px !important; }

.bc-mega-menu.bc-mega-tiles .bc-mega-thumb {
  flex: 0 0 120px !important;
  width: 120px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  display: block !important;
}
.bc-mega-menu.bc-mega-tiles .bc-mega-thumb img {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 12px !important;
  transition: transform .25s ease;
}
.bc-mega-menu.bc-mega-tiles .bc-mega-thumb:hover img { transform: scale(1.03); }

.bc-mega-content { flex: 1 1 auto !important; min-width: 0 !important; }
.bc-mega-menu.bc-mega-tiles .bc-mega-content .bc-mega-title { margin: 0 0 6px !important; font-size: 13px !important; line-height: 1.2 !important; }
.bc-mega-menu.bc-mega-tiles .bc-mega-content .bc-mega-links li > a { font-size: 12px !important; }
.bc-mega-menu.bc-mega-tiles .bc-mega-nested-links { margin: 4px 0 0 12px !important; }

/* Toggle button (desktop + mobile) */
.bc-mega-menu.bc-mega-tiles li.has-nested-toggle { position: relative !important; }
.bc-mega-menu.bc-mega-tiles li.has-nested-toggle > a {
  display: block !important;
  width: 100% !important;
  padding-right: 44px !important;
  box-sizing: border-box !important;
}
.bc-mega-menu.bc-mega-tiles li.has-nested-toggle > a .bc-subcat-label {
  min-width: 0 !important;
  display: block !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.bc-mega-menu.bc-mega-tiles .bc-nested-toggle {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 44px !important;
  height: 100% !important;
  min-height: 22px !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  opacity: .85 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}
.bc-mega-menu.bc-mega-tiles .bc-nested-toggle:hover {
  opacity: 1 !important;
  background: rgba(0,0,0,0.06) !important;
}
.bc-mega-menu.bc-mega-tiles .bc-nested-toggle::before {
  content: "▸";
  display: inline-block;
  transform: translateY(-1px);
}
.bc-mega-menu.bc-mega-tiles li.bc-nested-open > .bc-nested-toggle::before {
  content: "▾";
}

/* --- Mobile -------------------------------------------------------- */
@media (max-width: 1024px) {
  /* keep the general responsive grid */
  .bc-mega-menu.bc-mega-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* show all Level-1 items on mobile, hide "Mehr" */
  ul.bc-mega-links > li.bc-extra-subcat,
  ul.bc-subcategories > li.bc-extra-subcat,
  ul.bc-subcategories-child > li.bc-extra-subcat {
    display: list-item !important;
  }
  .bc-more-toggle-wrap { display: none !important; }

  /* mobile layout: image on top, text below */
  .bc-mega-row { flex-direction: column !important; }
  .bc-mega-menu.bc-mega-tiles .bc-mega-thumb {
    flex: none !important;
    width: 100% !important;
  }
  .bc-mega-menu.bc-mega-tiles .bc-mega-thumb img {
    width: 100% !important;
    height: auto !important;
  }

  .bc-mega-nested-links { margin: 5px 0 0 20px !important; }
  .bc-mega-nested-links li > a { font-size: 13px; opacity: 0.95; }
}

/* offcanvas / qode mobile navigation: force single column + cleaner box */
.qodef-mobile-header-navigation .bc-mega-menu.bc-mega-tiles {
  grid-template-columns: 1fr !important;
  padding: 10px 5px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

@media (max-width: 600px) {
  .bc-mega-menu.bc-mega-tiles { grid-template-columns: 1fr !important; }
}
