/**
 * WoodMart child-theme product card.
 * All selectors are scoped to the stable mm-product-card namespace.
 */

.mm-product-card {
	--mm-card-accent: var(--wd-primary-color, #c8882f);
	--mm-card-ink: #1d1b19;
	--mm-card-muted: #77716a;
	--mm-card-line: rgba(58, 48, 39, .12);
	--mm-card-media: #f7f4ef;
	--mm-card-radius: 16px;
	direction: rtl;
}

.mm-product-card .mm-product-card__surface {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--mm-card-line);
	border-radius: var(--mm-card-radius);
	box-shadow: 0 8px 28px rgba(45, 36, 28, .06);
	transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.mm-product-card .mm-product-card__media {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin: 8px 8px 0;
	aspect-ratio: 1 / 1;
	background: var(--mm-card-media);
	border-radius: calc(var(--mm-card-radius) - 5px);
}

.mm-product-card .mm-product-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
	padding: clamp(8px, 4%, 16px);
}

.mm-product-card .mm-product-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	transition: opacity 260ms ease, transform 260ms ease;
}

.mm-product-card .hover-img {
	border-radius: inherit;
}

.mm-product-card .mm-product-card__badges {
	position: absolute;
	z-index: 4;
	top: 12px;
	right: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: calc(100% - 66px);
}

.mm-product-card .mm-product-card__badge {
	display: inline-flex;
	align-items: center;
	min-height: 27px;
	padding: 4px 9px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	border-radius: 999px;
}

.mm-product-card .mm-product-card__badge--sale {
	color: #fff;
	background: var(--mm-card-accent);
}

.mm-product-card .mm-product-card__badge--stock {
	color: #fff;
	background: #3d3935;
}

.mm-product-card .product-label.onsale,
.mm-product-card .onsale.product-label {
	display: none;
}

.mm-product-card .mm-product-card__actions {
	position: absolute;
	z-index: 5;
	top: 12px;
	left: 12px;
	right: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0;
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 180ms ease, transform 180ms ease;
}

.mm-product-card .mm-product-card__actions .wd-action-btn {
	margin: 0;
}

.mm-product-card .mm-product-card__actions .wd-action-btn > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-height: 38px;
	color: var(--mm-card-ink);
	background: rgba(255, 255, 255, .96);
	border: 1px solid rgba(58, 48, 39, .1);
	border-radius: 50%;
	box-shadow: 0 4px 16px rgba(45, 36, 28, .1);
	transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.mm-product-card .mm-product-card__actions .wd-action-btn > a:hover,
.mm-product-card .mm-product-card__actions .wd-action-btn > a:focus-visible {
	color: #fff;
	background: var(--mm-card-ink);
	transform: translateY(-1px);
}

.mm-product-card .mm-product-card__swatches {
	position: absolute;
	z-index: 4;
	right: 12px;
	bottom: 10px;
	left: 12px;
}

.mm-product-card .mm-product-card__swatches:empty {
	display: none;
}

.mm-product-card .mm-product-card__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: stretch;
	padding: 17px 17px 16px;
	text-align: right;
}

.mm-product-card .mm-product-card__eyebrow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 20px;
	margin-bottom: 7px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
}

