/* ====================================================================
   mobile-fix.css — Correctifs ciblés du menu mobile et du bouton "haut"
   Chargé après main.css : surcharge volontairement plusieurs règles.
   ==================================================================== */

/* ---- Touch target plus large + feedback tactile sur le bouton menu ---- */
.mobile-toggle{
  width:48px;height:48px;
  font-size:1.35rem;
  -webkit-tap-highlight-color:rgba(78,130,84,.18);
  touch-action:manipulation;
}
.mobile-toggle:active{transform:scale(.94)}

/* ---- Overlay sombre derrière le panneau ---- */
.mobile-overlay{
  position:fixed;inset:0;
  background:rgba(9,20,14,.55);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  opacity:0;visibility:hidden;
  transition:opacity .25s ease,visibility .25s ease;
  z-index:1080;
}
.mobile-overlay.visible{opacity:1;visibility:visible}

/* ---- Panneau coulissant : hauteur dictée par le contenu ---- */
.mobile-panel{
  width:min(86vw,360px) !important;
  height:auto !important;
  max-height:calc(100dvh - 1rem) !important;
  top:.5rem !important;
  right:.5rem !important;
  border-radius:14px !important;
  -webkit-overflow-scrolling:touch;
  display:flex !important; flex-direction:column !important;
  overflow:hidden !important;
}
.mobile-panel-head{flex-shrink:0; padding:1rem 1.25rem !important; border-bottom:1px solid var(--c-border-light,#e7e2d8) !important}
.mobile-panel nav{
  flex:0 1 auto;
  overflow-y:auto !important;
  padding:.35rem 1.25rem 1.25rem !important;
  -webkit-overflow-scrolling:touch;
}

/* ---- Mode "accordéon" injecté dynamiquement par mobile-menu-enhance.js ---- */
.mobile-panel .m-group{
  border-bottom:1px solid var(--c-border-light,#e7e2d8);
}
.mobile-panel .m-group-head{
  display:flex;align-items:center;justify-content:space-between;
  width:100%;padding:.75rem .25rem;
  background:transparent;border:0;
  font:600 .98rem/1.2 'DM Sans',Inter,sans-serif;
  letter-spacing:-.01em;
  color:var(--c-text,#1d2c22);
  cursor:pointer;
  -webkit-tap-highlight-color:rgba(78,130,84,.12);
  text-align:left;
}
.mobile-panel .m-group-head:active{color:var(--c-accent,#9e6a3a)}
.mobile-panel .m-group-head .m-chev{
  width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;
  transition:transform .25s ease;
  color:var(--c-text-soft,#5a6b62);
  font-size:.95rem;
}
.mobile-panel .m-group.open .m-chev{transform:rotate(180deg)}
.mobile-panel .m-group-body{
  max-height:0;overflow:hidden;
  transition:max-height .32s ease;
}
.mobile-panel .m-group.open .m-group-body{max-height:1200px}
.mobile-panel .m-group-body .m-sub{
  display:block;
  padding:.85rem .25rem .85rem 1rem !important;
  font-size:.95rem !important;font-weight:500 !important;
  color:var(--c-text-soft,#5a6b62) !important;
  border-bottom:1px solid rgba(231,226,216,.55) !important;
  border-radius:0 !important;
}
.mobile-panel .m-group-body .m-sub:last-child{border-bottom:0 !important}
.mobile-panel .m-group-body .m-sub:active{color:var(--c-accent,#9e6a3a) !important}
.mobile-panel .m-group-body .m-label{
  display:block;padding:.85rem .25rem .35rem;
  font:700 .7rem/1 'DM Sans',Inter,sans-serif;
  letter-spacing:.12em;text-transform:uppercase;
  color:var(--c-text-muted,#8a9088);
}

/* Lien simple (sans sous-menu) dans la nav mobile */
.mobile-panel .m-leaf{
  display:block;
  padding:.75rem .25rem !important;
  font:600 .98rem/1.2 'DM Sans',Inter,sans-serif !important;
  color:var(--c-text,#1d2c22) !important;
  border-bottom:1px solid var(--c-border-light,#e7e2d8) !important;
  border-radius:0 !important;
}
.mobile-panel .m-leaf:active{color:var(--c-accent,#9e6a3a) !important}

/* CTA RDV en bas du panneau, toujours visible */
.mobile-panel .m-cta{
  margin:.85rem 0 0 !important;
  display:flex !important;align-items:center;justify-content:center;gap:.5rem;
  background:var(--c-btn,#3b6442) !important;color:#fff !important;
  font-weight:700 !important;font-size:.95rem !important;
  padding:.85rem 1.1rem !important;border-radius:10px !important;
  border:0 !important;
  box-shadow:0 8px 22px rgba(59,100,66,.25);
}
.mobile-panel .m-cta:active{transform:translateY(1px)}

/* ---- BOUTON "RETOUR EN HAUT" — au-dessus du bouton cookie ---- */
.back-to-top{
  width:48px !important;height:48px !important;
  border-radius:50% !important;
  z-index:1100 !important;
  right:max(1rem,env(safe-area-inset-right)) !important;
  bottom:max(1rem,env(safe-area-inset-bottom)) !important;
  font-size:1.05rem;
  -webkit-tap-highlight-color:rgba(78,130,84,.18);
  touch-action:manipulation;
}
.back-to-top:active{transform:scale(.94)}

/* Sur mobile, décaler le bouton cookie pour ne pas chevaucher le BTT */
@media(max-width:768px){
  .rj-cookie-fab{
    left:max(.85rem,env(safe-area-inset-left)) !important;
    bottom:max(.85rem,env(safe-area-inset-bottom)) !important;
  }
  /* Et garantir un peu de respiration entre les deux */
  .back-to-top{right:max(.85rem,env(safe-area-inset-right)) !important}
}

/* ---- Empêcher le scroll de la page quand le menu est ouvert (renfort) ---- */
html.menu-open,body.menu-open{
  overflow:hidden !important;
  position:relative;
  width:100%;
}
