/* Version 255: archive sidebars grow naturally with available results.
   On short result lists, only the filter panel scrolls, never a nested list. */
@media (min-width:64.01rem){
  .gp-product-archive .gp-directory-sidebar,
  .gp-knowledge-archive .gp-knowledge-sidebar,
  body.admin-bar .gp-product-archive .gp-directory-sidebar,
  body.admin-bar .gp-knowledge-archive .gp-knowledge-sidebar{
    position:static!important;
    inset:auto!important;
    top:auto!important;
    bottom:auto!important;
    align-self:start;
    height:auto;
    max-height:none!important;
    overflow:visible!important;
    scrollbar-gutter:auto;
    overscroll-behavior:auto;
  }
  .gp-product-archive .gp-product-filter-form,
  .gp-product-archive .gp-directory-filter-scrollbody,
  .gp-knowledge-archive .gp-knowledge-filter-scrollbody,
  body.admin-bar .gp-product-archive .gp-directory-filter-scrollbody,
  body.admin-bar .gp-knowledge-archive .gp-knowledge-filter-scrollbody,
  .gp-product-archive .gp-directory-option-scroll.is-scrollable{
    position:static;
    max-height:none!important;
    height:auto;
    overflow:visible!important;
    overscroll-behavior:auto;
    scrollbar-gutter:auto;
  }
  .gp-product-archive .gp-directory-filter-actions{
    position:static!important;
    bottom:auto!important;
    z-index:auto;
  }
  /* Only when result area is shorter than the fully expanded filter. */
  .gp-product-archive .gp-directory-sidebar.gp-filter--compact,
  .gp-knowledge-archive .gp-knowledge-sidebar.gp-filter--compact,
  body.admin-bar .gp-product-archive .gp-directory-sidebar.gp-filter--compact,
  body.admin-bar .gp-knowledge-archive .gp-knowledge-sidebar.gp-filter--compact{
    height:auto;
    max-height:var(--gp-filter-compact-max,700px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain;
    scrollbar-width:thin;
    scrollbar-color:#b9cec0 transparent;
  }
}
/* Mobile remains a full-height, separately scrollable filter drawer. */
@media (max-width:64rem){
  .gp-product-archive .gp-directory-sidebar,
  .gp-knowledge-archive .gp-knowledge-sidebar{ --gp-filter-compact-max:unset; }
}
