/* Category navigation grows with its content, including after AJAX filtering. */
.widget_cartify_ajax_product_category_filter .agni-product-categories > ul,
.widget_cartify_ajax_product_category_filter .agni-product-categories-taxonomy > ul {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    scroll-snap-type: none;
}

@media (max-width: 1023px) {
    /* Additional CSS hides this native entry point at every screen width. */
    .woocommerce .agni-shop-control-bar .agni-filter-toggle {
        display: block;
    }

    /* Show sidebar filters immediately instead of requiring a second expansion. */
    .woocommerce .shop-sidebar.has-topbar.has-sidebar .shop-sidebar-content__sidebar {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .woocommerce .shop-sidebar .shop-sidebar-content__toggle {
        display: none;
    }

    /* The existing mobile header uses 999999; keep the open drawer above it. */
    .woocommerce .shop-sidebar.active {
        z-index: 1000000;
    }
}

/* A tall desktop list must move with the page so its final links remain reachable.
   The mobile filter drawer retains its own viewport scrolling. */
@media (min-width: 1024px) {
    .shop-sidebar:not(.agni-filter-toggle-content) .shop-sidebar-container,
    .shop-sidebar:not(.agni-filter-toggle-content) .shop-sidebar-content {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}
