/* Contact Expert Widget - Template 1 (Glass Carousel, powered by Swiper Element) */

.cew-carousel {
	--cew-primary: #1a1a2e;
	--cew-accent: #25d366;
	--cew-text: #ffffff;
	--cew-glass-opacity: 0.55;

	position: relative;
	width: 100%;
	max-width: 340px;
	aspect-ratio: 3 / 4;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	background: var(--cew-primary);
	font-family: inherit;

	/* رنگ‌بندی داخلی Swiper (pagination) از رنگ‌های خود ویجت خوانده می‌شود */
	--swiper-theme-color: #ffffff;
	--swiper-pagination-color: #ffffff;
	--swiper-pagination-bullet-inactive-color: #ffffff;
	--swiper-pagination-bullet-inactive-opacity: 0.4;
	--swiper-pagination-bottom: 16px;
}

.cew-swiper {
	width: 100%;
	height: 100%;
	display: block;
}

/* محدود به همین ویجت تا روی اسلایدرهای دیگر سایت اثر نگذارد */
.cew-carousel swiper-slide {
	height: 100%;
}

.cew-slide-bg {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #222;
	padding: 8px;
	box-sizing: border-box;
}

.cew-slide-card {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	overflow: hidden;
}

.cew-slide-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 45%, transparent 70%);
	pointer-events: none;
}

.cew-slide-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 16px 16px 28px;
	color: var(--cew-text);
	text-align: center;
}

.cew-position {
	display: inline-block;
	font-size: 12px;
	opacity: 0.85;
	margin-bottom: 4px;
}

.cew-name {
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cew-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.cew-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, var(--cew-glass-opacity, 0.4));
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	text-decoration: none;
	border-radius: 8px;
	transition: transform 0.2s ease, background 0.2s ease;
}

.cew-btn:hover {
	transform: translateY(-2px);
}

.cew-btn-call {
	flex: 1 1 auto;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cew-text);
}

.cew-btn-whatsapp {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	color: var(--cew-accent);
}

.cew-icon {
	display: block;
}

/* ==========================
   حالت ادیتور المنتور: در نبود جاوااسکریپت (پیش از هیدریت شدن Swiper) هم قابل مشاهده بماند
   ========================== */
.cew-swiper:not(:defined) swiper-slide {
	display: none;
}
.cew-swiper:not(:defined) swiper-slide:first-child {
	display: block;
}

@media (max-width: 480px) {
	.cew-carousel {
		max-width: 100%;
	}
}

/* ==========================
   ویجت شناور (بدون اسلایدر)
   ========================== */
.cew-floating {
	--cew-primary: #1a1a2e;
	--cew-accent: #25d366;
	--cew-text: #ffffff;

	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
}

.cew-floating-bottom-left {
	left: 20px;
}

.cew-floating-bottom-right {
	right: 20px;
}

.cew-floating-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: var(--cew-accent);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.cew-floating-toggle:hover {
	transform: scale(1.05);
}

.cew-floating-panel {
	position: absolute;
	bottom: 68px;
	width: 260px;
	max-width: calc(100vw - 40px);
	background: var(--cew-primary);
	color: var(--cew-text);
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cew-floating-bottom-left .cew-floating-panel {
	left: 0;
}

.cew-floating-bottom-right .cew-floating-panel {
	right: 0;
}

.cew-floating-expert {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
}

.cew-floating-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.cew-floating-info {
	flex: 1 1 auto;
	min-width: 0;
}

.cew-floating-name {
	display: block;
	font-size: 13px;
	font-weight: 700;
}

.cew-floating-position {
	display: block;
	font-size: 11px;
	opacity: 0.75;
	margin-bottom: 4px;
}

.cew-floating-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.cew-floating-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cew-social-color, rgba(255, 255, 255, 0.12));
	color: #ffffff;
	text-decoration: none;
	transition: transform 0.2s ease, filter 0.2s ease;
}

.cew-floating-icon:hover {
	filter: brightness(1.1);
	transform: translateY(-2px);
	color: #ffffff;
}


