﻿/* Basic Styles */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8f9fa;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-logo img {
    height: 80px; /* ✅ التعديل الأول: تم تكبير ارتفاع اللوجو إلى 80px */
}

.header-search {
    display: flex;
    width: 50%;
}

    .header-search input {
        width: 100%;
        border: 1px solid #ced4da;
        border-radius: 0 5px 5px 0;
        padding: 8px 12px;
        border-left: none;
    }

    .header-search button {
        border: 1px solid #ced4da;
        border-radius: 5px 0 0 5px;
        background-color: #f8f9fa;
        padding: 8px 12px;
    }

        /* ✅ التعديل الثاني: قاعدة جديدة لضمان ظهور أيقونة البحث بشكل دائم */
        .header-search button i.fa-search {
            visibility: visible !important;
            opacity: 1 !important;
            color: #333 !important;
        }

.header-actions {
    display: flex;
    gap: 20px;
}

.header-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
}

    .header-action-item i {
        font-size: 20px;
    }

.header-nav {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

    .header-nav ul {
        display: flex;
        justify-content: center;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 30px;
    }

    .header-nav a {
        text-decoration: none;
        color: #333;
        font-weight: 700;
    }

/* Hero Slider */
.hero-slider-container {
    margin-bottom: 40px;
}

.slider-item img {
    width: 100%;
    height: 500px; /* تحديد ارتفاع للسلايدر */
    object-fit: cover; /* قص الصورة لتناسب الارتفاع */
}

.slick-dots {
    bottom: 25px;
}

/* --- New Styles for Homepage Sections --- */

.home-section {
    margin-bottom: 50px;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    text-decoration: none;
    color: #333;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    background-color: #fff;
}

    .category-card:hover {
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .category-card img {
        width: 100%;
        height: 150px;
        object-fit: cover;
    }

.category-card-title {
    padding: 10px;
    text-align: center;
    font-weight: 700;
}

/* Product Card */
.product-carousel .slick-slide {
    padding: 0 10px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fff;
    text-align: center;
    margin-bottom: 10px;
    overflow: hidden; /* لإخفاء أي أجزاء زائدة من الصورة */
}

.product-card-image {
    height: 250px; /* ✅ تحديد ارتفاع ثابت لمكان الصورة */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .product-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.product-card-body {
    padding: 15px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* لمنع الأسماء الطويلة من إفساد التصميم */
}

    .product-card-title a {
        text-decoration: none;
        color: #333;
    }

.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 10px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px 0;
    background-color: #343a40;
    color: white;
    margin-top: 40px;
}


/* --- Product Details Page Styles --- */

.product-details-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Image Gallery */
.gallery-main-image {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

    .gallery-main-image img {
        width: 100%;
        height: auto;
        max-height: 500px;
        object-fit: cover;
    }

.product-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail-item {
    border: 2px solid #eee;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
    width: 80px;
    height: 80px;
    transition: border-color 0.3s ease;
}

    .thumbnail-item:hover, .thumbnail-item.active {
        border-color: #007bff;
    }

    .thumbnail-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }


/* Product Info */
.product-info h2 {
    font-weight: 700;
    margin-bottom: 5px;
}

.product-info .category-name {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 15px;
}

.product-price-details .final-price {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
}

.product-price-details .original-price {
    font-size: 1.25rem;
    color: #6c757d;
    text-decoration: line-through;
}

.product-description {
    color: #495057;
    line-height: 1.6;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}


.product-card-image-container {
    position: relative;
}



/* ✅ هذا هو الكود الجديد الذي يظهر القلب بدون دائرة ✅ */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 24px; /* يمكنك التحكم في حجم القلب من هنا */
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 5;
    padding: 5px;
}

    .wishlist-btn:hover {
        color: #dc3545;
        transform: scale(1.1); /* تأثير بسيط عند التمرير */
    }

    .wishlist-btn.active {
        color: #dc3545; /* لون القلب الأحمر عند الإضافة */
    }



        .wishlist-btn.active .far.fa-heart::before {
            content: "\f004"; /* This changes the icon to the solid heart (fas) */
            font-weight: 900;
        }

/* --- Search Bar & Suggestions Styles --- */
.header-search {
    display: flex;
    flex-grow: 1; /* السماح له بأخذ المساحة المتاحة */
    margin: 0 40px;
    position: relative;
}

    /* ✅ إضافة جديدة: للتأكد من أن الفورم والمدخل يأخذان العرض الكامل */
    .header-search form {
        width: 100%;
        display: flex;
    }

    .header-search input {
        width: 100%; /* اجعل حقل الإدخال يملأ الفورم */
        font-size: 1.1rem;
        padding: 10px 15px;
        border-right: none;
    }

/* --- Search Bar & Suggestions Styles --- */
.header-search {
    position: relative; /* مهم للنافذة المنبثقة */
}

/* ... (باقي كود مربع البحث كما هو) ... */

.search-suggestions-popup {
    display: none; /* إخفاءها بشكل افتراضي */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); /* ظل أقوى */
    z-index: 1000;
    padding: 20px;
    max-height: 450px; /* تحديد ارتفاع أقصى */
    overflow-y: auto; /* إضافة سكرول عند الحاجة */
}

    .search-suggestions-popup h6 {
        font-weight: 700;
        color: #888;
        font-size: 0.9rem;
        margin-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 8px;
    }

    .search-suggestions-popup ul {
        list-style: none;
        padding: 0;
        margin: 0 0 20px 0;
        display: flex; /* ✅ إضافة هذا */
        flex-wrap: wrap; /* ✅ إضافة هذا */
        gap: 10px; /* ✅ إضافة هذا */
    }

        .search-suggestions-popup ul li {
            flex: 0 0 calc(25% - 8px); /* 4 عناصر في كل صف */
        }

            .search-suggestions-popup ul li a {
                display: flex;
                align-items: center;
                gap: 15px;
                padding: 8px 10px;
                text-decoration: none;
                color: #333;
                border-radius: 5px;
                transition: background-color 0.2s ease;
                width: 100%; /* ✅ إضافة هذا */
            }




                .search-suggestions-popup ul li a:hover {
                    background-color: #f5f5f5;
                }

            .search-suggestions-popup ul li img {
                width: 50px; /* ✅ حجم موحد للصور */
                height: 50px;
                object-fit: cover;
                border-radius: 5px;
                flex-shrink: 0;
            }

