/* ==========================================
   Support widget variables
========================================== */

.nesi-support {
	--nesi-primary: #ffd400;
	--nesi-primary-hover: #efc800;
	--nesi-text: #171717;
	--nesi-muted: #6f747b;
	--nesi-border: #e5e7ea;
	--nesi-surface: #ffffff;

	position: fixed;
	left: 22px;
	bottom: 22px;
	z-index: 99990;
	direction: rtl;
	font-family: inherit;

	opacity: 0;
	visibility: hidden;
	transform: translateY(28px) scale(0.96);

	transition:
		opacity 0.55s ease,
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.55s ease;
}

.nesi-support.is-ready {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

body.nesi-support-panel-open {
	overflow: hidden;
	touch-action: none;
}

/* ==========================================
   Desktop trigger
========================================== */

.nesi-support__trigger {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 285px;
	min-height: 66px;
	position: relative;
	padding: 9px 12px 9px 14px;
	margin: 0;

	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 20px;

	color: var(--nesi-text);
	background: var(--nesi-surface);

	box-shadow:
		0 15px 45px rgba(18, 30, 48, 0.14),
		0 3px 12px rgba(18, 30, 48, 0.08);

	cursor: pointer;
	text-align: right;
	overflow: hidden;

	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease,
		border-color 0.25s ease;
}

.nesi-support__trigger::before {
	content: "";
	width: 4px;
	position: absolute;
	top: 11px;
	left: 0;
	bottom: 11px;
	border-radius: 0 4px 4px 0;
	background: var(--nesi-primary);
}

.nesi-support__trigger:hover {
	transform: translateY(-3px);
	border-color: rgba(0, 0, 0, 0.12);

	box-shadow:
		0 20px 50px rgba(18, 30, 48, 0.18),
		0 5px 15px rgba(18, 30, 48, 0.1);
}

.nesi-support__trigger-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 47px;
	width: 47px;
	height: 47px;
	position: relative;
	z-index: 2;
	border-radius: 15px;
	color: #151515;
	background: var(--nesi-primary);
}

.nesi-support__trigger-pulse {
	width: 47px;
	height: 47px;
	position: absolute;
	top: 9px;
	right: 12px;
	z-index: 1;

	border: 2px solid rgba(255, 212, 0, 0.65);
	border-radius: 15px;

	animation:
		nesi-support-pulse 2.8s ease-out infinite;

	pointer-events: none;
}

.nesi-support__trigger-text-wrap {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.nesi-support__trigger-text {
	display: block;
	min-height: 22px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.5;

	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.nesi-support__trigger-text.is-changing {
	opacity: 0;
	transform: translateY(6px);
}

.nesi-support__trigger-text-wrap small {
	color: var(--nesi-muted);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.5;
}

.nesi-support__trigger-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	color: #73777d;

	transition:
		transform 0.3s ease;
}

.nesi-support.is-open
	.nesi-support__trigger-arrow {
	transform: rotate(-90deg);
}

/* ==========================================
   Panel desktop
========================================== */

.nesi-support__panel {
	width: min(370px, calc(100vw - 28px));
	max-height: min(450px, calc(100vh - 110px));
	position: absolute;
	left: 0;
	bottom: calc(100% + 13px);

	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 24px;

	background: var(--nesi-surface);

	box-shadow:
		0 25px 70px rgba(15, 26, 43, 0.2),
		0 6px 20px rgba(15, 26, 43, 0.08);

	overflow-x: hidden;
	overflow-y: auto;

	opacity: 0;
	visibility: hidden;

	transform: translateY(15px) scale(0.96);
	transform-origin: bottom left;

	transition:
		opacity 0.25s ease,
		transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.25s ease;
}

.nesi-support.is-open
	.nesi-support__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.nesi-support__panel-handle {
	display: none;
}

.nesi-support__panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;

	padding: 20px 20px 17px;

	border-bottom: 1px solid var(--nesi-border);
}

