/* =============================================================
   سوق السيارات السعودي - Style Sheet
   ============================================================= */

/* === إعداد الثيمات (CSS Variables) === */
:root {
    /* الثيم الشبابي الفاتح */
    --bg-youth: #e3f2fd;
    --primary-youth: #1565c0;
    --text-youth: #000000;

    /* الثيم العائلي الفاتح */
    --bg-family: #e8f5e9;
    --primary-family: #2e7d32;
    --text-family: #000000;

    /* الثيم البناتي الفاتح */
    --bg-feminine: #fce4ec;
    --primary-feminine: #e91e63;
    --text-feminine: #000000;

    /* الثيم الفاخر الفاتح */
    --bg-luxury: #fff8e1;
    --primary-luxury: #d4af37;
    --text-luxury: #000000;

    /* === النسخ الداكنة === */
    --dark-bg-youth: #1a1a1a;
    --dark-primary-youth: #4fc3f7;
    --dark-text-youth: #ffffff;

    --dark-bg-family: #0f1f15;
    --dark-primary-family: #81c784;
    --dark-text-family: #ffffff;

    --dark-bg-feminine: #2c0517;
    --dark-primary-feminine: #f06292;
    --dark-text-feminine: #ffffff;

    --dark-bg-luxury: #151515;
    --dark-primary-luxury: #ffd700;
    --dark-text-luxury: #ffffff;
}

/* === الوضع الداكن (Dark Mode) === */
body.dark-mode {
    --bg-youth: var(--dark-bg-youth);
    --primary-youth: var(--dark-primary-youth);
    --text-youth: var(--dark-text-youth);

    --bg-family: var(--dark-bg-family);
    --primary-family: var(--dark-primary-family);
    --text-family: var(--dark-text-family);

    --bg-feminine: var(--dark-bg-feminine);
    --primary-feminine: var(--dark-primary-feminine);
    --text-feminine: var(--dark-text-feminine);

    --bg-luxury: var(--dark-bg-luxury);
    --primary-luxury: var(--dark-primary-luxury);
    --text-luxury: var(--dark-text-luxury);
}

/* === تطبيق الثيمات === */
body.theme-youth    { --bg: var(--bg-youth);    --primary: var(--primary-youth);    --text: var(--text-youth); }
body.theme-family   { --bg: var(--bg-family);   --primary: var(--primary-family);   --text: var(--text-family); }
body.theme-feminine { --bg: var(--bg-feminine); --primary: var(--primary-feminine); --text: var(--text-feminine); }
body.theme-luxury   { --bg: var(--bg-luxury);   --primary: var(--primary-luxury);   --text: var(--text-luxury); }

body.theme-youth.dark-mode    { --bg: var(--dark-bg-youth);    --primary: var(--dark-primary-youth);    --text: var(--dark-text-youth); }
body.theme-family.dark-mode   { --bg: var(--dark-bg-family);   --primary: var(--dark-primary-family);   --text: var(--dark-text-family); }
body.theme-feminine.dark-mode { --bg: var(--dark-bg-feminine); --primary: var(--dark-primary-feminine); --text: var(--dark-text-feminine); }
body.theme-luxury.dark-mode   { --bg: var(--dark-bg-luxury);   --primary: var(--dark-primary-luxury);   --text: var(--dark-text-luxury); }

/* === التصميم العام === */
body {
    background-color: var(--bg);
    color: var(--text);
    transition: all 0.5s ease;
    font-family: 'Cairo', 'Tahoma', 'Segoe UI', 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary), #666);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* === شعار الشركة (استبدله من assets/images/logo.png) === */
.site-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.site-logo:hover {
    transform: scale(1.05) rotate(-3deg);
}

/* === أزرار تبديل الثيم === */
.theme-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.theme-btn:hover,
.theme-btn.active {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* === زر الوضع الداكن === */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s;
    font-size: 16px;
    font-family: inherit;
}

.theme-toggle:hover {
    background: white;
    color: var(--primary);
}

/* === البانر === */
.hero-banner {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--bg);
    color: var(--text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* === شبكة الفئات === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background-color: var(--bg);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 4em;
    margin-bottom: 10px;
    display: block;
    color: var(--primary);
}

.category-title {
    display: block;
    font-size: 1.4em;
    margin-bottom: 5px;
    color: var(--primary);
    font-weight: 800;
}

.category-desc {
    font-size: 0.9em;
    color: var(--text);
    opacity: 0.8;
    margin-bottom: 15px;
    line-height: 1.5;
}

.action-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.3s;
    font-family: inherit;
}

.action-btn:hover {
    background-color: var(--primary);
    opacity: 0.9;
}

/* === صندوق الفلاتر === */
.filter-box {
    background-color: var(--bg);
    padding: 25px;
    border-radius: 20px;
    margin: 30px auto;
    max-width: 800px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: var(--text);
}

.filter-box h3 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 20px;
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.filter-label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--primary);
    margin-bottom: -5px;
}

.filter-field {
    flex: 1;
    min-width: 200px;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background-color: var(--bg);
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

input::placeholder {
    color: var(--text);
    opacity: 0.5;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.filter-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 10px;
    width: 100%;
    font-family: inherit;
}

.filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* === شبكة السيارات === */
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.car-card {
    background-color: var(--bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border: 1px solid var(--primary);
    position: relative;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.car-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 2px solid var(--primary);
    background: rgba(0, 0, 0, 0.05);
}

.car-info {
    padding: 15px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
}

.car-model {
    font-size: 1.2em;
    font-weight: 800;
    margin-bottom: 5px;
    color: var(--primary);
}

.car-price {
    font-size: 1.4em;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 10px;
}

.car-year {
    font-size: 0.85em;
    color: var(--text);
    opacity: 0.7;
    margin-bottom: 8px;
}

.car-type-badge {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text);
    font-size: 0.85em;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 10px;
    border: 1px solid var(--primary);
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 50px;
    color: var(--text);
    opacity: 0.6;
    font-size: 1.2em;
    background: var(--bg);
    border-radius: 15px;
    border: 2px dashed var(--primary);
}

.loading-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 50px;
    color: var(--primary);
    font-size: 1.2em;
}


