/* ===========================
   Desktop Mega Menu - Body & Shape Store
   3-koloms dropdown panel
   =========================== */

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #f8f9f3; /* crème i.p.v. wit — consistent met header/linker kolom (klantfeedback: witruimte weg) */
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  border-top: 1px solid var(--bss-line, #d7dfd1);
  border-bottom: none;   /* base-theme (main.css) zet hier een groene 3px-lijn → weg (klantfeedback 08-07) */
  z-index: 99;
  display: none;
  padding: 0;
  overflow: hidden; /* clipt het full-bleed grijs van de categorie-kolom */
}
.mega-menu--open {
  display: block;
}

/* Inner box-uitgelijnd met de header-content (zelfde 1440px-box + 24px-rand),
   zodat de categorietekst exact onder het topmenu ("Producten") valt. */
.mega-menu__inner {
  max-width: none;
  margin: 0;
  /* base-theme (main.css) zet padding:1.5rem 0 → 24px cream-strook bovenaan ("balk").
     Verticale padding uit zodat de gekleurde linkerkolom tot de bovenkant reikt (klantfeedback 08-07). */
  padding-top: 0;
  padding-bottom: 0;
  padding-left: max(24px, calc((100% - 1440px) / 2));
  padding-right: max(24px, calc((100% - 1440px) / 2));
  display: grid;
  grid-template-columns: 230px 1fr 400px;
  min-height: 460px;
}

/* Left column: main categories — grijs loopt full-bleed naar de schermrand. */
.mega-menu__categories {
  position: relative;
  /* padding-top 6px zodat de eerste hoofdcat op dezelfde bovenlijn valt als de subcat-lijst
     en de rechterkolom-titel (klantfeedback 08-07: 3 kolommen bovenaan gelijk). */
  padding: 6px 0;
}
.mega-menu__categories::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: -9999px;
  /* Linkerkolom = zelfde kleur als USP-balk (klantfeedback 08-07, .bssc-topbar #e9efe2). */
  background: #e9efe2;
  z-index: 0;
}
.mega-menu__cat-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 24px 11px 0;
  font-size: 15px;
  color: var(--bss-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}
.mega-menu__cat-link--active {
  color: #2b2b2b; /* geselecteerde hoofdcat = donker, niet groen (klantfeedback 08-07) */
  font-weight: 600;
}
.mega-menu__cat-link:hover {
  color: var(--bss-green);
}
.mega-menu__cat-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.mega-menu__cat-link--active svg,
.mega-menu__cat-link:hover svg {
  opacity: 1;
}

/* Middle column: subcategories — top uitgelijnd met de categorie-kolom (klantfeedback: sub cat afstanden) */
.mega-menu__subcategories {
  padding: 12px 40px;
}
.mega-menu__sub-link { padding: 9px 0; }
.mega-menu__sub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mega-menu__sub-link {
  display: block;
  padding: 5px 0; /* subcat-ruimte kleiner dan hoofdcat (11px) — klantfeedback 08-07 */
  font-size: 15px;
  color: var(--bss-green);
  text-decoration: none;
  transition: color 0.15s ease;
}
.mega-menu__sub-link:hover {
  color: var(--bss-muted);
}

/* Right column: promotional products */
.mega-menu__promo {
  padding: 16px 28px;
  border-left: 1px solid #e9e8e5;
}
.mega-menu__promo-title {
  font-family: 'Neue Faktum Extended', 'Archivo', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--bss-green);
  margin-bottom: 24px;
  line-height: 1.2;
}

.mega-menu__promo-item {
  display: flex;
  align-items: stretch;   /* afbeelding + tekst boven-uitgelijnd, knop kan naar onder (klantfeedback 08-07) */
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--bss-tile-2);
  text-decoration: none;
  color: inherit;
}
.mega-menu__promo-item:last-child {
  border-bottom: none;
}
.mega-menu__promo-img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: contain;
}
.mega-menu__promo-info {
  flex: 1;
}
.mega-menu__promo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--bss-green);
  margin-bottom: 2px;
}
.mega-menu__promo-brand {
  font-size: 13px;
  color: var(--bss-muted);
  margin-bottom: 6px;
}
.mega-menu__promo-pricing {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mega-menu__promo-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--bss-green);
}
.mega-menu__promo-unit {
  font-size: 12px;
  color: var(--bss-muted-light);
}
.mega-menu__promo-btn {
  padding: 8px 18px;
  background: var(--bss-green);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  flex-shrink: 0;
  align-self: flex-end;   /* knop rechtsONDER in het productvlak (klantfeedback 08-07) */
  transition: background 0.2s ease;
}
.mega-menu__promo-btn:hover {
  background: var(--bss-green-hover);
}