.nesi-support__heading {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.nesi-support__title {
	color: var(--nesi-text);
	font-size: 16px;
	font-weight: 900;
	line-height: 1.5;
}

.nesi-support__subtitle {
	color: var(--nesi-muted);
	font-size: 11px;
	line-height: 1.6;
}

.nesi-support__close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 39px;
	width: 39px;
	height: 39px;
	padding: 0;
	margin: 0;

	border: 0;
	border-radius: 50%;

	color: #51565c;
	background: #f4f5f6;

	cursor: pointer;

	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		transform 0.25s ease;
}

.nesi-support__close:hover {
	color: #111;
	background: #ebedef;
	transform: rotate(90deg);
}

.nesi-support__panel-body {
	padding: 17px;
}

/* ==========================================
   Intro and status
========================================== */

.nesi-support__intro {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 13px;
	border-radius: 16px;
	background: #f7f8f9;
}

.nesi-support__intro-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 39px;
	width: 39px;
	height: 39px;
	border-radius: 12px;
	color: #171717;
	background: var(--nesi-primary);
}

.nesi-support__intro p {
	margin: 0;
	color: #4d5258;
	font-size: 12px;
	line-height: 2;
}

.nesi-support__intro strong {
	color: var(--nesi-text);
	font-weight: 800;
}

.nesi-support__status {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 13px 3px;
	color: #4e555c;
	font-size: 11px;
	line-height: 1.6;
}

.nesi-support__status-dot {
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #27b36a;

	box-shadow:
		0 0 0 5px rgba(39, 179, 106, 0.12);

	animation:
		nesi-support-status 2s ease-in-out infinite;
}

/* ==========================================
   Contact links
========================================== */

.nesi-support__links {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nesi-support__link {
	display: flex;
	align-items: center;
	gap: 11px;
	min-height: 58px;
	padding: 8px 11px;

	border: 1px solid var(--nesi-border);
	border-radius: 17px;

	color: var(--nesi-text);
	background: #fff;

	text-decoration: none;

	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		background-color 0.2s ease,
		box-shadow 0.2s ease;
}

.nesi-support__link:hover {
	color: var(--nesi-text);
	border-color: #d3d6da;
	background: #fafafa;

	box-shadow:
		0 7px 18px rgba(22, 31, 43, 0.07);

	transform: translateX(-3px);
}

.nesi-support__link--primary {
	border-color: var(--nesi-primary);
	background: var(--nesi-primary);
}

.nesi-support__link--primary:hover {
	border-color: var(--nesi-primary-hover);
	background: var(--nesi-primary-hover);
}

.nesi-support__link-icon,
.nesi-support__app-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 39px;
	width: 39px;
	height: 39px;
	border-radius: 12px;
}

.nesi-support__link-icon {
	color: #171717;
	background: rgba(255, 255, 255, 0.75);
}

.nesi-support__app-icon {
	color: #fff;
}

.nesi-support__app-icon--whatsapp {
	background: #25d366;
}

.nesi-support__app-icon--telegram {
	background: #2aabee;
}

.nesi-support__app-icon--bale {
	background: #247cb3;
}

.nesi-support__app-icon--rubika {
	background:
		linear-gradient(
			135deg,
			#245cc7,
			#a444d5
		);
}

.nesi-support__app-icon--instagram {
	background:
		linear-gradient(
			135deg,
			#515bd4,
			#8134af 35%,
			#dd2a7b 65%,
			#feda77
		);
}

.nesi-support__link-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.nesi-support__link-content strong {
	color: inherit;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.5;
}

.nesi-support__link-content small {
	color: var(--nesi-muted);
	font-size: 10px;
	line-height: 1.5;
}

.nesi-support__link--primary
	.nesi-support__link-content small {
	color: rgba(0, 0, 0, 0.65);
}

.nesi-support__link-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 25px;
	width: 25px;
	height: 25px;
	color: #8b9095;
}

.nesi-support__link--primary
	.nesi-support__link-arrow {
	color: #111;
}

