/* Alignement header SPA sans rebuild Vite : burger masqué dès laptop. */
@media (min-width: 1024px) {
  .site-header-menu-btn {
    display: none !important;
  }
}

/* Contrepartie manquante : sans ça, le menu complet ET le burger s'affichent
   en même temps entre ~640px et 1024px, débordant sur le bandeau ticker.
   Cause racine : .site-header-inner reste display:block sur le shell statique
   (les classes Tailwind flex/items-center du composant React ne sont pas
   incluses dans le CSS compilé pour ce HTML généré par site-nav.js) — logo,
   nav et actions s'empilent verticalement au lieu de tenir sur une ligne et
   débordent hors du header (hauteur fixe) par-dessus le bandeau ticker. */
@media (max-width: 1023px) {
  .site-header-nav {
    display: none !important;
  }

  .site-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .site-header-brand {
    display: flex !important;
    align-items: center !important;
  }

  .site-header-brand-text {
    display: none !important;
  }

  .site-header-actions {
    display: flex !important;
    align-items: center !important;
  }
}

/* Pages marketing : un reset `* { padding:0 }` / `a { color:inherit }`
   écrase sinon le menu des Enchères (couche Tailwind). */
.nav-link {
  padding: 0.5rem 0.25rem !important;
  margin-bottom: -2px !important;
  color: #1b1f2e !important;
}
@media (min-width: 1280px) {
  .nav-link {
    padding: 0.5rem 0.375rem !important;
  }
}
.nav-link:hover {
  color: #5e7f82 !important;
}
.nav-link-active,
.nav-link-active:hover {
  color: #5e7f82 !important;
  border-bottom-color: #5e7f82 !important;
}
.mobile-nav-link {
  padding: 0.75rem !important;
  color: #1b1f2e !important;
}
.mobile-nav-link-active,
.mobile-nav-link-active:hover {
  color: #fbf8f1 !important;
  background-color: #1b1f2e !important;
}

/* overflow-x:clip ne force pas overflow-y:auto (contrairement à hidden) : les menus restent visibles. */
html, body, #root {
  overflow-x: clip !important;
}

/* Menus langue / compte : ne pas couper les listes (même cause que les fiches). */
.site-header,
.site-header-inner,
.shell.site-header-inner,
.site-header-actions,
.site-header-account,
.site-header-lang {
  overflow: visible !important;
}

.site-header-actions {
  justify-self: end;
  flex-shrink: 0;
}

.site-header-actions > .site-header-admin { order: 1; }
.site-header-actions > .site-header-lang { order: 2; }
.site-header-actions > .site-header-menu-btn { order: 3; }
.site-header-actions > .site-header-account { order: 4; }

/* Jamais de réseaux dans le header / tiroir — pied de page seulement. */
header .site-header-social,
header nav[aria-label="Réseaux sociaux"],
#mobile-nav nav[aria-label="Réseaux sociaux"],
#mobileNav nav[aria-label="Réseaux sociaux"],
#nr-mobile-nav nav[aria-label="Réseaux sociaux"] {
  display: none !important;
}

/* Accueil = référence : écart NÉGOCE RENAÏ / EXPORT MAGHREB identique
   (sur l’accueil un reset * annule mt-1.5/sm:mt-2 ; ailleurs Tailwind laisse 8px). */
header .site-header-brand p,
header .site-header-brand-text > p,
header .site-header-inner > a p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
header .site-header-brand p:first-of-type,
header .site-header-brand-text > p:first-child,
header .site-header-inner > a p:first-of-type {
  line-height: 1 !important;
}

/* Filtres catalogue : la recherche part toute seule — pas de bouton Appliquer. */
.catalog-filters-apply-design {
  display: none !important;
}

/* Sidebar filtres : colonne crème + frise sur toute la hauteur du catalogue. */
@media (min-width: 1024px) {
  .catalog-layout--design {
    align-items: stretch !important;
  }
  .catalog-filter-sidebar--design {
    align-self: stretch !important;
    position: relative !important;
    top: auto !important;
    max-height: none !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }
}

/* Accueil = référence : pas de lien Admin dans le bandeau (l’URL /admin reste). */
.site-header-admin {
  display: none !important;
}

