/* ============================================================
   site.css — الموقع التسويقي وحده
   ============================================================ */

/* ---------- الشريط العلوي ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding-top: var(--safe-t);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 66px; }
/* `:not(.btn)` ليس تجميلاً: بدونه يغلب هذا المحدِّد (0,1,1)
   قاعدة `.btn` (0,1,0) فيأخذ زرّ الدعوة لون النصّ الباهت على
   أرضه البرتقالية — 1.4:1، أي غير مقروء أصلاً. */
.nav a:not(.btn) { color: var(--muted); font-size: .92rem; font-weight: 600; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
@media (max-width: 860px) { .nav-links { display: none; } }

.logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center;
  color: #ffffff; font-weight: 900; font-size: .95rem;
}

/* ---------- الواجهة الأولى ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset-block-start: -45%; inset-inline-end: -15%;
  width: 720px; height: 720px; max-width: 130vw;
  background: radial-gradient(circle, rgba(217, 119, 87, .16), transparent 68%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 19ch; }
.hero .lede { font-size: clamp(1.05rem, 2.3vw, 1.3rem); color: var(--muted); max-width: 56ch; margin-bottom: 2rem; }
.hero .cta { gap: .8rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-dim); color: var(--accent-ink);
  border: 1px solid var(--accent-soft);
  padding: .35rem .85rem; border-radius: 999px;
  font-size: .82rem; font-weight: 700; margin-bottom: 1.4rem;
}

.proof { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); }
.proof .value { font-size: 1.6rem; font-weight: 800; color: var(--text); }

/* ---------- الأقسام ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section.alt { background: var(--bg-soft); border-block: 1px solid var(--line-soft); }
.section-head { max-width: 62ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- بطاقات الخدمات ---------- */
.service {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: border-color .16s ease, transform .16s ease;
  min-inline-size: 0;
}
.service:hover { border-color: var(--accent-soft); transform: translateY(-2px); box-shadow: var(--shadow); }
.service .icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--accent-dim); margin-bottom: .4rem;
}
.service h3 { margin: 0; font-size: 1.15rem; }
.service p { color: var(--muted); font-size: .93rem; margin: 0; }
.service ul { margin: .5rem 0 0; padding-inline-start: 1.1rem; color: var(--faint); font-size: .87rem; line-height: 1.9; }

