/**
 * Shop & product archives — grid layout (fixes broken floats / pseudo clearfix with Tailwind).
 */

/* Result count + sort (wrapped via shift52_shop_toolbar_open / _close) */
body.woocommerce .shift52-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin-bottom: 2rem;
}

body.woocommerce .shift52-shop-toolbar .woocommerce-result-count {
	margin: 0;
	font-size: 0.9375rem;
	color: #757871;
}

body.woocommerce .shift52-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

body.woocommerce .shift52-shop-toolbar .woocommerce-ordering select {
	background: #f5f3f0;
	border: none;
	border-radius: 0.75rem;
	padding: 0.65rem 1.25rem;
	font-size: 0.875rem;
	color: #1b1c1a;
}

/* Kill float clearfix pseudo-rows (same issue as order summary grid) */
body.woocommerce ul.products::before,
body.woocommerce ul.products::after {
	display: none !important;
	content: none !important;
}

body.woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 1.5rem;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
	clear: both;
}

@media (min-width: 1200px) {
	body.woocommerce-shop ul.products,
	body.post-type-archive-product ul.products,
	body[class*="tax-product_"] ul.products,
	body[class*="tax-pa_"] ul.products {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 1.5rem 1.25rem;
	}
}

body.woocommerce ul.products li.product {
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 0.75rem;
	overflow: hidden;
	border: 1px solid rgb(196 200 191 / 0.45);
	box-shadow: 0 1px 0 rgb(86 98 82 / 0.06);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

body.woocommerce ul.products li.product:hover {
	box-shadow: 0 12px 32px rgb(86 98 82 / 0.1);
	transform: translateY(-2px);
}

body.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
	display: block;
	flex: 1 1 auto;
	text-decoration: none;
	color: inherit;
}

body.woocommerce ul.products li.product img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	background: #f5f3f0;
}

body.woocommerce ul.products li.product .onsale {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 2;
	min-height: auto;
	min-width: auto;
	padding: 0.35rem 0.65rem;
	border-radius: 9999px;
	font-family: Manrope, system-ui, sans-serif;
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.2;
	background: #566252;
	color: #ffffff;
	border: 0;
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: "Noto Serif", ui-serif, Georgia, serif;
	font-size: 1.0625rem;
	font-weight: 400;
	line-height: 1.35;
	padding: 1rem 1.25rem 0.25rem;
	margin: 0;
	color: #1b1c1a;
}

body.woocommerce ul.products li.product .price {
	padding: 0 1.25rem 1rem;
	font-family: Manrope, system-ui, sans-serif;
	font-size: 1rem;
	color: #566252;
	font-weight: 600;
}

body.woocommerce ul.products li.product .price del {
	opacity: 0.55;
	font-weight: 400;
	margin-right: 0.35rem;
}

body.woocommerce ul.products li.product .star-rating {
	margin: 0 1.25rem 0.5rem;
}

body.woocommerce ul.products li.product .button,
body.woocommerce ul.products li.product a.add_to_cart_button {
	align-self: stretch;
	margin: 0 1.25rem 1.25rem !important;
	padding: 0.75rem 1rem !important;
	border-radius: 9999px !important;
	background: #566252 !important;
	color: #ffffff !important;
	border: none !important;
	font-family: Manrope, system-ui, sans-serif !important;
	font-size: 0.8125rem !important;
	font-weight: 600 !important;
	text-align: center;
	text-decoration: none !important;
	transition: background 0.2s ease, color 0.2s ease;
}

body.woocommerce ul.products li.product .button:hover,
body.woocommerce ul.products li.product a.add_to_cart_button:hover {
	background: #bdcab7 !important;
	color: #1b1c1a !important;
}

/* Page title (classic woocommerce_content / archives) */
body.woocommerce .woocommerce-products-header h1.page-title,
body.woocommerce h1.page-title {
	font-family: "Noto Serif", ui-serif, Georgia, serif;
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	color: #1b1c1a;
	margin: 0 0 1.5rem;
}

body.woocommerce .woocommerce-breadcrumb {
	font-size: 0.8125rem;
	color: #757871;
	margin-bottom: 1.5rem;
}

body.woocommerce .woocommerce-breadcrumb a {
	color: #566252;
	text-decoration: none;
}

body.woocommerce .woocommerce-breadcrumb a:hover {
	text-decoration: underline;
}

body.woocommerce .woocommerce-products-header {
	margin-bottom: 0.5rem;
}

body.woocommerce .woocommerce-notices-wrapper:first-child {
	margin-bottom: 1.25rem;
}
