/* --- All Products Premium Design (Matching Home.html) --- */
:root {
    --primary-red: #FFD700;
    --primary-red-hover: #e6c200;
    --dark-bg: #1a1a1a;
    --card-bg: #ffffff;
    --text-main: #050A15;
    --text-light: #64748b;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -12px rgba(255, 215, 0, 0.25);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

body {
    background-color: #f8fafc;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--text-main);
}

/* Page Container */
.products-page-container {
    padding: 20px;
    max-width: 1350px;
    margin: 0 auto;
    min-height: 80vh;
}

/* Page Header - Professional Redesign */
.page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-red);
    border-radius: 4px;
}

.header-content {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.page-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
}

.page-title span {
    color: var(--primary-red);
}

.page-header p {
    color: var(--text-light);
    font-size: 1.15rem;
    margin: 0 auto;
    max-width: 600px;
    line-height: 1.7;
}

/* Sort Container - Clean & Minimal */
.sort-container {
    position: relative;
    min-width: 260px;
    z-index: 10;
}

.sort-select {
    appearance: none;
    width: 100%;
    padding: 14px 20px;
    padding-left: 50px;
    border-radius: 50px;
    /* Pillow shape for modern look */
    border: 2px solid #e2e8f0;
    background: #fff;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

.sort-select:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.sort-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
    pointer-events: none;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.sort-container:hover .sort-icon {
    transform: translateY(-50%) rotate(180deg);
}

/* Products Grid - Consistent with Home */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    padding-bottom: 20px;
}

/* Premium Product Card (Matching Home) */
.product-card {
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.15);
    border-color: var(--primary-red);
}
.card-img-wrapper { position: relative; overflow: hidden; background: #fff; }
.card-img-top { transition: transform 0.8s ease !important; width: 100%; height: 100%; object-fit: cover; }
.product-card:hover .card-img-top { transform: scale(1.1) !important; }

.badges-overlay { position: absolute; top: 15px; right: 15px; z-index: 10; display: flex; flex-direction: column; gap: 8px; }
.badge-custom { padding: 6px 14px; border-radius: 50px; font-weight: 700; font-size: 0.85rem; }
.badge-sale { background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-hover) 100%) !important; color: #050A15 !important; box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3); }
.badge-new { background: #fff; color: #050A15; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.actions-overlay { position: absolute; top: 15px; left: 15px; z-index: 10; opacity: 0; transform: translateX(-10px); transition: all 0.3s; }
.product-card:hover .actions-overlay { opacity: 1; transform: translateX(0); }
.action-btn { background: rgba(5, 10, 21, 0.8); color: var(--primary-red); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: all 0.3s; }
.action-btn:hover { background: var(--primary-red); color: #050A15; transform: scale(1.1); }

.card-body-custom { padding: 25px 20px; display: flex; flex-direction: column; flex-grow: 1; background: #ffffff; }
.product-cat { color: #64748b; font-size: 0.85rem; margin-bottom: 8px; font-weight: 600; }
.product-title { color: #050A15 !important; font-weight: 800; font-size: 1.15rem; margin-bottom: 15px; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.3s; line-height: 1.4; height: 2.8em; }
.product-title:hover { color: var(--primary-red) !important; }
.price-wrapper { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.price-current { color: #dfbe00ff !important; font-size: 1.25rem !important; font-weight: 800; }
.price-old { color: #94a3b8; text-decoration: line-through; font-size: 0.95rem; }

.btn-add-cart { background: #f8fafc; color: #050A15; border: 1px solid rgba(0,0,0,0.05); padding: 10px; border-radius: 12px; text-align: center; text-decoration: none; transition: all 0.3s; margin-bottom: 10px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-add-cart:hover { background: rgba(0,0,0,0.05); border-color: var(--primary-red); color: #050A15; }

.btn-order-now { background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-hover) 100%) !important; color: #050A15 !important; padding: 12px; border-radius: 12px; text-align: center; text-decoration: none; font-weight: 700; transition: all 0.3s; display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2) !important; border: none; margin-top: auto; }
.btn-order-now:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4) !important; background: linear-gradient(135deg, #FFe033 0%, #FFC107 100%) !important; }
.btn-out-of-stock { background: #1a233a; color: #64748b; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; border: none; width: 100%; cursor: not-allowed; display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: auto; }

/* Load More - Premium Redesign */
.load-more-container {
    text-align: center;
    margin-top: 60px;
    position: relative;
    padding-bottom: 20px;
}

.load-more-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: var(--text-main);
    padding: 16px 45px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--primary-red);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.load-more-btn:hover {
    color: #050A15;
    border-color: var(--primary-red);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(255, 215, 0, 0.3);
}

.load-more-btn:hover::before {
    width: 100%;
}

.load-more-btn i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.load-more-btn:hover i {
    transform: translateY(3px);
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-favourite {
    /* Keeping class name for compatibility or updating if needed */
    text-align: center;
    padding: 100px 20px;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    border: 1px dashed #e2e8f0;
    max-width: 600px;
    margin: 40px auto;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 3rem;
    color: #94a3b8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }

    .sort-container {
        width: 100%;
        max-width: 400px;
    }

    .products-grid {
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .products-page-container {
        padding: 15px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .page-title {
        font-size: 2rem;
    }

    .load-more-btn {
        width: 100%;
        justify-content: center;
    }
}