/* =========================================================
   HNZ Product Showcase — استایل ویجت نمایش محصولات
   رنگ‌های سازمانی: قرمز #ED2728 | خاکستری تیره #404040
   ========================================================= */

.hnz-ps-wrapper {
	--hnz-primary: #ED2728;
	--hnz-dark: #404040;
	--hnz-light-bg: #F7F7F8;
	--hnz-white: #FFFFFF;
	--hnz-hover-lift: -8px;
	direction: rtl;
	font-family: inherit;
	box-sizing: border-box;
}

.hnz-ps-wrapper *,
.hnz-ps-wrapper *::before,
.hnz-ps-wrapper *::after {
	box-sizing: border-box;
}

/* ---------- گرید ---------- */

.hnz-ps-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	width: 100%;
}

.hnz-ps-has-promo {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

@media (min-width: 1025px) {
	.hnz-ps-has-promo {
		grid-template-columns: 3fr 1fr;
		align-items: stretch;
	}
	.hnz-ps-has-promo .hnz-ps-grid {
		order: 1;
	}
	.hnz-ps-has-promo .hnz-ps-promo-box {
		order: 2;
	}
}

/* ---------- کارت محصول ---------- */

.hnz-ps-card {
	position: relative;
	background: var(--hnz-white);
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 10px rgba(64, 64, 64, 0.06);
	transition: transform 0.35s cubic-bezier(.22,1,.36,1), box-shadow 0.35s ease;
	will-change: transform;
	border: 1px solid rgba(64,64,64,0.06);
}

.hnz-ps-card:hover {
	transform: translateY(var(--hnz-hover-lift, -8px));
	box-shadow: 0 20px 40px rgba(64, 64, 64, 0.14);
}

/* ---------- تصویر ---------- */

.hnz-ps-card-image {
	position: relative;
	width: 100%;
	height: 240px;
	overflow: hidden;
	background: var(--hnz-light-bg);
}

.hnz-ps-image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.hnz-ps-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(.22,1,.36,1);
}

.hnz-ps-card:hover .hnz-ps-card-image img {
	transform: scale(1.08);
}

.hnz-ps-image-overlay {
	position: absolute;
	inset: 0;
	background: rgba(64,64,64,0.15);
	opacity: 0;
	transition: opacity 0.35s ease;
	pointer-events: none;
}

.hnz-ps-card:hover .hnz-ps-image-overlay {
	opacity: 1;
}

/* ---------- بج‌ها ---------- */

.hnz-ps-badges {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.hnz-ps-badge {
	display: inline-block;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	border-radius: 30px;
	color: #FFFFFF;
	box-shadow: 0 4px 10px rgba(0,0,0,0.15);
	letter-spacing: 0.2px;
}

.hnz-ps-badge-sale {
	background: var(--hnz-primary);
}

.hnz-ps-badge-new {
	background: var(--hnz-dark);
}

/* ---------- ناموجود ---------- */

.hnz-ps-out-of-stock {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.75);
	color: var(--hnz-dark);
	font-weight: 700;
	font-size: 15px;
	z-index: 4;
	backdrop-filter: blur(1px);
}

/* ---------- آیکون‌های شناور ---------- */

.hnz-ps-floating-icons {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 8px;
	opacity: 0;
	transform: translateX(-10px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.hnz-ps-card:hover .hnz-ps-floating-icons {
	opacity: 1;
	transform: translateX(0);
}

.hnz-ps-icon-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: none;
	background: #FFFFFF;
	color: var(--hnz-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
	padding: 0;
}

.hnz-ps-icon-btn:hover {
	background: var(--hnz-primary);
	color: #FFFFFF;
	transform: scale(1.08);
}

.hnz-ps-icon-btn.is-active {
	color: var(--hnz-primary);
}

.hnz-ps-icon-btn.is-active svg {
	fill: currentColor;
}

.hnz-ps-wishlist-btn.is-active svg {
	animation: hnzPsPulse 0.4s ease;
}

@keyframes hnzPsPulse {
	0% { transform: scale(1); }
	40% { transform: scale(1.35); }
	100% { transform: scale(1); }
}

/* ---------- بدنه کارت ---------- */

.hnz-ps-card-body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.hnz-ps-card-category {
	font-size: 12px;
	color: var(--hnz-primary);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.hnz-ps-card-category a {
	color: inherit;
	text-decoration: none;
}

.hnz-ps-card-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--hnz-dark);
}

.hnz-ps-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.25s ease;
}

