/* JTS v4.3.4 — archive/shop sidebar flow fix */

/* The sidebar is the positioning context. Individual cards must remain in flow. */
.jts-shop-sidebar,
.jts-archive-sidebar,
.jts-product-sidebar,
.woocommerce .jts-sidebar,
.woocommerce .widget-area,
.woocommerce aside[role="complementary"]{
  position:relative;
}

/* Filter panels and Treat Box promos must never overlap one another. */
.jts-shop-sidebar > *,
.jts-archive-sidebar > *,
.jts-product-sidebar > *,
.woocommerce .jts-sidebar > *,
.woocommerce .widget-area > *{
  position:relative!important;
  top:auto!important;
  bottom:auto!important;
  transform:none!important;
}

/* Common JTS filter/promo selectors: force normal vertical stacking. */
.jts-shop-filters,
.jts-product-filters,
.jts-filter-panel,
.jts-filters,
.jts-archive-filters,
.jts-treat-box-promo,
.jts-treatbox-promo,
.jts-sidebar-treat-box,
.jts-sidebar-treatbox,
[class*="treat-box"][class*="promo"],
[class*="treatbox"][class*="promo"]{
  position:relative!important;
  top:auto!important;
  bottom:auto!important;
  clear:both!important;
}

/* Treat Box card always gets breathing room after whatever filter height precedes it. */
.jts-shop-filters + .jts-treat-box-promo,
.jts-shop-filters + .jts-treatbox-promo,
.jts-product-filters + .jts-treat-box-promo,
.jts-product-filters + .jts-treatbox-promo,
.jts-filter-panel + .jts-treat-box-promo,
.jts-filter-panel + .jts-treatbox-promo,
.jts-filters + [class*="treat-box"],
.jts-filters + [class*="treatbox"],
.jts-archive-filters + [class*="treat-box"],
.jts-archive-filters + [class*="treatbox"]{
  margin-top:22px!important;
}

/* If the theme uses the sidebar itself as sticky, keep the whole stack together. */
@media(min-width:981px){
  .jts-shop-sidebar,
  .jts-archive-sidebar,
  .jts-product-sidebar,
  .woocommerce .jts-sidebar{
    align-self:start;
  }
}

/* On mobile/tablet there should be no sticky sidebar behaviour at all. */
@media(max-width:980px){
  .jts-shop-sidebar,
  .jts-archive-sidebar,
  .jts-product-sidebar,
  .woocommerce .jts-sidebar,
  .woocommerce .widget-area{
    position:relative!important;
    top:auto!important;
  }
}
