/*!
 * Lead Tracker & Floating Contact Widget v1.5.1
 * Copyright © 2026 تری وم (trivem) — تمامی حقوق محفوظ است.
 */
/* ===========================================================
   Lead Tracker – Floating Widget & Form Styles
   =========================================================== */

.ltr-widget {
	position: fixed;
	z-index: 99990;
	font-family: inherit;
}

/* حباب‌ها همیشه ثابت و قابل‌مشاهده (بدون هاور) */
/* direction: ltr برای اینکه چیدمان فیزیکی مستقل از راست‌چین بودن قالب باشد */
.ltr-bubbles {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	direction: ltr;
}
.ltr-widget.ltr-pos-left  .ltr-bubbles { align-items: flex-start; }
.ltr-widget.ltr-pos-right .ltr-bubbles { align-items: flex-end; }

/* دکمه‌های ارتباطی */
.ltr-bubble {
	width: calc(var(--ltr-size, 60px) * .82);
	height: calc(var(--ltr-size, 60px) * .82);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
	transition: transform .2s ease;
	flex: 0 0 auto;
}
.ltr-bubble svg { width: 52%; height: 52%; }

.ltr-bubble.ltr-phone    { background: var(--ltr-color, #25D366); }
.ltr-bubble.ltr-whatsapp { background: #25D366; }
.ltr-bubble.ltr-bale     { background: #8e44ec; }

/* دکمه تماس (اصلی): بزرگ‌تر و همیشه در حال تکان خوردن */
.ltr-bubble.ltr-primary {
	width: var(--ltr-size, 60px);
	height: var(--ltr-size, 60px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.ltr-bubble.ltr-primary svg { width: 55%; height: 55%; }

/* ردیف دکمه تماس + لیبل — چیدمان فیزیکی مستقل از جهت قالب */
.ltr-phone-row {
	display: flex;
	align-items: center;
	gap: 12px;
	direction: ltr;
}
/* موقعیت راست: دکمه تماس بچسبد به راست، لیبل بعد از آن (سمت چپش) */
.ltr-widget.ltr-pos-right .ltr-phone-row { flex-direction: row-reverse; }
/* موقعیت چپ: دکمه تماس سمت چپ، لیبل بعد از آن (سمت راستش) */
.ltr-widget.ltr-pos-left  .ltr-phone-row { flex-direction: row; }

/* متن داخل لیبل دوباره راست‌چین شود (برای فارسی) */
.ltr-typing-label { direction: rtl; text-align: right; }

/* انیمیشن‌ها روی دکمه تماس */
.ltr-anim-pulse .ltr-bubble.ltr-primary { animation: ltr-pulse 2s infinite; }
.ltr-anim-shake .ltr-bubble.ltr-primary { animation: ltr-shake 2.5s infinite; }

@keyframes ltr-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); }
	70%  { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@keyframes ltr-shake {
	0%, 82%, 100% { transform: rotate(0); }
	84% { transform: rotate(-12deg); }
	86% { transform: rotate(12deg); }
	88% { transform: rotate(-8deg); }
	90% { transform: rotate(8deg); }
	92% { transform: rotate(-4deg); }
	94% { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
	.ltr-bubble.ltr-primary { animation: none !important; }
}

/* لیبل تایپی */
.ltr-typing-label {
	background: #fff;
	color: #222;
	padding: 10px 16px;
	border-radius: 30px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
	font-size: 14px;
	white-space: nowrap;
	min-width: 190px;
	max-width: 190px;
	overflow: hidden;
	text-overflow: ellipsis;
	position: relative;
}
.ltr-typing-label::after {
	content: '';
	display: inline-block;
	width: 2px;
	height: 1em;
	background: #222;
	margin-inline-start: 2px;
	vertical-align: middle;
	animation: ltr-caret .7s steps(1) infinite;
}
@keyframes ltr-caret { 50% { opacity: 0; } }

/* موبایل */
@media (max-width: 600px) {
	.ltr-typing-label {
		min-width: 140px;
		max-width: 140px;
		font-size: 12px;
		padding: 8px 12px;
	}
}

/* ===========================================================
   فرم مشاوره — همیشه و به‌صورت خودکار کل عرض کانتینر را پر می‌کند
   =========================================================== */
.ltr-form-wrap {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	flex: 1 1 auto;      /* اگر کانتینر flex بود، کشیده شود */
	align-self: stretch; /* در flex/grid کامل کشیده شود */
}
.ltr-lead-form {
	display: block;
	width: 100%;
	max-width: 100%; /* پیش‌فرض: پر کردن کل عرض کانتینر */
	margin-inline: auto;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 14px;
	padding: clamp(16px, 4%, 26px); /* پدینگ متناسب با عرض کانتینر */
	box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
	font-family: inherit;
}
.ltr-form-title {
	margin: 0 0 18px;
	font-size: clamp(17px, 4vw, 21px);
	text-align: center;
}
.ltr-field { margin-bottom: 14px; }
.ltr-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}
.ltr-req { color: #e02424; margin-inline-start: 2px; }

.ltr-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid #d5d5d5;
	border-radius: 10px;
	font-size: 16px; /* ۱۶px تا موبایل هنگام فوکوس زوم نکند */
	transition: border-color .2s, box-shadow .2s;
}
.ltr-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid #d5d5d5;
	border-radius: 10px;
	font-size: 16px;
	background: #fff;
	font-family: inherit;
	transition: border-color .2s, box-shadow .2s;
}
.ltr-field select:focus {
	outline: none;
	border-color: var(--ltr-color, #25D366);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, .15);
}
.ltr-field select.ltr-service-locked {
	background: #f3f4f6;
	color: #555;
	cursor: not-allowed;
}
.ltr-field input:focus {
	outline: none;
	border-color: var(--ltr-color, #25D366);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, .15);
}
.ltr-field input.ltr-invalid {
	border-color: #e02424;
	box-shadow: 0 0 0 3px rgba(224, 36, 36, .12);
}

.ltr-submit-btn {
	width: 100%;
	padding: 13px;
	border: none;
	border-radius: 10px;
	background: var(--ltr-color, #25D366);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity .2s;
}
.ltr-submit-btn:hover { opacity: .9; }
.ltr-submit-btn:disabled { opacity: .6; cursor: wait; }

.ltr-form-msg {
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	display: none;
}
.ltr-form-msg.ltr-ok    { display: block; background: #e7f7ec; color: #1a7a3d; }
.ltr-form-msg.ltr-error { display: block; background: #fdeaea; color: #b5322c; }

/* در صفحه‌های خیلی باریک، فرم جمع‌وجورتر شود */
@media (max-width: 360px) {
	.ltr-lead-form { border-radius: 10px; }
	.ltr-field { margin-bottom: 10px; }
	.ltr-field input, .ltr-field select, .ltr-submit-btn { padding: 10px 12px; }
}

/* ===========================================================
   پاپ‌آپ موفقیت (Modal)
   =========================================================== */
.ltr-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
	box-sizing: border-box;
}
.ltr-popup-overlay.ltr-open { opacity: 1; visibility: visible; }

.ltr-popup-box {
	position: relative;
	width: 100%;
	max-width: 400px;
	background: #fff;
	border-radius: 16px;
	padding: 32px 24px 24px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	transform: translateY(16px) scale(.96);
	transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
	box-sizing: border-box;
	font-family: inherit;
}
.ltr-popup-overlay.ltr-open .ltr-popup-box { transform: translateY(0) scale(1); }

.ltr-popup-close {
	position: absolute;
	top: 10px;
	inset-inline-end: 14px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #999;
	cursor: pointer;
	padding: 0;
}
.ltr-popup-close:hover { color: #333; }

.ltr-popup-icon {
	width: 68px;
	height: 68px;
	margin: 0 auto 16px;
}
.ltr-popup-icon svg { width: 100%; height: 100%; }
.ltr-popup-icon circle { stroke: var(--ltr-color, #25D366); stroke-width: 2; }
.ltr-popup-icon path {
	stroke: var(--ltr-color, #25D366);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: ltr-check .4s .2s ease forwards;
}
@keyframes ltr-check { to { stroke-dashoffset: 0; } }

.ltr-popup-title {
	margin: 0 0 10px;
	font-size: 20px;
	color: #1a1a1a;
}
.ltr-popup-text {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.8;
	color: #555;
}
.ltr-popup-text p { margin: 0 0 8px; }
.ltr-popup-ok {
	min-width: 140px;
	padding: 11px 24px;
	border: none;
	border-radius: 10px;
	background: var(--ltr-color, #25D366);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}
.ltr-popup-ok:hover { opacity: .9; }

@media (max-width: 480px) {
	.ltr-popup-box { padding: 26px 18px 20px; border-radius: 14px; }
	.ltr-popup-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.ltr-popup-icon path { animation: none; stroke-dashoffset: 0; }
	.ltr-popup-box { transition: none; }
}