.hnz-ps-card-title a:hover {
	color: var(--hnz-primary);
}

.hnz-ps-card-rating {
	display: flex;
	gap: 2px;
	font-size: 14px;
	color: #D8D8D8;
}

.hnz-ps-star.is-filled {
	color: #FFB800;
}

.hnz-ps-card-desc {
	font-size: 13px;
	color: #7A7A7A;
	line-height: 1.6;
}

.hnz-ps-card-price {
	font-size: 17px;
	font-weight: 800;
	color: var(--hnz-primary);
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-top: 2px;
}

.hnz-ps-card-price del {
	font-size: 13px;
	font-weight: 500;
	color: #A6A6A6;
	opacity: 0.85;
	margin-inline-start: 4px;
}

.hnz-ps-card-price ins {
	text-decoration: none;
}

/* ---------- بخش اقدامات (تعداد + دکمه) ---------- */

.hnz-ps-card-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

.hnz-ps-quantity {
	display: flex;
	align-items: center;
	border: 1.5px solid #ECECEC;
	border-radius: 10px;
	overflow: hidden;
	background: var(--hnz-light-bg);
	flex-shrink: 0;
}

.hnz-ps-qty-btn {
	width: 32px;
	height: 38px;
	border: none;
	background: transparent;
	color: var(--hnz-dark);
	font-size: 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease;
	font-weight: 700;
}

.hnz-ps-qty-btn:hover {
	background: var(--hnz-primary);
	color: #FFFFFF;
}

.hnz-ps-qty-input {
	width: 34px;
	height: 38px;
	border: none;
	background: transparent;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--hnz-dark);
	-moz-appearance: textfield;
}

.hnz-ps-qty-input:focus {
	outline: none;
}

.hnz-ps-add-cart {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 38px;
	background: var(--hnz-primary);
	color: #FFFFFF;
	border: none;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
	position: relative;
	overflow: hidden;
	white-space: nowrap;
	padding: 0 10px;
}

.hnz-ps-add-cart:hover {
	background: var(--hnz-dark);
	box-shadow: 0 8px 18px rgba(237, 39, 40, 0.25);
	transform: translateY(-2px);
}

.hnz-ps-add-cart:active {
	transform: translateY(0);
}

.hnz-ps-add-cart.is-loading .hnz-ps-btn-text {
	opacity: 0.4;
}

.hnz-ps-btn-loader {
	display: none;
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.4);
	border-top-color: #FFFFFF;
	border-radius: 50%;
	animation: hnzPsSpin 0.6s linear infinite;
}

.hnz-ps-add-cart.is-loading .hnz-ps-btn-loader {
	display: inline-block;
}

@keyframes hnzPsSpin {
	to { transform: rotate(360deg); }
}

.hnz-ps-add-cart.is-success {
	background: #2E9E4A !important;
}

/* ---------- باکس تبلیغاتی ---------- */

.hnz-ps-promo-box {
	position: relative;
	background: linear-gradient(135deg, #ED2728 0%, #404040 100%);
	border-radius: 18px;
	color: #FFFFFF;
	padding: 32px 26px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 12px;
	overflow: hidden;
	min-height: 260px;
}

.hnz-ps-promo-decor {
	position: absolute;
	width: 220px;
	height: 220px;
	background: rgba(255,255,255,0.08);
	border-radius: 50%;
	top: -80px;
	left: -80px;
	pointer-events: none;
}

.hnz-ps-promo-decor::after {
	content: '';
	position: absolute;
	width: 140px;
	height: 140px;
	background: rgba(255,255,255,0.08);
	border-radius: 50%;
	bottom: -220px;
	right: -40px;
}

.hnz-ps-promo-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	margin-bottom: 6px;
	position: relative;
	z-index: 1;
}

.hnz-ps-promo-title {
	font-size: 22px;
	font-weight: 800;
	margin: 0;
	line-height: 1.5;
	position: relative;
	z-index: 1;
}

.hnz-ps-promo-subtitle {
	font-size: 14px;
	margin: 0;
	opacity: 0.9;
	line-height: 1.8;
	position: relative;
	z-index: 1;
}

