/* Manto Online product card (templates/card.php). One size for every product, whatever the photo. */

/* grid / carousel items stretch so every card in a row has the same height */
html .wd-product.product-grid-item {
	display: flex;
	text-align: right;
}
html .wd-carousel .wd-carousel-item,
html .wd-carousel .wd-carousel-item > .wd-product {
	height: auto;
}

.mo-card {
	--r: 26px;
	container-type: inline-size;
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 7px;
	border: 1px solid rgba(51, 40, 33, .06);
	border-radius: var(--r);
	background: var(--mo-white);
	box-shadow: 0 18px 40px -30px rgba(51, 40, 33, .4);
	transition: transform .45s var(--mo-ease), box-shadow .45s var(--mo-ease);
}
.mo-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 30px 50px -30px rgba(51, 40, 33, .5);
}

/* ---------- top strip (sale / new / free shipping) ---------- */
.mo-card__strip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 52px;
	margin: -7px -7px 0;
	padding: 9px 16px 22px;
	border-radius: var(--r) var(--r) 0 0;
	background: var(--mo-cream);
	color: var(--mo-brown);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}
.mo-card__strip.is-sale { background: var(--mo-soft); }
.mo-card__flag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}
.mo-card__flag svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linejoin: round;
	stroke-linecap: round;
}
.is-sale .mo-card__flag svg { fill: var(--mo-brown); stroke: var(--mo-brown); }
.is-sale .mo-card__flag svg .mo-pct { stroke: var(--mo-soft); stroke-width: 2; }
.mo-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mo-taupe);
	animation: mo-pulse 1.8s ease-in-out infinite;
}
.mo-card__meta {
	font-size: 12px;
	font-weight: 600;
	color: var(--mo-taupe);
	white-space: nowrap;
}
.mo-card__timer {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	direction: ltr;
}
.mo-card__timer b {
	display: grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 4px;
	border-radius: 7px;
	background: var(--mo-brown);
	color: var(--mo-cream);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.mo-card__timer i {
	font-style: normal;
	font-weight: 700;
	color: var(--mo-brown);
}

/* ---------- image ---------- */
.mo-card__media {
	position: relative;
	z-index: 1;
	margin-top: -14px;
	aspect-ratio: 3 / 4;               /* was 2/3: shorter, less stretched cards */
	overflow: hidden;
	border-radius: 20px;
	background: var(--mo-soft);
}
/* !important: WoodMart sets .product-image-link to position:relative with a stronger selector */
html .mo-card .mo-card__media .mo-card__img,
html .mo-card .mo-card__media .hover-img,
html .mo-card .mo-card__media .hover-img > a {
	position: absolute !important;
	inset: 0 !important;
	display: block;
	width: 100%;
	height: 100%;
}
html .mo-card .mo-card__media img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: 50% 20%;
	transition: transform .9s var(--mo-ease);
}
/* the card has no WoodMart image wrapper, so its lazy-load fade never gets .wd-loaded: show images directly */
.mo-card__media img.wd-lazy-fade { opacity: 1; }
.mo-card__media .hover-img {
	opacity: 0;
	transition: opacity .5s ease;
}
.mo-card:hover .mo-card__media .hover-img { opacity: 1; }
.mo-card:hover .mo-card__media img { transform: scale(1.04); }

/* wishlist (WoodMart button, restyled as a heart chip) */
.mo-card__wish {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 3;
}
.mo-card__wish .wd-compare-btn,
.mo-card__wish .wd-quick-view-btn { display: none !important; }
.mo-card__wish .wd-action-btn > a {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--mo-brown) !important;
	font-size: 0 !important;
	transition: transform .3s var(--mo-ease), background-color .25s ease;
}
.mo-card__wish .wd-action-btn > a::before {
	font-size: 17px !important;
	color: inherit !important;
}
.mo-card__wish .wd-action-btn > a:hover { transform: scale(1.1); background: var(--mo-white); }
.mo-card__wish .wd-action-btn > a.added { color: #B5413E !important; }

/* photo count */
.mo-card__count {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 26px;
	padding: 0 9px;
	border-radius: 999px;
	background: rgba(51, 40, 33, .5);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--mo-cream);
	font-size: 12px;
	font-weight: 600;
}
.mo-card__count svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
}

