/**
 * NM Mega Menu — styles (repris du prototype « header équilibré » validé le 01/12/2026).
 * Tout est préfixé .nm-mm / .nm-dr pour ne pas entrer en conflit avec Tailwind / Bootstrap du thème.
 */
.nm-mm, .nm-dr {
  --nm-green: #2f6f4e;
  --nm-green-deep: #0a3d29;
  --nm-green-tint: #e6f1eb;
  --nm-sage: #f6f8f6;
  --nm-ink: #1c2b24;
  --nm-muted: #5d6b64;
  --nm-line: #e3e9e5;
  --nm-paper: #fff;
  --nm-promo: #c92a2a;
  --nm-promo-tint: #fbeaea;
  --nm-btn: #111827;
  --nm-btn-hover: #374151;
  --nm-r: 6px;
  --nm-gutter: max(15px, calc((100% - 1240px) / 2 + 15px));
  color: var(--nm-ink);
  font-size: 15px;
}
.nm-mm *, .nm-dr * { box-sizing: border-box; }
.nm-mm a, .nm-dr a { color: inherit; text-decoration: none; }
/* le thème colore les liens du header au survol (bleu clair) : on impose le vert du menu */
.nm-mm a:hover, .nm-mm a:focus, .nm-dr a:hover, .nm-dr a:focus { color: var(--nm-green) !important; text-decoration: none !important; }
.nm-mm ul, .nm-dr ul { list-style: none; margin: 0; padding: 0; }
.nm-mm h2, .nm-dr h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--nm-green-deep); }
.nm-mm button, .nm-dr button { font: inherit; color: inherit; }

/* ---------------- Barre de menus ---------------- */
.nm-mm { position: relative; background: var(--nm-paper); }
.nm-mm-bar { position: relative; display: flex; align-items: stretch; gap: 34px; height: 50px; padding: 0 var(--nm-gutter); }
/* filets haut et bas de la barre : sur toute la largeur de l'écran (--nm-vw = largeur réelle, posée par le JS) */
.nm-mm-bar::before, .nm-mm-bar::after { content: ""; position: absolute; left: 50%; width: var(--nm-vw, 100vw); transform: translateX(-50%); height: 1px; pointer-events: none; }
.nm-mm-bar::before { top: 0; background: #eef1ef; }
.nm-mm-bar::after { bottom: 0; background: var(--nm-line); }
.nm-mm-bar > li { display: flex; margin: 0 !important; padding: 0 !important; height: 100%; } /* le thème ajoute une marge aux li */
.nm-mm-bar > li.nm-mm-event-li { margin-left: auto !important; } /* lien spécial calé à droite */
.nm-mm .nm-mm-tab, .nm-mm .nm-mm-link { font-family: inherit; height: 100%; border-top: 2px solid transparent !important; /* équilibre la bordure de soulignement → texte centré */ line-height: 1; letter-spacing: normal; text-transform: none; box-shadow: none; outline-offset: 2px; margin: 0; border-radius: 0; }
.nm-mm-tab, .nm-mm-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 15px !important; font-weight: 700 !important; color: var(--nm-ink); border-bottom: 2px solid transparent; }
.nm-mm-tab:hover, .nm-mm-link:hover, .nm-mm-tab[aria-expanded="true"] { color: var(--nm-green); }
.nm-mm-tab[aria-expanded="true"] { border-bottom-color: var(--nm-green); }
.nm-mm-pct { font-size: 12px; font-weight: 700; color: var(--nm-promo); background: var(--nm-promo-tint); border-radius: 999px; padding: 2px 7px; }
.nm-mm-event-li { margin-left: auto; }
.nm-mm .nm-mm-event, .nm-mm .nm-mm-event:hover, .nm-mm .nm-mm-event:focus { color: var(--nm-event, var(--nm-promo)) !important; font-weight: 700; }
.nm-mm-event-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 999px; background: var(--nm-event, var(--nm-promo)); }
.nm-mm-event-ico { font-size: 16px; line-height: 1; }
.nm-dr-event { display: inline-flex; align-items: center; gap: 8px; }

