/* Scrollbar du document : discrète, sans piste visible sur le header.
   Ne pas appliquer aux éléments défilants des modales. */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--st-edge, #725646) transparent;
}

/* scrollbar-color est hérité : ne pas recolorer les scrollbars des modales,
   formulaires et autres zones défilantes du site. */
html > body {
  scrollbar-color: auto;
}

html::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background-color: var(--st-edge, #725646);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover {
  background-color: var(--st-muted, #a68b7b);
}

/* Sur écran à menu rétractable, le défilement reste actif,
   mais sa barre ne traverse plus le header et la navigation mobile. */
@media (max-width: 960px) {
  html {
    scrollbar-width: none;
  }
  html::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* Seul le menu de la sidebar permanente possède sa propre scrollbar.
   Le tiroir mobile et les modales conservent leurs règles existantes. */
@media (min-width: 961px) {
  #admin-drawer.pro18-side:not([data-drawer-always]) > .drawer-scroll-content {
    scrollbar-width: thin;
    scrollbar-color: var(--st-edge, #725646) transparent;
  }

  #admin-drawer.pro18-side:not([data-drawer-always]) > .drawer-scroll-content::-webkit-scrollbar {
    width: 5px;
  }

  #admin-drawer.pro18-side:not([data-drawer-always]) > .drawer-scroll-content::-webkit-scrollbar-track {
    background: transparent;
  }

  #admin-drawer.pro18-side:not([data-drawer-always]) > .drawer-scroll-content::-webkit-scrollbar-thumb {
    background-color: var(--st-edge, #725646);
    border-radius: 999px;
  }
}

@media (forced-colors: active) {
  html,
  #admin-drawer.pro18-side > .drawer-scroll-content {
    scrollbar-color: auto;
  }
}
