/**
 * زر الاتصال + لوحة التواصل.
 * خصائص منطقية (inline-start/end) لتعمل في RTL و LTR بلا ملف منفصل.
 */

.pm-call-btn,
.pm-call-fab,
.pm-call {
	--pmc-blue: #0088ff;
	--pmc-navy: #022554;
	--pmc-ink: #10233d;
	--pmc-muted: #6b7c93;
	--pmc-line: #e3e9f2;
	--pmc-soft: #f5f8fc;
	--pmc-green: #25d366;
}

/* ------------------------------------------------------------------ */
/* زر الهيدر                                                           */
/* ------------------------------------------------------------------ */

.pm-call-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 18px 8px 14px;
	font: inherit;
	line-height: 1.3;
	color: #fff;
	background: var(--pmc-blue);
	border: 0;
	border-radius: 100px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 136, 255, .3);
	transition: background .2s, box-shadow .2s, transform .12s;
}

.pm-call-btn:hover {
	background: var(--pmc-navy);
	box-shadow: 0 8px 22px rgba(2, 37, 84, .28);
}

.pm-call-btn:active { transform: translateY(1px); }

.pm-call-btn:focus-visible {
	outline: 3px solid rgba(0, 136, 255, .45);
	outline-offset: 2px;
}

.pm-call-btn--ghost {
	color: var(--pmc-navy);
	background: var(--pmc-soft);
	border: 1px solid var(--pmc-line);
	box-shadow: none;
}

.pm-call-btn--ghost:hover {
	color: #fff;
	background: var(--pmc-blue);
	border-color: var(--pmc-blue);
}

.pm-call-btn-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	background: rgba(255, 255, 255, .2);
	border-radius: 100px;
}

.pm-call-btn--ghost .pm-call-btn-ico {
	background: rgba(0, 136, 255, .12);
	color: var(--pmc-blue);
}

.pm-call-btn--ghost:hover .pm-call-btn-ico {
	background: rgba(255, 255, 255, .2);
	color: #fff;
}

.pm-call-btn-ico svg { width: 17px; height: 17px; }

.pm-call-btn-txt {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: initial;
}

.pm-call-btn-label {
	font-size: 12px;
	font-weight: 500;
	opacity: .85;
}

.pm-call-btn-num {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .3px;
	unicode-bidi: isolate;
}

/* على الشاشات الضيقة نكتفي بالأيقونة كي لا يتكدّس الهيدر */
@media (max-width: 1200px) {
	.pm-call-btn { padding: 8px; gap: 0; }
	.pm-call-btn-txt { display: none; }
}

/* ------------------------------------------------------------------ */
/* الزر العائم (فوق زر الواتساب)                                       */
/* ------------------------------------------------------------------ */

/* الجهة فيزيائية لا منطقية: ويدجت الواتساب وزر "العودة للأعلى" في القالب
   يستعملان left/right مباشرة، فلو استخدمنا inset-inline-start هنا لانقلب
   الزر للجهة المقابلة في الصفحات العربية وابتعد عن عمود أزرار التواصل. */
.pm-call-fab {
	position: fixed;
	inset-block-end: var(--pmc-bottom, 96px);
	z-index: 100000;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 20px 0 6px;
	font: inherit;
	color: #fff;
	background: var(--pmc-blue);
	border: 0;
	border-radius: 100px;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(0, 136, 255, .45), 0 2px 8px rgba(2, 37, 84, .18);
	transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), background .2s, box-shadow .2s;
}

.pm-call-fab--left  { left: var(--pmc-side, 24px); right: auto; }
.pm-call-fab--right { right: var(--pmc-side, 24px); left: auto; }

/* الحشو غير المتماثل يتبع اتجاه الصفحة: الأيقونة دائماً في بداية السطر */
.pm-call-fab:dir(ltr) { padding: 0 20px 0 6px; }
.pm-call-fab:dir(rtl) { padding: 0 6px 0 20px; }

.pm-call-fab:hover {
	transform: translateY(-2px);
	background: var(--pmc-navy);
	box-shadow: 0 14px 30px rgba(2, 37, 84, .35);
}

.pm-call-fab:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.pm-call-fab-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	background: rgba(255, 255, 255, .22);
	border-radius: 100px;
}

.pm-call-fab-ico svg { width: 20px; height: 20px; }