/* =============================================================
   📱 الاستجابة (Responsive Design)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   نقاط الانكسار:
   • موبايل صغير: حتى 480px
   • موبايل عادي / فابلت: 481px - 767px
   • تابلت: 768px - 1023px
   • ديسكتوب: 1024px+
   ============================================================= */

/* === أساسيات عامة - تطبق على جميع الأحجام === */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* تكبير حقول الإدخال على iOS لتفادي الزووم التلقائي */
input, select, textarea, button {
    font-size: 16px;
}

/* تحسين أحجام اللمس - مهم جداً للموبايل */
button, .action-btn, .theme-btn, .theme-toggle, .filter-btn {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* === 📱 موبايل (حتى 768px) === */
@media screen and (max-width: 768px) {

    /* الهيدر - تبسيط */
    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.5em;
        margin: 10px 0 5px;
    }

    /* الشعار - تصغير على الموبايل */
    .site-logo {
        width: 70px;
        height: 70px;
        padding: 5px;
        margin-bottom: 5px;
    }

    /* أزرار الثيمات - مرنة على الموبايل */
    .theme-switcher {
        gap: 8px;
        margin-top: 12px;
        padding: 0 5px;
    }

    .theme-btn {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1 1 calc(50% - 8px);
        max-width: calc(50% - 8px);
        min-height: 44px;
    }

    /* زر الوضع الداكن */
    .theme-toggle {
        margin-top: 12px;
        padding: 10px 20px;
        font-size: 14px;
        width: 90%;
        max-width: 280px;
    }

    /* البانر */
    .hero-banner {
        padding: 25px 15px;
    }

    .hero-banner h2 {
        font-size: 1.4em;
        margin: 5px 0;
    }

    .hero-banner p {
        font-size: 0.95em;
    }

    /* شبكة الفئات - عمودين على الموبايل */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .category-card {
        padding: 15px 10px;
    }

    .category-icon {
        font-size: 2.5em;
        margin-bottom: 8px;
    }

    .category-title {
        font-size: 1.1em;
    }

    .category-desc {
        font-size: 0.8em;
        margin-bottom: 10px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 0.85em;
        width: 100%;
    }

    /* الفلاتر */
    .filter-box {
        padding: 18px 15px;
        margin: 20px 10px;
        border-radius: 15px;
    }

    .filter-box h3 {
        font-size: 1.15em;
        margin-bottom: 15px;
    }

    .filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-field {
        min-width: 100%;
        margin-top: 0 !important;
    }

    input, select {
        padding: 14px;
        font-size: 16px; /* مهم لتفادي زووم iOS */
        border-radius: 8px;
    }

    .filter-btn {
        padding: 14px 20px;
        font-size: 15px;
        margin-top: 5px;
    }

    /* شبكة السيارات - عمود واحد على الموبايل الصغير */
    .car-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .car-card {
        border-radius: 12px;
    }

    .car-img {
        height: 220px; /* أكبر شوي على الموبايل لإبراز الصورة */
    }

    .car-info {
        padding: 12px;
    }

    .car-model {
        font-size: 1.05em;
    }

    .car-price {
        font-size: 1.3em;
    }

    .car-year {
        font-size: 0.8em;
    }

    .car-type-badge {
        font-size: 0.8em;
        padding: 4px 10px;
    }

    /* الحالة الفارغة */
    .empty-state {
        padding: 30px 20px;
        font-size: 1em;
    }
}

/* === 📱 موبايل عريض / فابلت (480px - 600px) === */
@media screen and (min-width: 481px) and (max-width: 600px) {
    /* بطاقات السيارات: عمودين */
    .car-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .car-img {
        height: 160px;
    }
}

/* === 📱 موبايل صغير جداً (حتى 380px) === */
@media screen and (max-width: 380px) {

    header h1 {
        font-size: 1.3em;
    }

    .site-logo {
        width: 60px;
        height: 60px;
    }

    /* الفئات: عمود واحد على الشاشات الصغيرة جداً */
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 12px;
    }

    /* أزرار الثيمات: عمود واحد */
    .theme-btn {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .theme-switcher {
        flex-direction: column;
    }

    /* أيقونات أصغر */
    .category-icon {
        font-size: 2em;
    }
}

/* === 📲 تابلت (768px - 1023px) === */
@media screen and (min-width: 769px) and (max-width: 1023px) {

    /* شبكة السيارات: عمودين أو ثلاثة */
    .car-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .car-img {
        height: 200px;
    }

    /* شبكة الفئات: 4 أعمدة */
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .category-card {
        padding: 18px 12px;
    }

    /* الفلاتر تبقى أفقية */
    .filter-row {
        flex-wrap: nowrap;
    }

    /* الهيدر */
    header {
        padding: 25px 20px;
    }

    .site-logo {
        width: 90px;
        height: 90px;
    }
}

/* === 💻 شاشات كبيرة (1280px+) === */
@media screen and (min-width: 1280px) {
    .car-grid {
        max-width: 1400px;
        grid-template-columns: repeat(3, 1fr);
    }

    .category-grid {
        max-width: 1200px;
    }

    .filter-box {
        max-width: 900px;
    }
}

/* === 🖥️ شاشات عريضة جداً (1600px+) === */
@media screen and (min-width: 1600px) {
    .car-grid {
        max-width: 1500px;
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
}

/* === 🔄 الوضع الأفقي للموبايل (Landscape) === */
@media screen and (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 12px 15px;
    }

    .site-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
    }

    header h1 {
        font-size: 1.2em;
        margin: 5px 0;
    }

    .hero-banner {
        padding: 15px;
    }

    /* الفلتر في وضع أفقي: يمكن أن يكون صفّاً واحداً */
    .filter-row {
        flex-direction: row;
    }

    .filter-field {
        min-width: 200px;
    }
}

/* === ✨ تحسينات إضافية للوضع الداكن === */
@media (prefers-color-scheme: dark) {
    /* تفضيل النظام للوضع الداكن - يمكن استخدامه لاحقاً */
}

/* === ♿ تحسينات إمكانية الوصول === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === 🎯 تحسينات الطباعة === */
@media print {
    .theme-switcher,
    .theme-toggle,
    .filter-box,
    .action-btn,
    .filter-btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .car-card {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* === 🎨 تحسينات بصرية إضافية === */

/* إظهار السكرول الأفقي بسلاسة على الموبايل */
.car-grid, .category-grid {
    -webkit-overflow-scrolling: touch;
}

/* تحسين قابلية القراءة بحجم النص الأدنى */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.5;
    }
}

