/* ==========================================================================
   Product card — carousels, related products, shop loop.
   Shape: rounded card with a dent at the top (discount badge) and a bump
   at the bottom holding the round add-to-cart button.
   ========================================================================== */

.haminart-pcard {
	--haminart-card-bg: #fff;
	--haminart-card-radius: 27px;
	--haminart-card-outline: var(--haminart-pink, #e5097f);
	--haminart-card-shadow: rgba(0, 0, 0, 0.08);
	--haminart-notch-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -1 59 20'%3E%3Cpath d='M0 -1V0C5.08 0 9.23 3.99 9.49 9.01L9.51 9.99C9.77 15.01 13.92 19 19 19H40C45.08 19 49.23 15.01 49.49 9.99L49.51 9.01C49.77 3.99 53.92 0 59 0V-1Z'/%3E%3C/svg%3E");
	--haminart-notch-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 123 41'%3E%3Cpath d='M123 40C116.27 38.83 110.11 35.66 105.28 30.84L84.78 10.34C71.9-2.55 51-2.55 38.11 10.34L17.61 30.84C12.79 35.66 6.63 38.83 0 40V41H123Z'/%3E%3C/svg%3E");
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: calc(100% - 14px);
	margin: 4px 0 10px;
	padding: 30px 16px 52px;
	text-align: center;
}

/* Background layer: shadow lives on the wrapper so the notch mask doesn't clip it. */
.haminart-pcard__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	filter: drop-shadow(0 4px 37px var(--haminart-card-shadow));
}

