﻿/* ===== RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
}

/* ===== MAIN PRODUCTS STYLES ===== */
.categories-filter {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 20px;
    border: 2px dashed #dee2e6;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

    .categories-filter .btn {
        border-radius: 50px;
        padding: 12px 28px;
        font-weight: 700;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        border: 2px solid;
        font-size: 1rem;
        position: relative;
        overflow: hidden;
    }

        .categories-filter .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s;
        }

        .categories-filter .btn:hover::before {
            left: 100%;
        }

        .categories-filter .btn:hover {
            transform: translateY(-4px) scale(1.05);
            box-shadow: 0 12px 25px rgba(0,0,0,0.15);
        }

    .categories-filter .btn-primary {
        background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
        border-color: #3498db;
        color: white;
    }

    .categories-filter .btn-outline-primary {
        background: transparent;
        border-color: #3498db;
        color: #3498db;
        backdrop-filter: blur(5px);
    }

        .categories-filter .btn-outline-primary:hover {
            background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
            color: white;
            transform: translateY(-4px) scale(1.05);
            box-shadow: 0 12px 25px rgba(52, 152, 219, 0.3);
        }

/* Section Header */
.section-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}

.section-title {
    color: #2c3e50 !important;
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: #6c757d !important;
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Product Cards - Modern Design */
.product-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    border: 1px solid rgba(255,255,255,0.8);
}

    .product-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
        transform: scaleX(0);
        transition: transform 0.4s ease;
    }

    .product-card:hover::before {
        transform: scaleX(1);
    }

    .product-card:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    }

    /* Product Image */
    .product-card .card-img-top {
        height: 220px;
        object-fit: cover;
        transition: all 0.4s ease;
        border-bottom: 1px solid #e9ecef;
    }

    .product-card:hover .card-img-top {
        transform: scale(1.08);
    }

    /* Product Body */
    .product-card .card-body {
        padding: 2rem 1.5rem 1.5rem;
        position: relative;
    }

    /* Category Badge */
    .product-card .badge {
        font-size: 0.75rem;
        padding: 8px 16px;
        border-radius: 20px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border: 1px solid rgba(255,255,255,0.3);
    }

        .product-card .badge.bg-secondary {
            background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%) !important;
            color: white;
            box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
        }

    /* Product Title */
    .product-card .fw-bolder {
        color: #2c3e50 !important;
        font-weight: 800 !important;
        font-size: 1.2rem;
        margin: 15px 0 12px;
        line-height: 1.4;
        min-height: 3.2em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Product Description */
    .product-card .text-muted {
        color: #6c757d !important;
        line-height: 1.6;
        font-size: 0.9rem;
        margin-bottom: 15px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        min-height: 4.8em;
    }

    /* Product Price */
    .product-card .text-primary {
        color: #e74c3c !important;
        font-weight: 800;
        font-size: 1.4rem;
        background: linear-gradient(135deg, #e74c3c, #c0392b);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        display: block;
        margin: 10px 0;
    }

    /* View Details Button - MODERN DESIGN */
    .product-card .btn-view-details {
        border-radius: 50px;
        padding: 12px 30px;
        font-weight: 700;
        border: 2px solid #2c3e50;
        color: #2c3e50;
        background: transparent;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
        position: relative;
        overflow: hidden;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

        .product-card .btn-view-details::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent);
            transition: left 0.6s;
        }

        .product-card .btn-view-details:hover::before {
            left: 100%;
        }

        .product-card .btn-view-details:hover {
            background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
            border-color: #2c3e50;
            color: white;
            transform: translateY(-4px) scale(1.05);
            box-shadow: 0 12px 25px rgba(44, 62, 80, 0.3);
        }

        .product-card .btn-view-details i {
            font-size: 1.1rem;
            transition: transform 0.4s ease;
        }

        .product-card .btn-view-details:hover i {
            transform: scale(1.3) rotate(5deg);
        }

/* Selected Category Info */
.selected-category-info {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin: 40px 0;
    text-align: center;
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.3);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

    .selected-category-info::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        animation: float 6s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.selected-category-info h3 {
    color: white !important;
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.selected-category-info .text-muted {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 25px;
    position: relative;
}

.selected-category-info .btn-outline-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid white;
    color: white;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

    .selected-category-info .btn-outline-secondary:hover {
        background-color: white;
        color: #2c3e50;
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(255,255,255,0.3);
    }

/* Empty State */
.empty-state {
    padding: 100px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    margin: 40px 0;
    border: 2px dashed #dee2e6;
}

    .empty-state .display-1 {
        font-size: 5rem;
        color: #bdc3c7 !important;
        margin-bottom: 30px;
        opacity: 0.7;
    }

    .empty-state h4 {
        color: #2c3e50 !important;
        font-weight: 800;
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .empty-state .text-muted {
        color: #7f8c8d !important;
        font-size: 1.2rem;
        margin-bottom: 30px;
        line-height: 1.6;
    }

    .empty-state .btn-primary {
        background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
        border: none;
        padding: 15px 35px;
        border-radius: 50px;
        font-weight: 700;
        transition: all 0.3s ease;
        font-size: 1.1rem;
    }

        .empty-state .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(52, 152, 219, 0.3);
        }

/* Support Redirect Section */
.support-redirect-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 35px;
    border-radius: 20px;
    border: 2px dashed #3498db;
    margin: 30px 0;
    backdrop-filter: blur(10px);
}

    .support-redirect-section p {
        font-size: 1.2rem;
        color: #2c3e50;
        font-weight: 700;
        margin-bottom: 20px;
    }

    .support-redirect-section .text-muted {
        font-size: 1.1rem;
        color: #6c757d !important;
        margin-bottom: 25px;
    }

    .support-redirect-section .btn {
        border-radius: 50px;
        padding: 14px 30px;
        font-weight: 700;
        transition: all 0.3s ease;
        margin: 8px;
        font-size: 1rem;
    }

    .support-redirect-section .btn-primary {
        background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
        border: none;
    }

        .support-redirect-section .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(52, 152, 219, 0.3);
        }

    .support-redirect-section .btn-outline-primary {
        border: 2px solid #3498db;
        color: #3498db;
        background: transparent;
    }

        .support-redirect-section .btn-outline-primary:hover {
            background: #3498db;
            color: white;
            transform: translateY(-3px);
        }

    .support-redirect-section .btn-success {
        background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
        border: none;
    }

        .support-redirect-section .btn-success:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(39, 174, 96, 0.3);
        }

