/* تحسينات عامة على كل الصفحات (22 نوفمبر): الشريط العلوي، مساحات اللمس، قوائم البطاقات على الموبايل، التذييل. */

/* الشريط العلوي: الوصف مخفي تحت 900px (كان النمط المضمّن يغلب القاعدة القديمة) */
@media (max-width: 900px) { .topbar .tb-hide { display: none !important; } }
@media (max-width: 760px) {
  .topbar { font-size: 14px !important; }
  .topbar > div { padding: 6px 16px !important; justify-content: center !important; }
  .topbar > div > div { gap: 4px 20px !important; justify-content: center; }
  .topbar a { min-height: 32px; }
}

/* روابط التذييل: مساحة لمس مريحة */
.foot-d a:not([style*="display: flex"]) { display: inline-flex; align-items: center; min-height: 28px; }
/* التذييل أقصر على الكمبيوتر */
.foot-d > div:first-child { padding-top: 56px !important; padding-bottom: 28px !important; gap: 32px !important; }
.foot-d nav { gap: 4px !important; }
.foot-d nav > div:first-child { margin-bottom: 8px !important; }
.foot-d nav > span[aria-hidden="true"] { margin: 8px 0 !important; }
.foot-d > div:first-child > div:first-child { gap: 14px !important; }
.foot-d > div:first-child > div:first-child img { width: 210px !important; height: auto !important; }

/* الموبايل: البطاقات المتكررة تصبح شريطًا يُسحب أفقيًا بدل عمود طويل */
@media (max-width: 760px) {
  .vgrid,
  #services div[style*="minmax(230px"],
  #blog div[style*="minmax(300px"],
  #audiences div[style*="minmax(320px"] {
    display: grid !important; grid-auto-flow: column !important; grid-template-columns: none !important;
    grid-auto-columns: 84% !important; gap: 14px !important; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 2px; padding: 4px 2px 16px !important; scrollbar-width: none;
  }
  .vgrid::-webkit-scrollbar,
  #services div[style*="minmax(230px"]::-webkit-scrollbar,
  #blog div[style*="minmax(300px"]::-webkit-scrollbar,
  #audiences div[style*="minmax(320px"]::-webkit-scrollbar { display: none; }
  .vgrid > *, #services div[style*="minmax(230px"] > *, #blog div[style*="minmax(300px"] > *, #audiences div[style*="minmax(320px"] > * { scroll-snap-align: start; }
  .vgrid { padding-top: 26px !important; }

  /* الصور التوضيحية المكررة: تُخفى على الموبايل لاختصار الصفحة (أزرار الاختيار النصية تبقى) */
  #about div[style*="height: 560px"] { display: none !important; }
  #where .caps { display: none !important; }

  /* التذييل: عمودا روابط متجاوران */
  .foot-d > div:first-child { grid-template-columns: 1fr 1fr !important; gap: 34px 20px !important; padding: 52px 20px 28px !important; }
  .foot-d > div:first-child > :first-child, .foot-d > div:first-child > :last-child { grid-column: 1 / -1 !important; min-width: 0 !important; }
  .foot-d > div:first-child > * { min-width: 0 !important; }
}

/* زر واتساب: يظهر بعد تجاوز أول شاشة، ويختفي فوق نموذج الطلب والتذييل حتى لا يغطي محتوى */
.wa-js .wa-fab { opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .25s; }
.wa-js .wa-fab.wa-on { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .wa-js .wa-fab { transition: none; transform: none; } }
.wa-js .wa-fab.wa-on:hover { transform: translateY(-3px); }

/* خريطة «أين يُجرى الفحص» */
@media (max-width: 760px) { #where .where-map { flex-basis: 100% !important; height: 360px !important; border-radius: 28px !important; } #where .where-cap { font-size: 14px !important; bottom: 16px !important; inset-inline-start: 16px !important; } }

/* بطاقات الخدمات: بلا مربع أيقونة؛ خط شامبين رفيع ورقم المسار يقودان البطاقة */
#services .svc > span:first-child { display: none !important; }
#services .svc { position: relative; padding-top: 44px !important; }
#services .svc::before { content: ""; position: absolute; top: 28px; inset-inline-start: 26px; width: 36px; height: 2px; background: #C3AB82; }
#services article.svc:last-of-type::before { background: #14283F; }
#services .svc h3 { font-size: 22px !important; }

/* خط العناوين العربي (اعتمده حسن 22 نوفمبر): El Messiri للعناوين الكبيرة فقط، والنصوص تبقى IBM Plex Sans Arabic */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] .h-sec { font-family: 'El Messiri', 'IBM Plex Sans Arabic', system-ui, sans-serif !important; font-weight: 700; letter-spacing: 0; }
html[lang="ar"] h1 { line-height: 1.18 !important; }

