/*
 * SportingZone product archive media contract.
 *
 * The generated archive files are physically 4:3 even though WordPress can
 * advertise 3:2 dimensions in the image markup. Match the delivered pixels so
 * catalogue images remain fully visible without cropping or side rails.
 */

.nw-archive-pagination { margin: 2rem 0; }
.nw-archive-pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.nw-archive-pagination .page-numbers li { margin: 0; }
.nw-archive-pagination a.page-numbers,
.nw-archive-pagination span.page-numbers { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: .25rem .75rem; box-sizing: border-box; border: 1px solid #d4dcde; border-radius: 8px; text-decoration: none; color: #123c47; }
.nw-archive-pagination span.current { background: #123c47; border-color: #123c47; color: #fff; }
.nw-archive-pagination a:hover { background: #edf2f3; }
.nw-archive-pagination a:focus-visible { outline: 2px solid #123c47; outline-offset: 3px; }

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-image {
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: auto;
	flex: 0 0 auto;
	aspect-ratio: 4 / 3;
	margin: 0;
	overflow: hidden;
	border-radius: 13px 13px 0 0;
	background: #fff;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-image > a {
	display: block;
	width: 100%;
	height: 100%;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	/* WooCommerce writes object-fit inline, so this is the one required override. */
	object-fit: contain !important;
	object-position: 50% 50%;
	transform: none;
	transform-origin: 50% 50%;
	border-radius: 0;
	background: #fff;
}

/* Trek source artwork is framed more tightly than the established catalogue
 * photography. A small visual reduction and upward focal-point shift
 * normalise the apparent bike size while keeping the image fully visible in
 * the shared 4:3 stage. */
.nw-product-archive .wc-block-product-template > li.product:is(
	.post-8416,
	.post-8459,
	.post-8425,
	.post-8436,
	.post-8442
) .wc-block-components-product-image > a {
	display: grid;
	place-items: center;
}

.nw-product-archive .wc-block-product-template > li.product:is(
	.post-8416,
	.post-8459,
	.post-8425,
	.post-8436,
	.post-8442
) .wc-block-components-product-image img {
	width: 100% !important;
	height: 100% !important;
	margin: 0;
	transform: translateY(-10%) scale(0.9) !important;
	transform-origin: 50% 50%;
}

/* The Powerfly source framing places its focal point slightly lower than the
 * other Trek catalogue images, so lift just those two models a little more. */
.nw-product-archive .wc-block-product-template > li.product:is(
	.post-8436,
	.post-8442
) .wc-block-components-product-image img {
	transform: translateY(-13%) scale(0.9) !important;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-sale-badge {
	position: absolute;
	z-index: 9;
	top: 1rem;
	right: auto;
	left: 1rem;
	inset-inline-start: 1rem;
	inset-inline-end: auto;
	display: inline-flex;
	float: none;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: 999px;
	background: #123c47;
	box-shadow: none;
	color: #fff;
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1;
	text-transform: none;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.3rem 0.45rem;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price ins {
	order: -1;
	text-decoration: none;
}

/* Keep sale prices readable at a glance: the current price is the primary
 * dark value, while the original price is the quieter struck-through value.
 * WooCommerce emits the regular price before the sale price, so the flex
 * order above is part of the visual contract for archive cards. */
.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price ins {
	color: #0f1f24;
	font-weight: 850;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price del {
	color: #65767b;
	font-weight: 650;
	text-decoration: line-through;
}

.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price ins .woocommerce-Price-amount,
.nw-product-archive .wc-block-product-template > li.product .wc-block-components-product-price del .woocommerce-Price-amount {
	color: inherit;
}