/* Pagination */
.pagination .page-link {
    border-radius: 12px;
    margin: 0 6px;
    border: 2px solid #dee2e6;
    color: #2c3e50;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 10px 18px;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    border-color: #3498db;
    color: white;
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.pagination .page-link:hover {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
    transform: translateY(-2px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .section-title {
        font-size: 2.2rem;
    }

    .product-card .card-body {
        padding: 1.5rem 1.25rem 1.25rem;
    }
}

@media (max-width: 992px) {
    .categories-filter .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
    }

    .section-header {
        padding: 30px 20px;
    }

    .product-card .fw-bolder {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .categories-filter {
        padding: 20px 15px;
        margin-bottom: 30px;
    }

        .categories-filter .btn {
            padding: 8px 16px;
            font-size: 0.85rem;
            margin: 4px;
            width: calc(50% - 8px);
        }

    .section-header {
        padding: 25px 15px;
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }

    .selected-category-info {
        padding: 25px 15px;
        margin: 25px 0;
    }

        .selected-category-info h3 {
            font-size: 1.5rem;
        }

        .selected-category-info .text-muted {
            font-size: 1rem;
        }

    .empty-state {
        padding: 60px 15px;
        margin: 25px 0;
    }

        .empty-state .display-1 {
            font-size: 3.5rem;
        }

        .empty-state h4 {
            font-size: 1.6rem;
        }

    .support-redirect-section {
        padding: 25px 15px;
        margin: 20px 0;
    }

        .support-redirect-section .btn {
            padding: 12px 20px;
            font-size: 0.9rem;
            width: 100%;
            margin: 10px 0;
        }

        .support-redirect-section .d-flex {
            flex-direction: column;
        }

    .product-card .btn-view-details {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .categories-filter .btn {
        width: 100%;
        margin: 5px 0;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .product-card {
        margin-bottom: 25px;
    }

    .pagination .page-link {
        padding: 8px 14px;
        margin: 0 3px;
        font-size: 0.9rem;
    }
}

/* Animation for cards loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

    /* Hover effects for better interactivity */
    .product-card:hover .card-img-top {
        filter: brightness(1.1);
    }

/* Loading state */
.loading-state {
    opacity: 0.7;
    pointer-events: none;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #2980b9, #2c3e50);
    }


/* تحسين وصف المنتج - إزالة القص الإجباري */
.product-card .product-description {
    color: #6c757d !important;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 15px;
    min-height: auto;
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

/* تحسين العنوان ليأخذ مساحة مناسبة */
.product-card .fw-bolder {
    color: #2c3e50 !important;
    font-weight: 800 !important;
    font-size: 1.1rem;
    margin: 15px 0 12px;
    line-height: 1.4;
    min-height: auto;
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

/* تحسين ارتفاع البطاقة ليكون مرنًا */
.product-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    border: 1px solid rgba(255,255,255,0.8);
    height: auto;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

    .product-card .card-body {
        padding: 2rem 1.5rem 1.5rem;
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .product-card .card-footer {
        margin-top: auto;
    }