:root {
    --navy: #0B3C6E;
    --gold: #F2B632;
    --gold-soft: #FFF6DC;
    --bg: #F4F7FB;
    --text: #1B2A3A;
    --muted: #3B4A5C;
    --light: #D6E2F0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Cairo', Arial, sans-serif; color: var(--text); background: #fff; line-height: 1.7; }
a { text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 44px; width: auto; }
.brand span { font-weight: 800; font-size: 22px; color: var(--navy); letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.nav-links a.link { color: var(--navy); font-weight: 600; }
.nav-links a.link:hover { color: #6b4e00; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 12px 30px; border-radius: 12px; font-weight: 800; font-size: 18px; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(11,60,110,.18); }
.btn-primary { background: var(--navy); color: #fff; border: 2px solid var(--navy); }
.btn-outline { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn-sm { font-size: 16px; padding: 8px 22px; font-weight: 600; }

/* Hero */
.hero { background: var(--bg); }
.hero-inner { display: flex; align-items: center; gap: 64px; flex-wrap: wrap; padding: 80px 0; }
.hero-text { flex: 1 1 440px; }
.badge { display: inline-block; background: var(--gold); color: var(--navy); font-weight: 800; font-size: 14px; padding: 4px 14px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { margin: 0 0 20px; font-size: 56px; line-height: 1.25; font-weight: 800; color: var(--navy); }
.hero p.lead { margin: 0 0 32px; font-size: 20px; color: var(--muted); max-width: 520px; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-card { flex: 1 1 380px; background: var(--navy); color: #fff; border-radius: 24px; padding: 40px; }
.hero-card .title { font-weight: 800; font-size: 22px; margin-bottom: 24px; }
.check-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.2); font-size: 18px; }
.check-row:last-child { border-bottom: 0; }
.check-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; }

/* Sections */
section { scroll-margin-top: 16px; }
.section-pad { padding: 88px 0; }
h2.section-title { margin: 0 0 12px; font-size: 38px; font-weight: 800; color: var(--navy); text-align: center; }
p.section-sub { margin: 0 auto 48px; font-size: 18px; color: var(--muted); text-align: center; max-width: 620px; }
.grid { display: grid; gap: 24px; justify-content: center; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }

.feature { background: var(--bg); border-radius: 18px; padding: 28px; border-top: 6px solid var(--gold); }
.feature h3 { margin: 0 0 8px; font-size: 22px; color: var(--navy); }
.feature p { margin: 0; color: var(--muted); }

/* How */
.how { background: var(--navy); color: #fff; }
.how h2 { margin: 0 0 48px; font-size: 38px; font-weight: 800; text-align: center; }
.step-num { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 800; font-size: 26px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.how h3 { margin: 0 0 8px; font-size: 22px; }
.how p { margin: 0; color: var(--light); }

/* Payment */
.payment { background: var(--bg); }
.pay-card { background: #fff; border-radius: 20px; padding: 36px; border-top: 6px solid var(--gold); }
.pay-card.alt { border-top-color: var(--navy); }
.pay-card h3 { margin: 0 0 10px; font-size: 26px; color: var(--navy); }
.pay-card p { margin: 0; color: var(--muted); font-size: 17px; }
.pay-option { border-radius: 14px; padding: 18px 20px; margin-top: 12px; background: var(--bg); }
.pay-option.gold { background: var(--gold-soft); }
.pay-option strong { display: block; color: var(--navy); font-size: 18px; }
.pay-option span { color: var(--muted); font-size: 16px; }

/* Dealers */
.dealer-box { background: var(--gold-soft); border-radius: 24px; padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.dealer-box .txt { flex: 1 1 420px; }
.dealer-box h2 { margin: 0 0 12px; font-size: 36px; font-weight: 800; color: var(--navy); }
.dealer-box p { margin: 0; font-size: 19px; color: var(--muted); max-width: 560px; }

/* Footer */
footer { background: var(--navy); color: #fff; padding: 40px 0; text-align: center; }
footer .name { font-weight: 800; font-size: 24px; letter-spacing: 1px; }
footer .name span { color: var(--gold); }
footer .line { margin-top: 8px; color: var(--light); }
.lang-switch { color: var(--navy); font-weight: 800; border: 2px solid var(--navy); border-radius: 10px; padding: 6px 14px; min-height: 44px; display: inline-flex; align-items: center; }
.lang-switch:hover { background: var(--navy); color: #fff; }
footer .note { margin-top: 16px; font-size: 14px; color: var(--light); }

/* ===== Shared / inner pages ===== */
main { min-height: 60vh; }
.muted { color: var(--muted); }
.page-head { background: var(--bg); padding: 48px 0 40px; text-align: center; }
.page-head h1 { margin: 0 0 8px; font-size: 40px; font-weight: 800; color: var(--navy); }
.page-head p { margin: 0; color: var(--muted); font-size: 18px; }
.section-pad-sm { padding: 40px 0 72px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; color: var(--navy); font-size: 15px; }
.field input, .field select { font-family: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; border: 1.5px solid #C7D3E3; border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
.field input:focus, .field select:focus { outline: 3px solid rgba(242,182,50,.55); border-color: var(--navy); }
.err { color: #B3261E; font-size: 14px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; background: var(--bg); border-radius: 18px; padding: 20px; margin-bottom: 20px; }

.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; justify-content: center; }
.car-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #E1E8F2; border-radius: 18px; overflow: hidden; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.car-card:hover { box-shadow: 0 10px 24px rgba(11,60,110,.14); transform: translateY(-3px); }
.car-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg); display: flex; align-items: center; justify-content: center; color: #9AA9BC; font-weight: 600; }
.car-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-thumb .badge-cond { position: absolute; top: 12px; left: 12px; }
.car-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.car-brand { font-size: 14px; color: var(--muted); font-weight: 600; }
.car-title { margin: 0; font-size: 19px; color: var(--navy); line-height: 1.4; }
.car-meta { color: var(--muted); font-size: 15px; }
.car-price { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: 22px; color: var(--navy); }
.car-price small { font-size: 14px; font-weight: 600; color: var(--muted); }

.badge-cond { display: inline-block; font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.badge-cond.clean { background: #E3F4E8; color: #14602C; }
.badge-cond.accident { background: #FFF1D6; color: #7A4B00; }
.badge-cond.salvage { background: #FBE3E1; color: #8C1D18; }

.empty { text-align: center; padding: 64px 16px; color: var(--muted); font-size: 18px; }

/* Car details */
.back-link { display: inline-block; margin: 24px 0 16px; color: var(--navy); font-weight: 600; }
.show-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 32px; align-items: start; padding-bottom: 72px; }
.gallery-main { aspect-ratio: 4 / 3; background: var(--bg); border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #9AA9BC; font-weight: 600; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.show-title { margin: 24px 0 8px; font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1.35; }
.block { margin-top: 32px; }
.block h2 { margin: 0 0 16px; font-size: 24px; color: var(--navy); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.spec-grid > div { background: var(--bg); border-radius: 12px; padding: 12px 16px; }
.spec-grid dt { font-size: 14px; color: var(--muted); }
.spec-grid dd { margin: 0; font-weight: 800; color: var(--navy); }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 20px; }
.price-card, .lead-card { background: #fff; border: 1px solid #E1E8F2; border-radius: 20px; padding: 28px; }
.price-card { border-top: 6px solid var(--gold); }
.price-card .big { font-size: 36px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.price-card .big small { font-size: 16px; font-weight: 600; color: var(--muted); }
.price-card .row { margin-top: 14px; color: var(--muted); }
.price-card .row strong { color: var(--navy); }
.lead-card h3 { margin: 0 0 6px; font-size: 22px; color: var(--navy); }
.lead-card p { margin: 0 0 18px; }
.lead-card form { display: flex; flex-direction: column; gap: 14px; }
.alert-success { background: #E3F4E8; color: #14602C; border-radius: 12px; padding: 16px; font-weight: 600; }

/* =========================================
   التعديلات الخاصة بالجوال (Responsive Fixes)
   ========================================= */
@media (max-width: 900px) {
    .show-layout { grid-template-columns: 1fr; }
    .side { position: static; }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }

    .nav { flex-direction: column; text-align: center; gap: 15px; padding: 14px 0; }
    .nav-links { justify-content: center; gap: 12px 16px; width: 100%; }

    .hero-inner { padding: 48px 0; gap: 40px; text-align: center; }
    .hero h1 { font-size: 36px; }
    .hero p.lead { font-size: 18px; margin: 0 auto 24px; }
    .actions { justify-content: center; flex-direction: column; }
    .actions .btn { width: 100%; }
    .hero-card { padding: 28px 22px; width: 100%; }

    .section-pad { padding: 56px 0; }
    h2.section-title, .how h2 { font-size: 30px; }
    .page-head h1 { font-size: 30px; }
    .show-title { font-size: 26px; }
    .price-card .big { font-size: 30px; }

    .dealer-box { padding: 32px 24px; text-align: center; }
    .dealer-box .btn { width: 100%; margin-top: 20px; }
    .dealer-box h2 { font-size: 28px; }

    /* إصلاح التوسيط للعناصر في الجوال */
    .grid-3, .grid-4, .grid-2 {
        justify-content: center;
    }
    .grid-3 > div, .grid-4 > div {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .step-num {
        margin: 0 auto 16px auto;
    }
    .feature {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
    .pay-card {
        padding: 24px 20px;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}