/* Figma shape: rounded card with a notch on top (badge) and an arch cut at the bottom (cart button). */
.haminart-pcard__shape {
	position: absolute;
	inset: 0;
	background: var(--haminart-card-bg);
	border-radius: var(--haminart-card-radius);
	-webkit-mask: var(--haminart-notch-bottom) bottom center / 123px 41px no-repeat, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: var(--haminart-notch-bottom) bottom center / 123px 41px no-repeat, linear-gradient(#000 0 0);
	mask-composite: exclude;
}

.haminart-pcard.has-badge .haminart-pcard__shape {
	-webkit-mask: var(--haminart-notch-top) top center / 59px 20px no-repeat, var(--haminart-notch-bottom) bottom center / 123px 41px no-repeat, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: var(--haminart-notch-top) top center / 59px 20px no-repeat, var(--haminart-notch-bottom) bottom center / 123px 41px no-repeat, linear-gradient(#000 0 0);
	mask-composite: exclude;
}

.haminart-pcard__tab {
	display: none;
}

.haminart-pcard:hover .haminart-pcard__bg {
	filter: drop-shadow(0 1px 0 var(--haminart-card-outline)) drop-shadow(0 4px 37px var(--haminart-card-shadow));
}

.haminart-pcard__badge {
	position: absolute;
	top: -4px;
	left: 50%;
	min-width: 27px;
	height: 19px;
	padding: 0 5px;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	color: #fff;
	background: var(--haminart-red, #ff4848);
	border-radius: 50px;
	transform: translateX(-50%);
}

.haminart-pcard__image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 14px;
}

.haminart-pcard__image img {
	display: block;
	width: 100%;
	height: 136px;
	margin: 0 auto;
	object-fit: contain;
	border-radius: 12px;
}

.haminart-pcard__title {
	align-self: stretch;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 800;
	line-height: 28px;
	color: var(--haminart-dark, #404040);
	text-align: start;
}

.haminart-pcard__title a {
	display: -webkit-box;
	overflow: hidden;
	color: inherit;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.haminart-pcard:hover .haminart-pcard__title {
	color: var(--haminart-card-outline);
}

/* Category: small icon + label on a gray marker stripe. */
.haminart-pcard__cat {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin: 0 0 6px;
	font-size: 10.33px;
	font-weight: 400;
	line-height: 16px;
	color: #5b5b5b;
}

.haminart-pcard__cat span {
	padding: 0 2px;
	background: linear-gradient(to top, #ededed 7px, transparent 7px);
}

.haminart-pcard__cat b {
	font-weight: 600;
}

.haminart-pcard__cat svg,
.haminart-pcard__cat i {
	width: 9px;
	height: 9px;
	font-size: 9px;
}

.haminart-pcard__price {
	margin-top: auto;
	font-size: 12px;
	line-height: 1.79;
}

.haminart-pcard__price .price,
.haminart-pcard__price {
	display: flex;
	flex-wrap: nowrap;
	align-items: baseline;
	justify-content: center;
	column-gap: 8px;
	white-space: nowrap;
}

/* Figma: new + old price on one row, each with its تومان, tight tracking. */
.haminart-pcard__price .woocommerce-Price-amount,
.haminart-pcard__price bdi {
	white-space: nowrap;
}

.haminart-pcard__price ins,
.haminart-pcard__price > .woocommerce-Price-amount,
.haminart-pcard__price .price > .woocommerce-Price-amount {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -0.08em;
	color: var(--haminart-pink, #e5097f);
	text-decoration: none;
	background: none;
}

.haminart-pcard__price .woocommerce-Price-currencySymbol {
	margin-inline-start: 2px;
	font-size: 9.17px;
	font-weight: 600;
	letter-spacing: 0;
}

.haminart-pcard__price del {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: -0.08em;
	color: #454545;
	opacity: 0.6;
}

.haminart-pcard__price del .woocommerce-Price-currencySymbol {
	font-size: 9px;
	font-weight: 400;
}

.haminart-pcard__soldout {
	font-size: 13px;
	color: var(--haminart-gray, #676767);
}

/* Cart button: soft triangle sitting in the bottom arch, 10px below the card. */
.haminart-pcard__cart {
	position: absolute;
	bottom: -10px;
	left: 50%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 50px;
	height: 40px;
	padding-bottom: 10px;
	color: #fff;
	background: var(--haminart-cart-bg, #6e6e6e);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 51 40'%3E%3Cpath d='M14.6 3.91C20.62-1.3 29.54-1.3 35.55 3.91L44.6 11.74C55.8 21.44 48.94 39.83 34.12 39.83H16.03C1.22 39.83-5.64 21.44 5.56 11.74Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 51 40'%3E%3Cpath d='M14.6 3.91C20.62-1.3 29.54-1.3 35.55 3.91L44.6 11.74C55.8 21.44 48.94 39.83 34.12 39.83H16.03C1.22 39.83-5.64 21.44 5.56 11.74Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	transform: translateX(-50%);
}

.haminart-pcard__cart svg,
.haminart-pcard__cart i {
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.haminart-pcard:hover .haminart-pcard__cart {
	background: var(--haminart-card-outline);
}

.haminart-pcard__cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

.haminart-pcard__cart.added {
	background: #20b26b;
}

.haminart-pcard__badge i {
	font-style: normal;
	font-weight: 300;
}

.haminart-pcard .added_to_cart {
	display: none;
}

.haminart-pcard.is-out-of-stock .haminart-pcard__image img {
	opacity: 0.5;
	filter: grayscale(1);
}

/* Woo shop loop grid using the card. */
.woocommerce ul.products li.product .haminart-pcard {
	margin-bottom: 34px;
}

@media (max-width: 767px) {
	.haminart-pcard {
		padding: 28px 12px 50px;
	}

	.haminart-pcard__image img {
		height: 110px;
	}

	.haminart-pcard__title {
		font-size: 12px;
		line-height: 25px;
	}

	.haminart-pcard__cat {
		font-size: 10px;
	}

	.haminart-pcard__price .price,
	.haminart-pcard__price {
		column-gap: 10px;
	}

	.haminart-pcard__price ins,
	.haminart-pcard__price > .woocommerce-Price-amount,
	.haminart-pcard__price .price > .woocommerce-Price-amount {
		font-size: 14px;
	}

	.haminart-pcard__price .woocommerce-Price-currencySymbol {
		font-size: 10px;
	}
}

/* No hover animation: the hover state switches instantly. */
.haminart-pcard,
.haminart-pcard * {
	transition: none !important;
	animation: none !important;
}

/* Mobile (home-responsive.svg): ~179px cards, next card peeks past the content edge, compact image. */
@media (max-width: 767px) {
	.haminart-carousel.haminart-carousel--products,
	.haminart-carousel--products .swiper {
		overflow: visible !important;
		overflow-x: visible !important;
	}

	.haminart-pcard {
		padding: 30px 12px 50px;
	}

	.haminart-pcard__image img {
		height: 84px;
	}

	.haminart-pcard__image {
		margin-bottom: 18px;
	}
}

/* One continuous strike line across the old price (digits + تومان), no per-part lines. */
.haminart-pcard__price del{position:relative;text-decoration:none}
.haminart-pcard__price del *,.haminart-pcard__price del .haminart-num{text-decoration:none!important}
.haminart-pcard__price del::after{content:"";position:absolute;left:0;right:0;top:52%;height:1px;background:currentColor}

/* «قیمت» label when the product is not on sale */
.haminart-pcard__plabel{font-size:11px;font-weight:600;color:#7f7f7f}
.haminart-pcard__price:has(.haminart-pcard__plabel){column-gap:6px}