/* الأسئلة الشائعة: كروت بشكل رمز الشعار، والإجابة تظهر كبيرة في لوحة جانبية (كمبيوتر) أو لوحة سفلية (موبايل) */
#faq { position: relative; transform: none !important; }
#faq * { transform: none; }
#faq details[open] .plus { transform: rotate(45deg) !important; }
#faq > div:last-child { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px !important; align-content: start; }
#faq details { position: static !important; background: #FFFFFF !important; border: 1px solid #ECE6D8 !important; border-radius: 24px 24px 6px 24px !important; transition: background .3s cubic-bezier(.22,1,.36,1), border-color .3s, box-shadow .3s; }
#faq details:hover { border-color: #C3AB82 !important; box-shadow: 0 14px 30px -18px rgba(20,40,63,.35); }
#faq details > summary { position: relative; box-sizing: border-box; min-height: 84px !important; padding: 20px 24px 20px 64px !important; align-items: center !important; font-size: 16px !important; line-height: 1.6; cursor: pointer; list-style: none; }
html[lang="en"] #faq details > summary { padding: 20px 64px 20px 24px !important; }
#faq details > summary::-webkit-details-marker { display: none; }
/* كروت الأسئلة بلا رمز الشعار (26 نوفمبر): زر + يكفي، والرمز يبقى علامة لوحة الإجابة فقط */
#faq details > summary { justify-content: flex-start !important; gap: 14px !important; }
#faq details > summary::before { display: none !important; }
#faq details .plus { position: absolute; top: 50%; margin-top: -15px; left: 18px; width: 30px !important; height: 30px !important; font-size: 18px !important; background: transparent !important; color: #14283F !important; border: 1.5px solid #C3AB82; }
html[lang="en"] #faq details .plus { left: auto; right: 18px; }
#faq details::after { content: ""; position: absolute; }
#faq details[open] { background: #14283F !important; border-color: #14283F !important; box-shadow: 0 18px 40px -20px rgba(20,40,63,.6); }
#faq details[open] > summary { color: #F7F3EA; }
#faq details[open] .plus { background: #78CBE8 !important; color: #14283F !important; border-color: #78CBE8; transform: rotate(45deg); }
#faq details > p { margin: 0 !important; }

