/* DWD Mega Menu - Front */
.dwd-mm-item { position: relative; }

.dwd-mm-panel {
  position: absolute;
  left: 0;
  top: 100%;
  width: min(1200px, 95vw);
  margin-top: 0px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 40px rgba(0,0,0,.10);
  border-radius: 8px;
  padding: 22px;
  z-index: 9999;
  display: none;
}

.dwd-mm-item:hover > .dwd-mm-panel,
.dwd-mm-item.dwd-mm-open > .dwd-mm-panel {
  display: block;
}

.dwd-mm-inner {
  display: grid;
  gap: 28px;
  align-items: start;
}

.dwd-mm-layout-2col .dwd-mm-inner { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
.dwd-mm-layout-3col .dwd-mm-inner { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.dwd-mm-layout-3col_promo .dwd-mm-inner { grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(220px, 320px); }
.dwd-mm-layout-4col_promo .dwd-mm-inner { grid-template-columns: repeat(4, minmax(160px, 1fr)) minmax(220px, 320px); }

.dwd-mm-heading {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 10px;
}

.dwd-mm-links { list-style: none; padding: 0; margin: 0; }
.dwd-mm-links li { margin: 8px 0; }
.dwd-mm-links a {
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}
.dwd-mm-links a:hover { text-decoration: underline; }

.dwd-mm-promo { align-self: stretch; }
.dwd-mm-promo-link {
  position: relative;
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  min-height: 180px;
}
.dwd-mm-promo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dwd-mm-promo-placeholder { width: 100%; height: 100%; background: rgba(0,0,0,.15); min-height: 180px; }

.dwd-mm-promo-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
}
.dwd-mm-promo-title { font-weight: 800; letter-spacing: .03em; font-size: 18px; line-height: 1.1; margin-bottom: 6px; }
.dwd-mm-promo-button { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }




@media (max-width: 980px) {
  .dwd-mm-panel {
    position: static;
    width: 100%;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border-left: 0;
    border-right: 0;
    padding: 16px;
  }
  .dwd-mm-item:hover > .dwd-mm-panel { display: none; } /* hover not reliable on mobile */
  .dwd-mm-item.dwd-mm-open > .dwd-mm-panel { display: block; }
  .dwd-mm-layout-3col_promo .dwd-mm-inner,
  .dwd-mm-layout-4col_promo .dwd-mm-inner { grid-template-columns: 1fr; }
  .dwd-mm-layout-2col .dwd-mm-inner,
  .dwd-mm-layout-3col .dwd-mm-inner { grid-template-columns: 1fr; }
}


/* Auto-flow long brand lists into CSS columns */
.dwd-mm-links-flow {
  column-count: var(--dwd-mm-cols, 3);
  column-gap: 40px;
}
.dwd-mm-links-flow li { break-inside: avoid; }

/* Full width (fixed) panel option */
.dwd-mm-panel.dwd-mm-fixed {
  position: fixed;
  left: 0;
  right: 0;
  width: 100vw !important;
  max-width: none;
  margin-top: 0;
  border-radius: 0;
  z-index: 10050;
}

/* When fixed, keep inner content centered with a max width */
.dwd-mm-panel.dwd-mm-fixed .dwd-mm-inner {
  width: min(1400px, 94vw);
  margin: 0 auto;
}

/* Mobile: fixed panels should behave like normal stacked panels */
@media (max-width: 980px) {
  .dwd-mm-panel.dwd-mm-fixed {
    position: static;
    width: 100% !important;
    left: auto;
    right: auto;
    border-radius: 0;
  }
  .dwd-mm-links-flow { column-count: 1; }
}


/* Let a single brands column span across all content columns (when other cols are unused) */
.dwd-mm-span-all {
  grid-column: 1 / -1;
}

/* If promo exists, span across all NON-promo columns */
.dwd-mm-layout-3col_promo .dwd-mm-span-all,
.dwd-mm-layout-4col_promo .dwd-mm-span-all {
  grid-column: 1 / 4;
}

/* Make the flow list use the full available width */
.dwd-mm-span-all .dwd-mm-links-flow {
  column-gap: 60px;
}
/* =========================================================
   DWD Mega Menu - Front styles (authoritative)
   ========================================================= */

/* Panel defaults */
.dwd-mm-panel {
  display: none;
  background: #fff;
  z-index: 9999;
}

/* Open state - MUST win */
.navbar-nav > li.dwd-mm-item.dwd-mm-open > .dwd-mm-panel {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Desktop: fixed mega panel under nav */
@media (min-width: 992px) {
  .dwd-mm-panel.dwd-mm-fixed {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
  }

  /* Optional: nicer spacing */
  .dwd-mm-panel {
    padding: 18px 24px;
    border-top: 1px solid rgba(0,0,0,.08);
  }
}

/* Layout wrapper (your plugin outputs these classes) */
.dwd-mm-inner {
  display: grid;
  gap: 24px;
}

/* Example layouts (adjust if your plugin uses different layout classes) */
.dwd-mm-layout-2col .dwd-mm-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dwd-mm-layout-3col .dwd-mm-inner,
.dwd-mm-layout-3col_promo .dwd-mm-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dwd-mm-layout-4col .dwd-mm-inner { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Column heading */
.dwd-mm-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 10px 0;
}

/* Links list */
.dwd-mm-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dwd-mm-links > li {
  margin: 10px 0;
  padding: 0;
}
.dwd-mm-links > li > a {
  display: inline-block;
  padding: 2px 0;
  line-height: 1.15;
  text-decoration: none;
}

/* “Flow into columns” list (brands) */
.dwd-mm-links-flow {
  list-style: none;
  padding: 0;
  margin: 0;
  column-gap: 24px;
}
.dwd-mm-links-flow > li {
  break-inside: avoid;
  padding: 0;
  margin: 0 0 0px 0;
}
.dwd-mm-links-flow > li > a {
  display: inline-block;
  padding: 0;
  line-height: 1.12; /* tighten vertical spacing */
}

/* When plugin sets inline style --dwd-mm-cols */
.dwd-mm-links-flow { column-count: var(--dwd-mm-cols, 3); }

/* Mobile offcanvas: panels should be inline within list */
@media (max-width: 991.98px) {
  .dwd-mm-panel {
    position: static !important;
    padding: 10px 16px;
    border: 0;
  }
  .offcanvas .dwd-mm-links-flow,
  .offcanvas .dwd-mm-links-flow[style],
  .offcanvas .dwd-mm-links-flow[style*="--dwd-mm-cols"] {
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  .offcanvas .dwd-mm-links-flow > li {
    break-inside: auto !important;
    margin: 0 0 0px 0 !important;
  }

  .offcanvas .dwd-mm-links-flow > li > a {
    display: block;
    padding: 8px 0 !important;   /* nice tap target */
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;      /* stop weird splitting */
  }
}

@media (min-width: 992px) {
  .dwd-mm-panel.dwd-mm-fixed {
    top: 0;               /* safe default */
    transform: translateY(0);
  }
}