/* Accueil = référence : bandeau teal sans losanges / frise Amazigh. */
.bg-teal .ml-auto {
  display: none !important;
}
@media (min-width: 768px) {
  .bg-teal.border-b .flex.min-h-10::after {
    content: "·  EUROPE → MAGHREB";
    margin-left: 0.15rem;
    letter-spacing: 0.1em;
  }
}

@keyframes nr-drawer-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nr-drawer-item {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nr-nav-dim {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1023px) {
  .site-header-account [role="menu"],
  .nr-account-dropdown {
    position: fixed !important;
    right: 8px !important;
    left: auto !important;
    z-index: 400 !important;
    max-height: min(70dvh, 28rem);
    overflow-y: auto !important;
  }

  /* Toutes les pages : nom complet visible, y compris le ï. */
  .site-header-brand-text {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    min-width: max-content !important;
    overflow: visible !important;
  }
  .site-header-brand-text > p:first-child {
    white-space: nowrap;
    overflow: visible !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.02em !important;
  }
  .site-header-brand-text > p:last-child {
    display: none !important;
  }
  .site-header-brand img {
    width: 52px !important;
    height: 52px !important;
  }

  /* Voile derrière le tiroir : pages statiques (classe) + SPA (nav monté). */
  body.nr-nav-open,
  body:has(#mobile-nav) {
    overflow: hidden !important;
  }
  body.nr-nav-open::after,
  body:has(#mobile-nav)::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 18, 32, 0.38);
    pointer-events: none;
    animation: nr-nav-dim 0.2s ease;
  }
  header.sticky,
  header[class*="z-50"] {
    z-index: 50;
  }

  .site-header-menu-btn {
    display: inline-flex !important;
    width: 40px !important;
    height: 40px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 10px 9px !important;
    border: 1px solid rgba(27, 31, 46, 0.35) !important;
    background: #fbf8f1 !important;
    border-radius: 8px !important;
    cursor: pointer;
  }
  .site-header-menu-btn .menu-bar {
    display: block !important;
    width: 100% !important;
    height: 2px !important;
    background: #1b1f2e !important;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .site-header-menu-btn.is-open .menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .site-header-menu-btn.is-open .menu-bar:nth-child(2) {
    opacity: 0;
  }
  .site-header-menu-btn.is-open .menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  #mobile-nav::before,
  #mobileNav::before {
    display: none !important;
  }

  #mobile-nav,
  #mobileNav.open,
  nav.mobile-nav.open {
    padding: 8px 10px 14px !important;
    background: #fbf8f1 !important;
    border-top: 2px solid #1b1f2e !important;
    box-shadow: 0 16px 32px rgba(15, 18, 32, 0.12);
    animation: nr-drawer-in 0.22s ease;
  }

  .mobile-nav-link {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    margin: 3px 0 !important;
    font-size: 1.02rem !important;
    font-weight: 650 !important;
    letter-spacing: 0.01em !important;
    color: #1b1f2e !important;
    background: transparent !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
    animation: nr-drawer-item 0.28s ease both;
  }
  .mobile-nav-link:nth-child(1) { animation-delay: 0.02s; }
  .mobile-nav-link:nth-child(2) { animation-delay: 0.04s; }
  .mobile-nav-link:nth-child(3) { animation-delay: 0.06s; }
  .mobile-nav-link:nth-child(4) { animation-delay: 0.08s; }
  .mobile-nav-link:nth-child(5) { animation-delay: 0.1s; }
  .mobile-nav-link:nth-child(6) { animation-delay: 0.12s; }
  .mobile-nav-link:nth-child(7) { animation-delay: 0.14s; }

  .mobile-nav-link:hover,
  .mobile-nav-link:focus-visible {
    background: rgba(94, 127, 130, 0.12) !important;
    color: #1b1f2e !important;
  }

  .mobile-nav-link-active,
  .mobile-nav-link-active:hover,
  .mobile-nav-link-active:focus-visible {
    background: #1b1f2e !important;
    color: #fbf8f1 !important;
    box-shadow: none !important;
  }
  .mobile-nav-link-active::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3.5px;
    border-radius: 0 3px 3px 0;
    background: #5e7f82;
  }
}
