/* MERCURE mega-menu styles (injected by megamenu.js on every page).
   Reuses the site design tokens (--surface, --line, --link, --heading,
   --header-bg, --header-line, --shadow-md, --radius, --amber, --text,
   --text-muted, --surface-alt, --ghost-hover-bg) so light AND
   html[data-theme="dark"] just work. */

/* ---- EN/FR dual-text visibility (copied verbatim from templates/catalog.css
   so bilingual spans toggle with html[data-lang="fr"] on the standalone
   pages too). Default = EN; FR appears only when the toggle sets data-lang. */
.lang-fr{display:none !important}
html[data-lang="fr"] .lang-fr{display:revert !important}
html[data-lang="fr"] .lang-en{display:none !important}

/* ---- Bar (sits under the header) ---- */
.megamenu{position:relative;border-top:1px solid var(--header-line);background:var(--header-bg)}
.mm-cats{display:flex;align-items:stretch;gap:2px;list-style:none;margin:0;padding:0;
  overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
.mm-cat{position:relative;flex:0 0 auto;display:flex;align-items:stretch}
.mm-cat-link{display:inline-flex;align-items:center;min-height:44px;padding:6px 4px 6px 12px;
  color:var(--heading);font-size:15px;font-weight:600;line-height:1.2;white-space:nowrap}
.mm-cat:last-child .mm-cat-link{padding-right:12px}
.mm-cat-link:hover,.mm-cat:hover>.mm-cat-link,.mm-cat:focus-within>.mm-cat-link{color:var(--link)}
.mm-toggle{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:38px;
  padding:0 8px;background:transparent;border:0;color:var(--text-muted);cursor:pointer}
.mm-toggle:hover{color:var(--link)}
.mm-chevron{width:15px;height:15px;transition:transform .18s ease}
.mm-toggle[aria-expanded="true"] .mm-chevron{transform:rotate(180deg)}

/* ---- Panel (subcategories) ---- */
.mm-panel{background:var(--surface)}
.mm-panel[hidden]{display:none}
.mm-shopall{display:inline-flex;align-items:center;min-height:44px;padding:14px 0 8px;
  font-weight:700;color:var(--link)}
.mm-shopall:hover{text-decoration:underline}
.mm-subs{list-style:none;margin:0;padding:0 0 16px;display:grid;grid-template-columns:1fr;gap:2px}
.mm-subs a{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;
  padding:8px 10px;color:var(--text);border-radius:8px}
.mm-subs a:hover{background:var(--ghost-hover-bg);color:var(--link)}
.mm-count{flex:0 0 auto;font-size:12px;font-weight:600;color:var(--text-muted);
  background:var(--surface-alt);border-radius:999px;padding:2px 8px}

/* ---- Desktop: full-width dropdown below the bar ---- */
@media (hover:hover) and (min-width:921px){
  .mm-panel{position:absolute;left:0;right:0;top:100%;z-index:55;
    background:var(--surface);box-shadow:var(--shadow-md);border-bottom:1px solid var(--line)}
  .mm-subs{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:2px 24px}
}

/* ---- Mobile / touch: horizontal strip + inline accordion panel ---- */
@media (max-width:920px){
  .mm-cats{overflow-x:auto}
  .mm-panel{position:static;border-top:1px solid var(--line)}
  .mm-subs a{min-height:44px}
}

/* ---- Respect reduced motion ---- */
@media (prefers-reduced-motion:reduce){
  .mm-chevron{transition:none}
}