/* Bridge: spans → blokken zodat WC-image + naam/merk stapelen als in het ontwerp */
.mega-menu__promo-img { display: flex; align-items: center; justify-content: center; }
.mega-menu__promo-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mega-menu__promo-info { display: flex; flex-direction: column; }
.mega-menu__promo-name,
.mega-menu__promo-brand { display: block; }
.mega-menu__promo-price del { color: var(--bss-muted-light); font-weight: 400; font-size: 13px; margin-right: 4px; }
.mega-menu__promo-price ins { text-decoration: none; }
/* 'Alle X'-link identiek aan de rest (geen bold, geen pijltje) — klantfeedback 08-07. */
.mega-menu__sub-link--all { margin-top: 6px; }

/* ===========================
   Merken mega-menu — top-10 logo-grid + A-Z index (klant-design "Menu merken")
   Hergebruikt .mega-menu (positie/crème/full-width); alleen de inner-layout wijkt af.
   =========================== */
.bss-brandmenu__inner {
  grid-template-columns: 230px 1fr;
  min-height: 0; padding-top: 28px; padding-bottom: 36px; align-items: stretch;
}
.bss-brandmenu__side {
  position: relative;
  padding-right: 28px; /* gekleurde kolom + geen scheidingslijn (klantfeedback 08-07, zie design) */
  display: flex; flex-direction: column;
}
.bss-brandmenu__side::before {
  content: ''; position: absolute; top: -28px; bottom: -36px; right: 0; left: -9999px;
  background: #e9efe2; z-index: 0;   /* = USP-balk (klantfeedback 08-07) */
}
.bss-brandmenu__side > * { position: relative; z-index: 1; }
.bss-brandmenu__heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  /* Font gelijkgetrokken met de rest (Inter) + pijltje even groot als producten-menu (klantfeedback 08-07). */
  font-family: 'Inter', sans-serif; font-weight: 700; letter-spacing: 0;
  font-size: 17px; color: #2b2b2b; text-decoration: none; padding: 2px 0 20px;
}
/* Pijltje even groot als de top-nav chevrons "Producten"/"Merken" (11px) — klantfeedback 08-07. */
.bss-brandmenu__heading svg { width: 11px; height: 11px; stroke: currentColor; flex-shrink: 0; }
.bss-brandmenu__heading:hover { color: var(--bss-green, #30473f); }
.bss-brandmenu__index { display: flex; flex-direction: column; }
.bss-brandmenu__index-link {
  font-family: 'Inter', sans-serif; font-size: 15px; color: var(--bss-muted, #6f6f6f);
  text-decoration: none; padding: 11px 0; transition: color 0.15s ease;
}
.bss-brandmenu__index-link:hover,
.bss-brandmenu__index-link.is-active { color: var(--bss-green, #30473f); font-weight: 600; }
/* Leeg alfabet-segment (geen merken) → gedimd + niet-hoverbaar (klantfeedback 08-07). */
.bss-brandmenu__index-link--empty { opacity: 0.4; pointer-events: none; }
/* Wrapper om de gestapelde merken-panels (top-10 + per range); slechts één zichtbaar. */
.bss-brandmenu__grids { min-width: 0; }
.bss-brandmenu__grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px 20px;
  padding: 2px 0 2px 40px; align-content: start;
  min-width: 0; /* Safari: voorkomt dat aspect-ratio-inhoud de 1fr-tracks opblaast */
}
/* Safari-fix: grid-items met min-width:auto laten aspect-ratio-inhoud de 1fr-kolommen
   opblazen (enorme kaarten). min-width:0 ontkoppelt de trackbreedte van de inhoud. */
.bss-brandmenu__card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.bss-brandmenu__logo {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 16 / 9;   /* expliciete breedte: hoogte leidt af van breedte (Safari-deterministisch) */
  background: #e9efe2;   /* = kleur linker menu / USP-balk i.p.v. lichtgrijs (klantfeedback 08-07) */
  border: 1px solid var(--bss-line, #d7dfd1);
  border-radius: 12px; overflow: hidden; padding: 16px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bss-brandmenu__logo-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.bss-brandmenu__logo-text {
  font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 18px; line-height: 1.1;
  text-align: center; color: var(--bss-green, #30473f);
}
.bss-brandmenu__card:hover .bss-brandmenu__logo { border-color: var(--bss-green, #30473f); transform: translateY(-2px); }
.bss-brandmenu__name { font-size: 14px; font-weight: 500; color: var(--bss-ink, #262626); }
@media (max-width: 1100px) { .bss-brandmenu__grid { grid-template-columns: repeat(4, 1fr); } }

/* Lichte fade over de pagina als een mega-menu open is (klantfeedback 08-07).
   z-index 98 = ONDER het menu (99), de header (200) en de USP-balk (201) → de fade
   valt niet over de USP-header, alleen over de pagina-inhoud onder het menu. */
body:has(.mega-menu--open)::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(38, 38, 38, 0.14);
  z-index: 98;
  pointer-events: none;
  animation: bss-mega-fade 0.2s ease;
}
@keyframes bss-mega-fade { from { opacity: 0; } to { opacity: 1; } }

/* Only show on desktop */
@media (max-width: 767px) {
  .mega-menu { display: none !important; }
  body:has(.mega-menu--open)::after { display: none; }
}