.nesi-support__hours {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;

	margin-top: 13px;
	padding: 11px;

	border-radius: 13px;

	color: #4f555b;
	background: #f3f4f5;

	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
}

/* ==========================================
   SVG
========================================== */

.nesi-support svg,
.bb-support-mobile svg {
	display: block;
	fill: currentColor;
}

/* ==========================================
   Mobile footer button
========================================== */

.bb-support-mobile {
	display: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: visible;
}

.fix-contact.bb-support-mounted {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	position: relative;
	overflow: visible !important;
}

.bb-support-mobile__trigger {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;

	width: 100%;
	min-height: 58px;
	position: relative;

	padding: 4px;
	margin: 0;

	border: 0;

	color: #171717;
	background: transparent;

	cursor: pointer;
	overflow: visible;
}

.bb-support-mobile__icon {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 42px;
	height: 42px;

	position: relative;
	z-index: 2;

	border: 0;
	border-radius: 0;

	color: #171717;
	background: transparent;
	box-shadow: none;

	transition: transform 0.2s ease;
}

.bb-support-mobile__trigger:active
	.bb-support-mobile__icon {
	transform: scale(0.92);
}

.bb-support-mobile__label {
	color: #292929;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.4;
}

.bb-support-mobile__pulse {
	width: 42px;
	height: 42px;

	position: absolute;
	top: 4px;
	left: 50%;
	z-index: 1;

	border: 2px solid rgba(255, 212, 0, 0.75);
	border-radius: 13px;

	transform: translateX(-50%);

	animation:
		bb-support-mobile-pulse 2.4s ease-out infinite;

	pointer-events: none;
}

.bb-support-mobile__tip {
	display: flex;
	align-items: center;
	justify-content: center;

	width: max-content;
	max-width: 220px;
	min-height: 38px;

	position: absolute;
	left: 50%;
	bottom: calc(100% + 11px);
	z-index: 999;

	padding: 8px 13px;

	border: 1px solid rgba(0, 0, 0, 0.07);
	border-radius: 12px;

	color: #242424;
	background: #fff;

	box-shadow:
		0 10px 30px rgba(21, 31, 45, 0.16),
		0 3px 8px rgba(21, 31, 45, 0.08);

	font-size: 11px;
	font-weight: 800;
	line-height: 1.6;

	text-align: center;
	white-space: nowrap;

	transform: translateX(-50%);

	pointer-events: none;

	animation:
		bb-support-tip-float 3s ease-in-out infinite;

	transition:
		opacity 0.25s ease,
		visibility 0.25s ease;
}

.bb-support-mobile__tip::after {
	content: "";

	width: 10px;
	height: 10px;

	position: absolute;
	left: 50%;
	bottom: -6px;

	border-right: 1px solid rgba(0, 0, 0, 0.07);
	border-bottom: 1px solid rgba(0, 0, 0, 0.07);

	background: #fff;

	transform:
		translateX(-50%)
		rotate(45deg);
}

