/* =========================================================
   Parimah Special Offers
   ========================================================= */

.pso-special-offers {
	--pso-green: #1f3d35;
	--pso-dark: #122621;
	--pso-gold: #c89f57;
	--pso-gap: 16px;

	position: relative;
	width: calc(100% - 24px);
	max-width: 1380px;
	margin: 24px auto;
	padding: 26px;
	overflow: hidden;
	direction: rtl;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 26px;
	background:
		radial-gradient(
			circle at 8% 10%,
			rgba(255, 255, 255, 0.08),
			transparent 30%
		),
		linear-gradient(
			135deg,
			var(--pso-green) 0%,
			var(--pso-dark) 100%
		);
	box-shadow:
		0 25px 65px rgba(10, 32, 26, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	isolation: isolate;
}

.pso-special-offers::before {
	content: "";
	position: absolute;
	top: -120px;
	left: -100px;
	z-index: -1;
	width: 320px;
	height: 320px;
	pointer-events: none;
	border-radius: 50%;
	background: rgba(200, 159, 87, 0.07);
}

.pso-special-offers,
.pso-special-offers * {
	box-sizing: border-box;
}

.pso-shell {
	width: 100%;
}

/* =========================================================
   Header
   ========================================================= */

.pso-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 22px;
	margin-bottom: 22px;
	padding-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.pso-heading {
	min-width: 0;
}

.pso-subtitle {
	display: block;
	margin-bottom: 4px;
	color: var(--pso-gold);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 2.6px;
	direction: ltr;
	text-align: right;
	text-transform: uppercase;
}

.pso-title {
	margin: 0;
	color: #ffffff;
	font-size: clamp(21px, 2vw, 29px);
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -0.5px;
}

/* =========================================================
   Countdown
   ========================================================= */

.pso-countdown {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 58px;
	padding: 8px 18px;
	direction: ltr;
	unicode-bidi: isolate;
	border: 1px solid rgba(200, 159, 87, 0.4);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.07);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.08),
		0 7px 22px rgba(0, 0, 0, 0.08);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.pso-time-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	direction: rtl;
}

.pso-time-unit strong {
	display: block;
	color: #ffffff;
	font-size: 17px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.pso-time-unit span {
	display: block;
	margin-top: 3px;
	color: rgba(255, 255, 255, 0.68);
	font-size: 9px;
	font-weight: 500;
	line-height: 1;
}

.pso-time-separator {
	margin-top: -14px;
	color: var(--pso-gold);
	font-size: 18px;
	font-weight: 700;
}

/* =========================================================
   View all
   ========================================================= */

.pso-view-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 9px 18px;
	white-space: nowrap;
	color: #ffffff !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
	border: 1px solid rgba(255, 255, 255, 0.24);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	transition:
		color 0.25s ease,
		background-color 0.25s ease,
		border-color 0.25s ease,
		transform 0.25s ease;
}

.pso-view-all svg {
	flex: 0 0 auto;
	transition: transform 0.25s ease;
}

.pso-view-all:hover {
	color: var(--pso-dark) !important;
	border-color: var(--pso-gold);
	background: var(--pso-gold);
	transform: translateY(-2px);
}

.pso-view-all:hover svg {
	transform: translateX(-3px);
}

/* =========================================================
   Carousel
   ========================================================= */

.pso-carousel {
	position: relative;
	min-width: 0;
}

.pso-track {
	display: flex;
	align-items: stretch;
	gap: var(--pso-gap);
	width: 100%;
	max-width: 100%;
	padding: 2px 2px 10px;
	overflow-x: auto;
	overflow-y: hidden;
	direction: rtl;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-inline: contain;
	touch-action: pan-x pan-y;
	cursor: grab;
	outline: none;
}

.pso-track::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

.pso-track.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
	user-select: none;
}

.pso-track.is-dragging * {
	user-select: none;
	pointer-events: none;
}

.pso-track:focus-visible {
	outline: 2px solid var(--pso-gold);
	outline-offset: 5px;
	border-radius: 12px;
}

