@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* =========================================================
   1. أساسيات مشتركة (Common Styles)
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
html { scroll-behavior: smooth; }

body { 
    font-family: 'Cairo', sans-serif; 
    background-color: #f8f9fa; 
    color: #2d3436; 
    direction: rtl; 
    overflow-x: hidden;
}

/* الألوان */
:root {
    --main-green: #2E4F31;
    --gold: #D4AF37;
    --dark-bg: #1e1e1e;
}

/* السكرول بار */
::-webkit-scrollbar { width: 10px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--main-green); border-radius: 5px; }

/* الهيدر العام */
.main-header {
    background: #fff; height: 90px; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; align-items: center;
}
.header-content {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.logo img { height: 60px; width: auto; transition: 0.3s; }
.logo img:hover { transform: scale(1.05); }

/* البحث والسلة */
.search-box input {
    width: 100%; padding: 12px 20px; border-radius: 50px; border: 2px solid #eee;
    font-family: 'Cairo'; transition: 0.3s; background: #fdfdfd;
}
.search-box input:focus { border-color: var(--main-green); background: #fff; }

.cart-icon {
    position: relative; cursor: pointer; background: var(--main-green); color: #fff;
    width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-right: 15px; transition: 0.3s;
}
.cart-icon:hover { background: #1a301d; transform: scale(1.1); }
#cart-count {
    position: absolute; top: -5px; right: -5px; background: #e74c3c; color: #fff;
    width: 20px; height: 20px; border-radius: 50%; font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* إزالة النقط من القوائم */
ul { list-style: none; padding: 0; margin: 0; }

/* عنوان القسم (ياخد العرض كله) */
.category-separator {
    grid-column: 1 / -1; 
    width: 100%;
    font-size: 1.8rem; color: var(--main-green); font-weight: 900;
    margin: 40px 0 20px; border-bottom: 2px solid #D4AF37; padding-bottom: 10px;
    display: block;
}

/* كروت المنتجات */
.product-card {
    background: #fff; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee; display: flex; flex-direction: column; transition: 0.3s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.img-wrapper { height: 200px; overflow: hidden; position: relative; background: #f9f9f9; }
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.product-card:hover .img-wrapper img { transform: scale(1.1); }
.card-info { padding: 15px; text-align: center; display: flex; flex-direction: column; flex: 1; }
.card-info h4 { font-size: 1.1rem; margin-bottom: 5px; color: #333; }
.card-info p { color: #777; font-size: 0.9rem; margin-bottom: 15px; flex: 1; }
.price { color: var(--gold); font-weight: bold; font-size: 1.2rem; display: block; margin-bottom: 15px; }
.add-btn {
    width: 100%; padding: 12px; background: var(--main-green); color: #fff; border: none;
    border-radius: 50px; font-weight: bold; cursor: pointer; transition: 0.3s;
}
.add-btn:hover { background: #1a301d; }

/* السلة الجانبية */
.cart-sidebar {
    position: fixed; top: 0; left: -100%; width: 350px; height: 100vh;
    background: #fff; z-index: 2000; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 50px rgba(0,0,0,0.2); display: flex; flex-direction: column;
}
.cart-sidebar.open { left: 0; }
.cart-header { background: var(--main-green); color: #fff; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.cart-items { flex: 1; padding: 15px; overflow-y: auto; background: #f8f9fa; }
.cart-footer { padding: 20px; background: #fff; border-top: 1px solid #eee; }
.checkout-btn { width: 100%; padding: 15px; background: #25d366; color: #fff; border: none; border-radius: 50px; font-weight: bold; font-size: 1.1rem; cursor: pointer; }
.cart-item { background: #fff; padding: 15px; border-radius: 10px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.03); border: 1px solid #e0e0e0; }
.quantity-controls { display: flex; flex-direction: row; align-items: center; gap: 8px; background: #f0f0f0; padding: 4px 8px; border-radius: 20px; margin-top: 5px; width: fit-content; }
.qty-btn { width: 25px; height: 25px; background: #fff; border: 1px solid #ccc; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--main-green); }

/* آراء العملاء (مودرن) */
.reviews-section {
    margin-top: 80px; padding: 60px 0; background: #fff; position: relative;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.03); border-radius: 40px 40px 0 0;
    text-align: center; z-index: 10;
}
.section-title { font-size: 2rem; color: var(--main-green); margin-bottom: 40px; font-weight: 900; position: relative; display: inline-block; }
.section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--gold); margin: 10px auto 0; border-radius: 2px; }
.reviews-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.review-card {
    background: #f8f9fa; padding: 30px; border-radius: 20px; width: 320px; max-width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: 0.4s; border: 1px solid #eee;
    position: relative; margin: 0 auto; overflow: hidden;
}
.review-card:hover { transform: translateY(-10px); background: #fff; border-color: var(--main-green); }
.review-card::before { content: '"'; position: absolute; top: -10px; right: 20px; font-size: 5rem; color: rgba(212, 175, 55, 0.1); font-family: serif; }
.review-text { font-size: 1rem; color: #555; line-height: 1.6; margin-bottom: 20px; font-style: italic; position: relative; z-index: 2; }
.stars { color: var(--gold); font-size: 1.2rem; margin-bottom: 10px; }
.client-name { font-weight: 900; color: var(--main-green); font-size: 0.95rem; }

/* =========================================================
   2. تصميم الكمبيوتر فقط (Desktop) 💻
   ========================================================= */
@media (min-width: 901px) {
    .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
    
    .main-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; margin-top: 40px; align-items: start; }

    /* 🚨 القائمة العلوية (اللوك الجديد: زراير بتنور) 🚨 */
    .top-nav { display: flex; gap: 15px; margin: 0 20px; }
    
    .top-nav a {
        text-decoration: none; 
        color: #555; 
        font-weight: 700; 
        font-size: 1rem; 
        transition: 0.3s; 
        padding: 10px 20px; /* مسافة داخلية عشان يبقى زرار */
        border-radius: 50px; /* حواف دائرية */
    }

    /* لما تقف عليه أو يكون نشط (ينور أخضر) */
    .top-nav a:hover, .top-nav a.active {
        background-color: var(--main-green); /* الخلفية خضراء */
        color: #fff; /* النص أبيض */
        box-shadow: 0 5px 15px rgba(46, 79, 49, 0.2); /* ضل خفيف */
        transform: translateY(-2px); /* رفعة بسيطة */
    }

    /* السايد بار (القائمة الجانبية) */
    .sidebar {
        background: #fff; padding: 25px; border-radius: 20px; position: sticky; top: 110px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.03); border: 1px solid #f0f0f0;
    }
    .sidebar h3 { color: var(--main-green); margin-bottom: 15px; font-weight: 800; border-bottom: 2px solid #f5f5f5; padding-bottom: 10px; }
    .sidebar ul li a {
        display: block; padding: 12px 15px; margin-bottom: 5px; border-radius: 10px;
        text-decoration: none; color: #666; font-weight: 600; transition: 0.2s; cursor: pointer;
    }
    .sidebar ul li a:hover, .sidebar ul li a.active { background: var(--main-green); color: #fff; transform: translateX(-5px); }

    /* شبكة المنتجات */
    .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }
    
    /* البانر */
    .hero-banner {
        background: linear-gradient(135deg, var(--main-green) 0%, #1a301d 100%); color: #fff;
        padding: 40px; border-radius: 20px; text-align: center; margin-bottom: 40px;
        box-shadow: 0 15px 30px rgba(46, 79, 49, 0.2);
    }
    .hero-image { width: 100%; border-radius: 12px; margin-top: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.3); border: 4px solid rgba(255,255,255,0.1); display: block; }

    /* الفوتر */
    .main-footer { background: var(--dark-bg); color: #fff; padding: 50px 20px; text-align: center; margin-top: 50px; }
    .social-links { display: flex; justify-content: center; gap: 15px; }
    .social-btn { padding: 10px 25px; border-radius: 50px; background: #333; color: #fff; text-decoration: none; transition: 0.3s; }
    .facebook { background: #1877F2; } .whatsapp { background: #25D366; } .instagram { background: #bc1888; }
}

/* =========================================================
   3. تصميم الموبايل فقط (Mobile) 📱
   ========================================================= */
@media (max-width: 900px) {
    .container { padding: 0 15px; }
    .top-nav { display: none; }
    .header-content { gap: 10px; }
    .search-box { flex: 1; } 
    .logo img { height: 40px; }

    .main-layout { display: flex; flex-direction: column; margin-top: 20px; }

    /* السايد بار للموبايل (شريط أفقي) */
    .sidebar {
        background: #fff; position: sticky; top: 90px; z-index: 900;
        margin: 0 -15px 20px -15px; padding: 10px 15px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; border-bottom: 1px solid #eee;
    }
    .sidebar h3 { display: none; }
    .sidebar ul { display: flex; gap: 10px; padding: 0; margin: 0; }
    .sidebar ul li { list-style: none; }
    .sidebar ul li a {
        display: inline-block; padding: 8px 16px; background: #f1f1f1; color: #555;
        border-radius: 50px; font-size: 0.9rem; font-weight: bold; text-decoration: none;
        cursor: pointer; transition: 0.3s;
    }
    .sidebar ul li a.active { background: var(--main-green); color: #fff; box-shadow: 0 4px 10px rgba(46, 79, 49, 0.3); }

    /* شبكة المنتجات (2 جنب بعض) */
    .product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
    
    .category-separator { font-size: 1.4rem; margin: 20px 0 10px; }

    .hero-banner { background: linear-gradient(135deg, var(--main-green), #1a301d); color: #fff; padding: 20px; border-radius: 15px; text-align: center; margin-bottom: 20px; }
    .hero-banner h1 { font-size: 1.5rem; margin-bottom: 5px; }
    .hero-image { width: 100%; border-radius: 10px; margin-top: 15px; display: block; }

    .img-wrapper { height: 140px; }
    .card-info { padding: 10px; }
    .card-info h4 { font-size: 0.9rem; }
    .price { font-size: 1rem; }
    .add-btn { padding: 8px; font-size: 0.8rem; }

    .main-footer { background: var(--dark-bg); color: #fff; padding: 40px 15px; text-align: center; margin-top: 30px; }
    .social-links { display: flex; flex-direction: column; gap: 10px; }
    .social-btn { width: 100%; padding: 12px; border-radius: 50px; background: #333; color: #fff; text-decoration: none; display: block; }
    .facebook { background: #1877F2; } .whatsapp { background: #25D366; } .instagram { background: #bc1888; }
    
    .cart-sidebar { width: 85%; } 
}