/* TrustUs — the WhatsApp panel -------------------------------------------------
   Shown in front of a WhatsApp button: a name and a number, then the chat.
   Pairs with inc/section-whatsapp-modal.php. */

.tu-wa,
.tu-wa *,
.tu-wa *::before,
.tu-wa *::after { box-sizing: border-box; }

.tu-wa {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92vh, 900px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-surface);
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(20, 18, 26, .28);
}
.tu-wa[open] { display: block; }
.tu-wa::backdrop { background: rgba(20, 18, 26, .55); }
.tu-wa a { text-decoration: none; }
.tu-wa :focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.tu-wa__in {
  max-height: inherit;
  overflow-y: auto;
  padding: clamp(18px, 3vw, 30px) clamp(20px, 4vw, 44px) clamp(28px, 4vw, 40px);
  text-align: center;
}

/* The close on one side and the mark on the other, as the live one has it. */
.tu-wa__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tu-wa__x {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.tu-wa__x:hover { background: var(--wash); color: var(--red); }
.tu-wa__logo { height: 46px; width: auto; }

.tu-wa__head { margin: clamp(14px, 2.5vw, 26px) 0 clamp(20px, 3vw, 30px); }
.tu-wa__mark { display: block; margin-bottom: clamp(12px, 2vw, 18px); line-height: 0; }
.tu-wa__head h2 {
  margin: 0 0 clamp(14px, 2vw, 20px);
  color: var(--ink);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.35;
}
/* The English is the same sentence, not a second heading — same size, same
   weight, and it sits on the line under its Arabic. */
.tu-wa__head h2 span { display: block; }
.tu-wa__head p {
  max-width: 58ch;
  margin: 0 auto 10px;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.7;
}
.tu-wa__head p span { display: block; }
.tu-wa__head strong { color: var(--ink); }

.tu-wa__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  text-align: start;
}
.tu-wa__grid label { display: block; }
.tu-wa__grid input,
.tu-wa__grid select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tu-wa__grid input:focus,
.tu-wa__grid select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-tint);
}

/* الدولة يسارًا والرقم يمينًا، في العربية والإنجليزية معًا.
   الترتيب في الماركب هو الدولة ثم الرقم، وفي صفحةٍ تُقرأ من اليمين يضع ذلك
   الدولةَ يمينًا — فيصير الرقم في الطرف البعيد عن مفتاحه. الترتيب هنا لا في
   الماركب، فيبقى انتقال المؤشّر بالـTab: الدولة أولًا ثم الرقم. */
.tu-wa__phone   { order: 1; }
.tu-wa__country { order: 2; }

/* The dialling code sits inside the field rather than in a box of its own: it
   is part of the number, and two boxes read as two questions. */
/* والحقل نفسه يُقرأ من اليسار أيًّا كانت لغة الصفحة: الأرقام تُكتب من اليسار
   في اللغتين، فمفتاح الدولة يسبق الرقم على يساره. كان المفتاح يُرسم على
   اليمين لأن inset-inline-start ينقلب مع اتجاه الصفحة، فيظهر «90+» في طرفٍ
   والرقم يبدأ من الطرف الآخر. */
.tu-wa__phone { position: relative; direction: ltr; }
.tu-wa__code {
  position: absolute;
  inset-inline-start: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}
.tu-wa__phone input { padding-inline-start: 62px; text-align: start; }

.tu-wa__err {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--red);
  font-size: var(--fs-caption);
  font-weight: 700;
}

.tu-wa__go {
  width: min(240px, 100%);
  height: 48px;
  margin-top: clamp(18px, 3vw, 26px);
  border: 0;
  border-radius: var(--r-control);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .2s ease;
}
.tu-wa__go:hover { background: var(--red-deep); }

/* It only has to exist for the post to have somewhere to land. */
.tu-wa__sink { position: absolute; width: 0; height: 0; border: 0; opacity: 0; pointer-events: none; }

@media (max-width: 620px) {
  .tu-wa { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .tu-wa__grid { grid-template-columns: minmax(0, 1fr); }
  .tu-wa__go { width: 100%; }
}
