/**
 * LUNE & LUNA: full-width shop/category catalog (no filter sidebar) + 4 columns desktop.
 * Scoped via body classes from is_shop() / product taxonomy archives.
 */

/* Hide the filter sidebar column (Kategori/Pris etc.) — widgets stay registered. */
body.woocommerce.archive .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column:has(.wp-block-woocommerce-product-filters),
body.woocommerce-page.archive .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column:has(.wp-block-woocommerce-product-filters),
body.tax-product_cat .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column:has(.wp-block-woocommerce-product-filters),
body.tax-product_tag .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column:has(.wp-block-woocommerce-product-filters),
body.post-type-archive-product .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column:has(.wp-block-woocommerce-product-filters) {
	display: none !important;
}

/* Expand product column to full width. */
body.woocommerce.archive .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column,
body.woocommerce-page.archive .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column,
body.tax-product_cat .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column,
body.tax-product_tag .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column,
body.post-type-archive-product .wp-block-columns:has(> .wp-block-column .wp-block-woocommerce-product-filters) > .wp-block-column {
	flex-basis: 100% !important;
	width: 100% !important;
	max-width: 100% !important;
}

/* Desktop: ensure 4 cards per row even if class rewrite misses. Mobile keeps theme/WC shrink (~2). */
@media (min-width: 782px) {
	body.woocommerce.archive .wc-block-product-template.is-flex-container.columns-3 > li,
	body.woocommerce.archive .wc-block-product-template.is-flex-container.columns-4 > li,
	body.woocommerce-page.archive .wc-block-product-template.is-flex-container.columns-3 > li,
	body.woocommerce-page.archive .wc-block-product-template.is-flex-container.columns-4 > li,
	body.tax-product_cat .wc-block-product-template.is-flex-container.columns-3 > li,
	body.tax-product_cat .wc-block-product-template.is-flex-container.columns-4 > li,
	body.tax-product_tag .wc-block-product-template.is-flex-container.columns-3 > li,
	body.tax-product_tag .wc-block-product-template.is-flex-container.columns-4 > li,
	body.post-type-archive-product .wc-block-product-template.is-flex-container.columns-3 > li,
	body.post-type-archive-product .wc-block-product-template.is-flex-container.columns-4 > li {
		width: calc(25% - 0.9375em) !important;
	}

	/* Responsive grid variant used by some WC builds */
	body.woocommerce.archive .wc-block-product-template__responsive.columns-3,
	body.woocommerce.archive .wc-block-product-template__responsive.columns-4,
	body.tax-product_cat .wc-block-product-template__responsive.columns-3,
	body.tax-product_cat .wc-block-product-template__responsive.columns-4,
	body.post-type-archive-product .wc-block-product-template__responsive.columns-3,
	body.post-type-archive-product .wc-block-product-template__responsive.columns-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
}


/* Catalog archive header: full-width title + term description
 * (template used constrained+left → content-size ~720px left column with empty right). */
body.woocommerce.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-query-title,
body.woocommerce.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-term-description,
body.woocommerce.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wc-block-breadcrumbs,
body.woocommerce-page.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-query-title,
body.woocommerce-page.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-term-description,
body.woocommerce-page.archive .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wc-block-breadcrumbs,
body.tax-product_cat .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-query-title,
body.tax-product_cat .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-term-description,
body.tax-product_cat .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wc-block-breadcrumbs,
body.tax-product_tag .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-query-title,
body.tax-product_tag .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-term-description,
body.tax-product_tag .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wc-block-breadcrumbs,
body.post-type-archive-product .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-query-title,
body.post-type-archive-product .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wp-block-term-description,
body.post-type-archive-product .alignfull.has-background-light-background-color > .wp-block-group.alignwide > .wc-block-breadcrumbs {
	max-width: 100% !important;
	width: 100% !important;
}

/* Keep short SEO blurbs compact above the grid */
body.woocommerce.archive .wp-block-term-description,
body.tax-product_cat .wp-block-term-description,
body.tax-product_tag .wp-block-term-description,
body.post-type-archive-product .wp-block-term-description {
	max-width: 100%;
}
body.woocommerce.archive .wp-block-term-description p + p,
body.tax-product_cat .wp-block-term-description p + p {
	margin-top: 0.5em;
}

/* Category/tag archive term description: slightly smaller than H1 (has-large) */
body.woocommerce.archive .wp-block-term-description,
body.woocommerce.archive .wp-block-term-description.has-medium-small-font-size,
body.woocommerce-page.archive .wp-block-term-description,
body.woocommerce-page.archive .wp-block-term-description.has-medium-small-font-size,
body.tax-product_cat .wp-block-term-description,
body.tax-product_cat .wp-block-term-description.has-medium-small-font-size,
body.tax-product_tag .wp-block-term-description,
body.tax-product_tag .wp-block-term-description.has-medium-small-font-size,
body.post-type-archive-product .wp-block-term-description,
body.post-type-archive-product .wp-block-term-description.has-medium-small-font-size {
	font-size: 0.95rem;
	line-height: 1.55;
}

body.woocommerce.archive .wp-block-term-description p,
body.woocommerce-page.archive .wp-block-term-description p,
body.tax-product_cat .wp-block-term-description p,
body.tax-product_tag .wp-block-term-description p,
body.post-type-archive-product .wp-block-term-description p {
	font-size: inherit;
}
