/* ==========================================================================
   SHOES HUB — PRODUCT LOOP / CARD
   --------------------------------------------------------------------------
   Shared by the shop archive, related products and the homepage showcase
   rows so a product looks identical wherever it is listed. Loaded on Woo
   screens and on the front page when a showcase row renders. Tokens only.

   The card is a link: square studio image, title, category line, price.
   Mintpay and Koko inject their instalment lines inside .price; they are
   kept and only restyled here, never removed.
   ========================================================================== */

/* ---------- Product grid ------------------------------------------------ */

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-6) var(--space-3);
	margin: 0 0 var(--space-7);
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none;
}

@media (min-width: 1024px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--space-7) var(--space-4);
	}
}

.woocommerce ul.products li.product {
	position: relative;
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	text-align: left;
}

/* ---------- Product card ------------------------------------------------ */

/* Square tile, whole shoe visible. The catalogue photos are 1:1, so "contain"
   changes nothing for them; it only protects odd uploads from being cropped
   (thumbnail cropping is set to "uncropped" in the store settings). */
.woocommerce ul.products li.product a img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	margin: 0;
	border-radius: 0;
	background: var(--color-bg-soft);
	transition: opacity var(--dur) var(--ease);
}

.woocommerce ul.products li.product a:hover img {
	opacity: 0.9;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	margin: var(--space-3) 0 0;
	padding: 0;
	overflow: hidden;
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-snug);
	letter-spacing: 0;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Grey category line under the title (shoeshub_loop_subtitle()). */
.woocommerce ul.products li.product .loop-subtitle {
	display: block;
	margin-top: var(--space-1);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-normal);
	line-height: var(--leading-snug);
}

.woocommerce ul.products li.product .price {
	display: block;
	margin: var(--space-2) 0 0;
	color: var(--color-text);
	font-size: var(--text-base);
	font-weight: var(--font-weight-semibold);
	line-height: var(--leading-normal);
}

@media (min-width: 1024px) {
	.woocommerce ul.products li.product .woocommerce-loop-product__title,
	.woocommerce ul.products li.product .price {
		font-size: var(--text-md);
	}

	.woocommerce ul.products li.product .loop-subtitle {
		font-size: var(--text-base);
	}
}

.woocommerce ul.products li.product .price del {
	color: var(--color-text-subtle);
	font-weight: var(--font-weight-normal);
	opacity: 1;
}

.woocommerce ul.products li.product .price ins {
	text-decoration: none;
}

/* ---------- Sold out ---------------------------------------------------- */

/* The suffix is appended inside the title by shoeshub_loop_sold_out_title(),
   so the stored product name never changes. */
.woocommerce ul.products li.product .loop-sold-out {
	color: var(--color-text-muted);
	font-size: 0.8em;
	font-weight: var(--font-weight-normal);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Dim the photo and price so sold-out cards read at a glance, while the name
   and the label stay fully legible. */
.woocommerce ul.products li.product.outofstock a img {
	opacity: 0.45;
}

.woocommerce ul.products li.product.outofstock a:hover img {
	opacity: 0.55;
}

.woocommerce ul.products li.product.outofstock .price,
.woocommerce ul.products li.product.outofstock .price del,
.woocommerce ul.products li.product.outofstock .price ins {
	color: var(--color-text-muted);
}

/* ---------- Instalment lines (Mintpay / Koko) --------------------------- */

/* Both plugins print their breakdown inside .price. Keep the content and its
   links; only tighten the spacing so the group reads quietly under the price.
   The plugins hard-code inline sizes/colours, hence !important. Scoped to
   loop cards so the single product page is untouched. */
.woocommerce ul.products li.product .price > br {
	display: none;
}

.woocommerce ul.products li.product .price .mintpay-price-breakdown,
.woocommerce ul.products li.product .price .product-price-installments-not-in-variation {
	margin: var(--space-1) 0 0;
	color: var(--color-text-muted) !important;
	font-size: var(--text-xs) !important;
	font-weight: var(--font-weight-normal) !important;
	line-height: 1.4 !important;
}

.woocommerce ul.products li.product .price .mintpay-price-breakdown img,
.woocommerce ul.products li.product .price .product-price-installments-not-in-variation img {
	vertical-align: middle;
}

/* Sale badge */
.woocommerce span.onsale {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 1;
	display: inline-grid;
	place-items: center;
	min-width: 0;
	min-height: 24px;
	margin: 0;
	padding: 2px var(--space-2);
	border-radius: var(--radius-pill);
	background: var(--color-sale);
	color: var(--color-on-sale);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
}

/* Star ratings */
.woocommerce .star-rating {
	color: var(--color-rating);
	font-size: var(--text-sm);
}

.woocommerce .star-rating::before {
	color: var(--color-border-strong);
}