.mm-product-card .mm-product-card__eyebrow > a,
.mm-product-card .mm-product-card__eyebrow > span:first-child {
	overflow: hidden;
	color: var(--mm-card-muted);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mm-product-card .mm-product-card__eyebrow > a:hover {
	color: var(--mm-card-accent);
}

.mm-product-card .mm-product-card__availability {
	position: relative;
	flex: 0 0 auto;
	padding-right: 10px;
	color: #4f7b59;
}

.mm-product-card .mm-product-card__availability::before {
	position: absolute;
	top: 50%;
	right: 0;
	width: 5px;
	height: 5px;
	content: "";
	background: currentColor;
	border-radius: 50%;
	transform: translateY(-50%);
}

.mm-product-card .mm-product-card__title {
	min-height: 48px;
	margin-bottom: 7px;
}

.mm-product-card .mm-product-card__title .wd-entities-title {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	color: var(--mm-card-ink);
	font-size: clamp(14px, 1.05vw, 16px);
	font-weight: 700;
	line-height: 1.65;
	text-align: right;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.mm-product-card .mm-product-card__title .wd-entities-title a {
	color: inherit;
}

.mm-product-card .mm-product-card__title .wd-entities-title a:hover {
	color: var(--mm-card-accent);
}

.mm-product-card .mm-product-card__trust {
	display: flex;
	align-items: center;
	min-height: 18px;
	margin-bottom: 9px;
	color: #a29b94;
	font-size: 10px;
}

.mm-product-card .mm-product-card__trust .star-rating {
	margin: 0;
	font-size: 11px;
}

.mm-product-card .mm-product-card__review-count {
	margin-right: 5px;
	color: var(--mm-card-muted);
}

.mm-product-card .mm-product-card__no-rating {
	color: #aaa39c;
}

.mm-product-card .mm-product-card__price {
	display: flex;
	align-items: center;
	min-height: 46px;
	margin-top: auto;
	margin-bottom: 12px;
	color: var(--mm-card-ink);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.5;
}

.mm-product-card .mm-product-card__price > .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 3px 7px;
	margin: 0;
	color: inherit;
	font-size: inherit;
}

.mm-product-card .mm-product-card__price del {
	order: 2;
	color: #a39c95;
	font-size: 12px;
	font-weight: 500;
	opacity: 1;
}

.mm-product-card .mm-product-card__price ins {
	order: 1;
	color: var(--mm-card-accent);
	font-weight: 800;
	text-decoration: none;
}

.mm-product-card.product-type-variable .mm-product-card__price {
	font-size: 14px;
}

.mm-product-card .mm-product-card__cta,
.mm-product-card .mm-product-card__cta .wd-add-btn {
	width: 100%;
}

/* Neutralize the positional quick-hover CTA rules after moving it to content. */
.wd-product.mm-product-card .mm-product-card__cta .wd-add-btn {
	position: static;
	inset: auto;
	z-index: auto;
	display: block;
	opacity: 1;
	visibility: visible;
	transform: none;
}

.mm-product-card .mm-product-card__cta .button,
.mm-product-card .mm-product-card__details {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 44px;
	min-height: 44px;
	overflow: hidden;
	padding: 10px 14px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
	background: var(--mm-card-ink);
	border: 1px solid var(--mm-card-ink);
	border-radius: 10px;
	box-shadow: none;
	transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.wd-product.mm-product-card .mm-product-card__cta .wd-add-btn .add-to-cart-loop {
	width: 100%;
	height: auto;
	min-height: 44px;
	color: #fff;
	background: var(--mm-card-accent);
	border-color: var(--mm-card-accent);
	border-radius: 10px;
}

.wd-product.mm-product-card .mm-product-card__cta .wd-add-btn .add-to-cart-loop:hover,
.wd-product.mm-product-card .mm-product-card__cta .wd-add-btn .add-to-cart-loop:focus-visible {
	color: #fff;
	background: var(--mm-card-ink);
	border-color: var(--mm-card-ink);
}

.mm-product-card .mm-product-card__cta .button:hover,
.mm-product-card .mm-product-card__cta .button:focus-visible,
.mm-product-card .mm-product-card__details:hover,
.mm-product-card .mm-product-card__details:focus-visible {
	color: #fff;
	background: var(--mm-card-accent);
	border-color: var(--mm-card-accent);
}

.mm-product-card .mm-product-card__cta .wd-action-icon {
	display: none;
}

.mm-product-card .mm-product-card__cta .wd-action-text {
	display: inline !important;
	position: static;
	width: auto;
	height: auto;
	overflow: visible;
	clip: auto;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transform: none !important;
}

.mm-product-card .mm-product-card__cta .button.loading {
	color: rgba(255, 255, 255, .65);
	pointer-events: none;
}

.mm-product-card .mm-product-card__cta .button.loading::after {
	position: static;
	display: block;
	width: 15px;
	height: 15px;
	margin-right: 7px;
	content: "";
	border: 2px solid rgba(255, 255, 255, .38);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mm-card-spin .7s linear infinite;
}

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

.mm-product-card .mm-product-card__stock-progress,
.mm-product-card .mm-product-card__timer {
	margin-top: 12px;
}

.mm-product-card--out-of-stock .mm-product-card__media img {
	opacity: .78;
}

.mm-product-card--out-of-stock .mm-product-card__details {
	color: var(--mm-card-ink);
	background: transparent;
	border-color: var(--mm-card-line);
}

.mm-product-card a:focus-visible,
.mm-product-card button:focus-visible {
	outline: 2px solid var(--mm-card-accent);
	outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.mm-product-card:hover .mm-product-card__surface {
		border-color: rgba(200, 136, 47, .32);
		box-shadow: 0 14px 34px rgba(45, 36, 28, .1);
		transform: translateY(-3px);
	}

	.mm-product-card:hover .mm-product-card__actions,
	.mm-product-card:focus-within .mm-product-card__actions {
		opacity: 1;
		transform: translateX(0);
	}

	.mm-product-card:hover .mm-product-card__media > .mm-product-card__image-link img:first-child {
		transform: scale(1.015);
	}
}

@media (max-width: 1024px) {
	.mm-product-card .mm-product-card__actions {
		opacity: 1;
		transform: none;
	}

	.mm-product-card .mm-product-card__content {
		padding: 15px 15px 14px;
	}

	.mm-product-card .mm-product-card__price {
		font-size: 15px;
	}
}

@media (max-width: 767px) {
	.mm-product-card {
		--mm-card-radius: 13px;
	}

	.mm-product-card .mm-product-card__media {
		margin: 6px 6px 0;
	}

	.mm-product-card .mm-product-card__image-link {
		padding: 6px;
	}

	.mm-product-card .mm-product-card__actions {
		top: 8px;
		left: 8px;
		gap: 4px;
	}

	.mm-product-card .mm-product-card__actions .wd-action-btn > a {
		width: 34px;
		height: 34px;
		min-height: 34px;
	}

	.mm-product-card .mm-product-card__badges {
		top: 8px;
		right: 8px;
		max-width: calc(100% - 52px);
	}

	.mm-product-card .mm-product-card__badge {
		min-height: 24px;
		padding: 3px 7px;
		font-size: 9px;
	}

	.mm-product-card .mm-product-card__content {
		padding: 12px 11px 11px;
	}

	.mm-product-card .mm-product-card__eyebrow {
		margin-bottom: 5px;
		font-size: 9px;
	}

	.mm-product-card .mm-product-card__availability {
		display: none;
	}

	.mm-product-card .mm-product-card__title {
		min-height: 43px;
		margin-bottom: 5px;
	}

	.mm-product-card .mm-product-card__title .wd-entities-title {
		font-size: 12px;
		line-height: 1.75;
	}

	.mm-product-card .mm-product-card__trust {
		display: none;
	}

	.mm-product-card .mm-product-card__price,
	.mm-product-card.product-type-variable .mm-product-card__price {
		min-height: 58px;
		margin-bottom: 8px;
		font-size: 12px;
	}

	.mm-product-card.product-type-variable .mm-product-card__price {
		display: grid;
		align-content: center;
		justify-content: stretch;
		gap: 1px;
		overflow: hidden;
		font-size: 0;
		line-height: 1.35;
	}

	.mm-product-card.product-type-variable .mm-product-card__price > .amount[aria-hidden="true"] {
		display: block;
		max-width: 100%;
		font-size: 10px;
		font-weight: 800;
		white-space: nowrap;
	}

	.mm-product-card.product-type-variable .mm-product-card__price > .amount[aria-hidden="true"]:first-child::after {
		margin-right: 3px;
		color: var(--mm-card-muted);
		content: "تا";
		font-size: 9px;
		font-weight: 500;
	}

	.mm-product-card.product-type-variable .mm-product-card__price > span[aria-hidden="true"]:not(.amount) {
		display: none;
	}

	.mm-product-card.product-type-variable .mm-product-card__price--sale {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		min-height: 58px;
		gap: 2px;
		font-size: 0;
	}

	.mm-product-card.product-type-variable .mm-product-card__price--sale > del,
	.mm-product-card.product-type-variable .mm-product-card__price--sale > ins {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: flex-start;
		max-width: 100%;
		gap: 0 3px;
		line-height: 1.25;
	}

	.mm-product-card.product-type-variable .mm-product-card__price--sale > del {
		font-size: 8px;
	}

	.mm-product-card.product-type-variable .mm-product-card__price--sale > ins {
		font-size: 10px;
	}

	.mm-product-card .mm-product-card__price del {
		font-size: 9px;
	}

	.mm-product-card .mm-product-card__cta .button,
	.mm-product-card .mm-product-card__details {
		height: 41px;
		min-height: 41px;
		padding: 8px;
		font-size: 10px;
		border-radius: 8px;
	}

	.wd-product.mm-product-card .mm-product-card__cta .wd-add-btn .add-to-cart-loop {
		width: 100%;
		height: auto;
		min-height: 41px;
		border-radius: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-product-card .mm-product-card__surface,
	.mm-product-card .mm-product-card__media img,
	.mm-product-card .mm-product-card__actions,
	.mm-product-card .mm-product-card__actions .wd-action-btn > a,
	.mm-product-card .mm-product-card__cta .button {
		transition: none;
	}
}
