/* ============================================================
   RWC — Navbar partagée (consolidée).
   Base layout/dropdowns/mobile (anciennement rwc-nav.css)
   + design éditorial v3 (anciennement rwc-nav-v3.css) — les
   surcharges v3 sont placées en fin de fichier pour gagner la
   cascade, comme l'ancien double-chargement le faisait.
   ============================================================ */

#rwc-nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 10000 !important;
  background: rgba(255, 255, 255, .97) !important;
  color: #1f1f1f !important;
  border-bottom: 1px solid #eadfd7 !important;
  box-shadow: 0 10px 28px rgba(31, 31, 31, .06);
  backdrop-filter: blur(14px);
  isolation: isolate;
}

#rwc-nav > div:first-child {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: .9rem 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 1rem !important;
}

#rwc-nav .rwc-brand {
  display: inline-flex !important;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  height: 2.4rem;
}

#rwc-nav .rwc-brand-img {
  display: block;
  width: 220px;
  height: 2.4rem;
  object-fit: cover;
  object-position: center;
  transform: none !important;
  clip-path: none !important;
  max-width: none;
}

@media (max-width: 640px) {
  #rwc-nav .rwc-brand,
  #rwc-nav .rwc-brand-img {
    height: 2rem;
  }
  #rwc-nav .rwc-brand-img {
    width: 170px;
  }
}

#rwc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#rwc-nav button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

#rwc-nav [data-collapse-toggle] {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

#rwc-nav button[aria-controls="mega-menu-mobile"] {
  display: none !important;
}

#mega-menu-mobile {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: auto !important;
}

#mega-menu-mobile > ul {
  display: flex !important;
  align-items: center !important;
  gap: 1.8rem !important;
  background: transparent !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#mega-menu-mobile a,
#mega-menu-mobile button {
  white-space: nowrap;
  text-decoration: none;
}

#vetements-dd > div,
#sacs-dd > div,
#chaussures-dd > div {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 1.2rem 1rem !important;
  display: grid !important;
  gap: 1.2rem !important;
}

#vetements-dd > div {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#sacs-dd > div,
#chaussures-dd > div {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#vetements-dd li:first-child,
#sacs-dd li:first-child,
#chaussures-dd li:first-child {
  margin-bottom: .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6f7786 !important;
}

#vetements-dd li + li,
#sacs-dd li + li,
#chaussures-dd li + li {
  margin-top: .25rem;
}

#vetements-dd a,
#sacs-dd a,
#chaussures-dd a {
  display: block;
  padding: .44rem .5rem;
  border-radius: 8px;
  text-decoration: none;
}

#rwc-nav a,
#rwc-nav button {
  color: #1f1f1f !important;
}

#rwc-nav svg {
  color: currentColor !important;
}

#rwc-nav a:hover,
#rwc-nav button:hover {
  color: #c96542 !important;
  background: transparent !important;
}

#rwc-nav a[href*="/download"] {
  color: #fff !important;
  background: #111 !important;
}

#rwc-nav a[href*="/download"]:hover {
  color: #fff !important;
  background: #2a2927 !important;
}

#vetements-dd,
#sacs-dd,
#chaussures-dd {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: var(--rwc-nav-height, 84px) !important;
  z-index: 9999 !important;
  background: #fff !important;
  color: #1f1f1f !important;
  border-top: 1px solid #eadfd7 !important;
  border-bottom: 1px solid #eadfd7 !important;
  box-shadow: 0 18px 40px rgba(31, 31, 31, .12) !important;
}

#vetements-dd,
#sacs-dd,
#chaussures-dd {
  display: none !important;
}

#vetements-dd.rwc-nav-panel-open,
#sacs-dd.rwc-nav-panel-open,
#chaussures-dd.rwc-nav-panel-open {
  display: block !important;
}

#vetements-dd a,
#sacs-dd a,
#chaussures-dd a {
  color: #1f1f1f !important;
}

