/* ==========================================================================
   Product cards (site-wide): floating white cards, "Save Rs.X" badge,
   price above title, stock line, WhatsApp button only.
   Colors come from Woodmart Theme Settings (--wd-primary-color).
   ========================================================================== */

:root {
	--xh-card-radius: 14px;
	--xh-card-pad: 16px;
	--xh-ink: #111827;
	--xh-muted: #6b7280;
	--xh-line: #eceef2;
	--xh-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Equal height rows (grids + carousels) ---------- */
.wd-carousel .wd-carousel-wrap {
	height: auto; /* Woodmart's height:100% makes the track taller than the cards. */
	align-items: stretch !important; /* also overrides .wd-autoheight (flex-start) */
}
.wd-carousel .wd-carousel-item { height: auto !important; }
body .wd-carousel-item > .wd-product,
body .products .wd-product,
body .wd-products .wd-product { width: 100%; height: 100%; }

/* Grid items: let the card fill the full row height so buttons line up. */
body .wd-product { display: flex; flex-direction: column; }
body .wd-product .product-wrapper { flex: 1 1 auto; }

/* Room for the hover lift + shadow inside carousels. */
.wd-products .wd-carousel { padding-block: 10px 18px; }
.products-bordered-grid .wd-carousel-item,
.products-bordered-grid .wd-product { border: 0 !important; }
.products-bordered-grid { --wd-prods-brd: 0; }

/* ---------- Card ---------- */
body .wd-product .product-wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: var(--xh-card-pad);
	border: 1px solid var(--xh-line);
	border-radius: var(--xh-card-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 18px rgba(17, 24, 39, .04);
	transition: transform .35s var(--xh-ease), border-color .35s var(--xh-ease);
	will-change: transform;
}
/* Deeper shadow faded in on hover (opacity is cheap to animate, box-shadow is not). */
body .wd-product .product-wrapper::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	box-shadow: 0 24px 48px rgba(17, 24, 39, .12);
	opacity: 0;
	transition: opacity .35s var(--xh-ease);
	pointer-events: none;
}
body .wd-product:hover .product-wrapper {
	transform: translateY(-6px);
	border-color: color-mix(in srgb, var(--wd-primary-color) 55%, #fff);
}
body .wd-product:hover .product-wrapper::after { opacity: 1; }

/* ---------- Image ---------- */
body .wd-product .product-element-top {
	flex: 0 0 auto;
	margin: 0 0 14px;
	overflow: hidden;
	border-radius: calc(var(--xh-card-radius) - 6px);
	background: #fff;
}
body .wd-product .product-image-link img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	transition: transform .5s var(--xh-ease);
}
body .wd-product:hover .product-image-link img { transform: scale(1.05); }

