/* ===== لانچر چسبان — بدون نوار پس‌زمینه، چیدمان دلخواه ===== */

:root {
	--wse-primary: #4F46E5;
	--wse-light: #8B7CF6;
	--wse-dark: #1E1B4B;
	--wse-gap: 12px;
	--wse-avatar-size: 96px;
}

.wse-launcher {
	position: fixed;
	z-index: 99997;
	display: flex;
	align-items: center;
	gap: var(--wse-gap);
	direction: rtl;
	max-width: calc(100vw - 16px);
}

.wse-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--wse-primary), var(--wse-dark));
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 6px 20px rgba(0,0,0,0.25);
	transition: transform .15s ease, filter .15s ease;
	white-space: nowrap;
	flex-shrink: 0;
}
.wse-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.wse-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wse-icon svg { display: block; }

/* ===== آواتار: دایره (عکس/ویدیو) سمت راست + حباب کپشن هم‌پوشان سمت چپ ===== */
.wse-avatar-trigger {
	position: relative;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	display: flex;
	flex-direction: row; /* در RTL: فرزند اول (آواتار) راست، فرزند دوم (کپشن) چپ */
	align-items: center;
	flex-shrink: 0;
	max-width: 100%;
	gap: 0;
}
.wse-avatar-media-wrap {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
	display: block;
	line-height: 0;
}
.wse-avatar-media {
	width: var(--wse-avatar-size);
	height: var(--wse-avatar-size);
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #fff;
	box-shadow: 0 8px 24px rgba(0,0,0,0.3);
	display: block;
}
.wse-play-badge {
	position: absolute;
	bottom: 2px;
	left: -2px;
	background: var(--wse-primary);
	color: #fff;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	border: 2px solid #fff;
	z-index: 3;
}
.wse-avatar-caption {
	position: relative;
	z-index: 1;
	background: rgba(20,20,30,0.92);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	max-width: clamp(90px, 28vw, 160px);
	white-space: nowrap;          /* تک‌خط؛ هیچ‌وقت زیر آواتار/ویدیو نمی‌رود */
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: right;
	padding: 10px 14px;
	border-radius: 16px;
	margin-left: 8px; /* فاصله ثابت و کافی از آواتار به‌جای هم‌پوشانی متغیر */
	box-shadow: 0 6px 18px rgba(0,0,0,0.25);
	flex-shrink: 1;
	min-width: 0;
}

/* ===== پاپ‌آپ ویدیویی سوالات متداول (اختیاری) ===== */

.wse-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.65);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 999998;
	direction: rtl;
}
.wse-popup-overlay.wse-open { display: flex; }

.wse-popup-frame {
	position: relative;
	width: 92vw;
	max-width: 480px;
	height: 92vh;
	max-height: 860px;
	border-radius: 24px;
	overflow: hidden;
	background: var(--wse-dark);
	box-shadow: 0 20px 60px rgba(0,0,0,0.5);
	display: flex;
	flex-direction: column;
}

.wse-close-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 6;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	color: #fff;
	border: none;
	font-size: 17px;
	cursor: pointer;
}

.wse-progress-wrap {
	position: absolute;
	top: 18px;
	left: 58px;
	right: 58px;
	height: 4px;
	border-radius: 4px;
	background: rgba(255,255,255,0.25);
	z-index: 6;
	overflow: hidden;
}
.wse-progress-bar { height: 100%; width: 0%; background: #fff; border-radius: 4px; transition: width .3s linear; }

.wse-popup-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
	z-index: 1;
}

.wse-popup-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom,
		color-mix(in srgb, var(--wse-dark) 0%, transparent) 35%,
		color-mix(in srgb, var(--wse-dark) 95%, transparent) 80%,
		var(--wse-dark) 100%);
	z-index: 2;
	pointer-events: none;
}

.wse-video-error {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	width: 80%;
	text-align: center;
	color: #fff;
	background: rgba(0,0,0,0.55);
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 13px;
	line-height: 1.7;
}

.wse-popup-title {
	position: relative;
	z-index: 3;
	color: #fff;
	font-size: 15px;
	text-align: center;
	padding: 70px 24px 0;
	font-weight: 600;
	line-height: 1.7;
}

.wse-faq-back {
	align-self: flex-start;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 12.5px;
	cursor: pointer;
}
.wse-faq-back:hover { background: rgba(255,255,255,0.28); }