/* ---------------- Panneaux ---------------- */
/* Pleine largeur d'écran même si la barre est dans un .container du thème ; contenu centré sur 1240 px */
.nm-mm-panel { position: absolute; left: 50%; right: auto; width: 100vw; transform: translateX(-50%); top: 100%; z-index: 9999; width: var(--nm-vw, 100vw); overflow: hidden; background: var(--nm-paper); border-bottom: 1px solid var(--nm-line); box-shadow: 0 18px 30px rgba(10, 61, 41, .10); }
.nm-mm-panel[hidden] { display: none; }
.nm-mm-inner { display: flex; gap: 0; min-height: 500px; max-width: 1240px; margin: 0 auto; padding: 0 15px; }
.nm-mm-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--nm-muted); margin: 0 0 10px; }
.nm-mm-see-all { font-size: 14px; font-weight: 600; color: var(--nm-green); }
.nm-mm-see-all:hover { text-decoration: underline; }

/* Colonne de gauche */
.nm-mm-left { width: 283px; flex-shrink: 0; display: flex; flex-direction: column; padding: 22px 22px 22px 0; margin-left: -15px; padding-left: 15px; background: var(--nm-sage); position: relative; }
/* fond gris prolongé jusqu'au bord gauche de l'écran (coupé par overflow du panneau) */
.nm-mm-left::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 100vw; background: var(--nm-sage); }
.nm-mm-list a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 4px; font-weight: 600; font-size: 14.5px; }
.nm-mm-list a:hover, .nm-mm-list a:focus, .nm-mm-list a[aria-current="true"] { background: var(--nm-paper); color: var(--nm-green) !important; }
.nm-mm-chev { color: var(--nm-muted); }
.nm-mm-all-big { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--nm-paper); border: 1.5px solid var(--nm-green); border-radius: var(--nm-r); color: var(--nm-green) !important; font-size: 15.5px; font-weight: 800; }
.nm-mm-all-big span { font-size: 17px; line-height: 1; }
.nm-mm .nm-mm-all-big:hover, .nm-mm .nm-mm-all-big:focus, .nm-dr .nm-mm-all-big:hover, .nm-dr .nm-mm-all-big:focus { background: var(--nm-green); color: #fff !important; }

/* Sous-catégories + produit */
.nm-mm-pane { flex: 1; display: flex; min-width: 0; }
.nm-mm-pane[hidden] { display: none; }
.nm-mm-mid { flex: 1; min-width: 0; padding: 24px 32px; }
.nm-mm-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.nm-mm-subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.nm-mm-subs a { display: block; padding: 11px 0; border-bottom: 1px solid #eef1ef; font-size: 15.5px; font-weight: 600; color: var(--nm-ink); }
.nm-mm-subs a:hover, .nm-mm-subs a:focus { color: var(--nm-green) !important; }
/* Actifs associés sous les sous-catégories d'un besoin : plus discrets que les sous-catégories */
.nm-mm-related { margin-top: 22px; padding-top: 16px; border-top: 1px solid #eef1ef; }
.nm-mm-related .nm-mm-chips { margin-bottom: 0; gap: 6px; }
.nm-mm-chip.is-small { padding: 4px 10px; font-size: 12.5px; }

/* Entrées sans sous-catégories : petite liste de produits */
.nm-mm-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.nm-mm-top a { display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: var(--nm-r); }
.nm-mm-top a:hover { background: var(--nm-sage); }
.nm-mm-top-img { width: 54px; height: 54px; flex-shrink: 0; background: #f2f5f3; border-radius: var(--nm-r); overflow: hidden; display: block; }
.nm-mm-top-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; }
.nm-mm-top-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nm-mm-top-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--nm-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nm-mm-top a:hover .nm-mm-top-name { color: var(--nm-green); }
.nm-mm-top-price { font-size: 13.5px; color: var(--nm-ink); }
.nm-mm-top-price s { color: var(--nm-muted); font-size: 12.5px; }
.nm-mm-top-price b.is-promo { color: var(--nm-promo); }
.nm-mm-right { width: 220px; flex-shrink: 0; padding: 24px 0; }
.nm-mm-product { display: flex; flex-direction: column; gap: 8px; }
.nm-mm-product-img { position: relative; display: block; aspect-ratio: 1; background: #f2f5f3; border-radius: var(--nm-r); overflow: hidden; }
.nm-mm-product-img img { width: 100%; height: 100%; object-fit: contain; padding: 18px; box-sizing: border-box; }
.nm-mm-badge { position: absolute; top: 10px; left: 10px; background: var(--nm-green); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 4px; }
.nm-mm-badge.is-promo { background: var(--nm-promo); }
.nm-mm-product-name { font-weight: 600; line-height: 1.35; }
.nm-mm-product-price { display: flex; gap: 8px; align-items: baseline; }
.nm-mm-product-price s { color: var(--nm-muted); font-size: 13px; }
.nm-mm-product-price b { font-size: 16px; }

/* Actifs */
.nm-mm-type-actifs .nm-mm-inner { gap: 48px; padding-top: 24px; padding-bottom: 24px; min-height: 0; }
.nm-mm-actifs-popular { flex: 0 0 56%; }
.nm-mm-actifs-az { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nm-mm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.nm-mm-chip { line-height: 20px; padding: 6px 12px; background: var(--nm-green-tint); color: var(--nm-green-deep) !important; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.nm-mm .nm-mm-chip:hover, .nm-mm .nm-mm-chip:focus, .nm-dr .nm-mm-chip:hover, .nm-dr .nm-mm-chip:focus { background: var(--nm-green); color: #fff !important; }
.nm-mm-letters { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.nm-mm-letter { font-weight: 700 !important; font-size: 14px !important; display: flex; align-items: center; justify-content: center; height: 34px; border: 1px solid var(--nm-line); background: var(--nm-paper); border-radius: var(--nm-r); font-weight: 700; cursor: pointer; }
.nm-mm-letter:hover, .nm-mm-letter[aria-expanded="true"] { border-color: var(--nm-green); color: var(--nm-green) !important; }
.nm-mm-letter-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 0; }
.nm-mm-letter-list[hidden] { display: none; }
.nm-mm-letter-list a { font-size: 14px; }
.nm-mm-letter-list a:hover { color: var(--nm-green); }

/* Groupe « Vitamines & minéraux » : 2 lignes de pastilles maximum (pastille 32 px + écart 8 px) */
.nm-mm .nm-mm-chips.is-2-lines { max-height: 72px; overflow: hidden; }

/* Marques */
.nm-mm-type-brands .nm-mm-inner { gap: 88px; padding-top: 24px; padding-bottom: 24px; min-height: 0; }
.nm-mm-brands-feat { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; }
.nm-mm-feat-links li + li { border-top: 1px solid #eef1ef; }
.nm-mm-feat-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.nm-mm-feat-links span { display: flex; flex-direction: column; }
.nm-mm-feat-links small { color: var(--nm-muted); font-size: 12.5px; }
.nm-mm-feat-links img { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.nm-mm-feat-links a:hover b { color: var(--nm-green); }
.nm-mm-brands-feat .nm-mm-all-big { margin-top: 14px; }
.nm-mm-brands-all { flex: 1; min-width: 0; }
.nm-mm-brand-list { columns: 3; column-gap: 28px; }
.nm-mm-brand-list a { display: block; padding: 6px 0; font-size: 14px; }
.nm-mm-brand-list a:hover { color: var(--nm-green); }
.nm-mm-une { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--nm-sage); border-radius: var(--nm-r); }
.nm-mm-une img { max-width: 100%; max-height: 80px; object-fit: contain; align-self: flex-start; }
.nm-mm-une p { margin: 0; font-size: 13.5px; color: var(--nm-muted); }

/* Conseils & services : liens à gauche, Journal au milieu, carte nutrithérapeute à droite */
.nm-mm-mid[hidden] { display: none; }
.nm-mm-catalogs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nm-mm-catalogs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--nm-line); border-radius: var(--nm-r); }
.nm-mm-catalogs a:hover { border-color: var(--nm-green); background: var(--nm-sage); }
.nm-mm-catalog-ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: var(--nm-r); background: var(--nm-green-tint); color: var(--nm-green); display: flex; align-items: center; justify-content: center; }
.nm-mm-catalog-txt { display: flex; flex-direction: column; gap: 2px; }
.nm-mm-catalog-txt b { font-size: 14.5px; color: var(--nm-ink); }
.nm-mm-catalog-txt small { font-size: 12.5px; color: var(--nm-muted); }
.nm-mm-journal { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.nm-mm-art-main { display: flex; flex-direction: column; gap: 10px; }
.nm-mm-art-img { display: block; aspect-ratio: 16 / 9; background: #eef2ef; border-radius: var(--nm-r); overflow: hidden; }
.nm-mm-art-img img { width: 100%; height: 100%; object-fit: cover; }
.nm-mm-art-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nm-mm-art-date { font-size: 12px; color: var(--nm-muted); }
.nm-mm-art-title { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--nm-ink); }
.nm-mm-art-list { display: flex; flex-direction: column; gap: 6px; }
.nm-mm-art-list a { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: var(--nm-r); }
.nm-mm-art-list a:hover { background: var(--nm-sage); }
.nm-mm-art-thumb { width: 84px; height: 56px; flex-shrink: 0; background: #eef2ef; border-radius: 4px; overflow: hidden; display: block; }
.nm-mm-art-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nm-mm-art-name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--nm-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nm-mm-type-advice .nm-mm-inner { min-height: 0; } /* Conseils : hauteur du contenu (pas de minimum de 500 px) */
.nm-mm-type-advice .nm-mm-mid, .nm-mm-type-advice .nm-mm-right { padding-bottom: 28px; }
.nm-mm-type-advice .nm-mm-right { width: 250px; }
.nm-mm-type-advice .nm-mm-card { width: 100%; }
.nm-mm .nm-mm-card.is-dark .nm-mm-card-title, .nm-mm .nm-mm-card.is-dark .nm-mm-tag { color: #fff !important; }

/* Conseils & services (cartes) */
.nm-mm-cards { flex: 1; display: flex; justify-content: flex-end; gap: 16px; padding: 22px 0; }
.nm-mm-card { width: 260px; display: flex; flex-direction: column; background: #e7efe9; border-radius: var(--nm-r); overflow: hidden; }
.nm-mm-card-img { height: 170px; display: flex; align-items: center; justify-content: center; background: #dbe7df; }
.nm-mm-card-img img { width: 100%; height: 100%; object-fit: cover; }
.nm-mm-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.nm-mm-tag { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: #fff; }
.nm-mm-card-title { font-weight: 800; font-size: 16px; line-height: 1.3; }
.nm-mm-card.is-dark { background: var(--nm-btn); color: #fff; }
.nm-mm .nm-mm-card.is-dark:hover, .nm-mm .nm-mm-card.is-dark:focus, .nm-mm .nm-mm-card.is-dark:hover .nm-mm-see-all { color: #fff !important; }
.nm-mm-card.is-dark .nm-mm-card-img { background: #1f2937; color: #fff; }
.nm-mm-card.is-dark .nm-mm-tag { background: rgba(255, 255, 255, .15); color: #fff; }
.nm-mm-card.is-dark .nm-mm-see-all { color: #fff; }

/* ---------------- Tiroir mobile ---------------- */
.nm-dr { position: fixed; top: 0; bottom: 0; left: 0; width: min(420px, 100%); z-index: 1060; background: var(--nm-paper); overflow-y: auto; -webkit-overflow-scrolling: touch; box-shadow: 12px 0 32px rgba(10, 61, 41, .16); }
.nm-dr[hidden], .nm-dr-overlay[hidden], .nm-dr-level[hidden] { display: none; }
.nm-dr-overlay { position: fixed; inset: 0; z-index: 1059; background: rgba(10, 30, 20, .38); }
html.nm-dr-locked, html.nm-dr-locked body { overflow: hidden; }
.nm-dr-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 16px; background: var(--nm-paper); border-bottom: 1px solid var(--nm-line); }
.nm-dr-logo { height: 30px; width: auto; display: block; }
.nm-dr-title { font-weight: 800; font-size: 17px; color: var(--nm-green-deep); }
.nm-dr-close { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nm-dr-list a, .nm-dr-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 16px; border: 0; border-bottom: 1px solid #eef1ef; background: transparent; text-align: left; font-size: 16px; font-weight: 600; cursor: pointer; }
.nm-dr-list .is-promo { color: var(--nm-promo); font-weight: 700; }
.nm-dr .nm-dr-list .is-event, .nm-dr .nm-dr-list .is-event:hover { color: var(--nm-event, var(--nm-promo)) !important; font-weight: 700; }
.nm-dr-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.nm-dr-top { gap: 8px; padding-bottom: 6px; }
.nm-dr-back { align-self: flex-start; border: 0; background: transparent; padding: 0; font-weight: 600; color: var(--nm-green); cursor: pointer; }
.nm-dr .nm-mm-all-big { width: 100%; }
.nm-dr .nm-mm-letters { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.nm-dr .nm-mm-brand-list { columns: 2; }
.nm-dr .nm-mm-card { width: 100%; }
.nm-dr-advice { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--nm-line); border-radius: var(--nm-r); font-size: 13px; color: var(--nm-muted); line-height: 1.4; }
.nm-dr-advice strong { display: block; font-size: 14px; color: var(--nm-ink); }
.nm-dr-advice-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 999px; background: var(--nm-btn); color: #fff; display: flex; align-items: center; justify-content: center; }
.nm-dr-advice-ico svg { width: 18px; height: 18px; }
.nm-dr-lang { display: flex; gap: 8px; padding: 6px 16px 22px; }
.nm-dr-lang a { padding: 8px 12px; border: 1px solid var(--nm-line); border-radius: var(--nm-r); font-weight: 700; font-size: 14px; }
.nm-dr-lang a[aria-current="true"] { border-color: var(--nm-green); color: var(--nm-green); }

/* Bloc compte du tiroir */
.nm-dr-acct { margin: 0 16px 14px; padding: 14px; background: var(--nm-sage); border-radius: var(--nm-r); display: flex; flex-direction: column; gap: 10px; }
.nm-dr-acct-hello { display: flex; align-items: center; justify-content: space-between; font-size: 14.5px; }
.nm-dr-acct-hello a { font-weight: 600; font-size: 13.5px; color: var(--nm-green); }
.nm-dr-acct-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nm-dr-acct-links a { padding: 7px 11px; background: #fff; border: 1px solid var(--nm-line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.nm-dr-acct-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nm-dr-btn { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: var(--nm-r); font-weight: 700; font-size: 14px; }
.nm-dr-btn.is-primary { background: var(--nm-btn); color: #fff !important; }
.nm-dr .nm-dr-btn.is-primary:hover, .nm-dr .nm-dr-btn.is-primary:focus { background: var(--nm-btn-hover); color: #fff !important; }
.nm-dr-btn.is-outline { border: 1.5px solid var(--nm-btn); color: var(--nm-btn) !important; background: #fff; }
.nm-dr-acct p { margin: 0; font-size: 12.5px; color: var(--nm-muted); }

/* Voile sur la page quand un menu est ouvert : léger assombrissement + petit flou */
.nm-mm-backdrop { position: fixed; inset: 0; z-index: 9998; background: rgba(10, 30, 20, .28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility 0s linear .18s; }
.nm-mm-backdrop.is-visible { opacity: 1; visibility: visible; transition: opacity .18s ease, visibility 0s; }
@media (max-width: 991.98px) { .nm-mm-backdrop { display: none; } }

/* La barre ordinateur disparaît sur mobile (le tiroir prend le relais) */
@media (max-width: 991.98px) {
  .nm-mm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nm-mm *, .nm-dr * { transition: none !important; }
}

/* Menu ouvert : le header passe devant tout le contenu de la page (carrousels, bandeaux…) */
#header:has(.nm-mm.is-open), header:has(.nm-mm.is-open) { z-index: 9999 !important; } /* le header du thème est déjà positionné (z-index 20) */
