/**
 * پاپ‌آپ‌های فروشگاه — استایل سمت سایت.
 *
 * بدنه روی همان .pt-popup / .pt-promo-popup پوسته سوار می‌شود؛ این فایل فقط
 * ظاهرِ کارتِ پاپ‌آپ (تصویر ماسک‌شده، دکمه‌ها، کد تخفیف) را تعریف می‌کند.
 */

/* عرض کارت؛ mfp-content از این متغیر استفاده می‌کند. */
.mfp-wrap:has(.plt-popup) {
	--pt-popup-width: 460px;
	--pt-close-btn-offset-v: 42px;
	--pt-close-btn-offset-h: 6px;
}

.mfp-wrap:has(.plt-popup) .pt-popup-close {
	--pt-action-color: #fff;
	--pt-action-color-hover: rgba(255, 255, 255, 0.65);
}

/* کارت هم‌زمان با تینتِ پس‌زمینه محو شود تا بستن یک‌پارچه دیده شود. */
.mfp-wrap:has(.plt-popup) .mfp-content {
	transition: opacity 0.45s cubic-bezier(0.19, 1, 0.22, 1), transform 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}

.mfp-wrap.mfp-removing:has(.plt-popup) .mfp-content {
	opacity: 0;
	transform: scale(0.96);
}

/* کارتِ پاپ‌آپ بدون پدینگ: تصویر داخل باکس ردیوس‌دار ماسک می‌شود. */
.pt-popup.plt-popup {
	width: 100%;
	max-width: 460px;
	margin: 0 auto;
	padding: 0;
	overflow: hidden;
	border-radius: 26px;
	background-color: var(--bgcolor-white, #fff);
}

/* وقتی دکمه دارد، پدینگ کلی روی پاپ‌آپ می‌نشیند. */
.pt-popup.plt-popup--has-actions {
	padding: 12px;
}

.plt-popup .pt-popup-inner {
	margin: 0;
	padding: 0;
}

.plt-popup-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100dvh - 170px);
	object-fit: contain;
	object-position: center;
	background-color: var(--bgcolor-white, #fff);
}

.plt-popup--has-actions .plt-popup-image {
	border-radius: 16px;
	max-height: calc(100dvh - 220px);
}

.plt-popup-actions {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-top: 12px;
}

.plt-popup-actions > * {
	flex: 1 1 calc(50% - 5px);
	min-width: 0;
}

.plt-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 46px;
	padding: 0 18px;
	border: 1px solid #e6dfdf;
	border-radius: 14px;
	background-color: #f1f1f1;
	color: #242424;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.plt-popup-btn:hover {
	background-color: #e8e8e8;
	color: #242424;
}

.plt-popup-btn--secondary {
	background-color: #fff;
	color: #242424;
	border-color: #e0dddd;
}

.plt-popup-btn--secondary:hover {
	background-color: #f6f6f6;
	color: #242424;
}

/* تم تیره: زمینهٔ مشکی با متن و آیکون سفید. */
.plt-popup-actions--dark .plt-popup-btn,
.plt-popup-actions--dark .plt-popup-btn--secondary {
	background-color: #111;
	color: #fff;
	border-color: #111;
}

.plt-popup-actions--dark .plt-popup-btn:hover,
.plt-popup-actions--dark .plt-popup-btn--secondary:hover {
	background-color: #000;
	color: #fff;
	border-color: #000;
}

/* کد تخفیف با دکمهٔ کپی (pui-code.js مشترک). */
.plt-popup-code-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.plt-popup .pui-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 46px;
	padding: 0 16px;
	cursor: pointer;
	border: 1px dashed #d1d5db;
	border-radius: 14px;
	background-color: #f7f7f7;
	color: #242424;
	font-family: Consolas, Monaco, monospace;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 1px;
	direction: ltr;
	text-align: center;
}

.plt-popup .pui-code-copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	margin: 0 8px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: transparent;
	color: #72727b;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.plt-popup .pui-code-copy:hover {
	background-color: #e6dfdf;
	color: #282834;
}

.plt-popup .pui-code.is-copied .pui-code-copy {
	color: #22c55e;
}

/* کد تخفیف در تم تیره. */
.plt-popup-actions--dark .pui-code {
	background-color: #111;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.35);
}

.plt-popup-actions--dark .pui-code-copy {
	color: #fff;
}

.plt-popup-actions--dark .pui-code-copy:hover {
	background-color: rgba(255, 255, 255, 0.15);
	color: #fff;
}

/* پیام کوتاه کپی کد تخفیف. */
.plt-copy-toast {
	position: fixed;
	z-index: 100000;
	inset-inline: 0;
	bottom: 28px;
	width: max-content;
	max-width: calc(100vw - 40px);
	margin-inline: auto;
	padding: 10px 18px;
	border-radius: 999px;
	background-color: #111;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.plt-copy-toast.is-visible {
	opacity: 1;
	transform: none;
}

@media (max-width: 768px) {
	.mfp-wrap:has(.plt-popup) {
		--pt-close-btn-offset-v: 38px;
	}

	.pt-popup.plt-popup {
		border-radius: 22px;
	}
}
