/* Anchor the absolutely-positioned panel to the block wrapper so it works in
   any region (was previously tied to section.region-category-bar). */
.block-cws-category-menu-desktop-mega-block {
  position: relative;
  width: 100%;
  font-family: 'Zalando Sans Expanded', sans-serif;
}

/* The category bar region is a flex child of .category-links (col-12.d-flex);
   without this it shrinks to content width and hugs the left when items are few. */
.region-category-bar {
  width: 100%;
}

/* Top horizontal bar */
.cws-mega-nav__top {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.cws-mega-nav__item {
  /*position: relative;*/
  position: static;
}

.cws-mega-nav__link {
  display: inline-flex;
  align-items: center;
  padding: .75rem .25rem;
  text-decoration: none;
  white-space: nowrap;
}

.cws-mega-nav__item.has-children > .cws-mega-nav__link::after {
  content: "▾";
  font-size: .8em;
  margin-left: .35rem;
}

 /*Mega panel*/
.cws-mega-panel {
  /* Anchored to the full-width block wrapper (position:relative). Using absolute
     (not fixed) keeps the panel glued to the parent bar when the page is scrolled,
     while the full-width region/block still gives it edge-to-edge width. */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: #35393c;
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.cws-mega-panel__inner {
  padding: 1.25rem 0;
}

/* Columns: flex (not a rigid 4-track grid) so a reduced number of columns
   centers instead of pinning to the left. Each column is capped at the width
   it would have in the full 4-up layout, so 4 columns look unchanged. */
.cws-mega-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.cws-mega-col {
  /* basis = full-width column size, so exactly 4 fit per row and a 5th wraps,
     matching the old 4-track grid; fewer than 4 stay this width and center. */
  flex: 1 1 309px;
  min-width: 0;
  max-width: 309px;
}

.cws-mega-col__title {
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-bottom: .5rem;
  color: white;
}

.cws-mega-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 0.75rem;   /* overall indent */
  margin-top: 0.25rem;
  display: grid;
  gap: .35rem;

  border-left: 1px solid rgba(255,255,255,0.12);
}

.cws-mega-col__list-item {
  padding-left: 0.25rem;
}

.cws-mega-col__list-item a {
  text-decoration: none;
  display: inline-block;
  padding: .15rem 0;
  color: white;
}

 /*Open state controlled by JS*/
.cws-mega-nav__item.is-open > .cws-mega-panel {
  display: block;
}

/* force-open when li has .is-open */
.cws-mega-nav__item.is-open > .cws-mega-panel {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* if you're using the HTML5 hidden attribute */
.cws-mega-nav__item.is-open > .cws-mega-panel[hidden] {
  display: block !important;
}