/* ---------- الخطوات ---------- */
.steps { counter-reset: step; }
.step { display: flex; gap: 1.1rem; align-items: flex-start; padding: 1.1rem 0; border-bottom: 1px solid var(--line-soft); }
.step:last-child { border-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.step h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- الأسعار ---------- */
.plan {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.7rem;
  display: flex; flex-direction: column; min-inline-size: 0;
}
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan .price { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin: .4rem 0 .1rem; font-variant-numeric: tabular-nums; }
.plan .per { color: var(--faint); font-size: .85rem; margin-bottom: 1.2rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.plan li { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.plan li::before { content: '✓'; color: var(--accent-ink); font-weight: 800; flex: none; }
.plan .btn { margin-top: auto; }

/* ---------- الأسئلة ---------- */
details.faq {
  border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
  background: var(--surface); padding: 1rem 1.2rem; margin-bottom: .7rem;
}
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; color: var(--accent-ink); font-size: 1.3rem; line-height: 1; flex: none; }
details.faq[open] summary::after { content: '−'; }
details.faq p { color: var(--muted); font-size: .92rem; margin: .8rem 0 0; }

/* ---------- نموذج التواصل ---------- */
.contact-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.form-status { margin-top: 1rem; font-size: .92rem; }

/* ---------- التذييل ---------- */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 2.5rem 0 calc(2.5rem + var(--safe-b));
  color: var(--faint); font-size: .88rem;
}
.foot a { color: var(--muted); }

/* ---------- اختيار الخدمات في النموذج ---------- */
/* مربّعات اختيار مرسومة كأزرار قابلة للضغط: أسهل على الإبهام من
   مربّع ١٦ بكسل، والحالة تُقرأ من مسافة. */
.svc-picker { display: grid; gap: .5rem; }

.svc {
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  cursor: pointer;
  background: var(--bg);
  transition: border-color .14s ease, background .14s ease;
  min-height: 46px;
}
.svc:hover { border-color: var(--accent-soft); }
.svc input { width: auto; margin: 0; accent-color: var(--accent-ink); flex: none; }
.svc span { font-size: .93rem; color: var(--text); }
/* :has مدعوم في كل متصفّح حديث، والبديل عند غيابه حدٌّ رمادي
   عادي — يبقى الاختيار مقروءاً من مربّع التأشير نفسه. */
.svc:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.svc:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- زرّ واتساب ---------- */
.btn.wa { background: #1da851; color: #fff; }
.btn.wa:hover { background: #17843f; }

/* زرّ عائم على الجوال: الوصول لواتساب من أي مكان في الصفحة */
.wa-float {
  position: fixed;
  inset-block-end: calc(18px + var(--safe-b));
  inset-inline-start: max(18px, var(--safe-s));
  width: 54px; height: 54px; border-radius: 50%;
  background: #1da851; color: #fff;
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .22);
  z-index: 40;
}
.wa-float:hover { text-decoration: none; background: #17843f; }

/* زرّ الخدمة داخل بطاقتها يلتصق بالأسفل مهما اختلف طول النصّ */
.service .pick { margin-top: auto; align-self: flex-start; }
.service .pick.on { background: var(--accent-ink); color: #fff; }

/* ---------- مساعد الموقع ---------- */
/* يجلس فوق زرّ الواتساب لا بجانبه: زرّان دائريان متلاصقان في
   نفس الزاوية يصيران هدفاً واحداً مشوّشاً على شاشة جوال. */
.chat-launch {
  position: fixed;
  inset-block-end: calc(84px + var(--safe-b));
  inset-inline-start: max(18px, var(--safe-s));
  display: flex; align-items: center; gap: .55rem;
  background: var(--accent-ink); color: #fff;
  border: 0; border-radius: 999px;
  padding: .6rem 1.1rem .6rem .8rem;
  font: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .2);
  z-index: 41;
}
.chat-launch:hover { background: var(--accent-deep); }
.chat-launch .dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  display: grid; place-items: center; font-size: 1rem; flex: none;
}

.chat-panel {
  position: fixed;
  inset-block-end: calc(18px + var(--safe-b));
  inset-inline-start: max(18px, var(--safe-s));
  inset-inline-end: auto;
  width: min(380px, calc(100vw - 36px));
  height: min(560px, calc(100dvh - 120px));
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(60, 40, 30, .22);
  display: none; flex-direction: column; overflow: hidden;
  /* فوق الشريط العلوي (50). على الجوال تملأ اللوحة الشاشة،
     وشريط بترتيب أعلى كان يغطّي رأسها — بما فيه زرّ الإغلاق،
     فيعلق الزائر داخلها بلا مخرج. */
  z-index: 60;
}
.chat-panel.open { display: flex; }

.chat-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.chat-head .who { flex: 1; min-inline-size: 0; }
.chat-head .name { font-weight: 700; font-size: .95rem; }
.chat-head .sub { font-size: .76rem; color: var(--faint); }
.chat-head .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-dim); display: grid; place-items: center;
  font-size: 1.1rem; flex: none;
}
.chat-head button {
  background: none; border: 0; color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; flex: none;
}
.chat-head button:hover { background: var(--surface-2); color: var(--text); }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.chat-bubble {
  max-width: 85%;
  padding: .6rem .85rem;
  border-radius: 14px;
  font-size: .9rem; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.chat-bubble.them { background: var(--surface-2); align-self: flex-start; border-end-end-radius: 5px; }
.chat-bubble.me   { background: var(--accent-ink); color: #fff; align-self: flex-end; border-end-start-radius: 5px; }
.chat-bubble.err  { background: rgba(185, 28, 28, .07); color: #7f1d1d; align-self: stretch; font-size: .85rem; }

/* اقتراحات تُغني الزائر عن التفكير في أول سؤال */
.chat-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.chat-chips button {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .75rem;
  font: inherit; font-size: .8rem; color: var(--accent-ink);
  cursor: pointer;
}
.chat-chips button:hover { border-color: var(--accent); background: var(--accent-dim); }

.chat-bar { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line-soft); }
.chat-bar input { flex: 1; min-inline-size: 0; border-radius: 999px; }
.chat-bar button {
  border: 0; border-radius: 999px; background: var(--accent-ink); color: #fff;
  padding: 0 1.1rem; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer;
}
.chat-bar button:disabled { opacity: .5; cursor: default; }

/* على الجوال يملأ الشاشة: لوحة 380px داخل 360px لا معنى لها */
@media (max-width: 460px) {
  .chat-panel {
    inset: 0;
    width: auto; height: auto;
    border-radius: 0; border: 0;
    padding-top: var(--safe-t);
    padding-bottom: var(--safe-b);
  }
}