#vetements-dd a:hover,
#sacs-dd a:hover,
#chaussures-dd a:hover {
  color: #c96542 !important;
  background: #fff8f3 !important;
}

#mega-menu-mobile {
  background: #fff !important;
  color: #1f1f1f !important;
}

html.rwc-nav-lock,
html.rwc-nav-lock body {
  overflow: hidden;
}

@media (max-width: 767px) {
  html body #rwc-nav {
    position: sticky !important;
    top: 0 !important;
  }

  #rwc-nav > div:first-child {
    padding: .72rem 1rem !important;
  }

  #rwc-nav button[aria-controls="mega-menu-mobile"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    border: 1px solid #eadfd7 !important;
    border-radius: 999px !important;
  }

  #mega-menu-mobile {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: calc(var(--rwc-nav-height, 84px) + 8px) !important;
    z-index: 9998 !important;
    width: auto !important;
    max-height: calc(100dvh - var(--rwc-nav-height, 84px) - 24px) !important;
    overflow-y: auto !important;
    border: 1px solid #eadfd7 !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 40px rgba(31, 31, 31, .14) !important;
  }

  #mega-menu-mobile:not(.rwc-nav-panel-open) {
    display: none !important;
  }

  #mega-menu-mobile.rwc-nav-panel-open {
    display: block !important;
  }

  #mega-menu-mobile > ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    background: #fff !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 1rem !important;
    gap: .4rem !important;
  }

  #mega-menu-mobile a,
  #mega-menu-mobile button {
    width: 100% !important;
    color: #1f1f1f !important;
  }

  #vetements-dd,
  #sacs-dd,
  #chaussures-dd {
    top: calc(var(--rwc-nav-height, 84px) + 8px) !important;
    left: 12px !important;
    right: 12px !important;
    max-height: calc(100dvh - var(--rwc-nav-height, 84px) - 24px) !important;
    overflow-y: auto !important;
    border: 1px solid #eadfd7 !important;
    border-radius: 18px !important;
  }

  #vetements-dd > div,
  #sacs-dd > div,
  #chaussures-dd > div {
    grid-template-columns: 1fr !important;
    gap: .35rem !important;
    padding: 1rem !important;
  }
}

/* ============================================================
   Surcharges v3 — design éditorial (placées après pour gagner
   la cascade, comme l'ancien rwc-nav-v3.css le faisait).
   ============================================================ */

/* Outer <nav> : blanc solide edge-to-edge avec blur subtil.
   Opacité .94 pour ne pas laisser passer les sections sombres derrière. */
html body #rwc-nav{
  width: 100% !important;
  background: #ffffff !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
  border-bottom: 1px solid rgba(17,17,17,.10) !important;
  box-shadow: none !important;
  height: auto !important;
}
/* La classe .shrunk reste pour compatibilité JS mais ne change plus le rendu. */
html body #rwc-nav.shrunk{
  background: #ffffff !important;
  border-bottom-color: rgba(17,17,17,.10) !important;
}

/* DESKTOP : container interne aligné, max-width raisonnable. */
@media (min-width: 768px){
  html body #rwc-nav > div:first-child{
    max-width: clamp(900px, 92vw, 1320px) !important;
    margin: 0 auto !important;
    padding: clamp(.55rem, .9vw, .85rem) clamp(1rem, 2vw, 1.6rem) !important;
    gap: clamp(.5rem, 1vw, 1rem) !important;
    background: transparent !important;
  }
}

/* Gap entre items du menu */
html body #mega-menu-mobile > ul{
  gap: clamp(.5rem, 1.4vw, 1.4rem) !important;
}

/* Logo : compact, hauteur alignée sur celle des liens */
html body #rwc-nav .rwc-brand{
  height: clamp(1.7rem, 1.9vw, 2.05rem) !important;
}
html body #rwc-nav .rwc-brand-img{
  width: clamp(140px, 12vw, 180px) !important;
  height: clamp(1.7rem, 1.9vw, 2.05rem) !important;
}