/* ==========================
   تمپلیت ۲ - کارت کارشناس (تصویر بالا + دکمه‌های بزرگ شبکه‌های اجتماعی)
   ========================== */
.cew2 {
	--cew-primary: #0d4a9e;
	width: 100%;
	max-width: 300px;
	font-family: inherit;
	--swiper-pagination-color: var(--cew-primary);
	--swiper-pagination-bullet-inactive-color: var(--cew-primary);
	--swiper-pagination-bullet-inactive-opacity: 0.25;
	--swiper-pagination-bottom: 0px;
}

.cew2-swiper {
	display: block;
	width: 100%;
}

.cew2 swiper-slide {
	height: auto;
	padding-bottom: 30px;
	box-sizing: border-box;
}

.cew2-card {
	background: #fff;
	border-radius: 20px;
	padding: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	text-align: center;
	box-sizing: border-box;
}

.cew2-photo {
	aspect-ratio: 1 / 1;
	border-radius: 16px;
	background: var(--cew-primary);
	overflow: hidden;
	margin-bottom: 12px;
}

.cew2-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cew2-name {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	color: var(--cew-primary);
	line-height: 1.5;
}

.cew2-position {
	display: block;
	font-size: 13px;
	color: #555;
	margin-bottom: 12px;
}

.cew2-phone {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--cew-primary);
	color: #fff;
	text-decoration: none;
	border-radius: 10px;
	padding: 12px;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: 1px;
	margin-bottom: 10px;
	transition: filter 0.2s ease;
}

.cew2-phone:hover {
	filter: brightness(1.12);
	color: #fff;
}

.cew2-phone svg {
	width: 20px;
	height: 20px;
}

.cew2-social {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.cew2-social-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 8px;
	border: 1.5px solid var(--cew-social-color);
	border-radius: 10px;
	color: var(--cew-social-color);
	background: #fff;
	text-decoration: none;
	font-size: 15px;
	font-weight: 700;
	transition: background 0.2s ease, color 0.2s ease;
}

.cew2-social-btn svg {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
}

.cew2-social-btn:hover {
	background: var(--cew-social-color);
	color: #fff;
}

.cew2-social-btn:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

.cew2-swiper:not(:defined) swiper-slide { display: none; }
.cew2-swiper:not(:defined) swiper-slide:first-child { display: block; }

/* --- تمپلیت ۲: قفل‌کردن رنگ‌ها تا استایل تم/المنتور روی لینک‌ها و متن‌ها اثر نگذارد --- */
.cew2 a.cew2-social-btn,
.cew2 a.cew2-social-btn:link,
.cew2 a.cew2-social-btn:visited,
.cew2 a.cew2-social-btn:focus {
	color: var(--cew-social-color) !important;
	background: #fff !important;
	border: 1.5px solid var(--cew-social-color) !important;
	text-decoration: none !important;
	box-shadow: none;
}
.cew2 a.cew2-social-btn:hover,
.cew2 a.cew2-social-btn:active {
	color: #fff !important;
	background: var(--cew-social-color) !important;
}
.cew2 a.cew2-social-btn span,
.cew2 a.cew2-social-btn svg {
	color: inherit !important;
	fill: none;
}
.cew2 a.cew2-social-btn span {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}
.cew2 a.cew2-phone,
.cew2 a.cew2-phone:link,
.cew2 a.cew2-phone:visited,
.cew2 a.cew2-phone:hover,
.cew2 a.cew2-phone:focus {
	color: #fff !important;
	background: var(--cew-primary) !important;
	text-decoration: none !important;
}
.cew2 a.cew2-phone span,
.cew2 a.cew2-phone svg {
	color: #fff !important;
}
.cew2 h3.cew2-name {
	color: var(--cew-primary) !important;
	margin: 0 0 2px !important;
	padding: 0;
}
.cew2 .cew2-position {
	color: #555 !important;
}
.cew2 .cew2-card {
	text-align: center;
}
.cew2 .cew2-photo img {
	max-width: none;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 0;
}

/* ==========================
   تمپلیت ۳ - کارت مشاور (عکس بزرگ + ردیف تلفن‌ها + آیکون‌های شبکه)
   ========================== */
