/*
 * استایل دکمه شناور تماس
 * تمام کلاس‌ها با پیشوند fcb- نام‌گذاری شده‌اند تا با کلاس‌های قالب هلو، المنتور
 * یا ووکامرس تداخل نداشته باشند. یک ریست محلی روی خود ویجت اعمال شده تا استایل‌های
 * سراسری قالب (مثل box-sizing یا line-height متن سایت) روی ظاهر دکمه اثر نگذارد.
 */

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

.fcb-widget {
	position: fixed;
	bottom: var(--fcb-offset-bottom, 24px);
	z-index: var(--fcb-z, 999999);
	width: var(--fcb-btn-size, 60px);
	height: var(--fcb-btn-size, 60px);
	direction: rtl;
	font-family: inherit;
	line-height: 1;
}

.fcb-widget.fcb-pos-right {
	right: var(--fcb-offset-side, 24px);
	left: auto;
}

.fcb-widget.fcb-pos-left {
	left: var(--fcb-offset-side, 24px);
	right: auto;
}

/* دکمه اصلی */
.fcb-widget .fcb-main-btn {
	position: relative;
	width: var(--fcb-btn-size, 60px);
	height: var(--fcb-btn-size, 60px);
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(135deg, var(--fcb-bg-start, #7b2ff7), var(--fcb-bg-end, #5b1de0));
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
}

.fcb-widget .fcb-main-btn:hover,
.fcb-widget .fcb-main-btn:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
	outline: none;
}

.fcb-widget .fcb-icon {
	width: var(--fcb-icon-size, 26px);
	height: var(--fcb-icon-size, 26px);
	color: var(--fcb-icon-color, #fff);
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.fcb-widget .fcb-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.fcb-widget .fcb-icon-close {
	opacity: 0;
	transform: rotate(-45deg) scale(0.6);
}

.fcb-widget.fcb-open .fcb-icon-main {
	opacity: 0;
	transform: rotate(45deg) scale(0.6);
}

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

/* پالس */
.fcb-widget.fcb-pulse .fcb-main-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: inherit;
	animation: fcb-pulse-anim 2.2s ease-out infinite;
	z-index: -1;
}

@keyframes fcb-pulse-anim {
	0% {
		opacity: 0.55;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(1.8);
	}
}

/* لیست آیتم‌ها
 * با position:absolute نسبت به خود ویجت قرار می‌گیرد تا اندازه/موقعیت دکمه اصلی
 * هیچ‌وقت با باز و بسته شدن لیست جابه‌جا نشود.
 */
.fcb-widget .fcb-items-list {
	position: absolute;
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	min-width: max-content;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.fcb-widget.fcb-pos-right .fcb-items-list {
	right: 0;
	align-items: flex-end;
}

.fcb-widget.fcb-pos-left .fcb-items-list {
	left: 0;
	align-items: flex-start;
}

/* لیست بالای دکمه باز شود (پیش‌فرض) */
.fcb-widget.fcb-list-above .fcb-items-list {
	bottom: calc(100% + 12px);
	transform: translateY(8px);
}

/* لیست پایین دکمه باز شود */
.fcb-widget.fcb-list-below .fcb-items-list {
	top: calc(100% + 12px);
	transform: translateY(-8px);
}

.fcb-widget.fcb-open .fcb-items-list {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.fcb-widget .fcb-item a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 30px;
	text-decoration: none;
	white-space: nowrap;
	font-size: 14px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s ease, opacity 0.2s ease;
	opacity: 0;
	transform: translateY(6px);
}

.fcb-widget.fcb-open .fcb-item a {
	opacity: 1;
	transform: translateY(0);
}

.fcb-widget .fcb-item-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	display: flex;
}

.fcb-widget .fcb-item-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.fcb-widget .fcb-item a:hover {
	transform: translateY(-2px) scale(1.03);
}

/* حالت نمایش «فقط آیکون»: بدون متن، به‌صورت دایره کوچک */
.fcb-widget.fcb-display-icon-only .fcb-item a {
	padding: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	justify-content: center;
}

.fcb-widget.fcb-display-icon-only .fcb-item-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.fcb-widget.fcb-display-icon-only .fcb-item-icon {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
}

/* موبایل: همیشه با کلیک باز شود حتی اگر تنظیمات روی هاور باشد */
@media (hover: none) and (pointer: coarse) {
	.fcb-widget .fcb-item a {
		font-size: 13px;
		padding: 7px 12px;
	}
}

/* حالت پیش‌نمایش داخل پنل تنظیمات (استاتیک، نه فیکس) */
.fcb-preview-box .fcb-widget {
	position: relative;
	bottom: auto;
	right: auto;
	left: auto;
	inset-inline-end: 0;
}