.bb-support-mobile__tip
	[data-nesi-rotating-text] {
	display: block;

	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.bb-support-mobile__tip
	[data-nesi-rotating-text].is-changing {
	opacity: 0;
	transform: translateY(5px);
}

/* ==========================================
   Backdrop
========================================== */

.nesi-support__mobile-backdrop {
	display: none;
}

/* ==========================================
   Mobile bottom sheet
========================================== */

@media (max-width: 767px) {
	.nesi-support {
		display: block;
		width: 100%;
		height: 100%;
		position: fixed;
		inset: 0;
		z-index: 100000;

		opacity: 1;
		visibility: visible;
		transform: none;

		pointer-events: none;
	}

	.nesi-support.is-ready {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	/*
	 * دکمه شناور دسکتاپ در موبایل مخفی است.
	 */
	.nesi-support > .nesi-support__trigger {
		display: none !important;
	}

	.bb-support-mobile {
		display: flex;
	}

	/*
	 * جلوگیری از بریده‌شدن Tooltip.
	 */
	.bb-mobile-menu,
	.fix-menu-bottom,
	.fix-menu-bottom > .col-3,
	.fix-menu-bottom .fix-contact {
		overflow: visible !important;
	}

	/*
	 * پس‌زمینه تیره.
	 */
	.nesi-support__mobile-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1;

		background: rgba(8, 14, 24, 0.52);

		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);

		opacity: 0;
		visibility: hidden;

		transition:
			opacity 0.3s ease,
			visibility 0.3s ease;

		pointer-events: none;
	}

	.nesi-support.is-open
		.nesi-support__mobile-backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	/*
	 * Bottom Sheet.
	 */
	.nesi-support__panel {
		display: block;

		width: 100%;
		max-width: none;
		max-height: min(82vh, 720px);
		max-height: min(82dvh, 720px);

		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 2;

		border: 0;
		border-radius: 24px 24px 0 0;

		background: var(--nesi-surface);

		box-shadow:
			0 -15px 50px rgba(10, 20, 35, 0.2);

		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;

		opacity: 1;
		visibility: hidden;

		transform: translateY(105%);
		transform-origin: bottom center;

		transition:
			transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
			visibility 0.42s ease;

		pointer-events: auto;

		padding-bottom:
			env(safe-area-inset-bottom);
	}

	.nesi-support.is-open
		.nesi-support__panel {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.nesi-support__panel-handle {
		display: block;
		width: 44px;
		height: 5px;
		margin: 9px auto 2px;
		border-radius: 20px;
		background: #d7d9dc;
	}

	.nesi-support__panel-header {
		position: sticky;
		top: 0;
		z-index: 4;

		padding: 13px 17px 15px;

		background: rgba(255, 255, 255, 0.96);

		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
	}

	.nesi-support__panel-body {
		padding:
			14px
			14px
			calc(17px + env(safe-area-inset-bottom));
	}

	.nesi-support__intro {
		padding: 12px;
	}

	.nesi-support__intro p {
		font-size: 11px;
		line-height: 1.9;
	}

	.nesi-support__link {
		min-height: 56px;
	}

	.nesi-support__hours {
		margin-bottom: 4px;
	}

	body.nesi-support-panel-open
		.bb-support-mobile__tip {
		opacity: 0;
		visibility: hidden;
	}
}

/* ==========================================
   Very small screens
========================================== */

@media (max-width: 380px) {
	.bb-support-mobile__tip {
		max-width: 180px;
		padding: 7px 10px;
		font-size: 10px;
	}

	.nesi-support__link-content small {
		display: none;
	}

	.nesi-support__link {
		min-height: 53px;
	}
}

/* ==========================================
   Animations
========================================== */

@keyframes nesi-support-pulse {
	0% {
		opacity: 0.55;
		transform: scale(1);
	}

	65%,
	100% {
		opacity: 0;
		transform: scale(1.5);
	}
}

@keyframes nesi-support-status {
	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.45;
	}
}

@keyframes bb-support-mobile-pulse {
	0% {
		opacity: 0.7;
		transform:
			translateX(-50%)
			scale(1);
	}

	70%,
	100% {
		opacity: 0;
		transform:
			translateX(-50%)
			scale(1.55);
	}
}

@keyframes bb-support-tip-float {
	0%,
	100% {
		transform:
			translateX(-50%)
			translateY(0);
	}

	50% {
		transform:
			translateX(-50%)
			translateY(-4px);
	}
}

/* ==========================================
   Accessibility
========================================== */

.nesi-support__trigger:focus-visible,
.nesi-support__close:focus-visible,
.nesi-support__link:focus-visible,
.bb-support-mobile__trigger:focus-visible {
	outline: 2px solid #222;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.nesi-support,
	.nesi-support__panel,
	.nesi-support__trigger,
	.nesi-support__trigger-text,
	.nesi-support__trigger-pulse,
	.nesi-support__status-dot,
	.bb-support-mobile__pulse,
	.bb-support-mobile__tip,
	.bb-support-mobile__icon {
		animation: none !important;
		transition: none !important;
	}
}