/*
 * The page's scrollbar floats over the page and shows only while it is in use (js/scrollbar.js),
 * so it never takes the page's width. Only with a mouse or a trackpad: touch screens have their own
 * floating one. The page itself scrolls as before; the browser's bar is just not drawn. Scrolling
 * areas inside the page (the cart, the search suggestions) keep their own bars.
 */
@media (hover: hover) and (pointer: fine) {
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }
}

/* The strip along the right edge: hovering it shows the bar, clicking it pages up or down. */
.ags-scrollbar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100001; /* over the cart and the menu (100000), though hidden while they are open */
  box-sizing: border-box;
  width: 12px;
  padding: 3px 2px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ags-scrollbar.is-shown,
.ags-scrollbar.is-hover,
.ags-scrollbar.is-dragging {
  opacity: 1;
  transition-duration: 0.15s;
}

/* Nothing to scroll, or the page is locked under the cart, the search or the menu. */
.ags-scrollbar.is-off,
body.ags-cart-open .ags-scrollbar,
body.ags-search-open .ags-scrollbar,
body.ags-nav-open .ags-scrollbar {
  display: none;
}

.ags-scrollbar__thumb {
  width: 6px;
  margin-left: auto;
  border-radius: 6px;
  background: rgba(32, 22, 0, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6); /* seen on dark parts of the page too */
  transition: width 0.15s ease, background-color 0.15s ease;
  will-change: transform;
}

.ags-scrollbar.is-hover .ags-scrollbar__thumb,
.ags-scrollbar.is-dragging .ags-scrollbar__thumb {
  width: 8px;
  background: rgba(32, 22, 0, 0.55);
}
