/* --- 1. إعدادات عامة وخطوط --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

:root {
    --main-color: #3498db; /* اللون الأزرق المميز */
    --text-color: #333;
    --bg-color: #f4f4f4;
}

html {
    scroll-behavior: smooth; /* التمرير الناعم عند الضغط على الأزرار */
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- 2. تصميم النافبار (القائمة العلوية) --- */
nav {
    background: white;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; /* تثبيت القائمة عند النزول */
    top: 0;
    z-index: 1000;
}

nav .logo { font-weight: bold; font-size: 1.5rem; color: var(--main-color); }

nav ul { list-style: none; display: flex; gap: 20px; }

nav a { text-decoration: none; color: var(--text-color); font-weight: bold; transition: 0.3s; }
nav a:hover { color: var(--main-color); }

/* --- 3. تصميم الواجهة الرئيسية (Hero Section) - التصميم الجديد --- */
.hero {
    /* صورة خلفية تقنية مع طبقة تعتيم */
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    height: 90vh; /* ارتفاع كامل تقريباً للشاشة */
    display: flex;
    justify-content: center; /* توسيط أفقي */
    align-items: center;     /* توسيط رأسي */
    text-align: center;      /* توسيط الكلام */
    color: white;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content span { color: var(--main-color); }

.hero-content p {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn {
    display: inline-block;
    width: auto;
    padding: 12px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
}

/* --- 4. تصميم الكروت في صفحة المتجر --- */
.container { width: 85%; margin: 50px auto; }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: contain; /* نستخدم contain للإلكترونيات لتظهر كاملة */
    margin-bottom: 15px;
}

.card h3 { font-size: 1.1rem; margin-bottom: 5px; }

.price {
    color: var(--main-color);
    font-size: 1.3rem;
    font-weight: bold;
    margin: 10px 0;
}

/* --- 5. الأزرار العامة --- */
.btn {
    background: var(--main-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
    text-decoration: none; /* في حالة استخدامها كـ رابط */
}

.btn:hover { background: #2980b9; }

/* --- 6. صفحة السلة والجدول --- */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
}

th, td { padding: 15px; text-align: right; border-bottom: 1px solid #eee; }
th { background-color: var(--main-color); color: white; }

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}
.delete-btn:hover { background-color: #c0392b; }

/* --- 7. قسم المميزات --- */
.features {
    display: flex;
    justify-content: space-around;
    padding: 60px 50px;
    background: white;
    text-align: center;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.03);
}

.feature-box { padding: 20px; }
.feature-box i { font-size: 2.5rem; color: var(--main-color); margin-bottom: 15px; }
.feature-box h3 { margin-bottom: 10px; }

/* --- 8. الفوتر --- */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 25px;
    margin-top: 50px;
}

/* --- 9. رسالة الإشعار (Notification Toast) --- */
.notification-toast {
    visibility: hidden;
    min-width: 300px;
    background-color: #27ae60;
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.5s;
}

.notification-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* --- 10. التجاوب مع الموبايل --- */
@media (max-width: 768px) {
    nav { padding: 15px 20px; }
    nav ul { gap: 10px; font-size: 0.9rem; }
    
    .hero { height: 70vh; }
    .hero-content h1 { font-size: 2rem; }
    
    .features { flex-direction: column; gap: 40px; }
    
    .container { width: 95%; }
}
/* --- تنسيق عداد السلة --- */
nav ul li { position: relative; } /* عشان العداد يتحرك بالنسبة للزرار */

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #e74c3c; /* لون أحمر */
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%; /* يخليه دائرة */
    display: none; /* مخفي لو الصفر */
}
/* --- تنسيق أزرار الفلتر --- */
.filter-btn {
    padding: 8px 20px;
    margin: 0 5px;
    border: 2px solid var(--main-color);
    background: transparent;
    color: var(--main-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--main-color);
    color: white;
}