/* Mega Menu Styles */

#mega-menu-panel {
    position: fixed; 
    top: 0;
    left: 0;
    width: 25%; 
    height: 100vh; 
    background-color: #fff; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    z-index: 1060; 
    overflow-y: auto;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.mega-menu-panel .nav-link {
    text-transform: uppercase;
}

#mega-menu-panel.is-active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.mega-menu-item > span {
    cursor: pointer;
}

.mega-menu-level {
    padding: 15px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%); 
    border-bottom: 1px solid #eee;
}

.mega-menu-level.level-active {
    transform: translateX(0); 
}

.mega-menu-level.level-parent {
    transform: translateX(-100%); 
}

.mega-menu-level .level-title {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mega-menu-level .back-button {
    color: var(--wp--preset--color--color-2); 
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block; 
}


.close-mega-menu:hover {
    background-color: var(--wp--preset--color--color-1); 
    color: #fff;
}

/* Ajustement spécifique Close button */
.close-mega-menu {
    position: absolute;
    top: 15px; 
    right: 15px;
    width: 30px; 
    height: 30px; 
    border-radius: 50%;
    padding: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 22px; 
    font-weight: 300;
    background-color: var(--wp--preset--color--color-2); 
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
}

/* Ajustement spécifique Back button */
.mega-menu-level .back-button {
    margin-bottom: 15px;
    /* Icône + texte */
}
.mega-menu-level .back-button i {
    margin-right: 5px;
}

.mega-menu-level ul {
    list-style: none;
    padding: 0; 
    margin: 0;
}

/* Make list items flex containers */
.mega-menu-level ul li {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid #f0f0f0; 
    padding: 8px 0; 
}

.mega-menu-level ul li a,
.mega-menu-level ul li span { 
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease, background-color 0.2s ease;
    flex-grow: 1; 
    cursor: pointer;
}

.mega-menu-level ul li a:hover,
.mega-menu-level ul li span:hover {
    background-color: #f8f8f8;
    color: var(--wp--preset--color--color-2); 
}

/* Style for the dynamically added icon */
.mega-menu-icon {
    color: var(--wp--preset--color--color-2); 
    margin-left: 8px; 
    font-size: 0.9em; 
    flex-shrink: 0; 
}

/* Override Bootstrap display:none for UL inside the panel */
#mega-menu-panel .mega-menu-level > ul.dropdown-menu {
    display: block !important; 
    position: static; 
    border: none; 
    box-shadow: none;
    float: none; 
    width: auto; 
    margin: 0; 
    background-color: transparent;
}

/* Overlay for Mega Menu */
#mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1055; 
    opacity: 0;
    visibility: hidden;
}

#mega-menu-overlay.is-active {
    opacity: 1 !important; 
    visibility: visible !important;
}

/* Scroll Indicator */
#mega-menu-scroll-indicator {
    position: fixed; 
    bottom: 10px;
    left: 12.5%; 
    transform: translateX(-50%); 
    color: #6BC5B2; 
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none; 
    z-index: 1060;
}

/* Hide indicator via JS when scrolling down */
#mega-menu-scroll-indicator.indicator-hidden {
    opacity: 0 !important; 
    visibility: hidden !important; 
}

