/* ==========================================================================
   Popup Offer Pro — نوتیفیکیشن فروش (اعلان اجتماعی خرید)
   ========================================================================== */

.pop-sn-wrapper,
.pop-sn-wrapper * {
	box-sizing: border-box;
}

.pop-sn-wrapper {
	position: fixed;
	z-index: 999998; /* یک واحد کمتر از پاپ‌آپ اصلی (999999) تا در صورت فعال بودن هم‌زمان هر دو تداخل نکند */
	max-width: 340px;
	width: calc(100vw - 40px);
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition: opacity .35s ease, transform .4s cubic-bezier(.16, 1, .3, 1);
	-webkit-font-smoothing: antialiased;
}
.pop-sn-wrapper.pop-sn-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* موقعیت‌گیری دسکتاپ/تبلت با left/right فیزیکی (نه با flex/inset منطقی) تا
   صرف‌نظر از جهت متن سایت (RTL/LTR)، همیشه در همان گوشه انتخاب‌شده بماند.
   موقعیت موبایل کاملاً جدا و مستقل است (پایین‌تر، در رسانه max-width:600px). */
@media (min-width: 601px) {
	.pop-sn-wrapper.pop-sn-pos-bottom-left  { left: 20px;  bottom: 20px; }
	.pop-sn-wrapper.pop-sn-pos-bottom-right { right: 20px; bottom: 20px; }
	.pop-sn-wrapper.pop-sn-pos-top-left     { left: 20px;  top: 20px; }
	.pop-sn-wrapper.pop-sn-pos-top-right    { right: 20px; top: 20px; }
}

.pop-sn-toast {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .08);
	padding: 12px 14px;
	overflow: hidden; /* تا نوار پیشرفت داخل گوشه‌های گرد بماند */
}
.pop-sn-rtl .pop-sn-toast { direction: rtl; }
.pop-sn-ltr .pop-sn-toast { direction: ltr; }

/* نوار پیشرفت: از عرض کامل به صفر جمع می‌شود و زمان باقی‌مانده تا محو شدن
   نوتیفیکیشن را به‌صورت بصری و جذاب نشان می‌دهد. مدت انیمیشن هم‌زمان با
   «مدت نمایش» تنظیم‌شده در ادمین، توسط جاوااسکریپت مقداردهی می‌شود. */
.pop-sn-progress {
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	height: 3px;
	background: rgba(0, 0, 0, .07);
}
.pop-sn-progress-bar {
	height: 100%;
	width: 100%;
	background: #22c55e;
	transform: scaleX(1);
}
.pop-sn-rtl .pop-sn-progress-bar { transform-origin: right; }
.pop-sn-ltr .pop-sn-progress-bar { transform-origin: left; }

.pop-sn-link {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	text-decoration: none;
	color: inherit;
}

.pop-sn-image {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f2f2f3;
	display: block;
}

.pop-sn-body {
	min-width: 0;
	flex: 1;
}
.pop-sn-title-row {
	display: flex;
	align-items: center;
	gap: 5px;
}
.pop-sn-title {
	font-size: .87rem;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.4;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
.pop-sn-sub {
	display: block;
	margin-top: 3px;
	font-size: .74rem;
	color: #8a8f98;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pop-sn-sub:empty { display: none; }

.pop-sn-dot {
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	animation: pop-sn-pulse-dot 1.8s ease-out infinite;
}
@keyframes pop-sn-pulse-dot {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
	70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pop-sn-close {
	flex-shrink: 0;
	align-self: flex-start;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	/* !important روی پس‌زمینه و رنگ چون قالب‌هایی مثل وودمارت معمولاً استایل
	   سراسری خودشان را روی <button> اعمال می‌کنند؛ همان الگوی دکمه بستن پاپ‌آپ
	   اصلی، برای هماهنگی و اطمینان کامل از نمایش صحیح در هر قالبی. */
	background: transparent !important;
	border: none !important;
	border-radius: 50%;
	color: #9aa0a6 !important;
	cursor: pointer;
	padding: 0;
	transition: background .2s ease, color .2s ease;
}
.pop-sn-close-icon {
	display: block;
	font-size: 18px;
	line-height: 1;
	font-weight: 300;
}
.pop-sn-close:hover { background: #f2f2f3 !important; color: #50575e !important; }
.pop-sn-close:focus-visible { outline: 2px solid #2271b1; outline-offset: 1px; }

@media (max-width: 600px) {
	.pop-sn-wrapper {
		width: auto;
		max-width: calc(100vw - 24px);
	}
	.pop-sn-wrapper.pop-sn-mpos-bottom-left  { left: 12px;  bottom: 12px; right: auto; top: auto; }
	.pop-sn-wrapper.pop-sn-mpos-bottom-right { right: 12px; bottom: 12px; left: auto;  top: auto; }
	.pop-sn-wrapper.pop-sn-mpos-top-left     { left: 12px;  top: 12px;   right: auto;  bottom: auto; }
	.pop-sn-wrapper.pop-sn-mpos-top-right    { right: 12px; top: 12px;   left: auto;   bottom: auto; }
	.pop-sn-toast { padding: 11px 12px; }
	.pop-sn-image { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
	.pop-sn-wrapper { transition: opacity .2s linear; transform: none !important; }
	.pop-sn-dot { animation: none; }
	.pop-sn-progress-bar { transition: none !important; }
}