/* لوحة الإجابة */
#faq details[open] > p {
  position: absolute; z-index: 5; top: 150px; inset-inline-start: 40px; width: min(400px, calc((100% - 128px) / 3));
  background: url(/assets/brand/symbol-watermark.svg) no-repeat left -34px bottom -40px / 200px auto, radial-gradient(circle at 80% 0%, #24476A, #14283F 60%); color: #F7F3EA !important; border-radius: 28px 28px 6px 28px;
  padding: 58px 32px 34px !important; font-size: 19px !important; line-height: 1.9 !important; max-width: none !important;
  box-shadow: 0 0 0 1px rgba(195,171,130,.45), 0 30px 60px -30px rgba(20,40,63,.6); animation: faqIn .5s cubic-bezier(.22,1,.36,1);
}
#faq details[open] > p::before { content: "الإجابة"; position: absolute; top: 24px; inset-inline-start: 32px; font-size: 14px; font-weight: 700; color: #C3AB82; letter-spacing: .02em; }
html[lang="en"] #faq details[open] > p::before { content: "Answer"; }
#faq details[open] > p a { color: #78CBE8 !important; }
#faq > div:first-child { position: relative; min-height: 420px; }
#faq:not(:has(details[open])) > div:first-child::after {
  content: "اختر سؤالًا، وتظهر إجابته هنا."; display: block; margin-top: 36px; padding: 30px 32px 30px 120px; background: url(/assets/symbol-primary.svg) no-repeat left 28px center / 64px auto; border: 1.5px dashed #D9CDB4; border-radius: 28px 28px 6px 28px; color: #7C6037; font-size: 17px; line-height: 1.8;
}
html[lang="en"] #faq:not(:has(details[open])) > div:first-child::after { content: "Pick a question and its answer appears here."; padding: 30px 120px 30px 32px; background-position: right 28px center; }
@keyframes faqIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  #faq > div:first-child { min-height: 0; }
  #faq:not(:has(details[open])) > div:first-child::after { display: none; }
  #faq > div:last-child { gap: 10px !important; }
  #faq details > summary { min-height: 108px !important; padding: 14px 14px 46px !important; font-size: 15px !important; align-items: flex-start !important; flex-direction: column; gap: 10px !important; }
  #faq details > summary::before { width: 28px; height: 22px; background-position: right center; }
  html[lang="en"] #faq details > summary::before { background-position: left center; }
  html[lang="en"] #faq details > summary { padding: 14px 14px 46px !important; }
  #faq details .plus { top: auto; margin-top: 0; bottom: 12px; left: 12px; width: 28px !important; height: 28px !important; }
  html[lang="en"] #faq details .plus { right: 12px; }
  /* الإجابة: لوحة سفلية ثابتة */
  #faq details[open] > p {
    position: fixed; top: auto; bottom: 0; inset-inline: 0; width: auto; z-index: 80; max-height: 62vh; overflow: auto;
    border-radius: 28px 28px 0 0; padding: 54px 24px calc(30px + env(safe-area-inset-bottom)) !important; font-size: 17px !important;
    box-shadow: 0 -20px 50px rgba(11,24,40,.45); animation: faqUp .45s cubic-bezier(.22,1,.36,1);
  }
  #faq details[open] > p::before { top: 22px; inset-inline-start: 24px; }
  #faq details[open] > p::after { content: ""; position: absolute; top: 10px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: rgba(247,243,234,.35); }
}
@keyframes faqUp { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #faq details, #faq details[open] > p { animation: none !important; transition: none !important; } }

/* رمز TQ قبل الكلمة الصغيرة فوق عنوان الهيرو فقط (26 نوفمبر)؛ باقي الأقسام تبقى بالخط الشامبين الأصلي حتى لا يتكرر الرمز */
header span[aria-hidden="true"][style*="width: 28px; height: 2px; background: #C3AB82"] {
  width: 26px !important; height: 20px !important; background: url(/assets/brand/symbol-reverse.svg) center / contain no-repeat !important; flex: none;
}

/* الشريط العلوي (26 نوفمبر): «اطلب عرض سعر» هو الزر الملوّن، و«دخول المنصة» رابط نصي للعملاء الحاليين */
.navl .nav-login { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.navl .nav-login::before { content: ""; width: 1px; height: 18px; background: currentColor; opacity: .3; margin-inline-end: 6px; }
.navl .nav-login:hover { color: #78CBE8; }

/* رابط التخطي لمستخدمي لوحة المفاتيح وقارئات الشاشة: مخفي حتى يُركَّز عليه */
.skip-link { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 100; background: #78CBE8; color: #14283F !important; font-weight: 700; padding: 12px 18px; border-radius: 12px; text-decoration: none; transform: translateY(-160%); }
.skip-link:focus { transform: none; outline: 2px solid #F7F3EA; outline-offset: 2px; }

/* «الطريق الحي» (الإمضاء البصري، قرار 29 نوفمبر 2026): خطوط طريق متقطعة تمشي على الأقسام الكحلية فقط،
   تبهت قبل المحتوى بقناع، بلا توهج. تتوقف تحت prefers-reduced-motion. */
.tq-road { position: absolute; inset-inline: 0; top: 0; width: 100%; height: 120px; pointer-events: none; }
.tq-road path { fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 6 12; animation: tq-road-flow 14s linear infinite; }
.tq-road .a { stroke: #78CBE8; opacity: .32; }
.tq-road .b { stroke: #C3AB82; opacity: .24; animation-duration: 19s; animation-direction: reverse; }
@keyframes tq-road-flow { to { stroke-dashoffset: -180; } }
@media (prefers-reduced-motion: reduce) { .tq-road path { animation: none; } }

/* Header on tablets (761–1180px): keep the nav on one line next to the logo */
@media (max-width: 1180px) and (min-width: 761px) {
  .hdr-row { padding: 16px 24px !important; flex-wrap: nowrap !important; }
  .hdr-logo { width: 190px !important; height: 65px !important; }
  .navl { gap: 14px !important; font-size: 14px !important; flex-wrap: nowrap !important; white-space: nowrap; }
  .navl .cta-ice { padding: 10px 14px !important; }
}
