/*
 * Shop layout fixes
 * - Hide the Query Loop/All Products column
 * - Keep and expand the Filters column
 * - Align result-count + sorter
 * Author: WojBit
 */

/* Hide the column that contains a product Query Loop / All Products block */
.post-type-archive-product .entry-content .wp-block-columns > .wp-block-column:has(.wp-block-query,
  .wp-block-woocommerce-product-collection,
  .wp-block-woocommerce-all-products,
  .wp-block-post-template) {
  display: none !important;
}

/* Fallback if :has() is not supported: assume first column was the grid */
@supports not (selector(:has(*))) {
  .post-type-archive-product .entry-content .wp-block-columns > .wp-block-column:first-child {
    display: none !important;
  }
}

/* Make the remaining (filters) column full width */
.post-type-archive-product .entry-content .wp-block-columns > .wp-block-column {
  flex-basis: 100% !important;
  max-width: 100% !important;
}

/* Shop header controls */
.post-type-archive-product .woocommerce-result-count { float: left;  margin: .5rem 0 1rem; }
.post-type-archive-product .woocommerce-ordering     { float: right; margin: .5rem 0 1rem; }
.post-type-archive-product ul.products { clear: both; }

/* If a blank column slips through, hide empty columns and expand filters */
.post-type-archive-product .wp-block-columns > .wp-block-column:empty { display:none; }
.post-type-archive-product .wp-block-columns > .wp-block-column { flex-basis:100%; max-width:100%; }
