/* إعدادات الألوان والخط */
:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

* {
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
}

body {
    /* تم حذف الخلفية القديمة (bg-gradient) لتعويضها بالخلفية المتحركة */
    background-color: #f8fafc; 
    min-height: 100vh;
    padding: 20px;
    color: var(--secondary);
    position: relative;
    overflow-x: hidden;
}

/* ================= الخلفية المتحركة ================= */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* إبقاء الخلفية وراء كل العناصر */
    overflow: hidden;
    background: #f8fafc;
}

/* الكتل الضوئية المشتركة */
.blob {
    position: absolute;
    filter: blur(90px); /* ضبابية قوية لدمج الألوان */
    -webkit-filter: blur(90px);
    opacity: 0.5; /* شفافية هادئة */
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

/* البقعة الزرقاء (لون الشعار) */
.blob-blue {
    background: #139dd7;
    width: 500px;
    height: 500px;
    top: -15%;
    left: -10%;
    animation-delay: 0s;
}

/* البقعة الوردية (لون الشعار) */
.blob-pink {
    background: #bb4799;
    width: 400px;
    height: 400px;
    bottom: -15%;
    right: -10%;
    animation-duration: 25s;
    animation-direction: alternate-reverse;
}

/* بقعة إضافية فاتحة للتوازن */
.blob-light {
    background: rgba(19, 157, 215, 0.3);
    width: 350px;
    height: 350px;
    top: 40%;
    left: 40%;
    animation-duration: 30s;
    animation-delay: -5s;
}

/* حركة الطفو البطيئة */
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -50px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* الهيدر الاحترافي */
.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; 
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    margin-bottom: 50px;
    border-bottom: 4px solid var(--primary);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.header-left {
    position: absolute;
    left: 40px; 
    top: 50%;
    transform: translateY(-50%); 
}

.header-center { text-align: center; }
.header-center h1 { font-size: 2rem; font-weight: 800; letter-spacing: 1px; }
.header-center p { color: #7f8c8d; font-weight: 500; font-size: 1.1rem; margin-top: 5px; }

#company-logo { 
    max-height: 45px; 
    width: auto; 
}

/* نظام الشبكة صارم للكمبيوتر والتابلت */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 30px;
    max-width: 950px; /* حجم الحاوية الإجمالي */
    margin: 0 auto;
    justify-content: center;
    justify-items: center; /* يجبر البطاقات على البقاء في المنتصف */
}

