/* مشترك لكل القوالب (بعد CSS القالب) */

/* معرض صور السيارة: شريط صور بينسحب بالإصبع، كل صورة مالية الإطار (cover) بالنص، والكبسة بتفتح الشاشة الكاملة */
.gallery-main .g-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery-main .g-track::-webkit-scrollbar { display: none; }
.gallery-main .g-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; object-position: center; scroll-snap-align: center; cursor: zoom-in; transition: none; opacity: 1 !important; }
.gallery-main .nav-arrow, .gallery-main .counter { z-index: 2; }
.thumbs { justify-content: safe center; }

/* شاشة الصور الكاملة: الصورة بحجمها الأصلي (أو على قد الشاشة إذا أكبر)، بالنص */
.lightbox { position: fixed; inset: 0; z-index: 2147483000; background: #000; display: flex; align-items: center; justify-content: center; }
.lightbox { touch-action: none; overflow: hidden; }
.lightbox img { max-width: 100vw; max-height: 100dvh; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; cursor: zoom-in; transition: transform .2s ease; }
.lightbox img.zoomed { cursor: zoom-out; transition: none; }
.lightbox button { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.35); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox button:hover { background: rgba(0,0,0,.8); }
.lightbox button .icon { width: 22px; height: 22px; }
.lightbox .lb-close { top: 16px; inset-inline-end: 16px; font-size: 22px; line-height: 1; }
.lightbox .lb-prev { inset-inline-start: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { inset-inline-end: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(0,0,0,.5); padding: 4px 12px; border-radius: 999px; }
@media (max-width: 640px) { .lightbox .lb-prev, .lightbox .lb-next { width: 40px; height: 40px; } }

/* الفوتر: «مدعوم من» + شعار واسم ARAB GEAR ورابط arab-gear.com */
a.powered { color: inherit; text-decoration: none; }
a.powered b { font-weight: 700; letter-spacing: .04em; }
a.powered:hover b { text-decoration: underline; }

/* العناوين الكبيرة بالعربي: مسافة أسطر أوسع، لحتى نقاط الأحرف (ة، ي، ب…) ما تتشابك بين السطور. الإنكليزي بيضل متل ما هو. */
html[lang="ar"] .hero h1, html[lang="ar"] .car-head h1 { line-height: 1.32; letter-spacing: 0; }

/* شعار المعرض (طلب علاء 29 أكتوبر): فوق أكبر شوي، وتحت بالفوتر أكبر كتير — بكل القوالب */
.brand-logo { height: 48px; max-width: 170px; }
.footer .brand-logo { height: 96px; max-width: 260px; }
@media (max-width: 640px) {
  .brand-logo { height: 40px; max-width: 140px; }
  .footer .brand-logo { height: 80px; max-width: 220px; }
  /* اسم المعرض (بلا شعار) بالشريط فوق: سطر واحد، وإذا طويل بيتقصّ بـ «…» بدل ما ينكسر على سطرين */
  .topbar .brand { min-width: 0; }
  .topbar .brand-mark { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 220px); font-size: 14px !important; letter-spacing: .06em !important; }
}

/* الخصم: السعر القديم مشطوب + النسبة (بطاقة السيارة وصندوق السعر) */
/* 🛡️ شارات الثقة على السيارة */
.car-trust { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.car-trust span { font-size: 11.5px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; white-space: nowrap;
  color: #0b7a4b; background: rgba(18, 163, 100, .12); border: 1px solid rgba(18, 163, 100, .28); }
:root[data-theme="dark"] .car-trust span, .dark .car-trust span { color: #5fe0a4; background: rgba(60, 200, 140, .12); border-color: rgba(60, 200, 140, .3); }
.car-trust-lg { margin: 12px 0 2px; } .car-trust-lg span { font-size: 12.5px; padding: 6px 11px; }
.old-price, .pb-old { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 4px; flex-basis: 100%; }
.old-price s, .pb-old s { opacity: .85; }
.disc { background: var(--accent); color: #fff; border-radius: var(--pill); padding: 1px 8px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.pb-old { font-size: 15px; }
/* حاسبة التقسيط: البنوك */
.calc-banks { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.calc-banks .note { margin: 0 0 10px; }
.bank-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-list span { border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: var(--pill); padding: 6px 14px; font-size: 13px; font-weight: 600; color: inherit; background: transparent; }
.calc-banks { border-top-color: color-mix(in srgb, currentColor 20%, transparent); }
.calc-result .detail div { margin-top: 3px; }
@media (max-width: 640px) { .calc-grid { grid-template-columns: 1fr; gap: 20px; } .calc-result .detail { text-align: start; } }

/* بحث الرئيسية: ماركة + موديل + سعر من/إلى (الكمبيوتر: سطر واحد) */
@media (min-width: 1081px) { .filters { grid-template-columns: 1fr repeat(2, minmax(0, 140px)) minmax(0, 220px) minmax(0, 175px) minmax(0, 150px); } }
.filters .price-range { display: flex; align-items: center; gap: 6px; }
.filters .price-range input { flex: 1; min-width: 0; width: 50%; padding: 0 12px; background: transparent; border: 0; outline: 0; color: inherit; font: inherit; }
.filters .price-range i { font-style: normal; color: var(--muted); }
.filters select:disabled { opacity: .5; }

/* شريط لوغوهات الماركات */
.brands h2 { margin-bottom: 24px; }
/* أقل فراغ فوق الماركات وبينها وبين «المجموعة» (طلب علاء 5 نوفمبر) */
.section.brands { padding-top: 48px; }
.section.brands + .section { padding-top: 56px; }
@media (max-width: 720px) { .section.brands { padding-top: 32px; } .section.brands + .section { padding-top: 40px; } }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.mk { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: center; transition: border-color .2s, transform .2s; }
.mk:hover { border-color: var(--accent); transform: translateY(-2px); }
.mk img, .mk .brand-ph { width: 56px; height: 56px; object-fit: contain; }
.mk .brand-ph { display: grid; place-items: center; width: auto !important; min-width: 56px; padding: 0 10px; border-radius: 12px; background: #fff; color: #111; font-size: 15px; font-weight: 800; letter-spacing: .08em; font-family: system-ui, sans-serif; }
.mk b { font-size: 14px; font-weight: 600; }
.mk small { font-size: 12px; color: var(--muted); }
.mk img { background: #fff; border-radius: 12px; padding: 6px; }
@media (max-width: 720px) { .brand-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } .mk { padding: 12px 6px; } .mk img, .mk .brand-ph { width: 44px; height: 44px; } }

/* الصفحات المنفصلة: عن المعرض، تواصل معنا، بيع سيارتك، طلب تمويل */
.page-head { margin: 8px 0 36px; max-width: 60ch; }
.page-head h1 { margin: 0 0 10px; }
.page-head .lead-text { color: var(--muted); margin: 0; }
.visit-grid.has-map { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: stretch; }
.visit-map { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 340px; background: var(--surface-2); }
.visit-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }
.lead-form { max-width: 720px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 28px; display: grid; gap: 12px; }
.lead-form h3 { margin: 8px 0 0; font-size: 16px; }
.lead-form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* نماذج الطلب (تمويل، بيع سيارتك): خانتين بكل سطر، وإذا العدد فردي آخر خانة بعرض كامل (ما في خانة لحالها بنص سطر) */
.lead-form .two > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 520px) { .lead-form .two { grid-template-columns: minmax(0, 1fr); } }
.lead-form .field { height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.lead-form .field:focus-within { border-color: var(--ink); }
.lead-form .btn { margin-top: 8px; }
.lead-form .note { margin: 0; }
@media (max-width: 1100px) { .visit-grid.has-map { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .lead-form { padding: 20px; } .visit-map, .visit-map iframe { min-height: 260px; } }

/* الصورة المصغّرة المختارة: الإطار جوّا الصورة (كان برّا وبينقصّ من فوق وتحت بكل القوالب) */
.thumb { outline-offset: -3px !important; }
.thumb.on { outline-width: 3px !important; outline-style: solid !important; }

/* أيقونات الاتصال والواتساب الصغيرة بالشريط فوق (انشال الشريط اللي تحت) */
.tools .tool-contact { display: inline-flex !important; }
.tools .tool-wa { color: #25D366; }
.mobile-bar { display: none !important; }
@media (max-width: 1080px) { body { padding-bottom: 0 !important; } }
/* خانة السعر من/إلى مش قائمة ← بلا سهم */
.filters .price-range::after, .filters .price-range::before { display: none !important; content: none !important; }
.lead-form h3 small { font-weight: 400; font-size: 12px; }
.lead-form .field.area { height: auto; }
.lead-form .field.area textarea { width: 100%; min-height: 96px; border: 0; background: transparent; color: inherit; font: inherit; padding: 12px 16px; resize: vertical; outline: 0; }
.lead-form .km-unit { display: flex; }
.lead-form .km-unit input { flex: 1; min-width: 0; }
.lead-form .km-unit select { width: auto; flex: none; border: 0; border-inline-start: 1px solid var(--line); background: transparent; color: inherit; padding: 0 12px; }

/* شعار المعرض بلا إطار (قرار علاء 3 نوفمبر) */
.brand-logo:not(.on-light) { background: none !important; padding: 0 !important; border-radius: 0 !important; }

/* المواصفات بأربع مجموعات (متل دوبيزل) */
.feat-group { border-bottom: 1px solid var(--line); }
.feat-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; font-weight: 600; }
.feat-group > summary::-webkit-details-marker { display: none; }
.feat-group > summary b { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--pill); background: var(--surface-2); font-size: 13px; margin-inline-start: auto; }
.feat-group > summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
.feat-group[open] > summary::after { content: "−"; }
.feat-group .features { padding-bottom: 18px; }
/* تقييم سيارة البدل: نفس فورم «بيع سيارتك» جوّا النافذة */
.sheet-body .lead-form { border: 0; padding: 0; background: none; max-width: none; margin-top: 16px; }

/* «لديك سيارة للاستبدال؟»: مربع ملوّن ملفت (متل دوبيزل) */
.trade-btn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: background .2s; }
.alert-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 10px 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.alert-btn:hover { color: var(--ink); } .alert-btn .icon { width: 17px; height: 17px; flex: none; }
.trade-btn:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.trade-btn .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }
/* اسم السيارة صار تحت الصور */
.crumbs + .gallery-wrap { margin-top: 20px; }
.car-head.after-gallery { margin: 0; padding: 22px 0 0; }
.car-head.after-gallery h1 { margin: 6px 0 6px; }
.car-head.after-gallery + .car-layout { padding-top: 28px; }

/* تنبيه حاسبة التقسيط (طلب علاء): واضح وملفت إنو القسط تقديري والبنك بيحدد الرقم الأخير */
.calc .calc-warn { display: block; margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; line-height: 1.6;
  color: #8a4b00; background: #fff4e0; border: 1px solid #f0b54a; }
[data-theme="dark"] .calc .calc-warn { color: #ffd38a; background: rgba(240, 181, 74, .12); border-color: rgba(240, 181, 74, .55); }
/* تفاصيل الحاسبة: إشارة (− + =) بعمود ثابت بأول كل سطر */
.calc .calc-row { display: flex; align-items: baseline; gap: 6px; }
.calc .calc-row .sg { display: inline-block; width: 1.1em; text-align: center; opacity: .7; }
.calc .calc-row small { opacity: .7; }

/* حماية من النسخ (قرار علاء، 6 نوفمبر): بلا تحديد نص ولا سحب صور. الخانات والأرقام بيضلّوا قابلين للنسخ */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], a[href^="tel:"], .num-copy { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }

/* فيديو الواجهة (الباقة الاحترافية): فوق صورة الغلاف بنفس مكانها، وبيبيّن بنعومة لما يبلّش */
.hero-video { position: absolute; object-fit: cover; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.hero-video.on { opacity: 1; }

/* «انباعت مؤخراً»: شريط سيارات مباعة (بلا سعر)، بيمشي يمين ويسار على الموبايل */
.sold-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 300px); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.sold-card { margin: 0; scroll-snap-align: start; }
.sold-img { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius, 12px); background: var(--surface, #eee); }
.sold-img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }
.sold-tag { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--accent); color: var(--on-accent, #fff); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.sold-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 10px; }
.sold-card figcaption b { font-size: 15px; }
.sold-card figcaption small { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 720px) { .sold-row { grid-auto-columns: 72%; gap: 14px; } }

/* عنوان «من نحن / كيف تحجز» صار h2 (ترتيب العناوين، 17 نوفمبر): نفس شكل eyebrow. :where = بلا أولوية، فقواعد القالب بتغلب */
:where(h2.eyebrow) { margin: 0; font-weight: inherit; line-height: inherit; font-family: inherit; }
/* «إعدادات البيع» بصفحة السيارة: العربون + الأوراق المطلوبة (0180/0181) */
.pb-deal { margin: 12px 0 2px; display: grid; gap: 8px; font-size: 13.5px; }
.pb-dep { margin: 0; color: var(--ink); font-weight: 600; }
.pb-docs { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.pb-docs summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.pb-docs ul { margin: 8px 0 2px; padding-inline-start: 18px; color: var(--muted); line-height: 1.7; }
/* تصنيف الممشى (فلتر) */
.km-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.km-chips button { border: 1px solid var(--line); background: var(--surface, transparent); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.km-chips button small { color: var(--muted); font-weight: 500; margin-inline-start: 2px; }
.km-chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.km-chips button.on small { color: rgba(255, 255, 255, .8); }
/* مواصفات السيارة السريعة (.quick): الصفوف دايماً مليانة بالتساوي بكل القوالب (5 = 3 فوق + 2 أعرض تحت، بلا فراغ) */
@media (min-width: 721px) {
  .quick { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .quick > * { grid-column: span 2; }
  .quick > :nth-last-child(2):nth-child(3n+1), .quick > :nth-last-child(2):nth-child(3n+1) ~ * { grid-column: span 3; }
  .quick > :last-child:nth-child(3n+1) { grid-column: span 6; }
}
@media (max-width: 720px) { .quick > :last-child:nth-child(odd) { grid-column: span 2; } }
/* الماركات: آخر سطر بالنص (مش لازق على جنب) */
.brand-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.brand-grid > .mk { flex: 0 0 150px; }
@media (max-width: 720px) { .brand-grid > .mk { flex: 0 0 calc((100% - 16px) / 3); } }
/* «سيارات مشابهة»: لما الشبكة عمودين (آيباد) منبيّن سيارتين بس، لحتى ما تطلع التالتة لحالها */
@media (min-width: 721px) and (max-width: 1080px) { .similar .cars > :nth-child(3) { display: none; } }
/* جدول المواصفات: بيتعبّى عمود عمود (فوق لتحت)، فإذا العدد فردي بيصير عمود أطول بسطر (شكل طبيعي) بدل خانة فاضية */
@media (min-width: 721px) { .specs { display: block; columns: 2; column-gap: 40px; } .specs > div { break-inside: avoid; } }
/* 🏪 سوق ARAB GEAR (0197): مربع المعرض صاحب السيارة فوق بوكس السعر + المعرض على الكرت */
.shop-box { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius, 14px); background: var(--surface-2, var(--surface)); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.shop-box:hover { border-color: var(--accent); }
.shop-box img, .shop-box .shop-ini { width: 46px; height: 46px; border-radius: 12px; flex: none; object-fit: contain; background: var(--surface, #fff); border: 1px solid var(--line); }
.shop-box .shop-ini { display: grid; place-items: center; font-weight: 700; font-size: 18px; color: var(--accent); }
.shop-box .shop-txt { display: grid; gap: 2px; min-width: 0; }
.shop-box .shop-txt b { font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-box .shop-txt small { font-size: 12.5px; color: var(--muted); }
.shop-box .shop-go { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--pill, 999px); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.shop-box:hover .shop-go { border-color: var(--accent); color: var(--accent); }
.car-shop { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.car-shop img, .car-shop .shop-ini { width: 20px; height: 20px; border-radius: 6px; object-fit: contain; flex: none; background: var(--surface, #fff); }
.car-shop .shop-ini { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--line); }
.car-shop b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .shop-box { flex-wrap: wrap; } .shop-box .shop-go { margin-inline-start: 0; width: 100%; justify-content: center; } }
/* 🔎 صفحات جوجل (landing.tsx): المقدّمة، الأسئلة، والروابط تحت */
.seo-intro { margin: -6px 0 22px; max-width: 860px; color: var(--muted); font-size: 15px; line-height: 1.9; }
.seo-faq { margin-top: 32px; display: grid; gap: 10px; max-width: 860px; }
.seo-faq details { border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 12px 16px; background: var(--surface, transparent); }
.seo-faq summary { cursor: pointer; font-weight: 600; }
.seo-faq p { margin: 8px 0 0; color: var(--muted); line-height: 1.8; }
.seo-links { padding-top: 8px; }
.seo-links h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 18px; }
.seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.seo-grid b { display: block; margin-bottom: 8px; font-size: 15px; }
.seo-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.seo-grid a { color: var(--accent); text-decoration: none; font-size: 14px; }
.seo-grid a:hover { text-decoration: underline; }
.seo-grid small { color: var(--muted); font-size: 12px; }