/* موبایل: 1.5 محصول */
.pso-product {
	position: relative;
	display: flex;
	flex: 0 0 calc(66.6667% - 4px);
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	direction: rtl;
	color: #1d2824;
	border: 1px solid rgba(19, 46, 38, 0.08);
	border-radius: 18px;
	background: #ffffff;
	box-shadow:
		0 10px 30px rgba(0, 0, 0, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.65);
	scroll-snap-align: start;
	scroll-snap-stop: normal;
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

/* =========================================================
   Product image
   تصویر کامل بدون زوم و برش
   ========================================================= */

.pso-product-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	background:
		linear-gradient(
			145deg,
			#f7f5f1 0%,
			#ebe8e1 100%
		);
	border-bottom: 1px solid rgba(31, 61, 53, 0.07);
}

.pso-image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none !important;
}

.pso-image-link img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0;
	object-fit: contain !important;
	object-position: center center !important;
	transform: none !important;
	transition: none !important;
	user-select: none;
	-webkit-user-drag: none;
}

/*
 * جلوگیری از زوم تصویر توسط استایل‌های وودمارت.
 */
.pso-product:hover .pso-image-link img,
.pso-image-link:hover img,
.pso-product-media:hover img {
	transform: none !important;
	scale: 1 !important;
}

/* =========================================================
   Badges
   ========================================================= */

.pso-badges {
	position: absolute;
	top: 11px;
	right: 11px;
	left: 11px;
	z-index: 3;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	pointer-events: none;
}

.pso-special-badge,
.pso-discount-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 27px;
	padding: 5px 10px;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	box-shadow: 0 5px 14px rgba(0, 0, 0, 0.15);
	backdrop-filter: blur(7px);
	-webkit-backdrop-filter: blur(7px);
}

.pso-special-badge {
	margin-left: auto;
	background: rgba(53, 40, 29, 0.88);
}

.pso-discount-badge {
	margin-right: auto;
	background: var(--pso-gold);
}

/* =========================================================
   Product content
   ========================================================= */

.pso-product-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 15px;
}

.pso-category {
	display: block;
	margin-bottom: 5px;
	overflow: hidden;
	color: #9b8060;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pso-product-title {
	display: -webkit-box;
	min-height: 44px;
	margin: 0 0 9px;
	overflow: hidden;
	color: #202925;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.55;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.pso-product-title a {
	color: inherit !important;
	text-decoration: none !important;
}

.pso-price {
	display: flex;
	align-items: flex-end;
	min-height: 31px;
	margin-top: auto;
	color: var(--pso-green);
	font-size: 14px;
	font-weight: 800;
}

.pso-price:empty {
	display: none;
}

.pso-price .price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px 8px;
	margin: 0;
	color: var(--pso-green);
	font-size: inherit;
	font-weight: inherit;
	line-height: 1.5;
}

.pso-price ins {
	color: var(--pso-green);
	font-weight: 800;
	text-decoration: none;
}

.pso-price del {
	color: #aaa9a6;
	font-size: 11px;
	font-weight: 500;
	opacity: 1;
}

/* =========================================================
   Always-visible product button
   ========================================================= */

.pso-product-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 43px;
	margin-top: 13px;
	padding: 9px 14px;
	color: #ffffff !important;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none !important;
	border: 1px solid rgba(200, 159, 87, 0.38);
	border-radius: 12px;
	background:
		linear-gradient(
			135deg,
			var(--pso-green) 0%,
			var(--pso-dark) 100%
		);
	box-shadow:
		0 7px 18px rgba(18, 38, 33, 0.16),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	transition:
		transform 0.25s ease,
		background-color 0.25s ease,
		border-color 0.25s ease,
		box-shadow 0.25s ease;
}

.pso-product-button svg {
	flex: 0 0 auto;
	transition: transform 0.25s ease;
}

.pso-product-button:hover {
	color: var(--pso-dark) !important;
	border-color: var(--pso-gold);
	background: var(--pso-gold);
	box-shadow: 0 9px 22px rgba(18, 38, 33, 0.2);
	transform: translateY(-2px);
}

.pso-product-button:hover svg {
	transform: translateX(-3px);
}

/* =========================================================
   Progress
   ========================================================= */

.pso-carousel-footer {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 12px;
}

.pso-progress {
	position: relative;
	flex: 1 1 auto;
	height: 20px;
	padding: 8px 0;
	pointer-events: none;
}

.pso-progress::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	left: 0;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	transform: translateY(-50%);
}

.pso-progress-thumb {
	position: absolute;
	top: 50%;
	right: 0;
	width: 25%;
	height: 4px;
	border-radius: 999px;
	background: var(--pso-gold);
	box-shadow: 0 0 12px rgba(200, 159, 87, 0.25);
	transform: translate(0, -50%);
	transition:
		width 0.2s ease,
		transform 0.1s linear;
}

