/* دکمه شناور راه‌های ارتباطی */

/* قالب‌ها معمولاً روی button، a، ul و li استایل سنگین می‌گذارند.
   این بلوک فقط همان چند ویژگیِ حیاتی را قفل می‌کند تا چیدمان نشکند. */

.fcb,
.fcb *,
.fcb *::before,
.fcb *::after {
	box-sizing: border-box;
}

.fcb .fcb__toggle,
.fcb .fcb__item,
.fcb .fcb__list,
.fcb .fcb__row {
	margin: 0 !important;
	border: 0 !important;
	font-family: inherit !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-height: none !important;
	float: none !important;
	transform: none;
}

.fcb .fcb__list,
.fcb .fcb__row {
	list-style: none !important;
	padding: 0;
	background: none !important;
}

.fcb .fcb__row::before,
.fcb .fcb__row::after,
.fcb .fcb__list::before,
.fcb .fcb__list::after {
	content: none !important;
}

.fcb .fcb__row::marker {
	content: "";
}

.fcb {
	--fcb-size: 56px;
	--fcb-bottom: 24px;
	--fcb-side: 20px;
	--fcb-color: #2563eb;
	--fcb-icon: #ffffff;

	position: fixed;
	bottom: var(--fcb-bottom);
	z-index: 99990;

	/* چیدمان مستقل از جهت صفحه نگه داشته می‌شود تا در سایت RTL هم
	   آیکون‌ها به لبه صفحه بچسبند و زیر دکمه اصلی تراز بمانند. */
	direction: ltr;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	font-family: inherit;
	line-height: 1;
}

.fcb--right {
	right: var(--fcb-side);
	left: auto;
}

.fcb--left {
	left: var(--fcb-side);
	right: auto;
	align-items: flex-start;
}

/* برچسب کنار دکمه اصلی */

.fcb .fcb__toggle-wrap {
	display: flex;
	align-items: center;
}

.fcb .fcb__badge {
	flex: 0 0 auto;
	max-width: 0;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	line-height: 1 !important;
	color: #fff;
	background: var(--fcb-color);
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transition: max-width 0.22s ease, padding 0.22s ease, opacity 0.2s ease;
}

.fcb--left .fcb__badge {
	order: 1;
}

.fcb--badge-always .fcb__badge,
.fcb--badge-hover .fcb__toggle-wrap:hover .fcb__badge,
.fcb--badge-hover .fcb__toggle:focus-visible ~ .fcb__badge,
.fcb--badge-hover .fcb__toggle-wrap:focus-within .fcb__badge {
	max-width: 260px;
	padding: 11px 16px;
	opacity: 1;
	margin-inline-end: 10px;
}

.fcb--left.fcb--badge-always .fcb__badge,
.fcb--left.fcb--badge-hover .fcb__toggle-wrap:hover .fcb__badge,
.fcb--left.fcb--badge-hover .fcb__toggle-wrap:focus-within .fcb__badge {
	margin-inline-end: 0;
	margin-inline-start: 10px;
}

/* وقتی فهرست باز است، برچسب جمع می‌شود تا شلوغ نشود. */
.fcb.is-open .fcb__badge {
	max-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	opacity: 0 !important;
}

/* تصویر آیکون دلخواه */

.fcb .fcb-img {
	display: block;
	width: 55%;
	height: 55%;
	max-width: 28px;
	max-height: 28px;
	object-fit: contain;
}

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

.fcb .fcb__toggle {
	position: relative !important;
	width: var(--fcb-size) !important;
	height: var(--fcb-size) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	border-radius: 50% !important;
	background: var(--fcb-color) !important;
	color: var(--fcb-icon) !important;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.fcb__toggle:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.fcb__toggle:focus-visible {
	outline: 3px solid var(--fcb-color);
	outline-offset: 3px;
}

.fcb .fcb__toggle-icon {
	display: flex !important;
	position: absolute;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.fcb .fcb__toggle-icon--close {
	opacity: 0;
	transform: rotate(-90deg);
}

.fcb.is-open .fcb__toggle-icon--open {
	opacity: 0;
	transform: rotate(90deg);
}

.fcb.is-open .fcb__toggle-icon--close {
	opacity: 1;
	transform: rotate(0);
}

/* فهرست */

.fcb__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fcb__list[hidden] {
	display: none;
}

.fcb__row {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	justify-content: flex-end;

	/* نیم‌اختلاف قطر دکمه اصلی و آیکون‌ها، تا ستون دقیقاً تراز شود. */
	padding-right: calc(var(--fcb-size) * 0.1);
}

.fcb--left .fcb__row {
	justify-content: flex-start;
	padding-right: 0;
	padding-left: calc(var(--fcb-size) * 0.1);
}

/* آیکون همیشه سمت لبه صفحه می‌ماند. */
.fcb--left .fcb__icon {
	order: -1;
}

.fcb.is-open .fcb__row {
	animation: fcb-in 0.22s ease both;
	animation-delay: var(--fcb-delay, 0ms);
}

@keyframes fcb-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.85);
	}
}

/* هر مورد */

.fcb__item {
	--fcb-item-color: #2563eb;

	display: inline-flex !important;
	align-items: center;
	gap: 0;
	height: calc(var(--fcb-size) * 0.8) !important;
	padding: 0 !important;
	border-radius: 999px !important;
	background: var(--fcb-item-color) !important;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fcb .fcb__item:hover,
.fcb .fcb__item:focus-visible {
	color: #fff !important;
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.fcb__item:focus-visible {
	outline: 3px solid var(--fcb-item-color);
	outline-offset: 3px;
}

.fcb .fcb__icon {
	flex: 0 0 auto;
	width: calc(var(--fcb-size) * 0.8);
	height: calc(var(--fcb-size) * 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
}

.fcb .fcb__label {
	flex: 0 0 auto;
	max-width: 0;
	padding: 0;
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	transition: max-width 0.2s ease, padding 0.2s ease, opacity 0.18s ease;
}

/* نمایش نام: با نگه داشتن نشانگر */

.fcb--labels-hover .fcb__item:hover .fcb__label,
.fcb--labels-hover .fcb__item:focus-visible .fcb__label,
.fcb--labels-always .fcb__label {
	max-width: 260px;
	padding: 0 14px;
	opacity: 1;
}

/* نشان حرفی برای پیام‌رسان‌های بدون نشانِ ساده */

.fcb .fcb-letter {
	font-weight: 800;
	line-height: 1;
	display: block;
	letter-spacing: -0.02em;
}

/* پنهان‌سازی بر اساس اندازه صفحه */

@media (max-width: 782px) {
	.fcb--hide-mobile {
		display: none;
	}

	.fcb__label {
		font-size: 12px;
	}
}

@media (min-width: 783px) {
	.fcb--hide-desktop {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fcb.is-open .fcb__row {
		animation: none;
	}

	.fcb__toggle,
	.fcb__item,
	.fcb__toggle-icon {
		transition: none;
	}
}

/* پیش‌نمایش در پیشخوان */

.fcb-preview {
	position: relative;
	min-height: 360px;
	margin: 12px 0 24px;
	padding: 16px;
	overflow: hidden;
	background: #f6f7f7 repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0 10px, transparent 10px 20px);
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.fcb-preview .fcb {
	position: absolute;
}
