/* مشترك لكل القوالب (بعد 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; }
}

/* الخصم: السعر القديم مشطوب + النسبة (بطاقة السيارة وصندوق السعر) */
.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; }
.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(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.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; }
.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; }