/* تحسين أزرار النوافذ المنبثقة */
@media (hover: none) and (pointer: coarse) {
    /* أجهزة اللمس - تكبير الأهداف */
    .theme-btn:hover,
    .filter-btn:hover,
    .action-btn:hover {
        transform: none; /* إلغاء التحولات على اللمس لتفادي العلق */
    }
}


/* =============================================================
   💱 نظام العملات - التنسيقات
   ============================================================= */

/* الشريط العلوي - العملات + الوضع الداكن */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 10px;
    margin: -30px -20px 20px -20px;
}

.currency-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.currency-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.currency-select {
    width: auto !important;
    min-width: 180px;
    padding: 6px 10px !important;
    border: 1px solid var(--primary) !important;
    border-radius: 6px !important;
    background: white !important;
    color: var(--primary) !important;
    font-size: 14px !important;
    font-weight: 600;
    cursor: pointer;
}

.top-bar .theme-toggle {
    margin-top: 0;
    padding: 6px 18px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border-color: var(--primary);
}

/* === كتلة السعر الجديدة (عملتين) === */
.car-price-block {
    margin: 10px 0;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06));
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .car-price-block {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.1);
}

.car-price-primary {
    font-size: 1.5em;
    font-weight: 800;
    color: #d32f2f;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.car-price-secondary {
    font-size: 0.9em;
    color: var(--text);
    opacity: 0.7;
    margin-top: 4px;
    font-weight: 600;
}

/* استبعاد الكلاس القديم */
.car-price {
    display: none;
}

/* === الاستجابة للموبايل === */
@media screen and (max-width: 600px) {
    .top-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
        margin: -20px -15px 15px -15px;
    }

    .currency-box {
        width: 100%;
        justify-content: center;
    }

    .currency-select {
        flex: 1;
        min-width: 0 !important;
    }

    .top-bar .theme-toggle {
        width: 100%;
    }

    .car-price-primary {
        font-size: 1.3em;
    }

    .car-price-secondary {
        font-size: 0.85em;
    }
}


/* =============================================================
   🏷️ شارات حالة السيارة (Status Badges)
   ============================================================= */

.car-img-wrapper {
    position: relative;
    overflow: hidden;
}

.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.status-badge.status-available { background: rgba(16, 185, 129, 0.95); }
.status-badge.status-sold      { background: rgba(107, 114, 128, 0.95); }
.status-badge.status-reserved  { background: rgba(245, 158, 11, 0.95); }
.status-badge.status-coming    { background: rgba(59, 130, 246, 0.95); }

/* السيارات المباعة: تظهر بشكل باهت */
.car-card.car-status-sold {
    opacity: 0.75;
}
.car-card.car-status-sold .car-img {
    filter: grayscale(50%);
}

/* السيارات المحجوزة: حد كهرماني */
.car-card.car-status-reserved {
    border: 2px solid #f59e0b;
}

/* السيارات القادمة قريباً: حد أزرق */
.car-card.car-status-coming_soon {
    border: 2px dashed #3b82f6;
}

/* === تاريخ الإضافة على البطاقة === */
.car-date-added {
    font-size: 0.75em;
    color: var(--text);
    opacity: 0.55;
    margin-top: 3px;
    font-weight: 500;
}

.car-date-new {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 700;
    margin-right: 6px;
    animation: pulse-new 2s infinite;
}

@keyframes pulse-new {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === فلتر الحالة === */
@media screen and (max-width: 600px) {
    .status-badge {
        font-size: 0.75em;
        padding: 5px 10px;
        top: 8px;
        right: 8px;
    }
}


/* === Footer داخل بطاقة السيارة (Badge + Date) === */
.car-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}


/* =============================================================
   📄 صفحة تفاصيل السيارة (car.html)
   ============================================================= */

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: white;
    color: var(--primary);
}

