/**
 * Shop & product archives — complements WooCommerce twenty-twenty.css + Art Galleria templates.
 *
 * Fixes overlap between artist/category header rows and the Isotope product grid (flex vs masonry).
 */

body.woocommerce-shop #site-content,
body.post-type-archive-product #site-content,
body.tax-product_cat #site-content,
body.tax-product_tag #site-content {
	overflow-x: hidden;
}

/*
 * WooCommerce’s Twenty Twenty stylesheet uses flex on ul.products; Art Galleria uses Isotope inside
 * #ag-container — mixing them can collapse stacking. Use normal flow inside the plugin container only.
 */
body.woocommerce-shop .woocommerce #ag-container ul.products,
body.tax-product_cat .woocommerce #ag-container ul.products,
body.tax-product_tag .woocommerce #ag-container ul.products {
	display: block;
}

/* Keep product grid below artist / collection header blocks */
body.tax-product_cat #ag-container.ag-artworks-row,
body.tax-product_tag #ag-container.ag-artworks-row,
body.woocommerce-shop #ag-container.ag-artworks-row {
	clear: both;
	position: relative;
	margin-top: 1.5rem;
}

/*
 * Art Galleria opens the loop with #ag-container + div.product (not ul.products > li).
 * Stray marks beside tiles were often (a) list bullets on filters — fixed in AG categories_filter.php,
 * (b) rating/price/add-to-cart — hidden below, (c) empty sale badge — see span.onsale.hidden below.
 */
#ag-container .product > .star-rating,
#ag-container .product > .price,
#ag-container .product > a.button,
#ag-container .product > .added_to_cart {
	display: none !important;
}

/*
 * AG prints <span class="onsale hidden"></span> when the work is not on sale (or badge is hidden).
 * WooCommerce’s twenty-twenty.css positions .onsale at top:0;left:0; portfolio.css adds a border.
 * WordPress does not define .hidden as display:none — empty bordered box reads as a small square “dot”.
 */
body.woocommerce-shop #ag-container span.onsale.hidden,
body.post-type-archive-product #ag-container span.onsale.hidden,
body.tax-product_cat #ag-container span.onsale.hidden,
body.tax-product_tag #ag-container span.onsale.hidden {
	display: none !important;
}

/*
 * Shortcode / block loops may still output ul.products > li.product — kill discs if present.
 */
body.woocommerce-shop #ag-container ul.products,
body.post-type-archive-product #ag-container ul.products,
body.tax-product_cat #ag-container ul.products,
body.tax-product_tag #ag-container ul.products {
	list-style: none !important;
	padding-inline-start: 0 !important;
	margin-inline-start: 0 !important;
}

body.woocommerce-shop #ag-container ul.products > li.product,
body.post-type-archive-product #ag-container ul.products > li.product,
body.tax-product_cat #ag-container ul.products > li.product,
body.tax-product_tag #ag-container ul.products > li.product {
	list-style: none !important;
	margin-left: 0 !important;
	padding-inline-start: 0 !important;
}

#ag-container ul.products > li.product::marker {
	content: none;
	font-size: 0;
}

/* Artist archive (product_cat): separate photo/bio row from masonry grid */
body.tax-product_cat .ag-portfolio-artists_profile,
body.tax-product_cat .ag-artist_bio {
	position: relative;
	z-index: 2;
}

body.tax-product_cat .woocommerce .row:has(.ag-portfolio-artists_profile) {
	overflow: hidden;
	margin-bottom: 1.5rem;
}

body.tax-product_cat #ag-container.ag-artworks-row {
	z-index: 1;
}

/* WooCommerce wraps with #primary.content-area — full-width catalog column */
body.woocommerce-shop #primary.content-area,
body.post-type-archive-product #primary.content-area,
body.tax-product_cat #primary.content-area,
body.tax-product_tag #primary.content-area {
	width: 100%;
	max-width: none;
}

body.woocommerce-shop #main.site-main,
body.post-type-archive-product #main.site-main,
body.tax-product_cat #main.site-main,
body.tax-product_tag #main.site-main {
	max-width: none;
	width: 100%;
}

/* Art Galleria filter bars + grids: predictable horizontal padding */
body.woocommerce-shop .woocommerce,
body.post-type-archive-product .woocommerce,
body.tax-product_cat .woocommerce,
body.tax-product_tag .woocommerce {
	box-sizing: border-box;
}

body.woocommerce-shop .ag-filter-nav,
body.woocommerce-shop .ag-filter.option-set,
body.woocommerce-shop ul.products,
body.post-type-archive-product .ag-filter-nav,
body.tax-product_cat .ag-filter-nav,
body.tax-product_tag .ag-filter-nav {
	padding-left: max(1rem, env(safe-area-inset-left));
	padding-right: max(1rem, env(safe-area-inset-right));
}

/* Tag/category pills row — no disc markers (Twenty Twenty ul defaults); markup uses closed </li> in AG categories_filter.php */
body.woocommerce-shop .ag-filter-nav ul.ag-filter,
body.post-type-archive-product .ag-filter-nav ul.ag-filter,
body.tax-product_tag .ag-filter-nav ul.ag-filter {
	list-style: none;
	padding-inline-start: 0;
	margin-inline-start: 0;
}

body.woocommerce-shop .ag-filter-nav ul.ag-filter > li,
body.post-type-archive-product .ag-filter-nav ul.ag-filter > li,
body.tax-product_tag .ag-filter-nav ul.ag-filter > li {
	list-style: none;
}

/* Tame oversized archive title from WC compat stylesheet on catalog views */
body.woocommerce-shop .woocommerce-products-header__title.page-title,
body.post-type-archive-product .woocommerce-products-header__title.page-title,
body.tax-product_cat .woocommerce-products-header__title.page-title,
body.tax-product_tag .woocommerce-products-header__title.page-title {
	font-size: clamp(2.4rem, 4vw, 5rem);
	line-height: 1.15;
	margin-left: auto;
	margin-right: auto;
	max-width: 48ch;
}
