/**
 * Product Card V3 — Almutaheda Pack.
 *
 * One consolidated card layer. It supports shop archives, taxonomy loops,
 * homepage product loops, related products, and WooCommerce shortcodes.
 *
 * Grid ownership remains here temporarily because several existing loops rely
 * on it. A later layout audit can move archive-specific columns to the page
 * stylesheet without changing the card component.
 */

/* WooCommerce loop normalisation. */
ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

ul.products li.product {
	min-width: 0;
	margin: 0;
}

/* Card shell. */
.alm-product-card--v3 {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	border: 1px solid rgba(14, 34, 58, 0.11);
	border-radius: 0;
	background: var(--alm-color-white, #fff);
	box-shadow: 0 10px 32px rgba(14, 34, 58, 0.055);
	transition:
		transform var(--alm-duration-base, 180ms) var(--alm-easing-standard, ease),
		border-color var(--alm-duration-base, 180ms) var(--alm-easing-standard, ease),
		box-shadow var(--alm-duration-base, 180ms) var(--alm-easing-standard, ease);
}

.alm-product-card--v3:hover {
	transform: translateY(-4px);
	border-color: rgba(199, 154, 86, 0.78);
	box-shadow: 0 22px 52px rgba(14, 34, 58, 0.11);
}

.alm-product-card--v3:focus-within {
	outline: var(--alm-focus-ring-width, 2px) solid var(--alm-focus-ring-color, #c79a56);
	outline-offset: var(--alm-focus-ring-offset, 3px);
}

/* Media. */
.alm-product-card--v3 .alm-product-card__media {
	position: relative;
	flex: 0 0 auto;
	aspect-ratio: 1 / 0.82;
	overflow: hidden;
	background:
		linear-gradient(145deg, #fbf8f3 0%, #efe5d7 100%);
}

.alm-product-card--v3 .alm-product-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.alm-product-card--v3 .alm-product-card__image-link img,
.alm-product-card--v3 .alm-product-card__media .woocommerce-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	padding: clamp(0.8rem, 2vw, 1.25rem);
	object-fit: contain;
	transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.alm-product-card--v3:hover .alm-product-card__image-link img,
.alm-product-card--v3:hover .alm-product-card__media .woocommerce-placeholder {
	transform: scale(1.035);
}

.alm-product-card--v3 .alm-product-card__badge-stack {
	position: absolute;
	z-index: 3;
	inset-block-start: 0.85rem;
	inset-inline-start: 0.85rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.4rem;
	pointer-events: none;
}

.alm-product-card--v3 .onsale {
	position: static;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0.45rem 0.65rem;
	border-radius: 0;
	background: var(--alm-color-error, #b42318);
	color: #fff;
	font-size: var(--alm-text-xs, 0.75rem);
	line-height: 1;
}

.alm-product-card--v3 .alm-product-card__oos-overlay {
	position: absolute;
	z-index: 4;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(247, 243, 238, 0.76);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.alm-product-card--v3 .alm-product-card__oos-overlay span {
	padding: 0.6rem 0.8rem;
	border: 1px solid rgba(14, 34, 58, 0.16);
	background: rgba(255, 255, 255, 0.92);
	color: var(--alm-color-navy-primary, #102a43);
	font-size: var(--alm-text-xs, 0.75rem);
	font-weight: 700;
}

/* Body and information hierarchy. */
.alm-product-card--v3 .alm-product-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 0.8rem;
	padding: clamp(1.1rem, 2vw, 1.45rem);
}

.alm-product-card--v3 .alm-product-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	min-height: 1.7rem;
}

.alm-product-card--v3 .alm-product-card__usecase,
.alm-product-card--v3 .alm-product-card__type {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	min-height: 1.65rem;
	margin: 0;
	padding-inline: 0.6rem;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.2;
}

.alm-product-card--v3 .alm-product-card__usecase {
	background: rgba(14, 34, 58, 0.06);
	color: var(--alm-color-navy-primary, #102a43);
}

.alm-product-card--v3 .alm-product-card__type {
	background: rgba(199, 154, 86, 0.16);
	color: var(--alm-color-copper-deep, #8b5e2f);
}

.alm-product-card--v3 .alm-product-card__title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--alm-color-text-primary, #102a43);
	font-size: clamp(1rem, 1.45vw, 1.18rem);
	font-weight: 700;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.alm-product-card--v3 .alm-product-card__title-link {
	color: inherit;
	text-decoration: none;
}

.alm-product-card--v3 .alm-product-card__title-link::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
}

.alm-product-card--v3 .alm-product-card__summary {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--alm-color-text-secondary, #486581);
	font-size: var(--alm-text-sm, 0.875rem);
	line-height: 1.75;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.alm-product-card--v3 .alm-product-card__qty-note {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	margin: 0;
	padding-block: 0.7rem;
	border-block: 1px solid rgba(14, 34, 58, 0.09);
	background: transparent;
	color: var(--alm-color-text-secondary, #486581);
	font-size: var(--alm-text-xs, 0.75rem);
}

.alm-product-card--v3 .alm-product-card__qty-note span {
	color: var(--alm-color-text-muted, #829ab1);
}

.alm-product-card--v3 .alm-product-card__qty-note strong {
	min-width: 0;
	color: var(--alm-color-navy-primary, #102a43);
	font-weight: 700;
	text-align: end;
}

.alm-product-card--v3 .alm-product-card__commerce {
	display: grid;
	gap: 0.65rem;
	margin-block-start: auto;
	padding-block-start: 0.25rem;
}

.alm-product-card--v3 .alm-product-card__price {
	min-height: 2rem;
}

.alm-product-card--v3 .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.45rem 0.7rem;
	margin: 0;
	font-family: var(--alm-font-latin);
}

.alm-product-card--v3 .price .amount {
	color: var(--alm-color-navy-primary, #102a43);
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	font-weight: 800;
	line-height: 1.2;
}

.alm-product-card--v3 .price del,
.alm-product-card--v3 .price del .amount {
	color: var(--alm-color-text-muted, #829ab1);
	font-size: var(--alm-text-xs, 0.75rem);
	font-weight: 400;
}

.alm-product-card--v3 .price ins {
	text-decoration: none;
}

.alm-product-card--v3 .price ins .amount {
	color: var(--alm-color-error, #b42318);
}

.alm-product-card--v3 .alm-product-card__delivery {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	color: var(--alm-color-success, #168b5b);
	font-size: var(--alm-text-xs, 0.75rem);
	font-weight: 600;
	line-height: 1.5;
}

.alm-product-card--v3 .alm-product-card__delivery > span {
	inline-size: 0.5rem;
	block-size: 0.5rem;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 0.25rem rgba(22, 139, 91, 0.11);
}

/* Footer and WooCommerce actions. */
.alm-product-card--v3 .alm-product-card__footer {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.95rem clamp(1.1rem, 2vw, 1.45rem);
	border-block-start: 1px solid rgba(14, 34, 58, 0.09);
	background: rgba(14, 34, 58, 0.025);
}

.alm-product-card--v3 .alm-product-card__footer > a,
.alm-product-card--v3 .alm-product-card__footer > button,
.alm-product-card--v3 .alm-product-card__footer .button {
	position: relative;
	z-index: 2;
	width: 100%;
	min-height: 2.9rem;
	justify-content: center;
	text-align: center;
}

.alm-product-card--v3 .alm-product-card__footer .button.loading {
	position: relative;
	overflow: hidden;
	color: transparent !important;
	pointer-events: none;
	opacity: 0.78;
}

.alm-product-card--v3 .alm-product-card__footer .button.loading::after {
	content: "";
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	inline-size: 1rem;
	block-size: 1rem;
	margin: -0.5rem;
	border: 2px solid currentColor;
	border-block-start-color: transparent;
	border-radius: 50%;
	animation: alm-product-card-spin 650ms linear infinite;
}

.alm-product-card--v3 .alm-product-card__footer .button.added,
.alm-product-card--v3 .alm-product-card__footer .button.is-added {
	border-color: var(--alm-color-success, #168b5b);
	background: var(--alm-color-success, #168b5b);
	color: #fff;
}

.alm-product-card--v3 .alm-product-card__footer .added_to_cart {
	display: none;
}

.alm-product-card--v3.alm-product-card--premium,
.alm-product-card--v3.alm-product-card--bundle {
	border-block-start: 3px solid var(--alm-color-sand, #cdaa7d);
}

.alm-product-card--v3.alm-product-card--bundle-featured {
	border-color: rgba(199, 154, 86, 0.88);
	box-shadow: 0 22px 54px rgba(14, 34, 58, 0.12);
}

.alm-product-card--v3.alm-product-card--outofstock {
	opacity: 0.88;
}

.alm-product-card--v3.alm-product-card--outofstock:hover {
	transform: none;
	border-color: rgba(14, 34, 58, 0.11);
	box-shadow: 0 10px 32px rgba(14, 34, 58, 0.055);
}

@keyframes alm-product-card-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 47.99rem) {
	ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.85rem;
	}

	.alm-product-card--v3 .alm-product-card__media {
		aspect-ratio: 1 / 0.9;
	}

	.alm-product-card--v3 .alm-product-card__body {
		padding: 0.9rem;
	}

	.alm-product-card--v3 .alm-product-card__footer {
		padding: 0.8rem 0.9rem;
	}

	.alm-product-card--v3 .alm-product-card__summary,
	.alm-product-card--v3 .alm-product-card__qty-note span,
	.alm-product-card--v3 .alm-product-card__delivery {
		display: none;
	}

	.alm-product-card--v3 .alm-product-card__qty-note {
		display: block;
		padding-block: 0.55rem;
	}

	.alm-product-card--v3 .alm-product-card__qty-note strong {
		display: block;
		text-align: start;
	}

	.alm-product-card--v3 .alm-product-card__usecase,
	.alm-product-card--v3 .alm-product-card__type {
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.alm-product-card--v3,
	.alm-product-card--v3 .alm-product-card__image-link img,
	.alm-product-card--v3 .alm-product-card__media .woocommerce-placeholder {
		transition: none;
	}

	.alm-product-card--v3:hover,
	.alm-product-card--v3:hover .alm-product-card__image-link img,
	.alm-product-card--v3:hover .alm-product-card__media .woocommerce-placeholder {
		transform: none;
	}
}

/* ═══════════════════════════════════════════════════════════════════
   PRODUCT LOOP WIDTH RESET
   Neutralises WooCommerce float/width rules so each product fills
   its CSS Grid cell in archives and other product loops.
   ══════════════════════════════════════════════════════════════════ */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
ul.products li.product {
	float: none;
	clear: none;
	width: 100%;
	max-width: none;
	min-width: 0;
	margin: 0;
}

.woocommerce ul.products li.product.alm-product-card,
.woocommerce-page ul.products li.product.alm-product-card,
ul.products li.product.alm-product-card {
	width: 100%;
	max-width: none;
}

/* No-image placeholder caption. */
.alm-product-card--v3 .alm-product-card__img-placeholder {
	position: absolute;
	z-index: 2;
	inset-block-end: 0.6rem;
	inset-inline: 0;
	text-align: center;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--alm-color-copper-deep, #8b5e2f);
	letter-spacing: 0.04em;
	pointer-events: none;
}