/* Nouvelle règle: Afficher si le panneau est actif ET que l'indicateur n'est pas explicitement caché */
#mega-menu-panel.is-active + #mega-menu-scroll-indicator:not(.indicator-hidden) {
    opacity: 1;
    visibility: visible;
    animation: bounce-down 1.5s infinite;
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Bouton "Accéder à tout l'univers" */
.view-all-level-btn {
    border: 1px solid var(--wp--preset--color--color-text);
    font-weight: 800;
    padding: 7px 10px;
    border-radius: 25px;
    display: block;
    width: fit-content;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1;
    color: var(--wp--preset--color--color-text);
    text-decoration: none;
    margin: 15px 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-all-level-btn:hover {
    background-color: #f0f0f0; /* Léger fond au survol */
    color: var(--wp--preset--color--color-text);
}

/* =============================================================================
   MEGA MENU DEPLOYE  (2026-11-13)

   L'ancien panneau etait un tiroir de 25 % de large colle a gauche, qui
   montrait un niveau a la fois : trois clics pour atteindre une sous-rubrique.
   Il devient un bandeau pleine largeur sous le header, ouvert au survol, avec
   les rayons a gauche et tout leur contenu deplie a droite.

   assets/js/mega-menu.js pose la classe .pdc-mega-actif : les regles
   d'origine restent intactes au cas ou.
   ============================================================================= */

#mega-menu-panel.pdc-mega-actif {
  position: fixed;
  top: var(--pdc-entete-h, 150px);
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  max-height: calc(100vh - var(--pdc-entete-h, 150px) - 40px);
  overflow-y: auto;
  transform: none;
  border-top: 1px solid #ececf0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

.pdc-mega {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 80px;
}

@media screen and (min-width: 1400px) {
  .pdc-mega {
    max-width: 1600px;
    padding: 0 120px;
  }
}

@media screen and (min-width: 1600px) {
  .pdc-mega {
    max-width: 1800px;
    padding: 0 160px;
  }
}

/* --- Colonne des rayons ---------------------------------------------------- */

.pdc-mega__rail {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 24px 0;
  border-right: 1px solid #ececf0;
}

.pdc-mega__rayon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #3f4652 !important;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
}

/* Le theme pose une barre rose animee en ::before sur tous les <a>. */
.pdc-mega a::before,
.pdc-mega a::after {
  display: none !important;
  content: none !important;
}

.pdc-mega__rayon::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-top: 1.8px solid currentColor;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pdc-mega__rayon.is-actif {
  background: #f7f7f9;
  color: var(--wp--preset--color--color-1) !important;
}

.pdc-mega__rayon.is-actif::after {
  opacity: 1;
}

/* --- Contenu du rayon survole ---------------------------------------------- */

.pdc-mega__contenu {
  padding: 18px 0 28px 28px;
  min-width: 0;
}

.pdc-mega__tout {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--wp--preset--color--color-1);
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none !important;
}

.pdc-mega__tout:hover {
  filter: brightness(1.08);
}

/* Les blocs se repartissent en colonnes : le navigateur equilibre tout seul,
   quel que soit le nombre de sous-rayons. */
.pdc-mega__blocs {
  columns: 4;
  column-gap: 32px;
}

.pdc-mega__bloc {
  break-inside: avoid;
  margin-bottom: 22px;
}

.pdc-mega__bloc-titre {
  display: block;
  margin-bottom: 7px;
  color: #1a1a1a !important;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none !important;
}

.pdc-mega__bloc-titre:hover {
  color: var(--wp--preset--color--color-1) !important;
}

.pdc-mega__bloc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdc-mega__bloc li {
  margin: 0;
}

.pdc-mega__feuille {
  display: block;
  padding: 3px 0;
  color: #5e6470 !important;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-decoration: none !important;
}

.pdc-mega__feuille:hover {
  color: var(--wp--preset--color--color-1) !important;
}

@media screen and (max-width: 1399px) {
  .pdc-mega__blocs {
    columns: 3;
  }
}

/* L'onglet ouvert garde son soulignement pendant que le panneau est la. */
#desktop-nav-container .desktop-nav > li.est-ouvert::after {
  transform: scaleX(1);
}

/* L'icone du rayon dans la colonne de gauche du mega menu. */
.pdc-mega__rayon .pdc-icone {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-right: 10px;
  color: #9aa0ab;
}

.pdc-mega__rayon {
  justify-content: flex-start;
}

.pdc-mega__rayon > span {
  flex: 1 1 auto;
  min-width: 0;
}

.pdc-mega__rayon.is-actif .pdc-icone {
  color: var(--wp--preset--color--color-1);
}