.pm-call-fab-label {
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* نبضة خفيفة تلفت الانتباه للزر دون إزعاج */
.pm-call-fab::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--pmc-blue);
	opacity: .5;
	animation: pmCallPulse 2.8s cubic-bezier(.4, 0, .6, 1) infinite;
	z-index: -1;
}

@keyframes pmCallPulse {
	0%   { transform: scale(1); opacity: .45; }
	70%  { transform: scale(1.25); opacity: 0; }
	100% { transform: scale(1.25); opacity: 0; }
}

@media (max-width: 768px) {
	.pm-call-fab {
		height: 48px;
		--pmc-side: 16px;
	}
	.pm-call-fab:dir(ltr) { padding: 0 18px 0 5px; }
	.pm-call-fab:dir(rtl) { padding: 0 5px 0 18px; }
	.pm-call-fab-ico { width: 38px; height: 38px; flex-basis: 38px; }
	.pm-call-fab-ico svg { width: 18px; height: 18px; }
	.pm-call-fab-label { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.pm-call-fab::before { animation: none; opacity: 0; }
}

/* ------------------------------------------------------------------ */
/* اللوحة                                                              */
/* ------------------------------------------------------------------ */

.pm-call[hidden] { display: none; }

/* لا نعتمد على تصفير القالب: العناصر بعرض 100% مع حشو وحدود تتجاوز
   حاويتها إن كان box-sizing موروثاً بـ content-box، فتظهر تمرير أفقي. */
.pm-call *,
.pm-call *::before,
.pm-call *::after {
	box-sizing: border-box;
}

.pm-call {
	position: fixed;
	inset: 0;
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pm-call-overlay {
	position: absolute;
	inset: 0;
	background: rgba(2, 37, 84, .55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .22s;
}

.pm-call.is-open .pm-call-overlay { opacity: 1; }

.pm-call-sheet {
	position: relative;
	width: min(400px, 100%);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 70px rgba(2, 37, 84, .28);
	opacity: 0;
	transform: translateY(16px) scale(.97);
	transition: opacity .22s, transform .22s cubic-bezier(.34, 1.4, .64, 1);
}

.pm-call.is-open .pm-call-sheet {
	opacity: 1;
	transform: none;
}

/* الرأس */
.pm-call-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 20px;
	border-block-end: 1px solid var(--pmc-line);
}

.pm-call-head-txt {
	flex: 1;
	min-width: 0;
}

.pm-call-head-txt strong {
	display: block;
	font-size: 17px;
	font-weight: 700;
	color: var(--pmc-ink);
}

.pm-call-head-txt > span {
	display: block;
	margin-block-start: 2px;
	font-size: 13px;
	color: var(--pmc-muted);
}

.pm-call-x,
.pm-call-back {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	padding: 0;
	color: var(--pmc-muted);
	background: var(--pmc-soft);
	border: 0;
	border-radius: 100px;
	cursor: pointer;
	transition: color .2s, background .2s;
}

.pm-call-x:hover,
.pm-call-back:hover {
	color: var(--pmc-ink);
	background: var(--pmc-line);
}

.pm-call-x svg,
.pm-call-back svg { width: 15px; height: 15px; }

/* display:flex أعلاه يتغلّب على السمة hidden القادمة من متصفّح المستخدم،
   فنعيد إخفاء أي عنصر داخل اللوحة يحمل hidden صراحةً. */
.pm-call [hidden] { display: none; }

/* زر الرجوع يتبع اتجاه الصفحة */
.rtl .pm-call-back svg { transform: scaleX(-1); }

/* الخيارات */
.pm-call-view { padding: 14px; }

.pm-call-opt {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: 0 0 8px;
	padding: 14px 16px;
	font: inherit;
	text-align: initial;
	text-decoration: none;
	color: var(--pmc-ink);
	background: var(--pmc-soft);
	border: 1px solid transparent;
	border-radius: 14px;
	cursor: pointer;
	transition: background .2s, border-color .2s, transform .12s;
}

.pm-call-opt:last-child { margin-bottom: 0; }

.pm-call-opt:hover {
	background: #fff;
	border-color: var(--pmc-blue);
	transform: translateY(-1px);
}

.pm-call-opt-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	color: #fff;
	border-radius: 12px;
}

.pm-call-opt-ico svg { width: 20px; height: 20px; }

.pm-call-opt-ico--tel { background: var(--pmc-blue); }
.pm-call-opt-ico--wa  { background: var(--pmc-green); }
.pm-call-opt-ico--cb  { background: var(--pmc-navy); }

.pm-call-opt-txt { min-width: 0; }

.pm-call-opt-txt strong {
	display: block;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.5;
}

.pm-call-opt-txt > span {
	display: block;
	font-size: 12.5px;
	color: var(--pmc-muted);
}

.pm-call-opt-num {
	font-weight: 600;
	letter-spacing: .3px;
	unicode-bidi: isolate;
}

/* ------------------------------------------------------------------ */
/* نموذج طلب المكالمة                                                  */
/* ------------------------------------------------------------------ */

.pm-call-field { margin-bottom: 12px; }

.pm-call-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--pmc-ink);
}

