/* باکس پشتیبانی شناور — فرانت */

.atlasshop-sb {
	position: fixed;
	z-index: 9999999;
	font-family: 'Yekan Bakh', Tahoma, sans-serif;
	font-weight: 400;
	box-sizing: border-box;
	pointer-events: none;
}

/*
 * ریشهٔ باکس pointer-events:none است.
 * stack را none می‌گذاریم تا ناحیهٔ چیدمان پنلِ بسته (visibility:hidden ولی هنوز در layout) کلیک زیرین را نگیرد.
 * اورلی و پنل را اینجا auto نکنید — هر کدام در بلوک خود با بسته/باز، pointer-events درست دارند؛
 * وگرنه .atlasshop-sb .atlasshop-sb__overlay بر «pointer-events:none» اورلی غلبه می‌کرد و کل صفحه غیرقابل کلیک می‌شد.
 */
.atlasshop-sb .atlasshop-sb__stack {
	pointer-events: none;
}

.atlasshop-sb .atlasshop-sb__fab,
.atlasshop-sb #atlasshop-sb-toggle {
	pointer-events: auto;
}

.atlasshop-sb *,
.atlasshop-sb *::before,
.atlasshop-sb *::after {
	box-sizing: border-box;
}

.atlasshop-sb button,
.atlasshop-sb a,
.atlasshop-sb .atlasshop-sb__title,
.atlasshop-sb .atlasshop-sb__subtitle,
.atlasshop-sb .atlasshop-sb__link,
.atlasshop-sb .atlasshop-sb__fab-label {
	font-family: inherit;
}

/* نمایش فقط دسکتاپ / فقط موبایل */
@media (max-width: 768px) {
	.atlasshop-sb.atlasshop-sb--vis-desktop {
		display: none !important;
	}
}

@media (min-width: 769px) {
	.atlasshop-sb.atlasshop-sb--vis-mobile {
		display: none !important;
	}
}

/* جایگاه فیزیکی (مستقل از RTL صفحه) — فاصله از پایین از تنظیمات: --atlasshop-sb-bottom-desktop / --atlasshop-sb-bottom-mobile */
.atlasshop-sb--pos-bottom-right {
	bottom: max(var(--atlasshop-sb-bottom-desktop, 20px), env(safe-area-inset-bottom, 0px));
	right: max(20px, env(safe-area-inset-right, 0px));
	left: auto;
	top: auto;
}

.atlasshop-sb--pos-bottom-left {
	bottom: max(var(--atlasshop-sb-bottom-desktop, 20px), env(safe-area-inset-bottom, 0px));
	left: max(20px, env(safe-area-inset-left, 0px));
	right: auto;
	top: auto;
}

@media (max-width: 768px) {
	.atlasshop-sb--pos-bottom-right,
	.atlasshop-sb--pos-bottom-left {
		bottom: max(var(--atlasshop-sb-bottom-mobile, 20px), env(safe-area-inset-bottom, 0px));
	}
}

.atlasshop-sb--pos-top-right {
	top: max(20px, env(safe-area-inset-top, 0px));
	right: max(20px, env(safe-area-inset-right, 0px));
	left: auto;
	bottom: auto;
}

.atlasshop-sb--pos-top-left {
	top: max(20px, env(safe-area-inset-top, 0px));
	left: max(20px, env(safe-area-inset-left, 0px));
	right: auto;
	bottom: auto;
}

.atlasshop-sb__overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.35);
	backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	z-index: 0;
}

.atlasshop-sb.is-open .atlasshop-sb__overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* استک LTR تا «راست/چپ» با لبهٔ واقعی viewport یکی باشد (در سایت RTL برعکس نماند) */
.atlasshop-sb__stack {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	direction: ltr;
	align-items: flex-end;
	gap: 14px;
	animation: 3s infinite q;
}

.atlasshop-sb.is-open .atlasshop-sb__stack {
	animation: none;
}

.atlasshop-sb--pos-bottom-left .atlasshop-sb__stack,
.atlasshop-sb--pos-top-left .atlasshop-sb__stack {
	align-items: flex-start;
}

/* بالای صفحه: دکمه نزدیک لبه، پنل زیر دکمه */
.atlasshop-sb--pos-top-right .atlasshop-sb__stack,
.atlasshop-sb--pos-top-left .atlasshop-sb__stack {
	flex-direction: column-reverse;
}