/* L'icone des sous-rayons, devant le titre de chaque bloc. */
.pdc-mega__bloc-titre {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdc-mega__bloc-titre .pdc-icone {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #9aa0ab;
}

.pdc-mega__bloc-titre:hover .pdc-icone {
  color: var(--wp--preset--color--color-1);
}

/* =============================================================================
   MENU DES RAYONS : UNE SEULE ENTRÉE  (2026-11-24)

   Remplace les six onglets de rayon de l'ancien mega menu. La barre ne porte
   plus que « Catégories » et les raccourcis sans enfant du menu WordPress ;
   tout le reste vit dans un panneau à deux parties, ouvert au survol comme au
   clic. Modèle : pharma-gdd.com, relevé le même jour.

   Les règles .mega-menu-* qui précèdent dans ce fichier ne s'appliquent plus à
   rien : leur balisage a disparu du gabarit. Elles sont laissées le temps de
   valider la nouvelle navigation, puis elles partiront.
   ============================================================================= */

/* ── La barre ──────────────────────────────────────────────────────────────── */

.pdc-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.pdc-nav__declencheur,
.pdc-nav__lien {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 0;
  background: none;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  color: #1f2937;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}

.pdc-nav__declencheur {
  font-weight: 700;
}

.pdc-nav__lien:hover,
.pdc-nav__declencheur:hover,
.pdc-nav__declencheur.est-ouvert {
  color: var(--wp--preset--color--color-1, #e62ca1);
}

/* Les trois traits, dessinés plutôt qu'importés : trois <span> suffisent, et
   l'icône suit la couleur du texte sans dépendre de la bibliothèque. */
.pdc-nav__traits {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 17px;
  height: 12px;
}

.pdc-nav__traits span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.pdc-nav__lien .pdc-icone {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

/* ── Le panneau ────────────────────────────────────────────────────────────── */

/* RIEN NE BOUGE A L'OUVERTURE (corrige le 2026-11-24).
   Le panneau arrivait de 8 px plus haut, donc par-dessus le bas du bouton :
   la souris passait du bouton au panneau, l'animation redescendait le panneau
   sous le curseur, et le menu s'ouvrait puis se fermait en boucle. Un fondu
   seul ne deplace rien sous la souris. */
.pdc-rayons {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 1050;
  padding: 0 0 10px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.pdc-rayons.est-ouvert {
  opacity: 1;
}

.pdc-rayons__cadre {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 330px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
  overflow: hidden;
}

/* SOUS L'EN-TETE, et c'est tout l'interet (corrige le 2026-11-24).
   A 1040, le voile passait par-dessus l'en-tete (z-index 1000), donc par-dessus
   le bouton « Categories » lui-meme : la souris quittait le bouton sans avoir
   bouge, le menu se fermait, le voile disparaissait, le bouton se retrouvait
   sous la souris, le menu se rouvrait. Deux allers-retours par seconde, sans
   que le curseur ait bouge d'un pixel. L'en-tete reste donc au-dessus. */
.pdc-rayons__voile {
  position: fixed;
  inset: 0;
  z-index: 990;
  /* Il assombrit, il ne recoit rien : c'est ce qui l'empeche de voler le
     survol du bouton, et donc de relancer la boucle. */
  pointer-events: none;
  background: rgba(16, 24, 40, 0.28);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.pdc-rayons__voile.est-ouvert {
  opacity: 1;
}

/* Colonne de gauche : les rayons. */
.pdc-rayons__liste {
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: #fbfbfc;
  border-right: 1px solid #eceff3;
  max-height: 70vh;
  overflow-y: auto;
}

.pdc-rayons__onglet {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

.pdc-rayons__onglet .pdc-icone {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--wp--preset--color--color-2, #00bda5);
}

.pdc-rayons__onglet-mot {
  flex: 1 1 auto;
  min-width: 0;
}

.pdc-rayons__chevron {
  flex: 0 0 auto;
  color: #c7ccd4;
}

.pdc-rayons__onglet.est-actif,
.pdc-rayons__onglet:hover {
  background: #fff;
  color: var(--wp--preset--color--color-1, #e62ca1);
}

.pdc-rayons__onglet.est-actif .pdc-icone,
.pdc-rayons__onglet:hover .pdc-icone,
.pdc-rayons__onglet.est-actif .pdc-rayons__chevron {
  color: var(--wp--preset--color--color-1, #e62ca1);
}

/* Partie de droite : le rayon survolé. */
.pdc-rayons__panneaux {
  position: relative;
  padding: 18px 24px 22px;
  max-height: 70vh;
  overflow-y: auto;
}

.pdc-rayons__panneau {
  display: none;
}

.pdc-rayons__panneau.est-actif {
  display: block;
}

.pdc-rayons__entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f3f6;
}

.pdc-rayons__titre {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
}

.pdc-rayons__titre .pdc-icone {
  width: 22px;
  height: 22px;
  color: var(--wp--preset--color--color-1, #e62ca1);
}

.pdc-rayons__tout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--wp--preset--color--color-1, #e62ca1);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.pdc-rayons__tout:hover {
  background: var(--wp--preset--color--color-1, #e62ca1);
  color: #fff !important;
}

/* Les sous-rayons en colonnes : trois à l'aise, quatre sur un grand écran. */
.pdc-rayons__colonnes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media screen and (min-width: 1400px) {
  .pdc-rayons__colonnes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pdc-rayons__sous {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1f2937 !important;
  text-decoration: none !important;
}

.pdc-rayons__sous:hover {
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
}

.pdc-rayons__feuilles {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdc-rayons__feuilles a {
  display: block;
  padding: 3px 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #6b7280 !important;
  text-decoration: none !important;
}

.pdc-rayons__feuilles a:hover {
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
}

.pdc-rayons__plus {
  font-weight: 600;
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
}

/* Entre 992 et 1199 px, la colonne des rayons prend trop : on la resserre et
   on passe les sous-rayons sur deux colonnes. */
@media screen and (min-width: 992px) and (max-width: 1199px) {
  .pdc-rayons__cadre {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .pdc-rayons__colonnes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pdc-nav__declencheur,
  .pdc-nav__lien {
    padding: 12px 11px;
    font-size: 0.86rem;
  }
}

/* ── Téléphone et tablette : la descente par niveaux ───────────────────────── */

.pdc-mrayons {
  padding: 4px 0 10px;
}

.pdc-mrayons__raccourcis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 4px;
}

.pdc-mrayons__raccourci {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--wp--preset--color--color-1, #e62ca1);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
  text-decoration: none !important;
}

.pdc-mrayons__intitule {
  margin: 14px 0 4px;
  padding: 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa3ad;
}

/* En profondeur, les raccourcis et l'intitulé s'effacent : la liste du
   sous-rayon commence alors en haut de l'écran. */
.pdc-mrayons.est-en-profondeur .pdc-mrayons__raccourcis,
.pdc-mrayons.est-en-profondeur .pdc-mrayons__intitule {
  display: none;
}

.pdc-mrayons__niveau[hidden] {
  display: none;
}

.pdc-mrayons__liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdc-mrayons__entree {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #f1f3f6;
  background: none;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937 !important;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
}

.pdc-mrayons__entree span {
  flex: 1 1 auto;
  min-width: 0;
}

.pdc-mrayons__entree svg:last-child {
  flex: 0 0 auto;
  color: #c7ccd4;
}

.pdc-mrayons__entree .pdc-icone {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--wp--preset--color--color-2, #00bda5);
}

.pdc-mrayons__retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 10px 16px;
  border: 0;
  background: none;
  font-size: 0.86rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
}

.pdc-mrayons__tout {
  display: block;
  margin: 0 16px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fdf3f9;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  color: var(--wp--preset--color--color-1, #e62ca1) !important;
  text-decoration: none !important;
}