.pso-drag-hint {
	flex: 0 0 auto;
	color: rgba(255, 255, 255, 0.65);
	font-size: 10px;
	font-weight: 500;
	white-space: nowrap;
}

.pso-no-overflow .pso-carousel-footer {
	display: none;
}

/* =========================================================
   Desktop hover
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
	.pso-product:hover {
		transform: translateY(-5px);
		box-shadow:
			0 17px 40px rgba(0, 0, 0, 0.15),
			inset 0 1px 0 rgba(255, 255, 255, 0.7);
	}
}

/* =========================================================
   Tablet: 2.5 products
   ========================================================= */

@media (min-width: 768px) and (max-width: 1023px) {
	.pso-special-offers {
		--pso-gap: 14px;

		padding: 24px 20px;
	}

	.pso-header {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"heading button"
			"timer timer";
	}

	.pso-heading {
		grid-area: heading;
	}

	.pso-countdown {
		grid-area: timer;
		justify-self: start;
	}

	.pso-view-all {
		grid-area: button;
		justify-self: end;
	}

	.pso-product {
		flex-basis: calc(40% - 8.4px);
	}
}

/* =========================================================
   Desktop: 3.5 products
   ========================================================= */

@media (min-width: 1024px) {
	.pso-product {
		flex-basis: calc(28.5714% - 11.43px);
	}
}

/* =========================================================
   Mobile: 1.5 products
   ========================================================= */

@media (max-width: 767px) {
	.pso-special-offers {
		--pso-gap: 10px;

		width: calc(100% - 16px);
		margin: 14px auto;
		padding: 18px 12px 16px;
		border-radius: 19px;
	}

	.pso-header {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"heading heading"
			"timer button";
		gap: 14px 10px;
		margin-bottom: 17px;
		padding-bottom: 15px;
	}

	.pso-heading {
		grid-area: heading;
	}

	.pso-countdown {
		grid-area: timer;
		justify-self: start;
		min-height: 50px;
		gap: 5px;
		padding: 6px 10px;
		border-radius: 14px;
	}

	.pso-view-all {
		grid-area: button;
		justify-self: end;
		min-height: 39px;
		padding: 7px 12px;
		font-size: 11px;
	}

	.pso-view-all svg {
		width: 15px;
		height: 15px;
	}

	.pso-subtitle {
		margin-bottom: 3px;
		font-size: 9px;
		letter-spacing: 1.8px;
	}

	.pso-title {
		font-size: 20px;
	}

	.pso-time-unit {
		min-width: 34px;
	}

	.pso-time-unit strong {
		font-size: 14px;
	}

	.pso-time-unit span {
		font-size: 8px;
	}

	.pso-time-separator {
		margin-top: -12px;
		font-size: 14px;
	}

	.pso-product {
		border-radius: 15px;
	}

	.pso-product-content {
		padding: 11px;
	}

	.pso-product-title {
		min-height: 39px;
		margin-bottom: 7px;
		font-size: 12px;
		line-height: 1.6;
	}

	.pso-category {
		margin-bottom: 3px;
		font-size: 9px;
	}

	.pso-price {
		min-height: 27px;
		font-size: 12px;
	}

	.pso-price del {
		font-size: 9px;
	}

	.pso-badges {
		top: 8px;
		right: 8px;
		left: 8px;
	}

	.pso-special-badge,
	.pso-discount-badge {
		min-height: 23px;
		padding: 4px 7px;
		font-size: 8px;
	}

	.pso-product-button {
		min-height: 38px;
		margin-top: 10px;
		padding: 7px 8px;
		font-size: 10px;
		border-radius: 9px;
	}

	.pso-product-button svg {
		width: 14px;
		height: 14px;
	}

	.pso-carousel-footer {
		gap: 10px;
		margin-top: 8px;
	}

	.pso-drag-hint {
		font-size: 8px;
	}
}

@media (max-width: 420px) {
	.pso-header {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"heading"
			"timer"
			"button";
	}

	.pso-countdown {
		justify-self: stretch;
	}

	.pso-view-all {
		justify-self: start;
	}
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
	.pso-track {
		scroll-behavior: auto;
	}

	.pso-product,
	.pso-view-all,
	.pso-view-all svg,
	.pso-product-button,
	.pso-product-button svg,
	.pso-progress-thumb {
		transition: none !important;
	}
}