/* Liens nav (hors CTA Mettre en location) */
html body #rwc-nav ul li > a:not([href*="utm_content=mettre_en_location"]),
html body #rwc-nav ul li > button{
  font-family: 'Montserrat', sans-serif !important;
  font-size: clamp(10.5px, 0.85vw, 12px) !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
  color: #111 !important;
  transition: color .25s cubic-bezier(.22, 1, .36, 1) !important;
}
html body #rwc-nav ul li > a:not([href*="utm_content=mettre_en_location"]):hover,
html body #rwc-nav ul li > button:hover{
  color: #FFA384 !important;
  background: transparent !important;
}

/* CTA "Mettre en location" — pill noire */
html body #rwc-nav ul a[href*="utm_content=mettre_en_location"]{
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  border-radius: 999px !important;
  background: #111 !important;
  color: #fff !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: clamp(10px, 0.8vw, 11px) !important;
  letter-spacing: 0.12em !important;
  font-weight: 600 !important;
  padding: 10px clamp(12px, 1.4vw, 18px) !important;
  text-transform: uppercase !important;
  transition: background .35s cubic-bezier(.22, 1, .36, 1), color .35s cubic-bezier(.22, 1, .36, 1), transform .35s cubic-bezier(.22, 1, .36, 1) !important;
}
html body #rwc-nav ul a[href*="utm_content=mettre_en_location"]:hover{
  background: #FFA384 !important;
  color: #111 !important;
  transform: translateY(-1px) !important;
}

/* Sur viewports moyens (768-1280px), on cache "Accueil" et "Blog" pour
   garder dropdowns catalogue + CTA prêteuse toujours visibles. */
@media (min-width: 768px) and (max-width: 1280px){
  html body #mega-menu-mobile > ul > li:has(> a[href="/"]),
  html body #mega-menu-mobile > ul > li:has(> a[href*="journal."]){
    display: none !important;
  }
}

/* Dropdowns Vêtements / Sacs / Chaussures */
#vetements-dd, #sacs-dd, #chaussures-dd{
  background: #fafafa !important;
  border-color: rgba(17,17,17,.10) !important;
  box-shadow: 0 24px 60px rgba(31,31,31,.08) !important;
}
#vetements-dd a, #sacs-dd a, #chaussures-dd a{
  font-family: 'DM Sans', sans-serif !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-weight: 500 !important;
  color: #111 !important;
  transition: color .25s cubic-bezier(.22, 1, .36, 1) !important;
}
#vetements-dd a:hover, #sacs-dd a:hover, #chaussures-dd a:hover{
  color: #FFA384 !important;
  background: transparent !important;
}
#vetements-dd .text-gray-500, #sacs-dd .text-gray-500, #chaussures-dd .text-gray-500{
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.18em !important;
  color: #6b6b6b !important;
  font-size: 11px !important;
}

/* Burger mobile */
#rwc-nav button[data-collapse-toggle="mega-menu-mobile"]{
  color: #111 !important;
  background: transparent !important;
}

/* MOBILE : reposition du mega-menu en absolute par rapport à la nav,
   plus fiable que le calc(--rwc-nav-height + 8px). Override du scroll
   lock : la page reste scrollable quand le menu est ouvert. */
@media (max-width: 767px){
  html body #rwc-nav > div:first-child{
    max-width: 100% !important;
    padding: clamp(.5rem, 2vw, .8rem) clamp(.75rem, 3vw, 1.2rem) !important;
  }
  html body #mega-menu-mobile{
    top: 100% !important;
    left: 8px !important;
    right: 8px !important;
    margin-top: 6px !important;
    max-height: calc(100dvh - 100px) !important;
    -webkit-overflow-scrolling: touch !important;
  }
  html.rwc-nav-lock,
  html.rwc-nav-lock body{
    overflow: visible !important;
  }
}
