/**
 * NexaShop Floating Contact Us Widget Styles (ویجت شناور تماس با ما)
 * Matches Desktop (media_1790265377408.png & media_1790265377411.png) and Mobile Bottom Sheet (media_1790265377421.png)
 */

.nexashop-floating-contact-root {
	--ns-fc-primary: #2722c7;
	--ns-fc-btn-icon: #ffffff;
	--ns-fc-btn-border: #ffffff;
	--ns-fc-circle-size: 62px;
	--ns-fc-badge-bg: #ffffff;
	--ns-fc-badge-color: #1e293b;
	--ns-fc-card-bg: #ffffff;
	--ns-fc-title-color: #1e293b;
	--ns-fc-subtitle-color: #64748b;
	--ns-fc-item-bg: #ffffff;
	--ns-fc-item-border: #e2e8f0;
	--ns-fc-item-color: #1e293b;
	--ns-fc-bottom-desk: 28px;
	--ns-fc-side-desk: 28px;
	--ns-fc-bottom-mob: 82px;
	--ns-fc-side-mob: 18px;
	--ns-fc-title-size: 16px;
	--ns-fc-subtitle-size: 12px;
	--ns-fc-item-size: 14px;
	--ns-fc-badge-size: 12px;

	position: fixed;
	bottom: var(--ns-fc-bottom-desk, 28px);
	z-index: 99998;
	direction: rtl;
	font-family: inherit;
	pointer-events: none;
}

/* Desktop Position: Left (Default matching reference image) or Right */
.nexashop-floating-contact-root.ns-fc-desk-pos-left {
	left: var(--ns-fc-side-desk, 28px);
	right: auto;
}

.nexashop-floating-contact-root.ns-fc-desk-pos-right {
	right: var(--ns-fc-side-desk, 28px);
	left: auto;
}