/* دکمه شناور — بدون بوردر؛ گوشه‌های گرد؛ غلبه بر استایل سراسری دکمه/المنتور */
#atlasshop-support-box button.atlasshop-sb__fab,
.atlasshop-sb button.atlasshop-sb__fab.atlasshop-sb__fab {
	color: var(--atlasshop-fab-icon-color, #ffffff) !important;
	position: relative;
	width: 60px !important;
	height: 60px !important;
	min-width: 60px !important;
	min-height: 60px !important;
	max-width: 60px !important;
	max-height: 60px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-width: 0 !important;
	border-style: none !important;
	border-color: transparent !important;
	border-radius: 20px !important;
	outline: none !important;
	outline-width: 0 !important;
	box-shadow: 0 6px 22px rgba(44, 98, 215, 0.38);
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	-webkit-appearance: none !important;
	appearance: none !important;
	overflow: hidden;
	background-clip: padding-box;
	line-height: 1;
	vertical-align: middle;
	transition: box-shadow 0.2s ease;
	/* bk-pulse: مقیاس و سایه؛ l: موشن نبض (brightness، بدون تداخل transform) */
	animation: bk-pulse 2.5s ease-out infinite, l 2s infinite;
	animation-delay: 2s, 0s;
}

#atlasshop-support-box button.atlasshop-sb__fab:hover,
.atlasshop-sb button.atlasshop-sb__fab.atlasshop-sb__fab:hover {
	border: 0 !important;
	border-color: transparent !important;
	box-shadow: 0 8px 28px rgba(44, 98, 215, 0.4);
}

#atlasshop-support-box button.atlasshop-sb__fab:focus,
#atlasshop-support-box button.atlasshop-sb__fab:focus-visible,
.atlasshop-sb button.atlasshop-sb__fab.atlasshop-sb__fab:focus,
.atlasshop-sb button.atlasshop-sb__fab.atlasshop-sb__fab:focus-visible {
	outline: none !important;
	border: 0 !important;
}

#atlasshop-support-box button.atlasshop-sb__fab:focus-visible,
.atlasshop-sb button.atlasshop-sb__fab.atlasshop-sb__fab:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 6px 24px rgba(44, 98, 215, 0.35);
}

.atlasshop-sb__fab-inner {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 100%;
	height: 100%;
	padding: 6px 4px;
	direction: rtl;
	animation: bk-rotate 2.5s ease-in-out infinite;
	animation-delay: 2s;
}

.atlasshop-sb__fab-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	line-height: 0;
}

