/* Dave's Drum Shop — DW quote drawer overlay / scrolling fix, V7
   This file is additive: no cart, stock, inventory or PDF logic is modified.
   The existing catalogue banner has a sticky z-index of 80. */
#drawer-layer[hidden] {
  display: none !important;
}

/* Put the open quote overlay above the entire sticky Explore DW toolbar. */
#drawer-layer:not([hidden]) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  isolation: isolate;
  overscroll-behavior: contain;
}

#drawer-layer:not([hidden]) > .drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* The panel itself must fit the viewport and expose a scrolling child.
   Keep the original drawer width, colour, positioning and animations. */
#drawer-layer:not([hidden]) > .quote-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  box-sizing: border-box;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overscroll-behavior: contain;
}

#drawer-layer:not([hidden]) .drawer-top {
  flex: 0 0 auto;
}

/* Scroll quote items internally even if the page behind is body-locked. */
#drawer-layer:not([hidden]) #quote-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

#drawer-layer:not([hidden]) .drawer-bottom {
  flex: 0 0 auto;
  max-height: 47dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {
  /* Narrow panels fill the width, without horizontal dragging. */
  #drawer-layer:not([hidden]) > .quote-drawer {
    width: 100% !important;
    max-width: 100vw !important;
  }
  #drawer-layer:not([hidden]) .drawer-bottom {
    max-height: 46dvh;
  }
}

@media print {
  /* No side panel printed on customer PDFs. */
  #drawer-layer { display: none !important; }
}