.cew3 {
	--cew-primary: #0d4a9e;
	width: 100%;
	max-width: 300px;
	font-family: inherit;
	--swiper-pagination-color: var(--cew-primary);
	--swiper-pagination-bullet-inactive-color: var(--cew-primary);
	--swiper-pagination-bullet-inactive-opacity: 0.25;
	--swiper-pagination-bottom: 0px;
}
.cew3-swiper { display: block; width: 100%; }
.cew3 swiper-slide { height: auto; padding-bottom: 30px; box-sizing: border-box; }
.cew3-card {
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid #e6eaf2;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.cew3-photo {
	position: relative;
	aspect-ratio: 4 / 5;
	background: linear-gradient(180deg, #dbe6ff 0%, #b9ccf7 100%);
	overflow: hidden;
}
.cew3 .cew3-photo img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	max-width: none; margin: 0; border-radius: 0;
	object-fit: cover; object-position: top center;
}
.cew3-photo::after {
	content: "";
	position: absolute; inset: auto 0 0 0; height: 40%;
	background: linear-gradient(180deg, transparent, rgba(10, 30, 70, 0.75));
}
.cew3 h3.cew3-name {
	position: absolute; z-index: 2;
	right: 14px; bottom: 12px; left: 14px;
	margin: 0 !important; padding: 0;
	color: #fff !important;
	font-size: 17px; font-weight: 800; line-height: 1.5;
	text-align: right;
}
.cew3-online {
	position: absolute; z-index: 2; top: 12px; right: 12px;
	display: inline-flex; align-items: center; gap: 6px;
	background: #fff; color: #333 !important;
	border-radius: 20px; padding: 4px 10px;
	font-size: 12px; font-weight: 600;
}
.cew3-online i {
	width: 8px; height: 8px; border-radius: 50%;
	background: #22c55e; display: inline-block;
}
.cew3-body { padding: 12px; }
.cew3 .cew3-position {
	display: block; text-align: center;
	font-size: 12px; color: #666 !important; margin-bottom: 10px;
}
.cew3 a.cew3-row,
.cew3 a.cew3-row:link,
.cew3 a.cew3-row:visited,
.cew3 a.cew3-row:hover,
.cew3 a.cew3-row:focus {
	display: flex; align-items: center; gap: 10px;
	background: #f4f6fa !important;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	color: #1f2937 !important;
	text-decoration: none !important;
}
.cew3 a.cew3-row svg { width: 18px; height: 18px; color: var(--cew-primary) !important; flex: 0 0 auto; }
.cew3 a.cew3-row .cew3-label { font-size: 12px; color: #888 !important; margin-inline-start: 2px; }
.cew3 a.cew3-row .cew3-number {
	margin-inline-start: auto;
	font-size: 15px; font-weight: 800; color: #1f2937 !important;
	letter-spacing: 0.5px;
}
.cew3-icons {
	display: flex; justify-content: space-between; gap: 6px;
	margin-top: 4px;
}
.cew3 a.cew3-icon,
.cew3 a.cew3-icon:link,
.cew3 a.cew3-icon:visited,
.cew3 a.cew3-icon:focus {
	flex: 1 1 0;
	height: 38px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 10px;
	background: color-mix(in srgb, var(--cew-social-color) 13%, #fff) !important;
	color: var(--cew-social-color) !important;
	text-decoration: none !important;
	transition: transform 0.2s ease, background 0.2s ease;
}
.cew3 a.cew3-icon:hover {
	background: var(--cew-social-color) !important;
	color: #fff !important;
	transform: translateY(-2px);
}
.cew3 a.cew3-icon svg { width: 20px; height: 20px; color: inherit !important; }
.cew3-swiper:not(:defined) swiper-slide { display: none; }
.cew3-swiper:not(:defined) swiper-slide:first-child { display: block; }

/* ==========================
   تعداد اسلاید همزمان (ریسپانسیو)
   مقدار هر دستگاه از اتریبیوت style ویجت خوانده می‌شود:
   --cew-spv-m (موبایل ≤۷۶۷) / --cew-spv-t (تبلت ۷۶۸–۱۰۲۴) / --cew-spv-d (دسکتاپ ≥۱۰۲۵)
   عرض ظرف = (عرض یک کارت × تعداد) + فاصله‌ها، تا هر کارت همان اندازه‌ی حالت تک‌اسلایدی بماند.
   ========================== */
.cew-carousel,
.cew2,
.cew3 {
	--cew-spv: var(--cew-spv-m, 1);
	--cew-gap: 16px;
}
@media (min-width: 768px) {
	.cew-carousel,
	.cew2,
	.cew3 {
		--cew-spv: var(--cew-spv-t, 1);
	}
}
@media (min-width: 1025px) {
	.cew-carousel,
	.cew2,
	.cew3 {
		--cew-spv: var(--cew-spv-d, 1);
	}
}

.cew-carousel.cew-multi {
	max-width: calc(340px * var(--cew-spv) + var(--cew-gap) * (var(--cew-spv) - 1));
}
.cew2.cew-multi,
.cew3.cew-multi {
	max-width: calc(300px * var(--cew-spv) + var(--cew-gap) * (var(--cew-spv) - 1));
}

/* تمپلیت ۱ در حالت چنداسلایدی: ظاهر کارت از ظرف به هر اسلاید منتقل می‌شود */
.cew-carousel.cew-multi {
	aspect-ratio: auto;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
}
.cew-carousel.cew-multi .cew-swiper {
	height: auto;
}
.cew-carousel.cew-multi .cew-swiper::part(wrapper) {
	height: auto;
}
.cew-carousel.cew-multi swiper-slide {
	height: auto;
	border-radius: 20px;
	overflow: hidden;
	background: var(--cew-primary);
}
.cew-carousel.cew-multi .cew-slide-bg {
	height: auto;
	aspect-ratio: 3 / 4;
}
@media (max-width: 480px) {
	.cew-carousel.cew-multi,
	.cew2.cew-multi,
	.cew3.cew-multi {
		max-width: 100%;
	}
}

/* ==========================
   آیکون شبکه‌ها: پیش‌فرض (SVG داخلی) / عکس آپلودی / آیکون کتابخانه‌ی المنتور
   ========================== */
.cew-ch-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	line-height: 1;
	flex: 0 0 auto;
}
.cew-ch-icon svg {
	width: 100%;
	height: 100%;
}
.cew-ch-icon i {
	font-size: 20px;
	line-height: 1;
	color: inherit;
}
.cew-ch-icon .e-font-icon-svg,
.cew-ch-icon-custom svg {
	fill: currentColor;
}
.cew-ch-icon img.cew-icon-img,
.cew-ch-icon img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border-radius: 4px;
	object-fit: contain;
	box-shadow: none !important;
}
.cew2 a.cew2-social-btn .cew-ch-icon svg,
.cew3 a.cew3-icon .cew-ch-icon svg {
	width: 100%;
	height: 100%;
}
/* اندازه‌ی آیکون در هر تمپلیت (همان اندازه‌ی آیکون‌های قبلی) */
.cew2 a.cew2-social-btn .cew-ch-icon { width: 24px; height: 24px; font-size: 24px; line-height: 1; }
.cew2 a.cew2-social-btn .cew-ch-icon i { font-size: 24px; }
.cew3 a.cew3-row .cew-ch-icon,
.cew2 a.cew2-phone .cew-ch-icon { width: 18px; height: 18px; }
.cew3 a.cew3-row .cew-ch-icon svg { width: 100%; height: 100%; }
.cew-floating-icon .cew-ch-icon { width: 16px; height: 16px; }
.cew-floating-icon .cew-ch-icon i { font-size: 16px; }
/* آیکون‌های کتابخانه‌ی المنتور (فونت‌آیکون یا SVG) رنگ دکمه را بگیرند؛ آیکون‌های پیش‌فرض خطی دست نمی‌خورند */
.cew-ch-icon.cew-ch-icon-custom svg { fill: currentColor !important; }
