/**
 * TamasBaz — پاپ‌آپ RTL، هماهنگ با متغیرهای قالب.
 * No external font/icon CDNs; optional local @font-face may be added by theme.
 */
.obs-contact-root {
	--obs-popup-primary: var(--ast-global-color-0, #2563eb);
	--obs-popup-primary-dark: var(--ast-global-color-1, #1d4ed8);
	--obs-popup-surface: var(--ast-global-color-5, #ffffff);
	--obs-popup-muted: var(--ast-global-color-3, #64748b);
	--obs-popup-text: var(--ast-global-color-2, #0f172a);
	--obs-popup-card-bg: rgba(37, 99, 235, 0.08);
	--obs-popup-badge-bg: #f1f5f9;
	--obs-popup-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
	--obs-popup-radius: 22px;
	--obs-popup-card-radius: 12px;
	--obs-popup-z: 100000;
	font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
	direction: rtl;
	text-align: right;
}

/* پوستهٔ ثابت: برچسب + دکمه؛ انیمیشن شناور روی کل بلوک */
.obs-contact-fab-shell {
	position: fixed;
	bottom: 20px;
	z-index: calc(var(--obs-popup-z) - 1);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	pointer-events: none;
	animation: obs-fab-float 3.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.obs-contact-fab-shell > * {
	pointer-events: auto;
}

.obs-contact-fab__tooltip {
	display: inline-block;
	max-width: min(220px, calc(100vw - 48px));
	padding: 7px 14px;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.35;
	color: #4a5568;
	text-align: center;
	white-space: normal;
	background: #f2f2f2;
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);

	pointer-events: none;
}

.obs-contact-fab {
	position: relative;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 20px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	background: var(--obs-popup-primary, #33acff);
	color: #ffffff;
	box-shadow: 0 5px 18px rgba(51, 172, 255, 0.38);
	transition:
		transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow 0.35s ease,
		background 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}

.obs-contact-fab:hover,
.obs-contact-fab:focus-visible {
	transform: scale(1.07);
	box-shadow: 0 8px 28px rgba(51, 172, 255, 0.48);
	outline: 2px solid rgba(255, 255, 255, 0.85);
	outline-offset: 2px;
}

.obs-contact-fab svg {
	width: 26px;
	height: 26px;
	display: block;
	flex-shrink: 0;
	color: #ffffff;
	fill: currentColor;
}

.obs-contact-fab svg path {
	fill: currentColor;
}

@keyframes obs-fab-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-7px);
	}
}

.obs-contact-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--obs-popup-z);
	background: rgba(15, 23, 42, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
	.obs-contact-backdrop {
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
	}
}

.obs-contact-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.obs-contact-modal {
	position: fixed;
	left: 50%;
	z-index: calc(var(--obs-popup-z) + 1);
	width: min(440px, calc(100vw - 24px));
	max-height: min(90vh, 640px);
	background: var(--obs-popup-surface);
	box-shadow: var(--obs-popup-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition:
		transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.28s ease;
}

@media (max-width: 479px) {
	.obs-contact-modal {
		bottom: 0;
		top: auto;
		border-radius: var(--obs-popup-radius) var(--obs-popup-radius) 0 0;
		transform: translate(-50%, 105%);
	}

	.obs-contact-backdrop.is-open .obs-contact-modal {
		transform: translate(-50%, 0);
	}
}

@media (min-width: 480px) {
	.obs-contact-modal {
		top: 50%;
		bottom: auto;
		border-radius: var(--obs-popup-radius);
		max-height: min(85vh, 640px);
		transform: translate(-50%, -48%) scale(0.96);
		opacity: 0;
	}

	.obs-contact-backdrop.is-open .obs-contact-modal {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

.obs-contact-modal__inner {
	padding: 18px 18px 22px;
	overflow-y: auto;
	flex: 1;
	overscroll-behavior: contain;
}

.obs-contact-modal__header {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	align-items: start;
	gap: 8px 12px;
	margin-bottom: 16px;
}

.obs-contact-modal__titles {
	grid-column: 1;
}

.obs-contact-modal__title {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--obs-popup-text);
	line-height: 1.45;
}

.obs-contact-modal__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: var(--obs-popup-badge-bg);
	border-radius: 999px;
	font-size: 0.78rem;
	color: var(--obs-popup-muted);
	line-height: 1.4;
}

.obs-contact-modal__badge-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--obs-popup-primary);
	flex-shrink: 0;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.obs-contact-back {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	background: transparent;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--obs-popup-muted);
	font-size: 0.75rem;
	font-family: inherit;
	border-radius: 10px;
	transition: color 0.2s ease, background 0.2s ease;
}

.obs-contact-back:hover,
.obs-contact-back:focus-visible {
	color: #ffffff !important;
	background: var(--obs-popup-primary, #2563eb);
}

.obs-contact-back__circle {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f1f5f9;
	color: var(--obs-popup-muted, #64748b);
	border: 1px solid rgba(100, 116, 139, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.obs-contact-back:hover .obs-contact-back__circle,
.obs-contact-back:focus-visible .obs-contact-back__circle {
	background: var(--obs-popup-primary, #2563eb) !important;
	color: #ffffff !important;
	border-color: transparent;
	box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.obs-contact-back__circle svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.obs-contact-back:hover .obs-contact-back__circle svg,
.obs-contact-back:focus-visible .obs-contact-back__circle svg {
	stroke: #ffffff !important;
}

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

.obs-contact-card {
	margin: 0;
	position: relative;
}

.obs-contact-card__link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	background: var(--obs-popup-card-bg);
	border-radius: var(--obs-popup-card-radius);
	text-decoration: none;
	color: inherit;
	transition: background 0.2s, transform 0.15s;
	border: 1px solid transparent;
	-webkit-tap-highlight-color: transparent;
}

.obs-contact-card__link:hover:not(.is-disabled) {
	background: rgba(37, 99, 235, 0.12);
	transform: translateY(-1px);
}

.obs-contact-card__icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(
		145deg,
		var(--obs-popup-primary) 0%,
		var(--obs-popup-primary-dark, #1d4ed8) 100%
	);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

.obs-contact-card__icon svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
	stroke: none;
}

.obs-contact-card__body {
	min-width: 0;
	flex: 1;
}

.obs-contact-card__title {
	margin: 0 0 4px;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--obs-popup-text);
	line-height: 1.4;
}

.obs-contact-card__desc {
	margin: 0;
	font-size: 0.8rem;
	color: var(--obs-popup-muted);
	line-height: 1.5;
}

.obs-contact-card.is-disabled .obs-contact-card__link {
	opacity: 0.42;
	pointer-events: none;
	cursor: not-allowed;
}

.obs-contact-card__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 12px;
	border-radius: var(--obs-popup-card-radius);
	background: rgba(255, 255, 255, 0.82);
	pointer-events: none;
}

.obs-contact-card__overlay-msg {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	color: #334155;
	line-height: 1.55;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

[hidden] {
	display: none !important;
}

body.obs-contact-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.obs-contact-fab-shell,
	.obs-contact-fab,
	.obs-contact-modal,
	.obs-contact-backdrop,
	.obs-contact-card__link {
		animation: none !important;
		transition: none !important;
	}
}
