
/* =================================
   Styles for Bestsellers Page
   ================================= */

/* تخصيص قسم المنتجات الأكثر مبيعاً */
#bestsellers-page-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#bestsellers-title {
    text-align: center;
    color: #333;
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#bestsellers-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

/* تخصيص منتجات bestsellers */
#bestsellers-products-grid .product-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

#bestsellers-products-grid .product-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#bestsellers-products-grid .product-box img {
    border-radius: 8px 8px 0 0;
    transition: transform 0.3s ease;
}

#bestsellers-products-grid .product-box:hover img {
    transform: scale(1.05);
}

/* تخصيص pagination في صفحة bestsellers */
#bestsellers-pagination {
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#bestsellers-pagination .pagination-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#bestsellers-pagination button {
    padding: 10px 15px;
    background: linear-gradient(45deg, #f9a825, #ff6f00);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
}

#bestsellers-pagination button:hover:not(:disabled) {
    background: linear-gradient(45deg, #ff6f00, #f9a825);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 168, 37, 0.3);
}

#bestsellers-pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#bestsellers-pagination .pagination-info {
    color: #666;
    font-weight: 500;
    margin: 0 15px;
}

/* رسالة فارغة */
.empty-message {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    padding: 40px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
}

/* رسالة خطأ */
.error-message {
    text-align: center;
    color: #dc3545;
    font-size: 1.1rem;
    padding: 40px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid #dc3545;
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    #bestsellers-page-section {
        padding: 15px;
        margin: 10px;
    }

    #bestsellers-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    #bestsellers-products-grid {
        gap: 15px;
    }

    #bestsellers-pagination {
        gap: 5px;
    }

    #bestsellers-pagination button {
        padding: 8px 12px;
        min-width: 40px;
        font-size: 0.9rem;
    }

    #bestsellers-pagination .pagination-info {
        font-size: 0.9rem;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    #bestsellers-page-section {
        padding: 10px;
        margin: 5px;
    }

    #bestsellers-title {
        font-size: 1.3rem;
    }

    #bestsellers-products-grid {
        gap: 10px;
    }

    /* تحسين عرض المنتجات في الشاشات الصغيرة جداً */
    #bestsellers-products-grid .product-box {
        min-width: 140px;
        max-width: 160px;
        margin: 0 auto;
    }

    #bestsellers-products-grid .product-box img {
        height: 120px;
        object-fit: cover;
    }

    #bestsellers-products-grid .product-box .product-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin: 8px 0;
        height: 2.4rem;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    #bestsellers-products-grid .product-box .product-price {
        font-size: 1rem;
        font-weight: 700;
        color: #f9a825;
        margin: 5px 0;
    }

    #bestsellers-products-grid .product-box .product-short-desc {
        font-size: 0.75rem;
        color: #888;
        margin: 5px 0;
    }

    #bestsellers-products-grid .product-box .add-cart {
        padding: 6px 12px;
        font-size: 0.8rem;
        width: 100%;
        margin-top: 8px;
    }

    #bestsellers-products-grid .product-box .badges-container {
        position: absolute;
        top: 5px;
        left: 5px;
        z-index: 2;
    }

    #bestsellers-products-grid .product-box .badge-discount,
    #bestsellers-products-grid .product-box .badge-out-of-stock {
        font-size: 0.7rem;
        padding: 3px 6px;
        border-radius: 4px;
    }

    #bestsellers-pagination button {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 0.8rem;
    }
}

/* مؤشر التحميل */
.products-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 40px;
    min-height: 200px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
}

.lds-dual-ring {
    display: inline-block;
    width: 50px;
    height: 50px;
}

.lds-dual-ring:after {
    content: " ";
    display: block;
    width: 40px;
    height: 40px;
    margin: 5px;
    border-radius: 50%;
    border: 5px solid #f9a825;
    border-color: #f9a825 transparent #f9a825 transparent;
    animation: lds-dual-ring 1s linear infinite;
}

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.products-spinner span {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}