/* === Base mega-menu (front + éditeur) === */
:root {
  --hv-mm-breakpoint: 782px;
  --hv-mm-gap: 18px;
  --hv-mm-bg: var(--wp--preset--color--base, #fff);
  --hv-mm-fg: var(--wp--preset--color--contrast, #111);
}

.hv-mm { position: relative; }
.hv-mm__wrapper { display: block; }

.hv-mm__content { 
  display: flex; 
  align-items: center; 
  gap: var(--hv-mm-gap);
  list-style: none; 
  margin: 0; 
  padding: 0;
}
.hv-mm__content > li { position: static; }

.hv-mm-item__link { display:flex; align-items:center; gap:.5rem; }
.hv-mm-item__link > a { text-decoration:none; color: inherit; font-weight: 600; }

.hv-mm-item__toggle { 
  background: none; border: 0; cursor: pointer; line-height: 1; 
  display: inline-flex; align-items:center; justify-content:center; 
}
.hv-mm-item__toggle .fa { font-size: .9em; }
.hv-mm-item.hv-mm-item--open > .hv-mm-item__link .hv-mm-item__toggle { transform: rotate(180deg); }

.hv-mm-item__dropdown-wrapper { 
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1000; 
  display: none; 
}
.hv-mm-item.hv-mm-item--open > .hv-mm-item__dropdown-wrapper { display: block; }
.hv-mm-item__dropdown { background: var(--hv-mm-bg); color: var(--hv-mm-fg); border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.08); overflow: clip; }
.hv-mm-item__dropdown-content { padding: var(--wp--preset--spacing--30, 24px); }

.hv-mm--fullwidth .hv-mm-item__dropdown-wrapper { left: 0 !important; right: 0 !important; width: 100% !important; }

@media (max-width: 782px){
  .hv-mm__toggle-wrapper { display:block; }
  .hv-mm__content { flex-direction: column; align-items: stretch; }
  .hv-mm-item__dropdown-wrapper { position: static; }
}

.hv-mm a:focus-visible, .hv-mm button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Spécifique items / colonnes */
.hv-mm-item:not(.has-children) .hv-mm-item__toggle { display: none; }
.hv-mm-item:not(.has-children) .hv-mm-item__dropdown-wrapper { display:none; }

.hv-mm-item__dropdown-wrapper[data-columns="3"] .hv-mm-item__dropdown-content { 
  display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); 
  gap: var(--wp--preset--spacing--30, 24px); 
}
.hv-mm-item__dropdown-wrapper[data-columns="4"] .hv-mm-item__dropdown-content { 
  display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); 
  gap: var(--wp--preset--spacing--30, 24px); 
}