.car-detail-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.car-detail-card {
    background: var(--bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* قسم الصورة */
.detail-image-section {
    position: relative;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.detail-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-image-section .status-badge {
    top: 20px;
    right: 20px;
    font-size: 1em;
    padding: 8px 18px;
}

/* قسم المعلومات */
.detail-info-section {
    padding: 35px 30px;
    overflow-y: auto;
}

.detail-header {
    border-bottom: 2px solid rgba(0,0,0,0.08);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.detail-car-name {
    color: var(--primary);
    font-size: 1.9em;
    margin: 0 0 12px;
    font-weight: 800;
    line-height: 1.3;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.detail-category-badge,
.detail-type-badge,
.detail-year {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
    color: var(--text);
}

.detail-category-badge {
    background: var(--primary);
    color: white;
}

.detail-type-badge {
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

/* كتلة السعر */
.detail-price-block {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border: 2px solid #d32f2f;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

body.dark-mode .detail-price-block {
    background: linear-gradient(135deg, #3a1a1a, #2a1010);
}

.detail-price-label {
    font-size: 0.95em;
    color: var(--text);
    opacity: 0.7;
    margin-bottom: 8px;
}

.detail-price-primary {
    font-size: 2.3em;
    font-weight: 800;
    color: #d32f2f;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.detail-price-secondary {
    font-size: 1.1em;
    color: var(--text);
    opacity: 0.75;
    margin-top: 8px;
    font-weight: 600;
}

/* المواصفات */
.detail-specs, .detail-features, .detail-description {
    margin: 25px 0;
}

.detail-specs h3, .detail-features h3, .detail-description h3 {
    color: var(--primary);
    font-size: 1.2em;
    margin: 0 0 12px;
    padding-right: 10px;
    border-right: 4px solid var(--primary);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.spec-item {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    padding: 12px 14px;
}

body.dark-mode .spec-item {
    background: rgba(255, 255, 255, 0.05);
}

.spec-label {
    font-size: 0.85em;
    color: var(--text);
    opacity: 0.6;
    margin-bottom: 4px;
}

.spec-value {
    font-size: 1em;
    font-weight: 700;
    color: var(--text);
}

/* قائمة المميزات */
.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.features-list li {
    background: rgba(76, 175, 80, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95em;
    border-right: 3px solid #4caf50;
}

.features-list li.empty {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.04);
    border-right: 3px solid #9ca3af;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* الوصف */
.detail-description p {
    line-height: 1.8;
    color: var(--text);
    font-size: 1.05em;
    background: rgba(0, 0, 0, 0.03);
    padding: 15px;
    border-radius: 10px;
    border-right: 4px solid var(--primary);
    margin: 0;
}

body.dark-mode .detail-description p {
    background: rgba(255, 255, 255, 0.05);
}

/* أزرار التواصل */
.detail-contact-buttons {
    display: flex;
    gap: 12px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
}

.contact-btn {
    flex: 1;
    min-width: 200px;
    padding: 16px 25px;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    cursor: pointer;
}

.whatsapp-btn {
    background: #25d366;
    color: white;
}

.whatsapp-btn:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.call-btn {
    background: var(--primary);
    color: white;
}

.call-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* footer للمعلومات الإضافية */
.detail-footer-info {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-id {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85em;
    color: var(--text);
    opacity: 0.7;
    font-family: monospace;
}

/* === جعل صورة البطاقة قابلة للضغط === */
.car-card .car-img-wrapper,
.car-card .car-img {
    cursor: pointer;
}

.car-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* === استجابة صفحة التفاصيل === */
@media (max-width: 768px) {
    .car-detail-card {
        grid-template-columns: 1fr;
    }

    .detail-image-section {
        min-height: 250px;
    }

    .detail-main-image {
        height: 280px;
    }

    .detail-info-section {
        padding: 25px 20px;
    }

    .detail-car-name {
        font-size: 1.5em;
    }

    .detail-price-primary {
        font-size: 1.9em;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .contact-btn {
        min-width: 100%;
    }
}


/* === Overlay عند الـ hover على البطاقة === */
.car-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s;
}

.car-link:hover {
    transform: translateY(-4px);
}

.car-img-wrapper {
    position: relative;
    overflow: hidden;
}

.car-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.car-link:hover .car-img-overlay {
    opacity: 1;
}

.view-details-btn {
    background: white;
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* لمس الأجهزة المحمولة: الـ overlay يظهر دائماً بشكل خفيف */
@media (hover: none) and (pointer: coarse) {
    .car-img-overlay {
        opacity: 0.85;
        background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0) 40%);
    }
}


/* =============================================================
   🔍 شريط البحث المنفصل
   ============================================================= */
.search-box {
    position: relative;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.search-box input {
    width: 100%;
    padding: 14px 50px 14px 50px;
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-size: 16px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--primary);
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    background: var(--primary);
    color: white;
}

/* =============================================================
   🎛️ الفلاتر المتقدمة
   ============================================================= */
.filter-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-box-header h3 {
    margin: 0;
}

.filter-toggle-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
}

.filter-toggle-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

.advanced-filters {
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px dashed var(--primary);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.filter-reset-btn {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text);
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
    flex: 0 0 auto;
}

.filter-reset-btn:hover {
    background: rgba(0, 0, 0, 0.15);
}

.filter-actions .filter-btn {
    flex: 1;
    margin-top: 0;
}

.results-count {
    text-align: center;
    margin: 15px auto;
    padding: 8px 20px;
    max-width: 800px;
    color: var(--text);
    opacity: 0.75;
    font-size: 0.95em;
    font-weight: 600;
}

/* =============================================================
   💰 زر حاسبة التمويل في البانر
   ============================================================= */
.hero-finance-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    margin-top: 18px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.3s;
}

.hero-finance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
}

/* =============================================================
   💰 نافذة حاسبة التمويل (Modal)
   ============================================================= */
.finance-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.finance-modal.open {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.finance-modal-content {
    background: var(--bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    margin: 30px 0;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.finance-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.finance-close-btn:hover {
    background: #d32f2f;
    color: white;
}

.finance-modal-content h2 {
    color: var(--primary);
    margin: 0 0 5px;
    font-size: 1.6em;
}

.finance-subtitle {
    color: var(--text);
    opacity: 0.7;
    margin: 0 0 25px;
    font-size: 0.95em;
}

.finance-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 25px;
}

.finance-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.finance-field label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95em;
}

.finance-field input[type="number"],
.finance-field select {
    padding: 12px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

.finance-field input[type="range"] {
    margin-top: 8px;
    accent-color: var(--primary);
    width: 100%;
}

/* النتائج */
.finance-hint {
    text-align: center;
    color: var(--text);
    opacity: 0.6;
    padding: 30px;
    font-size: 1.05em;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.finance-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.finance-result-card {
    background: rgba(0, 0, 0, 0.04);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .finance-result-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.finance-result-card.highlight {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary), #666);
    color: white;
    border: none;
}

.finance-result-card.total {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    border: none;
}

.finance-result-label {
    font-size: 0.9em;
    opacity: 0.85;
    margin-bottom: 6px;
}

.finance-result-value {
    font-size: 1.5em;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.finance-result-card.highlight .finance-result-value {
    font-size: 2em;
}

.finance-result-sub {
    font-size: 0.8em;
    opacity: 0.75;
    margin-top: 4px;
}

.finance-disclaimer {
    margin-top: 20px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-right: 3px solid #f59e0b;
    border-radius: 8px;
    color: var(--text);
}

/* === الاستجابة === */
@media (max-width: 600px) {
    .finance-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .finance-result-grid {
        grid-template-columns: 1fr;
    }
    .finance-modal-content {
        padding: 22px 18px;
        margin: 10px 0;
    }
    .finance-modal-content h2 {
        font-size: 1.4em;
    }
    .filter-actions {
        flex-direction: column;
    }
}


/* =============================================================
   🖼️ Gallery للصور المتعددة
   ============================================================= */

.gallery-container { width: 100%; }

.gallery-main {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    background: #000;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-nav:hover { background: var(--primary); transform: translateY(-50%) scale(1.1); }
.gallery-prev { left: 15px; }
.gallery-next { right: 15px; }

.gallery-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.gallery-thumbs {
    background: rgba(0,0,0,0.05);
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
}

body.dark-mode .gallery-thumbs { background: rgba(255,255,255,0.05); }

.thumb-section { margin-bottom: 12px; }
.thumb-label {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.thumb-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.gallery-thumb:hover { border-color: var(--primary); transform: scale(1.05); }
.gallery-thumb.active { border-color: var(--primary); box-shadow: 0 0 10px rgba(0,0,0,0.3); }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.open { display: flex; animation: fadeIn 0.3s; }

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 40px;
    cursor: pointer;
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

@media (max-width: 768px) {
    .gallery-main { height: 280px; }
    .gallery-thumb { width: 55px; height: 55px; }
}


/* =============================================================
   🌐 زر تبديل اللغة
   ============================================================= */
.lang-toggle {
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 6px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: 0;
    margin-right: 8px;
}

.lang-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* الاتجاهات حسب اللغة */
html[dir="ltr"] body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
}

html[dir="ltr"] .car-info,
html[dir="ltr"] .filter-box,
html[dir="ltr"] .detail-info-section {
    text-align: left;
}

/* Adjust top bar for both directions */
.top-bar .lang-toggle,
.top-bar .theme-toggle {
    margin-top: 0;
}

@media (max-width: 600px) {
    .lang-toggle {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
}


/* =============================================================
   🌐 Dropdown اللغات الجديد
   ============================================================= */
.lang-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lang-label {
    font-size: 16px;
    color: var(--primary);
}

.lang-select {
    width: auto !important;
    min-width: 130px;
    padding: 5px 8px !important;
    border: 1px solid var(--primary) !important;
    border-radius: 6px !important;
    background: white !important;
    color: var(--primary) !important;
    font-size: 14px !important;
    font-weight: 600;
    cursor: pointer;
}

/* إخفاء زر اللغة القديم إن وُجد */
.lang-toggle { display: none !important; }

@media (max-width: 600px) {
    .lang-box {
        width: 100%;
        justify-content: center;
    }
    .lang-select {
        flex: 1;
        min-width: 0 !important;
    }
}


/* =============================================================
   📐 قسم الهيدر القابل للطي
   ============================================================= */

header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-collapsible {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.header-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.header-toggle-btn {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    width: 38px;
    height: 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 101;
}

.header-toggle-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-50%) scale(1.1);
}

/* عند الطي: الهيدر يصير صغير جداً */
.header-collapsible.collapsed ~ .header-toggle-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

header:has(.header-collapsible.collapsed) {
    padding: 10px 20px 22px !important;
}

/* على الموبايل: زر أوضح */
@media (max-width: 768px) {
    .header-toggle-btn {
        width: 50px;
        height: 32px;
        bottom: -16px;
        font-size: 16px;
    }
}


/* =============================================================
   ❤️ نظام المفضلة (Favorites)
   ============================================================= */

/* زر القلب على كل بطاقة سيارة */
.fav-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e91e63;
    color: #e91e63;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 5;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.fav-btn:hover {
    transform: scale(1.15);
    background: #e91e63;
    color: white;
}

.fav-btn.active {
    background: #e91e63;
    color: white;
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.15); }
}

/* زر المفضلة في الشريط العلوي */
.header-fav-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #e91e63;
    border: 2px solid #e91e63;
    padding: 6px 14px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-fav-btn:hover {
    background: #e91e63;
    color: white;
    transform: scale(1.05);
}

.fav-counter {
    background: #e91e63;
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: 12px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 800;
}

.header-fav-btn:hover .fav-counter {
    background: white;
    color: #e91e63;
}

/* Modal */
.favorites-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
}

.favorites-modal.open {
    display: flex;
    animation: fadeIn 0.3s;
}

.favorites-modal-content {
    background: var(--bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    margin: 30px 0;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 2px solid #e91e63;
}

.fav-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.fav-close-btn:hover { background: #e91e63; color: white; }

.favorites-modal-content h2 {
    color: #e91e63;
    margin: 0 0 5px;
}

.fav-clear-all {
    background: transparent;
    color: var(--text);
    opacity: 0.7;
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.fav-clear-all:hover {
    background: #d32f2f;
    color: white;
    opacity: 1;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.fav-empty {
    text-align: center;
    padding: 40px;
    color: var(--text);
    opacity: 0.7;
    font-size: 1.1em;
}

.fav-item {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.04);
    padding: 12px;
    border-radius: 12px;
    align-items: center;
}

body.dark-mode .fav-item { background: rgba(255, 255, 255, 0.06); }

.fav-item img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.fav-item-info { flex: 1; }
.fav-item-info h4 { margin: 0 0 5px; color: var(--primary); font-size: 1em; }
.fav-item-price { color: #d32f2f; font-weight: 700; margin-bottom: 8px; font-size: 0.9em; }

.fav-item-actions {
    display: flex;
    gap: 8px;
}

.fav-view-btn, .fav-remove-btn {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    font-family: inherit;
    text-decoration: none;
    font-weight: 600;
}

.fav-view-btn {
    background: var(--primary);
    color: white;
}
.fav-remove-btn {
    background: #fee;
    color: #d32f2f;
    border: 1px solid #fcc;
}

/* Toast */
.fav-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #e91e63;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
}

.fav-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
    .header-fav-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    .fav-item img { width: 70px; height: 50px; }
}


/* =============================================================
   📤 أزرار المشاركة
   ============================================================= */

/* زر المشاركة المدمج على البطاقة */
.share-wrapper {
    position: absolute;
    top: 12px;
    left: 60px;  /* بجنب زر القلب */
    z-index: 5;
}

.share-trigger-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.share-trigger-btn:hover {
    transform: scale(1.15);
    background: var(--primary);
    color: white;
}

.share-menu {
    position: absolute;
    top: 50px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.share-menu.open {
    display: flex;
    animation: shareSlideIn 0.2s ease;
}

@keyframes shareSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

body.dark-mode .share-menu {
    background: #2c2c2c;
    border-color: rgba(255, 255, 255, 0.1);
}

.share-menu button {
    background: transparent;
    color: var(--text);
    border: none;
    padding: 10px 14px;
    text-align: right;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

body.dark-mode .share-menu button { color: white; }

.share-menu button:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(-3px);
}

body.dark-mode .share-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* أزرار المشاركة الكاملة في صفحة التفاصيل */
.detail-share-section {
    margin: 25px 0;
}

.detail-share-section h3 {
    color: var(--primary);
    font-size: 1.2em;
    margin: 0 0 12px;
    padding-right: 10px;
    border-right: 4px solid var(--primary);
}

.share-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    flex: 1 1 auto;
    min-width: 130px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    color: white;
    transition: all 0.3s;
    font-size: 14px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.share-btn.whatsapp { background: #25d366; }
.share-btn.twitter  { background: #000000; }
.share-btn.telegram { background: #0088cc; }
.share-btn.copy     { background: #6b7280; }

@media (max-width: 600px) {
    .share-wrapper { left: 56px; }
    .share-trigger-btn { width: 36px; height: 36px; font-size: 14px; }
    .share-btn { min-width: 100%; }
}


/* =============================================================
   ⚖️ نظام المقارنة
   ============================================================= */

.compare-btn {
    position: absolute;
    top: 60px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary);
    color: var(--primary);
    min-width: 40px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    z-index: 5;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.compare-btn .cmp-icon {
    font-size: 16px;
    font-weight: 800;
}

.compare-btn .cmp-label {
    display: none;
    font-size: 12px;
}

.compare-btn.active .cmp-label {
    display: inline;
}

.compare-btn.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    padding: 0 14px;
    animation: heartBeat 0.5s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

/* overlay لما السيارة محددة للمقارنة */
.car-card:has(.compare-btn.active) {
    box-shadow: 0 0 0 3px #10b981, 0 10px 25px rgba(16, 185, 129, 0.25);
    transition: all 0.3s;
}

.compare-btn:hover {
    transform: scale(1.15);
    background: var(--primary);
    color: white;
}

.compare-btn.active {
    background: var(--primary);
    color: white;
    animation: heartBeat 0.5s ease;
}

.header-cmp-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.header-cmp-btn:hover {
    background: var(--primary) !important;
    color: white !important;
}

.header-cmp-btn .fav-counter {
    background: var(--primary);
}

/* Floating bar */
.compare-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.compare-floating-bar button {
    background: white;
    color: var(--primary);
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.compare-floating-bar .cmp-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
}

/* Compare Modal */
.compare-modal-content {
    max-width: 95vw !important;
}

.compare-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.compare-table th, .compare-table td {
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
    vertical-align: middle;
}

body.dark-mode .compare-table th,
body.dark-mode .compare-table td {
    border-color: rgba(255, 255, 255, 0.1);
}

.compare-table th {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
}

.row-label {
    background: rgba(0, 0, 0, 0.06);
    font-weight: 700;
    color: var(--primary);
    text-align: right !important;
}

body.dark-mode .row-label { background: rgba(255, 255, 255, 0.05); }

.compare-th-car {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cmp-remove-x {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.cmp-img {
    width: 100%;
    max-width: 150px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.cmp-feats {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
    font-size: 0.9em;
}

.cmp-feats li {
    padding: 3px 0;
}

.compare-actions {
    text-align: center;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .compare-btn { top: 56px; width: 36px; height: 36px; font-size: 14px; }
    .compare-floating-bar { padding: 8px 14px; font-size: 13px; }
    .cmp-img { max-width: 100px; height: 60px; }
}


/* =============================================================
   🎯 شريط الأزرار الجديد (Action Bar أسفل البطاقة)
   ============================================================= */

/* إخفاء الأزرار العائمة القديمة على البطاقات */
.car-card-wrapper .fav-btn,
.car-card-wrapper .compare-btn,
.car-card-wrapper .share-wrapper {
    display: none !important;
}

.car-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* البطاقة الكاملة */
.car-card-wrapper .car-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* شريط الأزرار */
.card-action-bar {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0 0 12px 12px;
    margin-top: -6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .card-action-bar {
    background: rgba(255, 255, 255, 0.05);
    border-top-color: rgba(255, 255, 255, 0.08);
}

.action-bar-btn {
    flex: 1;
    background: white;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text);
}

body.dark-mode .action-bar-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: white;
}

.action-bar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.action-bar-btn .ab-icon {
    font-size: 18px;
    line-height: 1;
}

.action-bar-btn .ab-label {
    font-size: 11px;
    white-space: nowrap;
}

/* المفضلة - نشطة */
.action-bar-btn.fav.active {
    background: #fce4ec !important;
    color: #e91e63 !important;
    border-color: #e91e63 !important;
}

body.dark-mode .action-bar-btn.fav.active {
    background: rgba(233, 30, 99, 0.2) !important;
}

/* المقارنة - نشطة */
.action-bar-btn.cmp.active {
    background: #d1fae5 !important;
    color: #047857 !important;
    border-color: #10b981 !important;
    font-weight: 800;
}

body.dark-mode .action-bar-btn.cmp.active {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
}

/* المشاركة - hover */
.action-bar-btn.share:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* البطاقة المحددة للمقارنة - حد أخضر */
.car-card.compare-selected {
    box-shadow: 0 0 0 3px #10b981, 0 10px 25px rgba(16, 185, 129, 0.3) !important;
}

/* الموبايل: نصوص أصغر */
@media (max-width: 600px) {
    .action-bar-btn .ab-label {
        font-size: 10px;
    }
    .action-bar-btn .ab-icon {
        font-size: 16px;
    }
    .action-bar-btn {
        padding: 6px 4px;
    }
}

/* تنبيه عند فتح مقارنة فاضية */
.empty-cmp-hint {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px dashed #f59e0b;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: #78350f;
    margin: 15px 0;
}

body.dark-mode .empty-cmp-hint {
    background: linear-gradient(135deg, #3a2e0f, #2c2107);
    color: #fde68a;
}


/* =============================================================
   🦶 Footer
   ============================================================= */
.site-footer {
    background: linear-gradient(135deg, var(--primary), #333);
    color: white;
    padding: 50px 30px 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 25px;
}

.footer-col h3 {
    margin: 10px 0;
    color: white;
    font-size: 1.3em;
}

.footer-col h4 {
    color: white;
    margin: 0 0 12px;
    font-size: 1.05em;
    opacity: 0.95;
}

.footer-col p {
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95em;
    line-height: 1.6;
}

.footer-col a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-col a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.footer-brand .footer-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 6px;
    display: block;
}

.footer-tagline {
    font-style: italic;
    opacity: 0.85;
    font-size: 0.9em !important;
}

.footer-map-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 6px;
    margin-top: 6px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.footer-map-link:hover {
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none !important;
}

.footer-hours {
    font-size: 0.85em !important;
    opacity: 0.9;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.footer-social a {
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.footer-social a:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.1);
}

.footer-legal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 0.9em;
    opacity: 0.9;
}

.footer-legal .dot {
    margin: 0 12px;
    opacity: 0.5;
}

.footer-legal strong {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.footer-bottom {
    text-align: center;
    padding: 18px 0 0;
    font-size: 0.85em;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .site-footer { padding: 35px 20px 15px; }
    .footer-content { gap: 25px; text-align: center; }
    .footer-brand .footer-logo { margin: 0 auto; }
    .footer-social { justify-content: center; }
    .footer-legal { font-size: 0.8em; }
    .footer-legal .dot { display: block; visibility: hidden; height: 5px; }
}

/* =============================================================
   🧭 Main Navigation Menu (header)
   ============================================================= */
.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
body.dark .main-nav {
    background: rgba(20,20,20,0.7);
    border-color: rgba(255,255,255,0.1);
}
.main-nav a {
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    color: var(--primary);
    background: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.92em;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.main-nav a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.main-nav a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
body.dark .main-nav a {
    background: rgba(40,40,40,0.8);
    color: var(--primary);
}
body.dark .main-nav a:hover { background: var(--primary); color: #fff; }
@media (max-width: 600px) {
    .main-nav { gap: 4px; padding: 8px; }
    .main-nav a { padding: 6px 10px; font-size: 0.85em; }
}

/* =============================================================
   📄 Company Sub-Pages (about / contact / services / faq / privacy / terms)
   ============================================================= */
body.subpage { padding-bottom: 40px; }
.page-main {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}
.subpage-header {
    text-align: center;
    padding: 20px 15px;
}
.subpage-header h1 {
    font-size: 1.8em;
    margin: 8px 0;
    color: var(--primary);
}
.header-logo-link { display: inline-block; }

.loading-state, .empty-state {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    color: #666;
}
body.dark .loading-state, body.dark .empty-state { color: #aaa; }

.company-page {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
body.dark .company-page { background: #1f1f1f; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

/* Page Hero (top of each page) */
.page-hero {
    text-align: center;
    padding: 30px 20px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
body.dark .page-hero { border-bottom-color: rgba(255,255,255,0.1); }
.page-hero h1 {
    font-size: 2.2em;
    margin: 10px 0;
    color: var(--primary);
}
.page-hero-logo {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin-bottom: 10px;
}
.page-hero-tagline {
    font-size: 1.15em;
    color: #666;
    margin: 5px 0;
}
body.dark .page-hero-tagline { color: #bbb; }

/* Sections + Paragraphs */
.page-section {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0,0,0,0.02);
    border-radius: 12px;
}
body.dark .page-section { background: rgba(255,255,255,0.04); }
.page-section h2 {
    color: var(--primary);
    margin: 0 0 15px 0;
    font-size: 1.4em;
}
.page-paragraph {
    line-height: 1.9;
    font-size: 1.05em;
    color: #333;
}
body.dark .page-paragraph { color: #ddd; }

/* Cards Grid (vision/mission/values) */
.page-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 20px 0;
}
.page-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    border: 2px solid rgba(0,0,0,0.05);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.3s;
}
body.dark .page-card {
    background: linear-gradient(135deg, rgba(60,60,60,0.9), rgba(40,40,40,0.7));
    border-color: rgba(255,255,255,0.08);
}
.page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.page-card h3 {
    color: var(--primary);
    margin: 0 0 10px 0;
    font-size: 1.2em;
}
.page-card p, .page-card li {
    line-height: 1.7;
    color: #444;
}
body.dark .page-card p, body.dark .page-card li { color: #ccc; }

/* Values list */
.values-list { list-style: none; padding: 0; margin: 0; }
.values-list li { padding: 5px 0; }

/* Legal Info Grid (CR + VAT + Location) */
.legal-info-section { background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(21,101,192,0.05)); }
.legal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.legal-info-item {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.06);
}
body.dark .legal-info-item { background: #2a2a2a; border-color: rgba(255,255,255,0.08); }
.legal-label { font-size: 0.9em; color: #666; margin-bottom: 5px; }
body.dark .legal-label { color: #aaa; }
.legal-value { font-weight: 700; font-size: 1.05em; color: var(--primary); word-break: break-word; }

/* Contact Page Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin: 20px 0;
}
.contact-card {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border: 2px solid rgba(0,0,0,0.05);
    transition: all 0.3s;
}
body.dark .contact-card { background: #2a2a2a; border-color: rgba(255,255,255,0.08); }
.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    border-color: var(--primary);
}
.contact-card.phone:hover   { border-color: #1565c0; }
.contact-card.whatsapp:hover{ border-color: #25d366; }
.contact-card.email:hover   { border-color: #ea4335; }
.contact-card.address:hover { border-color: #d4af37; }
.contact-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}
.contact-label { font-size: 0.9em; color: #888; margin-bottom: 5px; }
body.dark .contact-label { color: #aaa; }
.contact-value { font-weight: 700; font-size: 1.05em; color: var(--primary); word-break: break-word; }

/* Map embed container */
.map-container {
    margin: 25px 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.map-container iframe {
    width: 100%;
    height: 350px;
    border: 0;
    display: block;
}
.map-open-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}
.map-open-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.service-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    border: 2px solid rgba(0,0,0,0.05);
    transition: all 0.3s;
}
body.dark .service-card { background: #2a2a2a; border-color: rgba(255,255,255,0.08); }
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.12);
    border-color: var(--primary);
}
.service-card-icon {
    font-size: 3em;
    margin-bottom: 12px;
}
.service-card h3 {
    color: var(--primary);
    margin: 8px 0;
    font-size: 1.2em;
}
.service-card p { color: #555; line-height: 1.6; }
body.dark .service-card p { color: #ccc; }

/* FAQ Items (Collapsible) */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.faq-item {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
body.dark .faq-item { background: #2a2a2a; border-color: rgba(255,255,255,0.08); }
.faq-question {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05em;
    transition: background 0.2s;
}
.faq-question:hover { background: rgba(0,0,0,0.03); }
body.dark .faq-question:hover { background: rgba(255,255,255,0.04); }
.faq-toggle { font-size: 1.4em; transition: transform 0.3s; }
.faq-item.open .faq-toggle { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
    line-height: 1.8;
    color: #444;
}
body.dark .faq-answer { color: #ccc; }
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 20px 18px 20px;
}

/* Mobile responsiveness for company pages */
@media (max-width: 600px) {
    .page-main { padding: 0 10px; margin: 15px auto; }
    .company-page { padding: 20px 15px; }
    .page-hero h1 { font-size: 1.6em; }
    .page-hero-logo { width: 80px; height: 80px; }
    .page-section { padding: 15px; }
    .page-section h2 { font-size: 1.2em; }
    .contact-card, .service-card, .page-card { padding: 18px 15px; }
    .contact-icon, .service-card-icon { font-size: 2.2em; }
    .map-container iframe { height: 250px; }
}

/* =============================================================
   🎨 Social Media Icons - Colored
   ============================================================= */
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    margin: 4px;
    font-size: 1.1em;
    font-weight: 800;
    text-decoration: none;
    color: #fff !important;
    transition: all 0.2s;
}
.footer-social a:hover { transform: scale(1.15) rotate(-5deg); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.footer-social .sm-fb { background: #1877f2; }
.footer-social .sm-x  { background: #000;    }
.footer-social .sm-ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.footer-social .sm-tt { background: linear-gradient(135deg, #ff0050, #00f2ea); color: #fff; }
.footer-social .sm-sc { background: #fffc00; color: #000 !important; }
.footer-social .sm-yt { background: #ff0000; }
.footer-social .sm-li { background: #0a66c2; font-family: serif; font-style: italic; }

/* =============================================================
   🔧 Service Card Action Buttons
   ============================================================= */
.service-card-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.service-btn {
    display: block;
    padding: 10px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.2s;
    text-align: center;
}
.service-btn-primary {
    background: #25d366;
    color: #fff;
}
.service-btn-primary:hover {
    background: #128c7e;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(37,211,102,0.4);
}
.service-btn-secondary {
    background: var(--primary);
    color: #fff;
}
.service-btn-secondary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Make .dark match .dark-mode (compatibility) */
body.dark .page-hero,
body.dark .page-section,
body.dark .page-card,
body.dark .service-card,
body.dark .contact-card,
body.dark .faq-item,
body.dark .legal-info-item {
    background: #2a2a2a !important;
    color: #ddd;
}

/* =============================================================
   🛡️ Trust Section — التوثيقات الحكومية
   ============================================================= */

/* Compact trust bar (top of every page) */
.trust-bar {
    background: linear-gradient(90deg, #1b5e20, #2e7d32, #1b5e20);
    color: #fff;
    padding: 8px 15px;
    text-align: center;
    font-size: 0.88em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.trust-bar-main {
    font-weight: 800;
    letter-spacing: 0.3px;
}
.trust-bar-item {
    background: rgba(255,255,255,0.15);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.92em;
}
.trust-bar-item strong {
    color: #ffd54f;
    margin-inline-end: 4px;
}
@media (max-width: 600px) {
    .trust-bar { font-size: 0.78em; padding: 6px 10px; gap: 4px 10px; }
    .trust-bar-item { padding: 2px 8px; }
}

/* Full trust section (in About page) */
.trust-section {
    background: linear-gradient(135deg, rgba(27,94,32,0.08), rgba(212,175,55,0.05)) !important;
    border: 2px solid rgba(46,125,50,0.2);
}
.trust-section h2 {
    color: #2e7d32 !important;
    text-align: center;
    font-size: 1.6em !important;
}
.trust-subtitle {
    text-align: center;
    color: #555;
    font-size: 1.05em;
    margin-bottom: 25px;
    line-height: 1.8;
}
body.dark .trust-subtitle { color: #bbb; }

.trust-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin: 20px 0;
}
.trust-card {
    background: #fff;
    border: 2px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    padding: 22px 18px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
body.dark .trust-card { background: #2a2a2a; border-color: rgba(255,255,255,0.08); }

.trust-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(46,125,50,0.18);
}
.trust-card-cr:hover     { border-color: #1565c0; }
.trust-card-vat:hover    { border-color: #2e7d32; }
.trust-card-maroof:hover { border-color: #d4af37; }

.trust-card-icon {
    font-size: 3em;
    line-height: 1;
}
.trust-card-label {
    font-size: 0.95em;
    color: #666;
    font-weight: 600;
}
body.dark .trust-card-label { color: #bbb; }

.trust-card-number {
    font-size: 1.5em;
    font-weight: 800;
    color: #1b5e20;
    letter-spacing: 1px;
    direction: ltr;
    background: rgba(46,125,50,0.08);
    padding: 6px 14px;
    border-radius: 8px;
    margin: 4px 0;
}
.trust-card-cr     .trust-card-number { color: #1565c0; background: rgba(21,101,192,0.08); }
.trust-card-vat    .trust-card-number { color: #2e7d32; background: rgba(46,125,50,0.08); }
.trust-card-maroof .trust-card-number { color: #d4af37; background: rgba(212,175,55,0.12); }

.trust-card-desc {
    font-size: 0.9em;
    color: #888;
    line-height: 1.6;
}
body.dark .trust-card-desc { color: #aaa; }

.trust-card-verify {
    margin-top: auto;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 700;
    transition: transform 0.2s;
}
.trust-card-cr     .trust-card-verify { background: linear-gradient(135deg, #1565c0, #1976d2); }
.trust-card-maroof .trust-card-verify { background: linear-gradient(135deg, #b8860b, #d4af37); color: #1a1a1a; }
.trust-card:hover .trust-card-verify { transform: scale(1.05); }

/* Trust badges row */
.trust-badges-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed rgba(46,125,50,0.3);
}
.trust-badge {
    background: #fff;
    border: 2px solid;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    transition: transform 0.2s;
}
body.dark .trust-badge { background: #2a2a2a; }
.trust-badge:hover { transform: translateY(-2px) scale(1.05); }
.trust-badge-mc     { color: #1565c0; border-color: #1565c0; }
.trust-badge-zatca  { color: #2e7d32; border-color: #2e7d32; }
.trust-badge-maroof { color: #b8860b; border-color: #d4af37; }

@media (max-width: 600px) {
    .trust-cards-grid { gap: 12px; }
    .trust-card { padding: 18px 14px; }
    .trust-card-icon { font-size: 2.4em; }
    .trust-card-number { font-size: 1.2em; }
}
