/* ─── Panels container ─────────────────────────────── */
.mega-menu-panels {
  position: relative;
  z-index: 100;
}

/* ─── Panel individuel ─────────────────────────────── */
.mega-menu-panel {
  display: none; /* caché par défaut */
  position: fixed;
  top: var(--header-bottom, 80px);
  left: 0;
  right: 0;
  background: white;
  border-top: 3px solid var(--wp--preset--color--primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding-block: 2rem;
  z-index: 100;
}

.mega-menu-panel.is-open {
  display: block;
  animation: megaIn 0.2s ease;
}

@keyframes megaIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Overlay ──────────────────────────────────────── */
.mega-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-bottom, 80px);
  background: rgba(0,0,0,0.25);
  z-index: 99;
}
.mega-overlay.is-visible { display: block; }

/* ─── Trigger actif ────────────────────────────────── */
.mega-trigger.is-active > a {
  color: var(--wp--preset--color--primary);
}

.mega-trigger > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  margin-top: -2px;
  vertical-align: middle;
  transition: transform 0.2s;
}

.mega-trigger.is-active > a::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

/* ─── Colonnes ─────────────────────────────────────── */
.mega-col-title {
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wp--preset--color--primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 0.75rem !important;
}

.mega-col-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mega-col-list li a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, padding-left 0.15s;
}

.mega-col-list li a:hover {
  background: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
  color: var(--wp--preset--color--primary);
  padding-left: 1rem;
}

.mega-col--featured {
  background: var(--wp--preset--color--base-2, #f5f5f5);
  border-radius: 12px;
  padding: 1rem !important;
}

/* ─── Mobile ───────────────────────────────────────── */
@media (max-width: 1023px) {
  .mega-menu-panel.is-open {
    position: static;
    box-shadow: none;
    border-top: none;
    animation: none;
    padding: 1rem;
  }

  .mega-overlay { display: none !important; }
}




/* ─── Panel accordéon mobile ───────────────────────── */
.mega-mobile-panel {
  display: none;
  padding: 1rem;
  background: var(--wp--preset--color--base-2, #f5f5f5);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.mega-mobile-panel.is-open {
  display: block;
  animation: megaIn 0.2s ease;
}

/* Désactive le panel fixe desktop sur mobile */
@media (max-width: 1023px) {
  .mega-menu-panel,
  .mega-overlay {
    display: none !important;
  }

  /* Flèche sur le trigger */
  .mega-trigger > a::after {
    float: right;
    margin-top: 6px;
  }

  .mega-trigger.is-active > a::after {
    transform: rotate(-135deg);
  }
}