.atlasshop-sb__fab-icon .eicon,
.atlasshop-sb__fab-icon [class*='eicon'] {
	font-size: 26px;
	line-height: 1;
	color: var(--atlasshop-fab-icon-color, #ffffff);
}

.atlasshop-sb__fab-icon .eicon::before,
.atlasshop-sb__fab-icon .eicon::after,
.atlasshop-sb__fab-icon [class*='eicon']::before,
.atlasshop-sb__fab-icon [class*='eicon']::after {
	color: var(--atlasshop-fab-icon-color, #ffffff);
}

.atlasshop-sb__fab-icon svg {
	width: 26px;
	height: 26px;
	display: block;
	color: inherit;
}

/* توپُر (fill) و خطی (stroke) — هم‌راستا با استایل guard در فوتر */
.atlasshop-sb__fab-icon svg :is(path, circle, rect, line, polyline, polygon, ellipse, g)[stroke]:not([stroke='none']) {
	stroke: currentColor;
}

.atlasshop-sb__fab-icon svg :is(path, circle, rect, line, polyline, polygon, ellipse, g)[fill='none'],
.atlasshop-sb__fab-icon svg :is(path, circle, rect, line, polyline, polygon, ellipse, g)[fill='transparent'] {
	stroke: currentColor;
}

.atlasshop-sb__fab-icon svg :is(path, circle, rect, line, polyline, polygon, ellipse):not([fill='none']):not([fill='transparent']):not([fill^='url(']):not([fill^='URL(']) {
	fill: currentColor;
}

.atlasshop-sb__fab-icon svg g[fill='none'] :is(path, circle, rect, line, polyline, polygon, ellipse),
.atlasshop-sb__fab-icon svg g[fill='transparent'] :is(path, circle, rect, line, polyline, polygon, ellipse),
.atlasshop-sb__fab-icon svg[fill='none'] :is(path, circle, rect, line, polyline, polygon, ellipse),
.atlasshop-sb__fab-icon svg[fill='transparent'] :is(path, circle, rect, line, polyline, polygon, ellipse) {
	fill: none;
	stroke: currentColor;
}

.atlasshop-sb__fab-icon--img-mono-invert img {
	filter: brightness(0) invert(1);
}

.atlasshop-sb__fab-icon img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	display: block;
}

.atlasshop-sb__fab-icon--close svg {
	width: 14px;
	height: 14px;
}

.atlasshop-sb__fab-icon--close {
	display: none;
}

.atlasshop-sb.is-open .atlasshop-sb__fab-icon--open {
	display: none;
}

.atlasshop-sb.is-open .atlasshop-sb__fab-icon--close {
	display: flex;
}

.atlasshop-sb__fab-label {
	font-size: 9px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--atlasshop-fab-icon-color, #ffffff);
	text-align: center;
	max-width: 52px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* حلقه‌های قدیمی غیرفعال — پالس با bk-pulse روی خود دکمه */
.atlasshop-sb__pulse {
	display: none;
}

.atlasshop-sb.is-open .atlasshop-sb__fab,
.atlasshop-sb.is-open .atlasshop-sb__fab-inner {
	animation: none;
}

.atlasshop-sb.is-open .atlasshop-sb__fab {
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
	transform: none;
}

@keyframes bk-rotate {
	0%,
	100% {
		transform: rotate(0deg);
	}
	25% {
		transform: rotate(-6deg);
	}
	50% {
		transform: rotate(0deg);
	}
	75% {
		transform: rotate(6deg);
	}
}

@keyframes bk-pulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow: 0 6px 22px rgba(44, 98, 215, 0.38);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 8px 28px rgba(44, 98, 215, 0.48);
	}
}

/* نبض دوضربه در هر سیکل ۲ ثانیه — مطابق animation: 2s infinite l */
@keyframes l {
	0%,
	100% {
		filter: brightness(1);
	}
	12% {
		filter: brightness(1.18);
	}
	25% {
		filter: brightness(1);
	}
	38% {
		filter: brightness(1.12);
	}
	50% {
		filter: brightness(1);
	}
}

/* حرکت ملایم کل باکس شناور (نام q مطابق درخواست) */
@keyframes q {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-8px);
	}
}

/* پنل — نزدیک طرح کارت پشتیبانی */
.atlasshop-sb__panel {
	width: min(360px, calc(100vw - 28px));
	max-height: min(78vh, 560px);
	overflow-y: auto;
	overflow-x: hidden;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 16px 50px rgba(15, 23, 42, 0.12), 0 4px 16px rgba(15, 23, 42, 0.06);
	padding: 22px 20px 20px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
	border: none;
}

.atlasshop-sb.is-open .atlasshop-sb__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.atlasshop-sb__panel-head {
	padding-bottom: 16px;
	margin-bottom: 16px;
	border-bottom: 1px solid #eceff3;
}

.atlasshop-sb__title {
	margin: 0 0 8px;
	font-size: 1.125rem;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
	letter-spacing: -0.01em;
}

.atlasshop-sb__subtitle {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
	line-height: 1.55;
}

.atlasshop-sb__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.atlasshop-sb__link {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	background: #f3f4f6;
	border-radius: 14px;
	text-decoration: none;
	color: #1f2937;
	font-weight: 600;
	font-size: 0.9375rem;
	transition: background 0.2s ease, transform 0.15s ease;
	border: none;
}

.atlasshop-sb__link:hover {
	background: #e5e7eb;
	color: #111827;
	transform: translateY(-1px);
}

.atlasshop-sb__item-icon {
	flex-shrink: 0;
	order: 1;
	width: 60px;
	height: 60px;
	min-width: 60px;
	min-height: 60px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.atlasshop-sb__item-icon img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

.atlasshop-sb__item-icon .eicon,
.atlasshop-sb__item-icon [class*='eicon'] {
	font-size: 26px;
	line-height: 1;
	color: #fff;
}

.atlasshop-sb__item-text {
	flex: 1;
	min-width: 0;
	order: 2;
	text-align: right;
}