/* ---------- Labels ---------- */
body .wd-product .product-labels {
	top: 10px;
	left: 10px;
	right: auto;
	align-items: flex-start;
	gap: 6px;
}
body .wd-product .product-label {
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	white-space: nowrap;
	margin: 0;
	padding: 6px 10px !important;
	border-radius: 6px !important;
	font-size: 12px !important;
	font-weight: 700;
	line-height: 1.2 !important;
	letter-spacing: 0;
	text-transform: none;
	word-break: normal;
	box-shadow: 0 4px 10px rgba(17, 24, 39, .08);
}
body .wd-product .product-label.onsale {
	background: var(--wd-primary-color);
	color: #000;
}
body .wd-product .product-label.out-of-stock {
	background: rgba(17, 24, 39, .85);
	color: #fff;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

/* ---------- Content order: price, title, description, stock, WhatsApp ---------- */
body .wd-product .product-element-bottom {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 0;
}
body .wd-product .product-element-bottom > .wrap-price { display: contents !important; }
body .wd-product .product-element-bottom .price { order: 1; }
body .wd-product .product-element-bottom .wd-entities-title { order: 2; }
body .wd-product .product-element-bottom .custom-product-description { order: 3; }
body .wd-product .product-element-bottom .xh-stock { order: 4; }
body .wd-product .product-element-bottom > a#sendbtn,
body .wd-product .product-element-bottom > .wa-shop-button { order: 10; margin-top: auto; }

/* Hidden: categories, add to cart / read more wrappers. */
body .wd-product .wd-product-cats,
body .wd-product .product-element-bottom > .fade-in-block,
body .wd-product .wd-add-btn,
body .wd-product .add_to_cart_button:not(.wa-shop-button),
body .wd-product .add-to-cart-loop { display: none !important; }

/* Price: sale price first, old price struck through after it. */
body .wd-product .price {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
	margin: 0 0 8px !important;
	color: var(--xh-ink);
	font-family: var(--wd-title-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}
body .wd-product .price ins { order: 1; color: var(--xh-ink); text-decoration: none; font-weight: 700; }
body .wd-product .price del {
	order: 2;
	color: #9ca3af;
	font-size: 14px;
	font-weight: 500;
	opacity: 1;
}
body .wd-product .price .amount { color: inherit; }

/* Title: always 2 lines tall. */
body .wd-product .wd-entities-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: calc(2 * 1.45em);
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
}
body .wd-product .wd-entities-title a { color: var(--xh-ink); transition: color .3s var(--xh-ease); }
body .wd-product .wd-entities-title a:hover { color: color-mix(in srgb, var(--wd-primary-color) 70%, #000); }

body .wd-product .custom-product-description {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: calc(2 * 1.5em);
	margin: 0 0 10px;
	color: var(--xh-muted);
	font-size: 13px;
	line-height: 1.5;
}

/* Stock line */
body .wd-product .xh-stock {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	color: var(--xh-ink);
	font-size: 13px;
	font-weight: 600;
}
.xh-stock-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wd-primary-color);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--wd-primary-color) 25%, transparent);
}
.xh-stock.is-out { color: var(--xh-muted); }
.xh-stock.is-out .xh-stock-dot { background: #9ca3af; box-shadow: 0 0 0 4px rgba(156, 163, 175, .25); }

/* WhatsApp button */
body .wd-product a#sendbtn,
body .wd-product .wa-shop-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 44px;
	margin: auto 0 0 !important; /* auto top margin pins it to the bottom of the card */
	padding: 10px 14px !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	font-size: 14px;
	line-height: 1.2;
	transition: transform .3s var(--xh-ease), filter .3s var(--xh-ease);
}
body .wd-product a#sendbtn:hover,
body .wd-product .wa-shop-button:hover { transform: translateY(-2px); filter: brightness(1.05); }

/* ---------- Single product ---------- */
.single-product .wd-buy-now-btn,
.single-product .single_add_to_cart_button { display: none !important; }

.xh-wa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 6px 20px 18px 0;
	padding: 14px 28px;
	border-radius: 10px;
	background: #25d366;
	color: #fff !important;
	font-size: 16px;
	font-weight: 600;
	box-shadow: 0 10px 24px rgba(37, 211, 102, .28);
	transition: transform .3s var(--xh-ease);
}
.xh-wa-btn:hover { transform: translateY(-2px); }

@media (max-width: 767px) {
	:root { --xh-card-pad: 10px; --xh-card-radius: 12px; }
	body .wd-product .price { font-size: 16px; }
	body .wd-product .price del { font-size: 12px; }
	body .wd-product .wd-entities-title { font-size: 13px; }
	body .wd-product .custom-product-description { display: none; }
	body .wd-product a#sendbtn,
	body .wd-product .wa-shop-button { min-height: 38px; font-size: 12px; padding: 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
	body .wd-product .product-wrapper,
	body .wd-product .product-image-link img { transition: none; }
	body .wd-product:hover .product-wrapper,
	body .wd-product:hover .product-image-link img { transform: none; }
}