/* ---------- color dots ---------- */
.mo-swatches {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 5px;
	max-width: calc(100% - 20px);
	margin: 0;
	padding: 6px 8px;
	list-style: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: 0 6px 16px -8px rgba(51, 40, 33, .45);
}
.mo-swatch {
	flex: none;
	width: 14px;
	height: 14px;
	margin: 0;
	border-radius: 50%;
	background: var(--c, repeating-linear-gradient(45deg, #D8C5AD 0 2px, #FFFFFF 2px 4px));
	box-shadow: 0 0 0 1.5px var(--mo-white), 0 0 0 2.5px rgba(51, 40, 33, .1);
	transition: transform .25s var(--mo-ease);
}
.mo-swatch.is-light {
	box-shadow: 0 0 0 1.5px var(--mo-white), 0 0 0 2.5px rgba(51, 40, 33, .28);
}
.mo-swatch:hover { transform: scale(1.3); }
.mo-card:hover .mo-swatch {
	animation: mo-swatch-pop .45s var(--mo-ease) calc(var(--k, 0) * .045s) both;
}
@keyframes mo-swatch-pop {
	0% { transform: scale(1); }
	45% { transform: scale(1.28); }
	100% { transform: scale(1); }
}
.mo-swatch-more {
	flex: none;
	min-width: 18px;
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	line-height: 14px;
	text-align: center;
	color: var(--mo-brown);
}

/* out of stock */
.mo-card.is-out .mo-card__media img { filter: grayscale(.7); opacity: .75; }
.mo-card__out {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	transform: translate(-50%, -50%);
	padding: 6px 16px;
	border-radius: 999px;
	background: rgba(51, 40, 33, .85);
	color: var(--mo-cream);
	font-size: 13px;
	font-weight: 700;
}

/* ---------- body ---------- */
.mo-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: 14px 8px 6px;
}
.mo-card__tag {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--mo-cream);
	color: var(--mo-taupe);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}
.mo-card__tag svg {
	width: 13px;
	height: 13px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}
html .mo-card__title {
	margin: 0 !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	line-height: 1.5 !important;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	overflow: hidden;
}
html .mo-card__title a {
	color: var(--mo-brown) !important;
}
html .mo-card__title a:hover { color: var(--mo-taupe) !important; }

.mo-card__foot {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1.5px dashed rgba(51, 40, 33, .15);
}
.mo-card__price {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}
.mo-card__price del {
	font-size: 12px;
	color: var(--mo-taupe);
	opacity: .9;
}
.mo-card__price del .amount { color: inherit !important; }
.mo-card__now {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	font-size: 18px;
	font-weight: 800;
	color: var(--mo-brown);
	white-space: nowrap;
}
.mo-card__now .amount { color: inherit !important; }
.mo-card__now small {
	font-size: 12px;
	font-weight: 500;
	color: var(--mo-taupe);
}
.mo-card__price .woocommerce-Price-currencySymbol {
	font-size: .68em;
	font-weight: 600;
	margin-inline-start: 2px;
}

.mo-card__cta {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 42px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--mo-brown);
	color: var(--mo-cream) !important;
	font-size: 14px;
	font-weight: 700;
	transition: background-color .25s ease, transform .25s var(--mo-ease);
}
.mo-card__cta svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.mo-card__cta:hover {
	background: var(--mo-hover);
	color: var(--mo-white) !important;
	transform: translateY(-1px);
}
.mo-card__cta:focus-visible,
.mo-card__title a:focus-visible,
.mo-card__img:focus-visible {
	outline: 2px solid var(--mo-taupe);
	outline-offset: 2px;
}

/* ---------- narrow cards (2 columns on phones, small carousels) ---------- */
@container (max-width: 230px) {
	.mo-card__strip { min-height: 46px; padding: 8px 12px 20px; font-size: 12px; }
	.mo-card__timer b { min-width: 21px; height: 21px; font-size: 11px; }
	html .mo-card__title { font-size: 15px !important; }
	.mo-card__foot { flex-direction: column; align-items: stretch; gap: 8px; }
	.mo-card__now { font-size: 16px; }
	.mo-card__cta { width: 100%; height: 38px; }
	.mo-swatch { width: 12px; height: 12px; }
	.mo-swatches { gap: 4px; padding: 5px 7px; }
}
@container (max-width: 190px) {
	.mo-card__meta { display: none; }
	.mo-card__count { display: none; }
	.mo-card__tag { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	.mo-card, .mo-card__media img, .mo-swatch, .mo-card__cta { transition: none !important; }
	.mo-card:hover .mo-swatch, .mo-dot { animation: none !important; }
	.mo-card:hover { transform: none; }
}
