/*
 * Shared product card — shop loop, related/cross-sell products, and
 * homepage Bestsellers/New Arrivals sections all render this same markup.
 */

/* WooCommerce still wraps related products / cross-sells in its own
   <ul class="products">, unlike the shop archive's custom .grid--4. */
ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-lg);
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 959px) {
	ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 599px) {
	ul.products {
		grid-template-columns: 1fr;
	}
}

ul.products li.product {
	list-style: none;
}

.product-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	margin-bottom: var(--space-sm);
	background-color: var(--color-white);
	transition: box-shadow 0.3s ease;
}

.product-card__media:hover,
.product-card__media:focus-visible {
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.product-card__media:hover img,
.product-card__media:focus-visible img {
	transform: scale(1.04);
}

.product-card__badges {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-3xs);
	align-items: flex-start;
}

.product-card__name {
	margin: 0;
	font-size: var(--text-sm);
}

.product-card__meta {
	margin: var(--space-3xs) 0 0;
	font-size: var(--text-sm);
	color: rgba(0, 0, 0, 0.65);
}

.product-card__price {
	margin-top: var(--space-2xs);
	font-weight: 600;
	font-size: var(--text-sm);
}

.product-card__price del {
	margin-right: var(--space-2xs);
	color: rgba(0, 0, 0, 0.45);
	font-weight: 400;
}

.product-card__price ins {
	text-decoration: none;
}

.product-card__info .badge {
	margin-top: var(--space-2xs);
}

.product-card__delivery {
	margin: var(--space-3xs) 0 0;
	font-size: var(--text-xs);
	color: rgba(0, 0, 0, 0.55);
}

.product-card__delivery--extended {
	font-weight: 600;
	color: var(--color-black);
}

/*
 * Not scoped under .woocommerce on purpose (unlike cart.css's button
 * rule) — this card partial also renders on the homepage, whose body
 * doesn't carry that class outside an actual WooCommerce page/template.
 */
.product-card__actions {
	margin-top: var(--space-sm);
}

.product-card__actions .button {
	display: block;
	width: 100%;
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-pill);
	border: 2px solid var(--color-black);
	background-color: var(--color-black);
	color: var(--color-white);
	font-size: var(--text-sm);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.product-card__actions .button:hover,
.product-card__actions .button:focus-visible {
	background-color: transparent;
	color: var(--color-black);
}

.product-card__actions .button.loading {
	opacity: 0.6;
	pointer-events: none;
}

.product-card__actions .added_to_cart {
	display: block;
	margin-top: var(--space-2xs);
	font-size: var(--text-xs);
	text-align: center;
	text-decoration: underline;
	color: var(--color-black);
}
