/* StickyFlow internal module for FilterFlow Ultimate */

/*
 * This stylesheet does not alter FilterFlow visual styling or filtering.
 * It only supports desktop sticky viewport behavior.
 */
@media (min-width:1024px) {
  .filterflow-sticky-placeholder {
    display:block;
    min-width:0;
    min-height:1px;
  }

  .filterflow-sticky-fixed,
  .filterflow-sticky-bottom {
    box-sizing:border-box !important;
  }

  .filterflow-sticky-fixed .ivy-filter-sidebar,
  .filterflow-sticky-bottom .ivy-filter-sidebar {
    scrollbar-width:thin;
    overscroll-behavior:contain;
  }

  .filterflow-sticky-fixed .ivy-filter-sidebar::-webkit-scrollbar,
  .filterflow-sticky-bottom .ivy-filter-sidebar::-webkit-scrollbar {
    width:6px;
  }

  .filterflow-sticky-fixed .ivy-filter-sidebar::-webkit-scrollbar-track,
  .filterflow-sticky-bottom .ivy-filter-sidebar::-webkit-scrollbar-track {
    background:transparent;
  }

  .filterflow-sticky-fixed .ivy-filter-sidebar::-webkit-scrollbar-thumb,
  .filterflow-sticky-bottom .ivy-filter-sidebar::-webkit-scrollbar-thumb {
    background:#cfcfcf;
    border-radius:999px;
  }
}

@media (max-width:1023px) {
  .filterflow-sticky-placeholder {
    display:none !important;
  }
}


/* =========================================================
   StickyFlow fix 1.0.1 — force fixed state over FilterFlow's
   original desktop sticky !important rules.
   ========================================================= */

@media (min-width:1024px) {

  /* When StickyFlow says FIXED, it must win over FilterFlow's own sticky CSS. */
  .ivy-shop-filter-wrap.filterflow-sticky-fixed {
    position:fixed !important;
    bottom:auto !important;
    right:auto !important;
    transform:none !important;
    margin:0 !important;
  }

  .ivy-shop-filter-wrap.filterflow-sticky-fixed .ivy-filter-sidebar {
    position:relative !important;
    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;
    inset:auto !important;
    transform:none !important;
    width:100% !important;
    height:auto !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }

  /* Same protection when StickyFlow reaches the last product boundary. */
  .ivy-shop-filter-wrap.filterflow-sticky-bottom {
    position:fixed !important;
    bottom:auto !important;
    right:auto !important;
    transform:none !important;
    margin:0 !important;
  }

  .ivy-shop-filter-wrap.filterflow-sticky-bottom .ivy-filter-sidebar {
    position:relative !important;
    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    left:auto !important;
    inset:auto !important;
    transform:none !important;
    width:100% !important;
    height:auto !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
  }

  /* Avoid the original sticky container clipping a fixed descendant. */
  html.filterflow-stickyflow-active,
  html.filterflow-stickyflow-active body {
    overflow-x:clip;
  }
}


/* StickyFlow fix 1.0.2 — top-return visibility */
@media (min-width:1024px) {
  .filterflow-sticky-placeholder {
    height:0;
    min-height:0;
    margin:0;
    padding:0;
  }

  /* Placeholder receives inline height only while fixed/bottom mode is active. */
  html.filterflow-stickyflow-active .filterflow-sticky-placeholder {
    box-sizing:border-box;
  }
}
