/* =========================================
   1. المتغيرات والإعدادات العامة
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-color: #D4AF37;
    --dark-bg: #1a1a1a;
    --light-bg: #f8f9fa;
    --text-color: #333;
    --border-color: #f1f2f6;
    --border-radius: 12px;
}

body.main-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* =========================================
   تطويرات الهيدر (الأنيميشن والأزرار)
   ========================================= */
.main-header {
    background-color: var(--dark-bg, #1a1a1a);
    padding: 15px 5% !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex !important; /* أهم سطر: يجعل اللوجو والأزرار على خط واحد */
    align-items: center; /* التوسيط العمودي */
    justify-content: flex-start; /* يبدأ من اليمين ولا يرمي الأزرار لأقصى اليسار */
}

.header-logo a { 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
}

.dynamic-nav { 
    display: flex; 
    gap: 25px; 
    align-items: center; 
    margin-right: 8%; /* هذه المسافة ستجعل الأزرار في منطقة "متوسطة" وأنيقة بجوار اللوجو */
}

.nav-item {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-item i { 
    color: var(--primary-color, #D4AF37); 
    font-size: 16px; 
    transition: 0.3s; 
}

/* تأثير الخط الأصفر أسفل الزر عند التمرير */
.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 3px;
    background-color: var(--primary-color, #D4AF37);
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-item:hover::before { width: 100%; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--primary-color, #D4AF37); }
.nav-item:hover i { transform: scale(1.2); }

/* ترتيب الهيدر بشكل أنيق في شاشات الموبايل */
@media (max-width: 900px) {
    .main-header {
        flex-direction: column;
        justify-content: center;
        gap: 15px;
        padding: 15px !important;
    }
    .dynamic-nav {
        margin-right: 0;
        flex-wrap: wrap;
        justify-content: center;
    }
}
/* =========================================
   تطويرات الفوتر الشامل
   ========================================= */
.main-footer {
    background-color: #111;
    padding: 50px 20px 20px;
    border-top: 4px solid var(--primary-color);
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    text-align: right;
}

.footer-title {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-desc { color: #aaa; line-height: 1.8; font-size: 14px; }

.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-contact-link {
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    transition: 0.3s;
}
.footer-contact-link i { color: #fff; background: rgba(255,255,255,0.1); padding: 8px; border-radius: 50%; font-size: 13px; transition: 0.3s; }
.footer-contact-link:hover { color: #fff; transform: translateX(-5px); }
.footer-contact-link.whatsapp i { color: #25D366; background: rgba(37, 211, 102, 0.1); }
.footer-contact-link.whatsapp:hover i { background: #25D366; color: #fff; }

.footer-social { display: flex; gap: 15px; flex-wrap: wrap; }
.footer-social a {
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 20px;
    transition: all 0.3s ease;
}
/* ألوان منصات السوشيال ميديا */
.footer-social a.fb:hover { background: #1877F2; transform: translateY(-5px); }
.footer-social a.ig:hover { background: #E1306C; transform: translateY(-5px); }
.footer-social a.snap:hover { background: #FFFC00; color: #000; transform: translateY(-5px); }
.footer-social a.tiktok:hover { background: #fff; color: #000; transform: translateY(-5px); }
.footer-social a.yt:hover { background: #FF0000; transform: translateY(-5px); }
.footer-social a.tw:hover { background: #1DA1F2; transform: translateY(-5px); }

.footer-copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #888;
    font-size: 13px;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer-title { justify-content: center; }
    .footer-contact-link { justify-content: center; }
    .footer-social { justify-content: center; }
    .main-header { flex-direction: column; gap: 15px; padding: 15px !important; }
}

/* =========================================
   3. الصفحة الرئيسية (شبكة السيارات)
   ========================================= */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.car-card-new { display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.06); border: 1px solid var(--border-color); transition: 0.3s; height: 100%; }
.car-card-new:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(0,0,0,0.1); }

.img-wrap { width: 100%; aspect-ratio: 4/3; position: relative; background: var(--light-bg); overflow: hidden; }
.img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.badge-status { position: absolute; top: 15px; right: 15px; padding: 6px 15px; border-radius: 20px; font-size: 12px; font-weight: bold; color: #fff; z-index: 10; backdrop-filter: blur(5px); white-space: nowrap; }
.bg-green { background: rgba(40, 167, 69, 0.9); }
.bg-red { background: rgba(220, 53, 69, 0.9); }

.car-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.car-title { font-size: 20px; margin: 0 0 5px 0; color: var(--dark-bg); }
.car-subtitle { font-size: 13px; color: #888; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; }

.specs-grid-home { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.spec-item-home { background: var(--light-bg); padding: 8px; border-radius: 8px; font-size: 13px; color: #555; display: flex; align-items: center; gap: 8px; }
.spec-item-home i { color: var(--primary-color); }

.car-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 15px; }
.price-tag { font-size: 22px; font-weight: bold; color: #e74c3c; }
.price-currency { font-size: 12px; color: #888; }

.btn-details { background: linear-gradient(135deg, var(--dark-bg), #333); color: var(--primary-color); padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: bold; transition: all 0.3s ease; text-align: center; border: 1px solid var(--dark-bg); }
.btn-details:hover { background: var(--primary-color); color: var(--dark-bg); transform: scale(1.05); box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); }

/* =========================================
   4. صفحة تفاصيل السيارة (Car Details)
   ========================================= */
.details-container { max-width: 1200px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.glass { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-radius: 20px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 25px; }

.car-title-box { background: var(--dark-bg); color: #fff; padding: 20px; border-radius: 15px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.car-title-box h1 { margin: 0; font-size: 24px; }
.car-title-box p { margin: 5px 0 0 0; opacity: 0.8; font-size: 14px; }

.social-btns { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.social-btn { font-size: 22px; margin: 0 5px; transition: 0.3s; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,0.1); padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.social-btn:hover { transform: translateY(-3px); background: rgba(255,255,255,0.2); }
.social-btn.wa i { color: #25d366; }
.social-btn.fb i { color: #1877f2; }
.social-btn.ig i { color: #e1306c; }

.gallery-main { position: relative; width: 100%; border-radius: 15px; overflow: hidden; background: var(--light-bg); }
.gallery-main img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.busy-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(220, 53, 69, 0.7); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 10; color: #fff; text-align: center; backdrop-filter: blur(3px); }
.busy-overlay i { font-size: 50px; margin-bottom: 15px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.busy-overlay h2 { margin: 0; font-size: 28px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.busy-overlay p { margin: 10px 0 0 0; font-size: 16px; font-weight: bold; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }

.gallery-thumbs { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; padding-bottom: 5px; }
.gallery-thumbs img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; flex-shrink: 0; border: 2px solid transparent; transition: 0.3s; }
.gallery-thumbs img:hover { border-color: var(--primary-color); }

.specs-title { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.spec-item { padding: 12px; border-bottom: 1px solid #eee; font-size: 14.5px; }
.spec-full-width { grid-column: 1 / -1; }
.spec-areas { color: #2980b9; background: #f0f8ff; border-radius: 8px; border: none; }
.spec-fees { color: #c0392b; background: #fdf3f2; border-radius: 8px; border: none; }

.booking-sidebar { position: sticky; top: 20px; text-align: center; }
.booking-sidebar h3 { margin-top: 0; color: var(--dark-bg); }
.price-box-details { margin: 20px 0; background: #fdf3f2; padding: 20px; border-radius: 15px; }
.price-label { font-size: 15px; color: #555; }
.price-value { font-size: 30px; font-weight: bold; color: #e74c3c; margin-top: 5px; }
.price-value span { font-size: 16px; }

.btn-book-now { width: 100%; padding: 18px; background: var(--dark-bg); color: #fff; font-weight: bold; font-size: 18px; border: none; border-radius: 10px; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: 0.3s; margin-bottom: 15px; }
.btn-book-now:hover { background: #333; }
.btn-book-now i { margin-left: 8px; }

.btn-wa-contact { width: 100%; padding: 15px; background: #fff; color: #25d366; font-weight: bold; font-size: 16px; border: 2px solid #25d366; border-radius: 10px; cursor: pointer; transition: 0.3s; }
.btn-wa-contact:hover { background: #25d366; color: #fff; }
.btn-wa-contact i { margin-left: 8px; font-size: 20px; }

/* =========================================
   5. النافذة المنبثقة (Modal) ونموذج الحجز
   ========================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 9999; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-content { background: #fff; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto; border-radius: 15px; padding: 30px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.close-modal { position: absolute; top: 15px; left: 15px; background: #e74c3c; color: #fff; border: none; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-weight: bold; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.close-modal:hover { background: #c0392b; transform: scale(1.1); }

.modal-header { margin-top: 0; text-align: center; color: var(--dark-bg); }
.modal-desc { text-align: center; color: #7f8c8d; font-size: 14px; margin-bottom: 25px; }

.section-title-form { font-size: 15px; color: var(--primary-color); margin: 25px 0 15px 0; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.form-input { width: 100%; padding: 10px; margin-bottom: 15px; border-radius: 8px; border: 1px solid #ddd; font-family: inherit; font-size: 14px; background: #fafafa; }
.form-row-flex { display: flex; gap: 10px; }
.file-label { font-size: 12px; font-weight: bold; color: #555; display: block; margin-bottom: 5px; }

.calc-box { background: var(--light-bg); padding: 15px; border-radius: 8px; margin: 15px 0; text-align: center; border: 1px solid #eee; }
.calc-days { display: block; font-size: 14px; color: #555; }
.calc-total { font-size: 22px; color: var(--dark-bg); font-weight: bold; }

.btn-submit-booking { width: 100%; padding: 15px; background: #27ae60; color: #fff; font-weight: bold; font-size: 16px; border: none; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.btn-submit-booking:hover { background: #219653; }

.success-box { text-align: center; padding: 40px 20px; }
.success-box i { color: #27ae60; font-size: 70px; margin-bottom: 20px; }
.success-box h3 { color: #27ae60; margin-top: 0; }
.success-box p { color: #555; font-size: 16px; line-height: 1.6; margin-bottom: 30px; }
.btn-close-success { padding: 12px 30px; background: var(--dark-bg); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; }

@media (max-width: 900px) { 
    .details-container { grid-template-columns: 1fr; } 
    .car-title-box { flex-direction: column; text-align: center; gap: 15px; }
    .form-row-flex { flex-direction: column; gap: 0; }
}