/* Desktop mega menu + compact header (meilleur-accessoire-chat.fr). Palette: sage #768471, dark #1a1f1a. */
:root { --mm-sage: #768471; --mm-sage-d: #5d6b59; --mm-dark: #1a1f1a; --mm-cream: #f4f5f1; --mm-line: #e3e6df; }

/* ---------- compact header + smaller logo ---------- */
body #masthead .ast-primary-header-bar { min-height: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; position: relative; }
body #masthead .ast-primary-header-bar .ast-builder-grid-row { min-height: 66px !important; align-items: stretch; }
body #masthead .site-branding, body #masthead .ast-site-identity { padding: 0 !important; }
body #masthead .site-logo-img img.custom-logo,
body #masthead .custom-logo-link img { height: 46px !important; width: auto !important; max-height: 46px !important; max-width: none !important; }
body #masthead .ast-builder-layout-element { align-items: center; }
/* Containers between the bar and the panel must not be positioned (panel is anchored on the bar) */
body #masthead .site-header-primary-section-right, body #masthead .ast-builder-menu-1, body #masthead .ast-main-header-bar-alignment,
body #masthead .main-header-bar-navigation, body #masthead .main-navigation, body #masthead #primary-site-navigation-desktop { position: static !important; align-self: stretch; display: flex; }
body #masthead .main-header-bar-navigation, body #masthead .main-navigation { align-items: stretch; }
@media (max-width: 921px) {
  body #masthead .site-logo-img img.custom-logo, body #masthead .custom-logo-link img { height: 38px !important; max-height: 38px !important; }
}

/* ---------- bar ---------- */
.mac-mm { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 4px; font-family: 'Montserrat', 'Instrument Sans', sans-serif; }
.mac-mm > li { display: flex; align-items: center; margin: 0; padding: 0; }
.mac-mm-caret { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.mac-mm-g:hover .mac-mm-caret, .mac-mm-g.is-open .mac-mm-caret { transform: rotate(180deg); }
body #masthead .mac-mm-btn, body #masthead .mac-mm-lien {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none;
  color: #e9ede6 !important; font: 500 14.5px/1 'Montserrat', 'Instrument Sans', sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: none;
}
body #masthead .mac-mm-btn:hover, body #masthead .mac-mm-g:hover > .mac-mm-btn, body #masthead .mac-mm-g.is-open > .mac-mm-btn,
body #masthead .mac-mm-lien:hover { background: rgba(255,255,255,.09); color: #fff !important; }
body #masthead .mac-mm-phare {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--mm-sage); color: #fff !important;
  font: 600 14px/1 'Montserrat', 'Instrument Sans', sans-serif; white-space: nowrap; text-decoration: none; transition: background .2s;
}
body #masthead .mac-mm-phare:hover { background: #fff; color: var(--mm-dark) !important; }
.mac-mm-btn:focus-visible, .mac-mm-phare:focus-visible, .mac-mm-panel a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- panels (hover / keyboard focus / tap) ---------- */
.mac-mm-g { position: static; }
.mac-mm-panel {
  position: absolute; z-index: 60; top: 100%; background: #fff; border-top: 3px solid var(--mm-sage); box-shadow: 0 18px 40px rgba(20,28,20,.18);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .16s ease, transform .16s ease, visibility 0s linear .22s;
  font-family: 'Montserrat', 'Instrument Sans', sans-serif; color: var(--mm-dark);
}
.mac-mm-g:hover > .mac-mm-panel, .mac-mm-g.is-open > .mac-mm-panel, .mac-mm-g:has(:focus-visible) > .mac-mm-panel {
  opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
.mac-mm-mega {
  left: 50%; margin-left: calc(min(1180px, 100vw - 32px) / -2); width: min(1180px, 100vw - 32px);
  display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 26px; padding: 22px 26px 24px; border-radius: 0 0 18px 18px;
}
.mac-mm-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.mac-mm-card { background: var(--mm-cream); border-radius: 14px; padding: 14px 14px 10px; }
.mac-mm-t { margin: 0 0 8px; padding-bottom: 9px; border-bottom: 2px solid var(--mm-sage); font: 700 11.5px/1.2 'Poppins', 'Montserrat', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--mm-dark); }
.mac-mm-t--bare { border-bottom: 0; padding-bottom: 0; margin: 0; }
.mac-mm-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.mac-mm-card li a, .mac-mm-mini li a { display: block; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--mm-dark) !important; font: 400 14px/1.3 'Montserrat', 'Instrument Sans', sans-serif; text-decoration: none; }
.mac-mm-card li a:hover, .mac-mm-mini li a:hover { background: #fff; color: var(--mm-sage-d) !important; }
.mac-mm-side { display: grid; align-content: start; gap: 12px; padding-left: 26px; border-left: 1px solid var(--mm-line); }
.mac-mm-une { display: grid; gap: 5px; color: var(--mm-dark) !important; text-decoration: none; }
.mac-mm-photo { display: block; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: var(--mm-cream); }
.mac-mm-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.mac-mm-une:hover img { transform: scale(1.04); }
.mac-mm-une small { margin-top: 4px; font: 600 11.5px/1.2 'Montserrat', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--mm-sage-d); }
.mac-mm-une strong { font: 600 16px/1.25 'Poppins', 'Montserrat', sans-serif; }
.mac-mm-sub { font-size: 13px; color: #5f685c; }

/* Narrow dropdown (accessories) */
.mac-mm-g--etroit { position: relative; }
.mac-mm-mini { right: 0; left: auto; width: 260px; padding: 12px 16px 14px; border-radius: 0 0 14px 14px; }
.mac-mm-mini .mac-mm-l1 { font-weight: 600; }
.mac-mm-mini ul ul { padding-left: 14px; }
.mac-mm-mini ul ul a { font-size: 13px; color: #4f594c !important; }

@media (max-width: 1180px) {
  .mac-mm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .mac-mm-mega { grid-template-columns: 1fr; }
  .mac-mm-side { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mac-mm-panel { transition: none; } }

/* Overrides vs. theme globals */
body #masthead .mac-mm-btn, body #masthead .mac-mm-lien, body #masthead .mac-mm-phare { text-transform: none !important; letter-spacing: 0; }
body #masthead .mac-mm-panel a.mac-mm-une, body #masthead .mac-mm-panel .mac-mm-une strong { color: var(--mm-dark) !important; }
body #masthead .mac-mm-panel .mac-mm-une:hover strong { color: var(--mm-sage-d) !important; }

/* ---------- axis dropdown panels (Taille, Matière, Usage, Prix, Marque, Accessoires) ---------- */
.mac-mm-g { position: relative; }
.mac-mm-axe { left: 0; min-width: 270px; max-width: min(92vw, 380px); padding: 16px 18px 16px; border-radius: 0 0 16px 16px; }
.mac-mm-axe .mac-mm-t { margin-bottom: 8px; }
.mac-mm-axe > ul { display: grid; gap: 1px; }
.mac-mm-axe > ul > li > a { display: block; padding: 7px 10px; margin: 0 -10px; border-radius: 8px; color: var(--mm-dark) !important; font: 500 14.5px/1.3 'Montserrat', 'Instrument Sans', sans-serif; text-decoration: none; }
.mac-mm-axe > ul > li > a:hover { background: var(--mm-cream); color: var(--mm-sage-d) !important; }
.mac-mm-axe .mac-mm-l1 { font-weight: 600; }
.mac-mm-axe ul ul { padding-left: 14px; }
.mac-mm-axe ul ul a { display: block; padding: 5px 10px; margin: 0 -10px; border-radius: 8px; font-size: 13px; color: #4f594c !important; text-decoration: none; }
.mac-mm-axe ul ul a:hover { background: var(--mm-cream); }
.mac-mm-cta { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--mm-line); font: 600 13.5px/1.3 'Montserrat', sans-serif; color: var(--mm-sage-d) !important; text-decoration: none; }
.mac-mm-cta:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The last groups open leftwards so panels never overflow the window */
.mac-mm > .mac-mm-g:nth-last-child(-n+3) > .mac-mm-axe { left: auto; right: 0; }
body #masthead .mac-mm-panel a.mac-mm-cta { color: var(--mm-sage-d) !important; }