/* --- Banner Styles --- */
.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.banner-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

    .banner-item img:hover {
        transform: scale(1.03);
    }



/* --- Promo Banner Styles --- */
.promo-banner {
    background-color: #ffc107; /* اللون الأصفر */
    color: #333;
    text-align: center;
    padding: 10px 0;
    font-weight: bold;
}

#countdown-timer {
    background-color: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 15px;
}

/* ================================================= */
/* ==  تحسين أيقونة السلة والعداد (الكود الموحد)  == */
/* ================================================= */

/* أولاً: تكبير حجم أيقونة السلة نفسها والنصوص المجاورة لها */
.header-top-icon.cart-badge-top {
    font-size: 16px; /* تكبير حجم الخط للأيقونة والنص */
    color: #333; /* لون داكن وواضح */
    font-weight: 600; /* خط أسمك قليلاً */
    transition: color 0.2s ease-in-out;
}

    .header-top-icon.cart-badge-top:hover {
        color: var(--bs-primary); /* تغيير اللون عند مرور الماوس */
    }

    .header-top-icon.cart-badge-top i.fa-shopping-bag {
        font-size: 22px; /* تكبير حجم الأيقونة بشكل خاص */
        vertical-align: middle; /* للتوسيط العمودي مع النص */
    }

/* ثانياً: تصميم جديد وواضح لعداد المنتجات (الشارة) */
.cart-badge-top .badge {
    position: absolute;
    top: -10px; /* نرفعه للأعلى قليلاً */
    right: -12px; /* ندفعه لليمين قليلاً */
    /* --- أكواد الشكل والحجم --- */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px; /* حجم خط كبير وواضح للرقم */
    font-weight: bold;
    color: white; /* لون الرقم أبيض */
    background-color: #dc3545; /* لون خلفية أحمر مميز (يمكنك تغييره) */
    width: 24px; /* عرض ثابت */
    height: 24px; /* ارتفاع ثابت */
    border-radius: 50%; /* دائري تمامًا */
    border: 2px solid white; /* حد أبيض سميك وواضح */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* ظل خفيف لإبرازه */
}

/* --- كود خاص باللغة العربية (RTL) --- */
html[dir="rtl"] .cart-badge-top .badge {
    right: auto;
    left: -12px;
}




/* ================================== */
/* ===     Footer Styles (Final)    === */
/* ================================== */

.site-footer {
    background-color: #343a40; /* خلفية داكنة */
    color: #adb5bd;
    padding: 40px 0 20px 0;
    font-size: 14px;
    text-align: initial; /* إلغاء المحاذاة للمنتصف القديمة */
}

.footer-main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-about .footer-logo img {
    max-height: 40px;
    margin-bottom: 15px;
    /* تم حذف الفلتر ليعود اللوجو لشكله الطبيعي */
}

.footer-description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-social-links {
    display: flex;
    gap: 15px;
}

    .footer-social-links a {
        color: #adb5bd;
        font-size: 20px;
        transition: color 0.2s;
    }

        .footer-social-links a:hover {
            color: #fff;
        }

.footer-links h4, .footer-contact h4 {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links ul li {
        margin-bottom: 10px;
    }

        .footer-links ul li a {
            text-decoration: none;
            color: #adb5bd;
            font-size: 14px;
            transition: color 0.2s;
        }

            .footer-links ul li a:hover {
                color: #fff;
            }

/* --- الكود المصحح والنهائي لمشكلة المحاذاة --- */
.footer-contact .contact-item {
    display: flex;
    align-items: center; /* المحاذاة في المنتصف عمودياً */
    gap: 15px;
    margin-bottom: 15px;
}

    .footer-contact .contact-item i {
        font-size: 18px;
        color: var(--bs-primary);
        flex-shrink: 0;
    }

    .footer-contact .contact-item span {
        display: block;
        font-size: 12px;
        color: #adb5bd;
    }

    .footer-contact .contact-item a {
        font-size: 14px;
        font-weight: 500;
        color: #fff;
        text-decoration: none;
    }
/* --- نهاية الكود المصحح --- */

.footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #adb5bd;
}


/* تعديل أماكن الأسهم في اللغة العربية (RTL) */
html[dir="rtl"] .product-carousel .slick-prev {
    left: auto;
    right: -15px;
}

html[dir="rtl"] .product-carousel .slick-next {
    right: auto;
    left: -15px;
}



