/* SA Float — دکمهٔ شناور تماس، چسبان پایین-راست (RTL، تم روشن سایت) */

.sa-float {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 210;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	direction: rtl;
	font-family: var(--sa-font, "Vazirmatn", Tahoma, sans-serif);
}

/* ---------- دکمهٔ اصلی ---------- */

.sa-float-fab {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 56px !important;
	height: 56px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: #1d1d1b !important;
	color: #ffffff !important;
	box-shadow: 0 10px 26px rgba(29, 29, 27, 0.28) !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sa-float-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 32px rgba(29, 29, 27, 0.34), 0 0 0 4px rgba(var(--sa-gold-rgb, 255, 218, 0), 0.35) !important;
}

.sa-float-fab:focus-visible {
	outline: none;
	box-shadow: 0 10px 26px rgba(29, 29, 27, 0.28), 0 0 0 4px rgba(var(--sa-gold-rgb, 255, 218, 0), 0.55) !important;
}

/* تعویض آیکن گفتگو ⇄ ضربدر */
.sa-float-fab-ico {
	position: absolute;
	inset: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.18s ease, transform 0.25s ease;
}

.sa-float-fab-ico-close {
	opacity: 0;
	transform: rotate(-45deg) scale(0.6);
}

.sa-float.is-open .sa-float-fab-ico-chat {
	opacity: 0;
	transform: rotate(45deg) scale(0.6);
}

.sa-float.is-open .sa-float-fab-ico-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

.sa-float.is-open .sa-float-fab {
	background: var(--sa-gold, #ffda00) !important;
	color: #1d1d1b !important;
}

/* ---------- پشتهٔ آیکن‌ها ---------- */

.sa-float-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.sa-float-list > li {
	opacity: 0;
	transform: translateY(10px) scale(0.9);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.25, 1, 0.3, 1);
}

.sa-float.is-open .sa-float-list > li {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* پلکانی: هر ردیف کمی دیرتر (از پایین به بالا) */
.sa-float.is-open .sa-float-list > li:nth-last-child(1) { transition-delay: 0s; }
.sa-float.is-open .sa-float-list > li:nth-last-child(2) { transition-delay: 0.04s; }
.sa-float.is-open .sa-float-list > li:nth-last-child(3) { transition-delay: 0.08s; }
.sa-float.is-open .sa-float-list > li:nth-last-child(4) { transition-delay: 0.12s; }
.sa-float.is-open .sa-float-list > li:nth-last-child(5) { transition-delay: 0.16s; }
.sa-float.is-open .sa-float-list > li:nth-last-child(n+6) { transition-delay: 0.2s; }

.sa-float-item {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}

.sa-float-item-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 8px 22px rgba(29, 29, 27, 0.16);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* آیکن سفارشی (تصویر کاربر): گرد، پرکنندهٔ دایره؛ دو کلاسه تا از قاعدهٔ img قالب قوی‌تر باشد */
.sa-float-item-ico .sa-float-item-custom {
	width: 28px !important;
	height: 28px !important;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.sa-float-item:hover .sa-float-item-ico,
.sa-float-item:focus-visible .sa-float-item-ico {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(29, 29, 27, 0.22);
}

.sa-float-item:focus-visible {
	outline: none;
}

.sa-float-item:focus-visible .sa-float-item-ico {
	box-shadow: 0 8px 22px rgba(29, 29, 27, 0.16), 0 0 0 3px rgba(var(--sa-gold-rgb, 255, 218, 0), 0.55);
}

/* برچسب: پیل سفید کنار آیکن (سمت چپ، چون پشته لبهٔ راست است) */
.sa-float-item-label {
	padding: 7px 14px;
	border-radius: 999px;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 6px 18px rgba(29, 29, 27, 0.14);
	color: #1d1d1b;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

/* ---------- موبایل ---------- */

@media (max-width: 600px) {
	.sa-float {
		right: 14px;
		bottom: 14px;
	}

	.sa-float-fab {
		width: 52px !important;
		height: 52px !important;
	}
}

/* ---------- کاهش حرکت ---------- */

@media (prefers-reduced-motion: reduce) {
	.sa-float-fab,
	.sa-float-fab-ico,
	.sa-float-list > li,
	.sa-float-item-ico {
		transition: none !important;
	}

	.sa-float-fab:hover {
		transform: none;
	}
}
