/* ========================================================================== */
/* ETHNOS R154 — Scroll automatique + bouton Fermer officiel                  */
/* Base : R153 corrigée. Salons favoris et Mes contacts uniquement.           */
/* ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1 — Salons favoris                                                         */
/* Le volet entier défile seulement lorsque son contenu dépasse la hauteur.   */
/* Le bouton Fermer reste toujours présent, environ 40 px après la liste.      */
/* -------------------------------------------------------------------------- */
html body .memberFavoritesShell{
  box-sizing:border-box !important;
  height:100% !important;
  min-height:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior:contain !important;
  scrollbar-gutter:stable !important;
  scrollbar-width:thin !important;
  scrollbar-color:rgba(7,26,57,.30) transparent !important;
}
html body .memberFavoritesShell::-webkit-scrollbar{width:6px !important}
html body .memberFavoritesShell::-webkit-scrollbar-track{background:transparent !important}
html body .memberFavoritesShell::-webkit-scrollbar-thumb{
  border-radius:10px !important;
  background:rgba(7,26,57,.28) !important;
}
html body .memberFavoritesShell>header{
  flex:0 0 auto !important;
}
html body .memberFavoritesList{
  flex:0 0 auto !important;
  min-height:0 !important;
  overflow:visible !important;
  padding-bottom:0 !important;
}
html body .memberFavoritesShell>.memberDrawerCloseButton{
  flex:0 0 auto !important;
  box-sizing:border-box !important;
  width:calc(100% - 28px) !important;
  min-width:0 !important;
  min-height:44px !important;
  margin:40px 14px 14px !important;
  padding:0 14px !important;
  border:1px solid #071a39 !important;
  border-radius:10px !important;
  background:#071a39 !important;
  color:#fffaf3 !important;
  font-family:var(--ethnos-official-title,Inter,"Segoe UI",Arial,sans-serif) !important;
  font-size:clamp(13px,.84vw,16px) !important;
  font-weight:800 !important;
  line-height:1 !important;
  cursor:pointer !important;
  box-shadow:0 8px 18px rgba(7,26,57,.12) !important;
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease !important;
}
html body .memberFavoritesShell>.memberDrawerCloseButton:hover,
html body .memberFavoritesShell>.memberDrawerCloseButton:focus-visible{
  transform:translateY(-2px) !important;
  filter:brightness(1.08) !important;
  box-shadow:0 12px 24px rgba(7,26,57,.18) !important;
  outline:none !important;
}

/* -------------------------------------------------------------------------- */
/* 2 — Mes contacts                                                           */
/* Même règle : défilement automatique du volet et Fermer 40 px après la liste.*/
/* La règle fonctionne aussi avec zéro contact.                               */
/* -------------------------------------------------------------------------- */
html body .bodyContactsDrawer{
  box-sizing:border-box !important;
  height:100% !important;
  min-height:0 !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior:contain !important;
  scrollbar-gutter:stable !important;
  scrollbar-width:thin !important;
  scrollbar-color:rgba(7,26,57,.30) transparent !important;
}
html body .bodyContactsDrawer::-webkit-scrollbar{width:6px !important}
html body .bodyContactsDrawer::-webkit-scrollbar-track{background:transparent !important}
html body .bodyContactsDrawer::-webkit-scrollbar-thumb{
  border-radius:10px !important;
  background:rgba(7,26,57,.28) !important;
}
html body .bodyContactsDrawer>header,
html body .bodyContactsDrawer>.bodyContactSearch{
  flex:0 0 auto !important;
}
html body .bodyContactGrid{
  flex:0 0 auto !important;
  min-height:0 !important;
  overflow:visible !important;
  scrollbar-gutter:auto !important;
}
html body .bodyContactsDrawer>.memberDrawerCloseButton{
  flex:0 0 auto !important;
  box-sizing:border-box !important;
  width:calc(100% - 28px) !important;
  min-width:0 !important;
  min-height:44px !important;
  margin:40px 14px 14px !important;
  padding:0 14px !important;
  border:1px solid #071a39 !important;
  border-radius:10px !important;
  background:#071a39 !important;
  color:#fffaf3 !important;
  font-family:var(--ethnos-official-title,Inter,"Segoe UI",Arial,sans-serif) !important;
  font-size:clamp(13px,.84vw,16px) !important;
  font-weight:800 !important;
  line-height:1 !important;
  cursor:pointer !important;
  box-shadow:0 8px 18px rgba(7,26,57,.12) !important;
  transition:transform .16s ease,box-shadow .16s ease,filter .16s ease !important;
}
html body .bodyContactsDrawer>.memberDrawerCloseButton:hover,
html body .bodyContactsDrawer>.memberDrawerCloseButton:focus-visible{
  transform:translateY(-2px) !important;
  filter:brightness(1.08) !important;
  box-shadow:0 12px 24px rgba(7,26,57,.18) !important;
  outline:none !important;
}

/* Formats compacts : même distance demandée, bouton légèrement moins haut. */
@media (max-width:1600px) and (max-height:920px){
  html body .memberFavoritesShell>.memberDrawerCloseButton,
  html body .bodyContactsDrawer>.memberDrawerCloseButton{
    min-height:40px !important;
    margin-top:40px !important;
    font-size:11px !important;
  }
}

@media (prefers-reduced-motion:reduce){
  html body .memberFavoritesShell>.memberDrawerCloseButton,
  html body .bodyContactsDrawer>.memberDrawerCloseButton{
    transition:none !important;
  }
  html body .memberFavoritesShell>.memberDrawerCloseButton:hover,
  html body .memberFavoritesShell>.memberDrawerCloseButton:focus-visible,
  html body .bodyContactsDrawer>.memberDrawerCloseButton:hover,
  html body .bodyContactsDrawer>.memberDrawerCloseButton:focus-visible{
    transform:none !important;
  }
}