.pm-call-field input,
.pm-call-field select,
.pm-call-field textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pmc-ink);
	background: #fff;
	border: 1.5px solid var(--pmc-line);
	border-radius: 12px;
	box-shadow: none;
	transition: border-color .2s, box-shadow .2s;
}

.pm-call-field textarea { resize: vertical; min-height: 62px; }

/* سهم واضح يميّز القائمة المنسدلة عن حقول النص */
.pm-call-field select {
	appearance: none;
	-webkit-appearance: none;
	padding-inline-end: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7c93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 18px;
	background-position: left 14px center;
}

.pm-call-field select:dir(ltr) {
	background-position: right 14px center;
}

.pm-call-field input:focus,
.pm-call-field select:focus,
.pm-call-field textarea:focus {
	outline: 0;
	border-color: var(--pmc-blue);
	box-shadow: 0 0 0 4px rgba(0, 136, 255, .14);
}

/* مصيدة العناكب: مخفية بصرياً دون display:none كي يملأها الروبوت.
   نستخدم clip-path لا الإزاحة خارج الشاشة، لأن الإزاحة في صفحة RTL
   تدفع المحتوى خارج الحاوية وتُنشئ شريط تمرير أفقياً داخل اللوحة. */
.pm-call-hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	white-space: nowrap;
	clip-path: inset(50%);
}

.pm-call-submit {
	display: block;
	width: 100%;
	margin-block-start: 4px;
	padding: 14px 20px;
	font: inherit;
	font-size: 15.5px;
	font-weight: 700;
	color: #fff;
	background: var(--pmc-blue);
	border: 0;
	border-radius: 100px;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(0, 136, 255, .26);
	transition: background .2s, opacity .2s;
}

.pm-call-submit:hover { background: var(--pmc-navy); }

.pm-call-submit[disabled] {
	opacity: .65;
	cursor: default;
}

.pm-call-msg {
	margin-block-start: 12px;
	padding: 0;
	font-size: 13.5px;
	line-height: 1.6;
	text-align: center;
	color: #b4004a;
}

.pm-call-msg:empty { display: none; }

.pm-call-msg:not(:empty) {
	padding: 11px 14px;
	background: rgba(252, 0, 94, .07);
	border: 1px solid rgba(252, 0, 94, .18);
	border-radius: 12px;
}

/* التأكيد */
.pm-call-done {
	padding: 16px 10px 10px;
	text-align: center;
}

.pm-call-done-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-bottom: 14px;
	color: #fff;
	background: #12b76a;
	border-radius: 100px;
	box-shadow: 0 10px 24px rgba(18, 183, 106, .32);
}

.pm-call-done-ico svg { width: 28px; height: 28px; }

.pm-call-done strong {
	display: block;
	margin-bottom: 6px;
	font-size: 18px;
	font-weight: 700;
	color: var(--pmc-ink);
}

.pm-call-done-txt {
	display: block;
	margin-bottom: 18px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--pmc-muted);
}

/* ------------------------------------------------------------------ */
/* الشاشات الصغيرة: اللوحة كورقة سفلية                                 */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {

	.pm-call {
		padding: 0;
		align-items: flex-end;
	}

	.pm-call-sheet {
		width: 100%;
		max-height: 92vh;
		border-radius: 22px 22px 0 0;
		transform: translateY(100%);
	}

	/* منع تكبير الصفحة تلقائياً في iOS */
	.pm-call-field input,
	.pm-call-field select,
	.pm-call-field textarea {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pm-call-sheet,
	.pm-call-overlay,
	.pm-call-opt,
	.pm-call-btn,
	.pm-call-fab {
		transition-duration: .01ms;
	}
}