/* Device Visibility Modifiers */
@media (min-width: 769px) {
	.nexashop-floating-contact-root.ns-fc-hide-desktop {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.nexashop-floating-contact-root {
		bottom: max(var(--ns-fc-bottom-mob, 82px), calc(var(--ns-mobile-bottom-nav-offset, 0px) + 12px));
		transition: bottom 0.3s ease, transform 0.35s ease, opacity 0.3s ease;
	}

	body.ns-hamburger-open .nexashop-floating-contact-root {
		transform: translateY(130%);
		opacity: 0;
		pointer-events: none;
	}

	.nexashop-floating-contact-root.ns-fc-mob-pos-left {
		left: var(--ns-fc-side-mob, 18px);
		right: auto;
	}

	.nexashop-floating-contact-root.ns-fc-mob-pos-right {
		right: var(--ns-fc-side-mob, 18px);
		left: auto;
	}

	.nexashop-floating-contact-root.ns-fc-hide-mobile {
		display: none !important;
	}
}

/* =========================================================================
   1. FLOATING TRIGGER BUTTON + PILL BADGE (media_1790265377408.png)
   ========================================================================= */
.ns-fc-trigger-wrap {
	pointer-events: auto;
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	cursor: pointer;
	outline: none !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ns-fc-trigger-wrap:hover {
	transform: translateY(-3px);
}

.ns-fc-circle-btn {
	position: relative;
	width: var(--ns-fc-circle-size, 62px);
	height: var(--ns-fc-circle-size, 62px);
	border-radius: 50%;
	background: var(--ns-fc-primary, #2722c7);
	color: var(--ns-fc-btn-icon, #ffffff);
	border: 3.5px solid var(--ns-fc-btn-border, #ffffff);
	box-shadow: 0 10px 28px rgba(39, 34, 199, 0.36), 0 4px 12px rgba(15, 23, 42, 0.14);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	z-index: 2;
}

.ns-fc-icon-open,
.ns-fc-icon-close {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.26s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ns-fc-icon-open svg,
.ns-fc-icon-open i,
.ns-fc-icon-open img {
	width: 30px;
	height: 30px;
	font-size: 28px;
	object-fit: contain;
}

.ns-fc-icon-close {
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

.ns-fc-icon-close svg {
	width: 26px;
	height: 26px;
}

/* White Pill Badge "تماس با ما" underneath the circle */
.ns-fc-pill-badge {
	position: relative;
	z-index: 3;
	margin-top: -10px;
	background: var(--ns-fc-badge-bg, #ffffff);
	color: var(--ns-fc-badge-color, #1e293b);
	font-size: var(--ns-fc-badge-size, 12px);
	font-weight: 800;
	line-height: 1.3;
	padding: 3px 12px 4px;
	border-radius: 999px;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
	border: 1px solid rgba(226, 232, 240, 0.85);
	transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease;
}

/* Morph Floating Button when Open (Matches bottom of media_1790265377411.png) */
.nexashop-floating-contact-root.is-open .ns-fc-icon-open {
	opacity: 0;
	transform: rotate(90deg) scale(0.5);
}

.nexashop-floating-contact-root.is-open .ns-fc-icon-close {
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

.nexashop-floating-contact-root.is-open .ns-fc-pill-badge {
	opacity: 0;
	transform: translateY(-6px) scale(0.85);
	pointer-events: none;
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	margin-top: 0;
	border-width: 0;
	overflow: hidden;
}

/* =========================================================================
   2. LEVITATION & PULSE ANIMATIONS (انیمیشن شناور و اوج گرفتن)
   ========================================================================= */
.ns-fc-pulse-ring {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid var(--ns-fc-primary, #2722c7);
	opacity: 0;
	pointer-events: none;
}

/* Levitate + Pulse (Default Recommended) */
.ns-fc-anim-levitate_pulse:not(.is-open) .ns-fc-trigger-wrap {
	animation: nsFcLevitate 3.2s ease-in-out infinite;
}

.ns-fc-anim-levitate_pulse:not(.is-open) .ns-fc-pulse-ring {
	animation: nsFcPulseWave 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Levitate Only */
.ns-fc-anim-levitate:not(.is-open) .ns-fc-trigger-wrap {
	animation: nsFcLevitate 3.2s ease-in-out infinite;
}

/* Pulse Wave Only */
.ns-fc-anim-pulse_wave:not(.is-open) .ns-fc-pulse-ring {
	animation: nsFcPulseWave 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Soft Bounce */
.ns-fc-anim-bounce:not(.is-open) .ns-fc-trigger-wrap {
	animation: nsFcBounce 2.8s infinite;
}

/* Attention Wiggle */
.ns-fc-anim-wiggle:not(.is-open) .ns-fc-circle-btn {
	animation: nsFcWiggle 3.6s ease-in-out infinite;
}

@keyframes nsFcLevitate {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-9px);
	}
}

@keyframes nsFcPulseWave {
	0% {
		transform: scale(0.96);
		opacity: 0.65;
	}
	75% {
		transform: scale(1.38);
		opacity: 0;
	}
	100% {
		transform: scale(1.38);
		opacity: 0;
	}
}

@keyframes nsFcBounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-11px);
	}
	60% {
		transform: translateY(-5px);
	}
}

@keyframes nsFcWiggle {
	0%, 80%, 100% {
		transform: rotate(0deg);
	}
	84% {
		transform: rotate(-12deg) scale(1.04);
	}
	88% {
		transform: rotate(12deg) scale(1.04);
	}
	92% {
		transform: rotate(-8deg);
	}
	96% {
		transform: rotate(8deg);
	}
}

/* =========================================================================
   3. DESKTOP POPUP DIALOG (media_1790265377411.png)
   ========================================================================= */
.ns-fc-backdrop {
	display: none;
}

.ns-fc-dialog {
	pointer-events: none;
	position: absolute;
	bottom: calc(100% + 14px);
	width: 358px;
	max-width: calc(100vw - 32px);
	background: var(--ns-fc-card-bg, #ffffff);
	border-radius: 24px;
	padding: 20px 18px 18px;
	box-shadow: 0 22px 55px rgba(15, 23, 42, 0.16), 0 4px 16px rgba(15, 23, 42, 0.06);
	border: 1px solid rgba(226, 232, 240, 0.85);
	opacity: 0;
	visibility: hidden;
	transform: translateY(18px) scale(0.96);
	transform-origin: bottom left;
	transition: opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
	            transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
	            visibility 0.28s;
	z-index: 10;
}

.ns-fc-desk-pos-left .ns-fc-dialog {
	left: 0;
	right: auto;
	transform-origin: bottom left;
}

.ns-fc-desk-pos-right .ns-fc-dialog {
	right: 0;
	left: auto;
	transform-origin: bottom right;
}

.nexashop-floating-contact-root.is-open .ns-fc-dialog {
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

/* Dialog Header */
.ns-fc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.ns-fc-header-right {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ns-fc-header-avatar {
	width: 48px;
	height: 48px;
	min-width: 48px;
	border-radius: 50%;
	background: var(--ns-fc-primary, #2722c7);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(39, 34, 199, 0.25);
}

.ns-fc-header-avatar svg,
.ns-fc-header-avatar i,
.ns-fc-header-avatar img {
	width: 25px;
	height: 25px;
	font-size: 24px;
	object-fit: contain;
}

.ns-fc-header-texts {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ns-fc-header-title {
	margin: 0 !important;
	font-size: var(--ns-fc-title-size, 16px);
	font-weight: 800;
	color: var(--ns-fc-title-color, #1e293b);
	line-height: 1.35;
}

.ns-fc-header-subtitle {
	margin: 0 !important;
	font-size: var(--ns-fc-subtitle-size, 12px);
	font-weight: 500;
	color: var(--ns-fc-subtitle-color, #64748b);
	line-height: 1.45;
}

/* Top-Left Circular Close Button (Shown in Header on both Desktop & Mobile) */
.nexashop-floating-contact-root .ns-fc-mobile-close-btn {
	display: inline-flex !important;
	width: 38px !important;
	height: 38px !important;
	min-width: 38px !important;
	max-width: 38px !important;
	min-height: 38px !important;
	max-height: 38px !important;
	aspect-ratio: 1 / 1 !important;
	border-radius: 50% !important;
	background: #f1f5f9 !important;
	color: #475569 !important;
	border: 1px solid #e2e8f0 !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	cursor: pointer !important;
	transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease !important;
}

.nexashop-floating-contact-root .ns-fc-mobile-close-btn svg {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	display: block !important;
	margin: 0 !important;
	stroke: currentColor !important;
	pointer-events: none;
}

.nexashop-floating-contact-root .ns-fc-mobile-close-btn:hover,
.nexashop-floating-contact-root .ns-fc-mobile-close-btn:focus-visible {
	background: #fee2e2 !important;
	color: #ef4444 !important;
	border-color: #fecaca !important;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.18) !important;
	transform: rotate(90deg) scale(1.05) !important;
}

.nexashop-floating-contact-root.is-open .ns-fc-trigger-wrap:hover .ns-fc-circle-btn {
	background: #ef4444 !important;
	color: #ffffff !important;
	box-shadow: 0 10px 28px rgba(239, 68, 68, 0.38), 0 4px 12px rgba(15, 23, 42, 0.14) !important;
}

/* =========================================================================
   4. CONTACT / SOCIAL ITEMS LIST (media_1790265377411.png & media_1790265377421.png)
   ========================================================================= */
.ns-fc-items-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 62vh;
	overflow-y: auto;
	padding-left: 2px;
}

.ns-fc-items-list::-webkit-scrollbar {
	width: 4px;
}

.ns-fc-items-list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 99px;
}

.ns-fc-item-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--ns-fc-item-bg, #ffffff);
	border: 1.5px solid var(--ns-fc-item-border, #e2e8f0);
	border-radius: 16px;
	padding: 9px 11px 9px 14px;
	text-decoration: none !important;
	color: var(--ns-fc-item-color, #1e293b) !important;
	transition: all 0.22s ease;
}

.ns-fc-item-card:hover {
	border-color: #cbd5e1;
	background: #f8fafc;
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.ns-fc-item-right {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ns-fc-item-icon-box {
	width: 42px;
	height: 42px;
	min-width: 42px;
	border-radius: 11px;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.ns-fc-item-icon-box svg,
.ns-fc-item-icon-box i,
.ns-fc-item-icon-box img {
	width: 22px;
	height: 22px;
	font-size: 21px;
	color: #ffffff;
	object-fit: contain;
}

.ns-fc-item-title {
	font-size: var(--ns-fc-item-size, 14px);
	font-weight: 700;
	color: var(--ns-fc-item-color, #1e293b);
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ns-fc-item-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #334155;
	transition: transform 0.22s ease, color 0.22s ease;
}

.ns-fc-item-arrow svg {
	width: 17px;
	height: 17px;
}

.ns-fc-item-card:hover .ns-fc-item-arrow {
	transform: translateX(-3px);
	color: var(--ns-fc-primary, #2722c7);
}

/* =========================================================================
   5. MOBILE SLIDING BOTTOM SHEET (<= 768px) — Matches media_1790265377421.png
   ========================================================================= */
@media (max-width: 768px) {
	.ns-fc-circle-btn {
		width: var(--ns-fc-circle-size, 56px);
		height: var(--ns-fc-circle-size, 56px);
	}

	.ns-fc-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.55);
		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		z-index: 999990;
	}

	.nexashop-floating-contact-root.is-open .ns-fc-backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.ns-fc-dialog {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		border-radius: 26px 26px 0 0 !important;
		padding: 22px 18px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
		border: none !important;
		box-shadow: 0 -14px 42px rgba(15, 23, 42, 0.24) !important;
		transform: translateY(104%) !important;
		opacity: 1 !important;
		visibility: hidden;
		transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.34s !important;
		z-index: 999995 !important;
	}

	.nexashop-floating-contact-root.is-open .ns-fc-dialog {
		visibility: visible !important;
		transform: translateY(0) !important;
	}

	.ns-fc-mobile-close-btn {
		display: inline-flex;
	}

	.ns-fc-items-list {
		max-height: 66dvh;
	}
}