/* البطاقة بحجم ثابت واحترافي */
.product-card {
    background: white;
    border-radius: 25px;
    padding: 25px;
    position: relative;
    width: 100%;
    max-width: 420px; /* التعديل الأهم: يمنع البطاقة من التضخم في الكمبيوتر */
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}
.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* شارة "منتج جديد" بتصميم احترافي */
.badge-new {
    position: absolute;
    top: 15px;
    left: 15px;
    /* تدرج لوني يجمع بين ألوان الشعار (الوردي والأزرق) */
    background: linear-gradient(135deg, #ff0000, #139dd7);
    color: white;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(187, 71, 153, 0.3);
    z-index: 10;
    animation: badgePulse 2.5s infinite;
}

/* حركة وميض هادئة للشارة */
@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(187, 71, 153, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(187, 71, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(187, 71, 153, 0); }
}

/* حاوية الصورة */
.card-image-container {
    height: 250px; /* تثبيت طول الصورة باش ماتكبرش بزاف */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    cursor: pointer;
    overflow: hidden;
    border-radius: 15px;
}
.product-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.card-image-container:hover .product-image {
    transform: scale(1.15); 
}

.product-title { 
    text-align: center; 
    font-size: 1.5rem; 
    font-weight: 800; 
    margin: 15px 0 20px; 
}

/* جداول المعلومات والأسعار (تم إضافة table-layout لمنع الخروج عن الإطار) */
.info-table, .price-table {
    width: 100%;
    table-layout: fixed; /* التعديل الأهم للهاتف: يجبر الجدول على احترام حجم البطاقة */
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e0e6ed;
    word-wrap: break-word; /* يكسر الكلمات الطويلة إذا لزم الأمر */
}

.info-table { margin-bottom: 20px; font-size: 0.85rem; }
.info-table th { background: #7f8c8d; color: white; padding: 10px; font-weight: 700; letter-spacing: 1px; text-align: center; }
.info-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; color: var(--secondary); background: #fdfdfd; }
.info-table td:first-child { font-weight: 800; width: 45%; border-right: 1px solid #f0f0f0; color: #34495e; }
.info-table tr:last-child td { border-bottom: none; }

.price-table th { background: var(--primary); color: white; padding: 12px; font-size: 0.95rem; font-weight: 700; }
.price-table td { text-align: center; padding: 12px; font-weight: 800; color: var(--secondary); background: #fdfdfd; border-right: 1px solid #e0e6ed; border-top: 1px solid #e0e6ed;}
.price-table td:last-child, .price-table th:last-child { border-right: none; }

/* نافذة التكبير */
/* نافذة التكبير */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    /* تم حذف padding-top من هنا */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show { 
    display: block; 
    opacity: 1; 
}

.modal-content {
    /* كود التوسيط المثالي (أفقيا وعموديا) */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 20px; 
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.modal.show .modal-content { 
    /* دمج حركة الظهور مع التوسيط */
    transform: translate(-50%, -50%) scale(1); 
}
.close-modal { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 50px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.close-modal:hover { color: var(--accent); }

.loading { text-align: center; width: 100%; font-size: 1.5rem; color: var(--primary); font-weight: bold; animation: pulse 1.5s infinite; }

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* التجاوب الصارم مع شاشات الهواتف */
@media (max-width: 768px) {
    .top-bar { 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center;
        padding: 15px 20px; 
        border-radius: 15px;
        margin-bottom: 30px;
    }
    
    .header-left {
        position: static;
        transform: none;
        margin: 0;
        display: flex;
        align-items: center;
        flex-shrink: 0; 
    }

    #company-logo { max-height: 25px; width: auto; }

    .header-center {
        display: flex;
        flex-direction: column;
        align-items: flex-end; 
        overflow: hidden;
    }

    .header-center h1 { font-size: 14px; font-weight: 800; margin: 0; white-space: nowrap; }
    .header-center p { display: block; font-size: 0.8rem; font-weight: 500; margin: 2px 0 0 0; color: #7f8c8d; white-space: nowrap; }

    .products-grid { 
        grid-template-columns: 1fr; 
        padding: 0; 
    }

    /* تعديلات ضرورية لحجم البطاقة في الهاتف */
    .product-card {
        padding: 15px; /* تصغير الفراغ الداخلي لإعطاء مساحة للجداول */
        max-width: 100%;
    }
    
    .card-image-container {
        height: 200px; /* تصغير ارتفاع الصورة في الهاتف */
    }

    /* تصغير خطوط الجداول باش مايتزاحموش في الهاتف */
    .info-table, .price-table {
        font-size: 0.75rem;
    }
    .info-table td, .info-table th, .price-table td, .price-table th {
        padding: 8px 5px; /* تقليل الفراغ الداخلي للخلايا */
    }
}
/* ================= تصميم واجهة التواصل (الحصري والحديث) ================= */
.contact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Tajawal', sans-serif;
}

.contact-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: #ffffff; /* لون نقي فاتح بدل الزجاج المعتم */
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
    border: 1px solid #f0f4f8;
}

.contact-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* هيدر حديث نظيف */
.popup-header-modern {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 25px 15px;
    background: #f8fafc;
    border-bottom: 1px solid #f0f4f8;
}
.header-icon-wrap {
    background: rgba(187, 71, 153, 0.1); /* وردي شفاف */
    padding: 12px;
    border-radius: 16px;
    display: flex;
}
.header-text-modern h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: #1e293b; }
.header-text-modern p { margin: 3px 0 0 0; color: #64748b; font-weight: 500; font-size: 0.9rem; }

/* جسم النافذة (البطاقات) */
.popup-body-modern {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s ease;
}

/* تأثير التوهج عند التمرير */
.call-card:hover { border-color: #139dd7; box-shadow: 0 10px 20px rgba(19, 157, 215, 0.1); transform: translateY(-3px); }
.wa-card:hover { border-color: #bb4799; box-shadow: 0 10px 20px rgba(187, 71, 153, 0.1); transform: translateY(-3px); }

/* الأيقونات الملونة */
.card-icon {
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.card-icon svg { width: 22px; height: 22px; }
.blue-icon { background: rgba(19, 157, 215, 0.1); color: #139dd7; }
.pink-icon { background: rgba(187, 71, 153, 0.1); color: #bb4799; }

.card-text { flex: 1; }
.card-text strong { display: block; font-size: 1rem; color: #0f172a; margin-bottom: 3px; }
.card-text span { display: block; font-size: 0.8rem; color: #64748b; margin-bottom: 4px; }
.time-badge { display: inline-block !important; background: #f1f5f9; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem !important; color: #475569 !important; font-weight: 600; }

/* فوتر بسيط وأنيق */
.popup-footer-modern {
    padding: 15px 25px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}
.popup-footer-modern span { color: #94a3b8; font-size: 0.85rem; font-weight: 600; }
.social-icons-mini { display: flex; gap: 12px; }
.social-icons-mini a {
    width: 32px; height: 32px;
    background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.social-icons-mini a:hover { background: #ffffff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); transform: translateY(-2px); }

/* زر الفتح */
.widget-toggle {
    width: 65px; height: 65px;
    background: #1e293b; border: none; border-radius: 50%;
    color: white; cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}
.widget-toggle svg { width: 32px; height: 32px; }
.widget-toggle.active { background: #ef4444; transform: rotate(90deg); }

@media (max-width: 768px) {
    .contact-widget { bottom: 20px; right: 20px; }
    .widget-toggle { width: 55px; height: 55px; }
    .widget-toggle svg { width: 28px; height: 28px; }
    .contact-popup { width: 300px; right: 0; bottom: 75px; }
}
.search-filter-container {
    display: flex;
    gap: 15px;
    margin: 0 auto 30px auto;
    max-width: 800px;
    flex-wrap: wrap;
}
.search-filter-container input, .search-filter-container select {
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s ease;
    font-family: inherit;
    color: var(--secondary);
    background-color: white;
}
.search-filter-container input {
    flex: 2;
    min-width: 250px;
}
.search-filter-container select {
    flex: 1;
    min-width: 150px;
    cursor: pointer;
}
.search-filter-container input:focus, .search-filter-container select:focus {
    border-color: #139dd7;
    box-shadow: 0 4px 15px rgba(19, 157, 215, 0.15);
}