.hnz-ps-promo-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	background: #FFFFFF;
	color: var(--hnz-primary);
	font-weight: 700;
	font-size: 13.5px;
	padding: 10px 22px;
	border-radius: 10px;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	position: relative;
	z-index: 1;
}

.hnz-ps-promo-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(0,0,0,0.2);
	color: var(--hnz-dark);
}

.hnz-ps-arrow {
	font-style: normal;
	display: inline-block;
	transform: scaleX(-1);
}

/* ---------- مودال مشاهده سریع ---------- */

.hnz-ps-quickview-overlay {
	position: fixed;
	inset: 0;
	background: rgba(64,64,64,0.6);
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 20px;
	backdrop-filter: blur(2px);
}

.hnz-ps-quickview-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.hnz-ps-quickview-modal {
	background: #FFFFFF;
	border-radius: 18px;
	max-width: 720px;
	width: 100%;
	max-height: 85vh;
	overflow-y: auto;
	position: relative;
	transform: scale(0.92) translateY(20px);
	transition: transform 0.35s cubic-bezier(.22,1,.36,1);
	direction: rtl;
	box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

.hnz-ps-quickview-overlay.is-open .hnz-ps-quickview-modal {
	transform: scale(1) translateY(0);
}

.hnz-ps-quickview-close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: #F2F2F2;
	color: var(--hnz-dark);
	font-size: 18px;
	cursor: pointer;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.hnz-ps-quickview-close:hover {
	background: var(--hnz-primary);
	color: #FFFFFF;
}

.hnz-ps-quickview-inner {
	display: flex;
	flex-wrap: wrap;
}

.hnz-ps-quickview-image {
	flex: 1 1 280px;
	background: var(--hnz-light-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hnz-ps-quickview-image img {
	max-width: 100%;
	border-radius: 12px;
}

.hnz-ps-quickview-content {
	flex: 1 1 280px;
	padding: 30px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.hnz-ps-quickview-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--hnz-dark);
}

.hnz-ps-quickview-price {
	font-size: 18px;
	font-weight: 800;
	color: var(--hnz-primary);
}

.hnz-ps-quickview-desc {
	font-size: 14px;
	line-height: 1.9;
	color: #6E6E6E;
}

.hnz-ps-quickview-link {
	margin-top: auto;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	background: var(--hnz-primary);
	color: #FFFFFF;
	text-decoration: none;
	padding: 12px 20px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 14px;
	transition: background-color 0.25s ease;
}

.hnz-ps-quickview-link:hover {
	background: var(--hnz-dark);
	color: #FFFFFF;
}

.hnz-ps-quickview-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 60px;
	width: 100%;
}

.hnz-ps-spinner {
	width: 36px;
	height: 36px;
	border: 4px solid #F0F0F0;
	border-top-color: var(--hnz-primary);
	border-radius: 50%;
	animation: hnzPsSpin 0.7s linear infinite;
}

/* ---------- Toast اطلاع‌رسانی ---------- */

.hnz-ps-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: var(--hnz-dark);
	color: #FFFFFF;
	padding: 12px 24px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
	box-shadow: 0 10px 30px rgba(0,0,0,0.25);
	direction: rtl;
}

.hnz-ps-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.hnz-ps-toast.is-success {
	background: #2E9E4A;
}

.hnz-ps-toast.is-error {
	background: var(--hnz-primary);
}

/* ---------- استایل‌های جایگزین کارت ---------- */

.hnz-ps-wrapper[data-card-style="minimal"] .hnz-ps-card {
	box-shadow: none;
	border: 1.5px solid #ECECEC;
}

.hnz-ps-wrapper[data-card-style="minimal"] .hnz-ps-card:hover {
	border-color: var(--hnz-primary);
	box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.hnz-ps-wrapper[data-card-style="bold"] .hnz-ps-card-image {
	background: linear-gradient(180deg, #FFF4F4 0%, #FFFFFF 100%);
}

.hnz-ps-wrapper[data-card-style="bold"] .hnz-ps-card-body {
	background: var(--hnz-light-bg);
}

/* ---------- ریسپانسیو ---------- */

@media (max-width: 1024px) {
	.hnz-ps-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.hnz-ps-grid {
		grid-template-columns: repeat(1, 1fr);
	}
	.hnz-ps-card-image {
		height: 220px;
	}
	.hnz-ps-quickview-inner {
		flex-direction: column;
	}
}
