/* Barbet World Wholesale: fixed-in-view filters + basket, scrolling product grid.
   Scoped to the B2B catalogue so retail and wholesale checkout are untouched.
   On desktop, the centre catalogue scrolls with the normal page while both
   side panels remain visible. Tall side panels scroll internally. */

@media (min-width: 1001px) {
  body.bw-page .bw-columns {
    align-items: start;
    /* Sticky cannot work correctly if an ancestor clips vertical overflow. */
    overflow: visible;
  }

  body.bw-page .bw-columns > .bw-filters,
  body.bw-page .bw-columns > .bw-basket {
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    min-height: 0;
  }

  /* Search and category remain available even in short browser windows. */
  body.bw-page .bw-columns > .bw-filters {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #ddafc3 transparent;
  }

  /* Basket title / summary / checkout stay visible. Only the item list
     scrolls when many sizes or products are selected. */
  body.bw-page .bw-columns > .bw-basket {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.bw-page .bw-basket-top,
  body.bw-page .bw-basket-bottom { flex: 0 0 auto; }
  body.bw-page .bw-basket-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: #ddafc3 transparent;
  }
  body.bw-page .bw-catalog { min-width: 0; }
}

/* At tablet and mobile widths the original collapsible filter and normal
   stacked basket are kept. No sticky overlay can obscure product selection. */
@media (max-width: 1000px) {
  body.bw-page .bw-columns > .bw-filters {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}
@media (max-width: 720px) {
  body.bw-page .bw-columns > .bw-basket {
    position: static;
    top: auto;
    max-height: none;
    display: block;
    overflow: hidden;
  }
}