.wse-faq-stack {
	position: relative;
	z-index: 3;
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0 18px 14px;
	max-height: 48vh;
	overflow-y: auto;
}

.wse-faq-item {
	background: rgba(255,255,255,0.12);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255,255,255,0.25);
	color: #fff;
	border-radius: 14px;
	padding: 13px 16px;
	font-size: 14px;
	text-align: center;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
	flex-shrink: 0;
}
.wse-faq-item:hover { background: color-mix(in srgb, var(--wse-light) 35%, rgba(255,255,255,0.12)); transform: translateY(-2px); }
.wse-faq-item.wse-answered { opacity: .55; }
.wse-faq-item.wse-active { background: linear-gradient(135deg, var(--wse-primary), var(--wse-dark)); border-color: var(--wse-primary); }

.wse-final-cta { position: relative; z-index: 3; padding: 0 22px 14px; text-align: center; }
.wse-final-cta h3 { color: #fff; font-size: 16px; margin-bottom: 12px; line-height: 1.6; }
.wse-btn-final { background: linear-gradient(135deg, var(--wse-primary), var(--wse-dark)); color: #fff; border: none; border-radius: 999px; padding: 14px 22px; font-size: 14px; font-weight: 700; cursor: pointer; width: 100%; }
.wse-btn-final:hover { filter: brightness(1.1); }

.wse-chat-cta {
	position: relative;
	z-index: 3;
	margin: 0 18px 14px;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.3);
	color: #fff;
	border-radius: 999px;
	padding: 11px 16px;
	font-size: 13px;
	cursor: pointer;
	width: calc(100% - 36px);
	flex-shrink: 0;
}
.wse-chat-cta:hover { background: rgba(255,255,255,0.2); }

.wse-popup-footer {
	position: relative;
	z-index: 3;
	text-align: center;
	padding: 6px 16px 18px;
	flex-shrink: 0;
}
.wse-footer-text { color: rgba(255,255,255,0.6); font-size: 12px; }
.wse-footer-logo img { max-height: 26px; max-width: 140px; object-fit: contain; opacity: .9; }

/* ===== موبایل: کوچک‌تر شدن المان‌ها بدون آسیب به محتوا و بدون رفتن دکمه‌ها تو هم ===== */
@media (max-width: 480px) {
	:root { --wse-avatar-size: min(var(--wse-avatar-size), 64px); }
	.wse-launcher { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
	.wse-btn .wse-label { display: none; }
	.wse-btn { padding: 12px; border-radius: 50%; }
	.wse-avatar-trigger {
		flex-direction: column; /* روی موبایل کپشن زیر آواتار می‌آید، نه کنارش، تا چیزی تو هم نرود */
		align-items: center;
		gap: 4px;
	}
	.wse-avatar-caption {
		margin-left: 0;
		max-width: clamp(70px, 38vw, 120px);
		font-size: 10.5px;
		padding: 6px 10px;
		text-align: center;
	}
	.wse-play-badge { width: 18px; height: 18px; font-size: 9px; }
	.wse-popup-title { padding-top: 60px; font-size: 14px; }
}

@media (max-width: 340px) {
	.wse-avatar-caption { display: none; } /* فضای خیلی کم؛ فقط آواتار با نشانگر پخش باقی می‌ماند */
}


/* ===== سوالات متداول داخل محتوای صفحه (مثل بخش سئو) ===== */
.wse-inline-faq {
	margin: 2rem 0;
	padding: 1.25rem;
	background: color-mix(in srgb, var(--wse-light, #8B7CF6) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--wse-light, #8B7CF6) 30%, transparent);
	border-radius: 14px;
}
.wse-inline-faq-title { margin: 0 0 .9rem; font-size: 17px; font-weight: 700; }
.wse-inline-faq-list { display: flex; flex-direction: column; gap: 8px; }
.wse-inline-faq-item {
	display: flex; align-items: center; justify-content: space-between;
	width: 100%; text-align: right; background: #fff; border: 1px solid rgba(0,0,0,0.08);
	border-radius: 10px; padding: 12px 14px; font-size: 14.5px; cursor: pointer;
	transition: border-color .15s ease, transform .1s ease;
}
.wse-inline-faq-item:hover { border-color: var(--wse-primary); transform: translateY(-1px); }
.wse-inline-faq-play {
	flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
	background: var(--wse-primary); color: #fff; display: flex; align-items: center;
	justify-content: center; font-size: 10px; margin-right: 10px;
}

/* ===== دکمه چسبان وقتی این صفحه سوال/ویدیوی مخصوص خودش را دارد —
   تمایز روی خود دکمه شناور، نه روی پاپ‌آپ ===== */
.wse-avatar-trigger-special .wse-avatar-media {
	border-color: var(--wse-light, #8B7CF6);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--wse-light, #8B7CF6) 35%, transparent), 0 8px 24px rgba(0,0,0,0.3);
}
.wse-avatar-trigger-special .wse-play-badge {
	background: var(--wse-light, #8B7CF6);
	animation: ping-pulse-launcher 2s ease-in-out infinite;
}
@keyframes ping-pulse-launcher {
	0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wse-light, #8B7CF6) 50%, transparent); }
	50% { box-shadow: 0 0 0 6px transparent; }
}

/* ---- دکمه‌های پیام‌رسان (مستقل از پاپ‌آپ ویدیویی) ---- */
.wse-btn-telegram,
.wse-btn-whatsapp,
.wse-btn-bale,
.wse-btn-rubika {
	background: #fff;
	color: #23233a;
	border: 1px solid rgba(0,0,0,.08);
	box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.wse-btn-telegram:hover,
.wse-btn-whatsapp:hover,
.wse-btn-bale:hover,
.wse-btn-rubika:hover {
	background: var(--wse-msg-color, #4F46E5);
	color: #fff;
	filter: none;
}
.wse-btn-telegram:hover .wse-icon,
.wse-btn-whatsapp:hover .wse-icon,
.wse-btn-bale:hover .wse-icon,
.wse-btn-rubika:hover .wse-icon { color: #fff !important; }

/* ============ گروه دکمه‌های ارتباطی (Speed-dial) ============ */
.wse-contacts { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* لیست دکمه‌ها — پیش‌فرض بسته (مخفی) */
.wse-contacts-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-end;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.wse-contacts.open .wse-contacts-list {
	max-height: 500px;
	opacity: 1;
	pointer-events: auto;
}

/* هر آیتم با انیمیشن پلکانی از پایین باز می‌شود */
.wse-contacts-list .wse-contact-item {
	transform: translateY(14px) scale(.85);
	opacity: 0;
	transition: transform .28s cubic-bezier(.2,.9,.3,1.3), opacity .22s ease;
	transition-delay: calc(var(--wse-i, 0) * 0ms);
}
.wse-contacts.open .wse-contact-item {
	transform: translateY(0) scale(1);
	opacity: 1;
	transition-delay: calc((var(--wse-i, 0) - 1) * 45ms);
}

/* دکمه‌ی مادر */
.wse-contacts-fab {
	width: 56px; height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(135deg, var(--wse-primary, #4F46E5), var(--wse-dark, #3730A3));
	color: #fff;
	display: grid; place-items: center;
	box-shadow: 0 8px 22px rgba(79,70,229,.42);
	transition: transform .2s ease, box-shadow .2s ease;
	align-self: flex-end;
}
.wse-contacts-fab:hover { transform: scale(1.06); }
.wse-contacts-fab .wse-icon { display: grid; place-items: center; transition: opacity .2s, transform .2s; }
.wse-contacts-icon-open { position: absolute; opacity: 0; transform: rotate(-90deg); }
.wse-contacts.open .wse-contacts-fab { box-shadow: 0 8px 22px rgba(79,70,229,.55); }
.wse-contacts.open .wse-contacts-icon-closed { opacity: 0; transform: rotate(90deg); }
.wse-contacts.open .wse-contacts-icon-open { opacity: 1; transform: rotate(0); }

/* دکمه‌ی تکیِ ارتباطی (وقتی فقط یکی فعال است) رنگ برندش را می‌گیرد */
.wse-contact-single:hover,
.wse-contacts-list .wse-contact-item:hover {
	background: var(--wse-msg-color, #4F46E5);
	color: #fff; filter: none;
}
.wse-contact-single:hover .wse-icon,
.wse-contacts-list .wse-contact-item:hover .wse-icon { color: #fff !important; }
.wse-contact-single, .wse-contacts-list .wse-contact-item {
	background: #fff; color: #23233a;
	border: 1px solid rgba(0,0,0,.08);
	box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
