/*
====================================
           General Styles
====================================
*/

/* استيراد خط القاهرة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

/* تنسيق عام للصفحة */
body {
    font-family: 'Cairo', sans-serif, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
    text-align: right;
    direction: rtl;
    padding-bottom: 70px;
}

a {
    text-decoration: none;
    transition: color 0.3s;
}

header {
    background-color: #5d35a0 ;
    color: white; 
    padding: 30px 0;
    margin-bottom: 20px;
    ;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    text-align: center;
}

/* تنسيق أزرار الفئات في الصفحة الرئيسية */
.category-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.category-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 20px 0;
    font-size: 1.2em;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.3s;
    font-weight: bold;
}

.phone-button {
    background-color: #9c27b0;
    color: white;
    border: 2px solid #9c27b0;
}

.laptop-button {
    background-color: white;
    color: #5d35a0;
    border: 2px solid #5d35a0;
}

.watch-button {
    background-color: #5d35a0;
    color: white;
    border: 2px solid #5d35a0;
}

.category-button:hover {
    opacity: 0.8;
}

/* ==================================== */
/* تنسيق عرض المنتجات (Grid) */
/* ==================================== */
.products-grid-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.products-grid-container h2 {
    text-align: right;
    color: #5d35a0;
    margin-bottom: 15px;
    border-bottom: 2px solid #9c27b0;
    padding-bottom: 5px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* تنسيق بطاقة المنتج الفردية */
.product-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: right;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.product-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 10px;
}

.product-card h3 {
    color: #5d35a0;
    font-size: 1.2em;
    margin-top: 5px;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    min-height: 40px;
}

/* تنسيق التفاصيل المضافة (شاشة، ذاكرة، إلخ) */
.product-details {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    padding: 0 10px;
    width: 100%;
    min-height: 80px;
}

.product-details p {
    margin: 5px 0;
}

.product-price {
    font-size: 1.4em;
    font-weight: bold;
    color: #9c27b0;
    margin-bottom: 15px;
    width: 100%;
    text-align: center;
}

/* ==================================== */
/* تنسيق أزرار الشراء والسلة */
/* ==================================== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    margin-top: auto;
    padding-bottom: 5px;
}

.buy-now, .add-to-cart {
    display: block;
    padding: 12px 10px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
}

.buy-now {
    background-color: #9c27b0;
    color: white;
}

.buy-now:hover {
    background-color: #7b1fa2;
}

.add-to-cart {
    background-color: #ffffff;
    color: #9c27b0;
    border: 2px solid #9c27b0;
}

.add-to-cart:hover {
    background-color: #f4f4f4;
}

/* ==================================== */
/* تنسيق شريط التنقل السفلي الثابت */
/* ==================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: #666;
    font-size: 0.8em;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
}

.nav-item i {
    font-size: 1.5em;
    margin-bottom: 2px;
}

/* استخدام ألوان المتجر الجديدة لشريط التنقل */
.nav-item:hover, .nav-item.active {
    color: #5d35a0;
    font-weight: bold;
}
.nav-item:hover i, .nav-item.active i {
    color: #9c27b0;
}

/* --- تنسيق التذييل (Main Footer) --- */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    border-top: 5px solid #9c27b0;
    text-align: right;
}

.footer-section {
    width: 30%;
    min-width: 150px;
    margin-bottom: 10px;
}

.footer-section h4 {
    color: #ffffff;
    border-bottom: 2px solid #3498db;
    padding-bottom: 4px;
    margin-bottom: 10px;
    font-size: 1.0em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 1.5;
    display: block;
    transition: color 0.3s;
    font-size: 0.9em;
}

.social-icons {
    margin-top: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.social-icon {
    color: #ecf0f1;
    font-size: 20px;
    transition: color 0.3s, transform 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.facebook:hover {
    color: #3b5998;
}

.social-icon.instagram:hover {
    color: #e1306c;
}

.social-icon.whatsapp:hover {
    color: #25d366;
}

.copyright {
    font-size: 0.8em;
    color: #7f8c8d;
    text-align: right;
    width: 100%;
    margin-top: 10px;
}

/* ==================================== */
/* تنسيق خاص بصفحات الدعم والتواصل (contact, about, policy) */
/* ==================================== */
.info-section {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    text-align: right;
    transition: transform 0.3s;
}

.info-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
    color: #5d35a0;
    border-bottom: 2px solid #9c27b0;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.contact-detail {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.contact-detail a {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.contact-detail .icon {
    margin-left: 10px;
    color: #9c27b0;
}


/* ==================================== */
/* Media Queries (تكييف الشاشات) */
/* ==================================== */

@media (max-width: 20px) {

    /* عرض شريط التنقل السفلي */
    .bottom-nav {
        display: flex;
    }

    /* إخفاء شريط التنقل العلوي في الهواتف إذا كان موجوداً */
    header nav {
        display: none;
    }

    /* تعديل تنسيق بطاقات المنتجات على الشاشات الصغيرة */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-card h3 {
        font-size: 1em;
        min-height: 35px;
    }

    .product-details {
        min-height: 70px;
    }

    .buy-now, .add-to-cart {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    /* --- التعديلات النهائية على التذييل (Footer) لضمان التوسيط والتصغير --- */
    .main-footer {
        flex-direction: column;
        align-items: center; /* توسيط جميع الأقسام رأسياً */
        text-align: center; /* توسيط النصوص افتراضياً */
        padding-bottom: 80px;
        padding-top: 15px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .footer-section {
        width: 100%;
        min-width: unset;
        text-align: center; /* لضمان توسيط العناوين والنصوص */
        margin-bottom: 15px;
    }

    .footer-section h4 {
        border-bottom: 2px solid #3498db;
    }

    /* توسيط ايقونات التواصل الاجتماعي */
    .social-icons {
        justify-content: center; /* توسيط الأيقونات في الهاتف */
    }
    /* توسيط نص حقوق الطبع والنشر */
    .copyright {
        text-align: center;
        margin-top: 10px;
    }
}
