/* تصميم متجر القروي - النسخة الاحترافية النهائية */
:root {
    --body-bg: #f0f2f5;
    --header-bg: #1a1a1a; /* لون الهيدر الأسود الفخم */
    --card-bg: #ffffff;
    --primary-color: #b38600;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    background-color: var(--body-bg);
    direction: rtl;
    overflow-x: hidden;
}

/* --- الهيدر العلوي (البار) --- */
.main-header {
    display: flex;
    justify-content: space-between; /* بيفصل الأيقونات يمين واللوجو شمال */
    align-items: center;
    padding: 10px 15px;
    background-color: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 998;
    height: 65px;
}

/* حاوية الأيقونات اللي على اليمين */
.header-icons { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

#menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.currency-select { 
    background: #333; 
    color: white; 
    border: 1px solid #444; 
    border-radius: 5px; 
    padding: 4px 8px; 
    font-size: 0.85rem; 
    outline: none;
}

.user-link { 
    color: white; 
    font-size: 1.3rem; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
}

/* زر الرصيد في الهيدر (يظهر بعد تسجيل الدخول) */
.header-balance-btn {
    background: #2ecc71;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    direction: ltr;
}

/* --- اللوجو على الشمال --- */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img { 
    height: 40px; /* مقاس مظبوط عشان ما يبوظش الهيدر */
    object-fit: contain;
    display: block; 
}

/* =========================================
   تصميم القائمة الجانبية (Sidebar)
   ========================================= */
.side-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.side-nav.open { transform: translateX(0); }

#overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,.5);
    z-index: 999;
    display: none;
}

/* 1. حالة الزائر (المربع الكحلي) */
.login-section-sidebar {
    background-color: #082032;
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    color: white;
    margin: 15px;
}
.login-section-sidebar h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 8px; }
.login-section-sidebar p { font-size: 0.8rem; color: #b0c5d5; margin-bottom: 15px; }

.btn-green-sidebar {
    background-color: #2ecc71;
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.btn-google-sidebar {
    background-color: white;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 2. حالة العميل (بروفايل المستخدم) */
.sidebar-profile {
    text-align: center;
    padding: 25px 15px 15px;
    border-bottom: 1px solid #eee;
}
.sidebar-avatar {
    font-size: 4.5rem; 
    color: #000;
    margin-bottom: 12px;
}
.sidebar-username {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 18px;
}
.sidebar-badge {
    background: #f4f6f9;
    color: #333;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
}
.sidebar-balance {
    font-size: 1.8rem; 
    font-weight: 900;
    color: #0044cc;
    direction: ltr;
    margin-bottom: 25px;
}
.sidebar-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 25px;
}
.sidebar-actions a {
    color: #333;
    font-size: 1.4rem;
    text-decoration: none;
}
.btn-secondary-currency {
    background: #fffdf5;
    color: #b38600;
    border: 1px solid #b38600;
    border-radius: 20px;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    width: 85%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

/* 3. روابط التنقل */
.nav-links-sidebar {
    list-style: none;
    padding: 10px;
    margin: 0;
    flex: 1;
}
.nav-links-sidebar li {
    margin-bottom: 3px;
}
.nav-links-sidebar a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px; 
    color: #333;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem; 
    border-radius: 10px;
    transition: 0.2s;
}
.nav-links-sidebar a:hover, .nav-links-sidebar a.active {
    background-color: #f0f2f5; 
}
.nav-links-sidebar a i {
    font-size: 1.1rem;
}

/* --- المحتوى الرئيسي (البانر والأقسام والبحث) --- */
main { padding: 0 15px 30px 15px; }

.banner-container { margin-top: 20px; }
.banner-image { width: 100%; height: 115px; object-fit: cover; border-radius: 15px; display: block; }

.search-container { margin-top: 20px; }
.search-bar { width: 100%; padding: 12px 20px; border: 1px solid #ddd; border-radius: 25px; background: #fff; outline: none; font-size: 0.9rem; }

.category-grid { margin-top: 25px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.category-card { position: relative; height: 115px; border-radius: 12px; overflow: hidden; text-decoration: none; box-shadow: 0 3px 8px rgba(0,0,0,0.06); }
.category-card img { width: 100%; height: 100%; object-fit: cover; }
.category-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.category-card p { color: white; margin: 0; font-weight: 800; font-size: 0.65rem; text-align: center; line-height: 1.2; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

/* شريط الإعلانات المتصل */
.news-ticker-container { margin-top: 15px; background: #ffffff; padding: 6px 12px; border-radius: 8px; display: flex; align-items: center; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05); border: 1px solid #f0f0f0; }
.news-ticker-container i { margin-left: 8px; font-size: 0.9rem; color: var(--primary-color); z-index: 2; }
.ticker-wrap { flex: 1; overflow: hidden; direction: rtl; }
.ticker-move { display: flex; width: max-content; animation: ticker-rtl 25s linear infinite; }
.ticker-item { padding-left: 50px; font-weight: 700; font-size: 0.75rem; color: #333333; white-space: nowrap; }
@keyframes ticker-rtl { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }