﻿/* ============================================
           PRODUCTS — نسخه مشتریان
           ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    direction: rtl;
    padding: 20px;
}

/* ============================================
           HEADER
           ============================================ */
.products-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f2f5;
}

    .products-header .title-section {
        display: flex;
        align-items: center;
        gap: 14px;
    }

        .products-header .title-section .title-icon {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #003366, #0a4d8c);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #F4B400;
            font-size: 1.4rem;
            box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
        }

        .products-header .title-section h2 {
            font-weight: 800;
            color: #003366;
            margin: 0;
            font-size: 1.4rem;
        }

        .products-header .title-section small {
            display: block;
            color: #9ca3af;
            font-size: 0.8rem;
            font-weight: 400;
        }

    .products-header .header-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

/* ============================================
           SEARCH & FILTER
           ============================================ */
.search-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

    .search-filter .search-box {
        flex: 1;
        min-width: 200px;
        display: flex;
        align-items: center;
        background: #f5f7fa;
        border-radius: 50px;
        padding: 4px 16px;
        border: 2px solid transparent;
        transition: all 0.4s ease;
    }

        .search-filter .search-box:focus-within {
            border-color: #F4B400;
            background: #ffffff;
            box-shadow: 0 0 0 4px rgba(244, 180, 0, 0.08);
        }

        .search-filter .search-box i {
            color: #9ca3af;
            font-size: 1rem;
        }

        .search-filter .search-box input {
            border: none;
            background: transparent;
            padding: 10px 12px;
            font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
            font-size: 0.95rem;
            width: 100%;
            outline: none;
            color: #1a1a2e;
        }

            .search-filter .search-box input::placeholder {
                color: #9ca3af;
            }

    .search-filter .filter-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

        .search-filter .filter-buttons .filter-btn {
            padding: 8px 18px;
            border: 2px solid #e5e7eb;
            border-radius: 50px;
            background: transparent;
            color: #6b7280;
            font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.4s ease;
        }

            .search-filter .filter-buttons .filter-btn:hover {
                border-color: #003366;
                color: #003366;
            }

            .search-filter .filter-buttons .filter-btn.active {
                background: #003366;
                color: #fff;
                border-color: #003366;
            }

/* ============================================
           PRODUCT GRID
           ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

.product-item {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0f2f5;
    transition: all 0.5s cubic-bezier(.34, 1.56, .64, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

    .product-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
        border-color: #F4B400;
    }

    /* ============================================
           PRODUCT IMAGE
           ============================================ */
    .product-item .product-image {
        height: 240px;
        background: linear-gradient(135deg, #fafafa, #f0f2f5);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        position: relative;
        overflow: hidden;
    }

        .product-item .product-image img {
            max-height: 100%;
            max-width: 100%;
            object-fit: contain;
            transition: transform 0.7s cubic-bezier(.34, 1.56, .64, 1);
        }

    .product-item:hover .product-image img {
        transform: scale(1.06) rotate(-2deg);
    }

    /* ============================================
           BADGES
           ============================================ */
    .product-item .product-badge {
        position: absolute;
        top: 12px;
        right: 12px;
        padding: 4px 14px;
        border-radius: 50px;
        font-size: 0.7rem;
        font-weight: 700;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .product-item .product-badge.featured {
            background: linear-gradient(135deg, #F4B400, #d49d00);
            color: #003366;
            box-shadow: 0 4px 15px rgba(244, 180, 0, 0.3);
        }

        .product-item .product-badge.sale {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: #fff;
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
        }

        .product-item .product-badge.new {
            background: linear-gradient(135deg, #24c06d, #1a9e58);
            color: #fff;
            box-shadow: 0 4px 15px rgba(36, 192, 109, 0.3);
        }

        .product-item .product-badge.best-seller {
            background: linear-gradient(135deg, #7e56c6, #5a3a9e);
            color: #fff;
            box-shadow: 0 4px 15px rgba(126, 86, 198, 0.3);
        }

    /* ============================================
           WISHLIST BUTTON
           ============================================ */
    .product-item .wishlist-btn {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        color: #9ca3af;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(.34, 1.56, .64, 1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

        .product-item .wishlist-btn:hover {
            transform: scale(1.1);
            background: #fff;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }

        .product-item .wishlist-btn.active {
            color: #ef4444;
        }

            .product-item .wishlist-btn.active i {
                font-weight: 900;
            }

    /* ============================================
           PRODUCT INFO
           ============================================ */
    .product-item .product-info {
        padding: 16px 18px 18px;
    }

        .product-item .product-info .product-rating {
            display: flex;
            align-items: center;
            gap: 4px;
            color: #F4B400;
            font-size: 0.85rem;
            margin-bottom: 4px;
        }

            .product-item .product-info .product-rating .rating-number {
                color: #6b7280;
                font-weight: 600;
                margin-right: 4px;
                font-size: 0.8rem;
            }

            .product-item .product-info .product-rating .fa-regular {
                color: #e5e7eb;
            }

            .product-item .product-info .product-rating .reviews-count {
                color: #9ca3af;
                font-size: 0.7rem;
                font-weight: 400;
                margin-right: 2px;
            }

        .product-item .product-info h4 {
            font-weight: 700;
            color: #003366;
            font-size: 1.05rem;
            margin-bottom: 2px;
        }

        .product-item .product-info .product-category {
            font-size: 0.8rem;
            color: #9ca3af;
            margin-bottom: 8px;
        }

            .product-item .product-info .product-category i {
                color: #F4B400;
                margin-left: 4px;
            }

        .product-item .product-info .product-price {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 14px;
        }

            .product-item .product-info .product-price .current {
                font-weight: 800;
                font-size: 1.15rem;
                color: #003366;
            }

            .product-item .product-info .product-price .old {
                color: #bbb;
                text-decoration: line-through;
                font-size: 0.9rem;
            }

            .product-item .product-info .product-price .discount-badge {
                background: #ef4444;
                color: #fff;
                font-size: 0.65rem;
                font-weight: 700;
                padding: 2px 10px;
                border-radius: 50px;
            }

    /* ============================================
           ADD TO CART BUTTON
           ============================================ */
    .product-item .add-to-cart {
        width: 100%;
        padding: 12px;
        border: 2px solid #003366;
        background: transparent;
        border-radius: 12px;
        color: #003366;
        font-family: 'Vazirmatn', 'Segoe UI', sans-serif;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.4s cubic-bezier(.34, 1.56, .64, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

        .product-item .add-to-cart:hover {
            background: #003366;
            color: #fff;
            transform: scale(1.02);
            box-shadow: 0 4px 20px rgba(0, 51, 102, 0.2);
        }

        .product-item .add-to-cart.added {
            background: #24c06d;
            border-color: #24c06d;
            color: #fff;
        }

            .product-item .add-to-cart.added:hover {
                background: #1a9e58;
                border-color: #1a9e58;
            }

    /* ============================================
           STOCK STATUS
           ============================================ */
    .product-item .product-info .product-stock {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 3px 12px;
        border-radius: 50px;
        font-size: 0.7rem;
        font-weight: 600;
        margin-bottom: 12px;
    }

        .product-item .product-info .product-stock.in-stock {
            background: #d1fae5;
            color: #065f46;
        }

        .product-item .product-info .product-stock.low-stock {
            background: #fef3c7;
            color: #92400e;
        }

        .product-item .product-info .product-stock.out-stock {
            background: #fee2e2;
            color: #991b1b;
        }

/* ============================================
           FOOTER
           ============================================ */
.products-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

    .products-footer .products-count {
        color: #6b7280;
        font-size: 0.9rem;
    }

        .products-footer .products-count strong {
            color: #003366;
        }

    /* ============================================
           PAGINATION
           ============================================ */
    .products-footer .pagination {
        display: flex;
        gap: 6px;
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .products-footer .pagination li {
            display: inline-block;
        }

            .products-footer .pagination li a,
            .products-footer .pagination li span {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-width: 38px;
                height: 38px;
                padding: 0 12px;
                border-radius: 10px;
                border: 1px solid #e5e7eb;
                color: #003366;
                font-weight: 600;
                font-size: 0.85rem;
                text-decoration: none;
                transition: all 0.3s ease;
                background: #fff;
                cursor: pointer;
            }

                .products-footer .pagination li a:hover {
                    background: #003366;
                    color: #fff;
                    border-color: #003366;
                }

            .products-footer .pagination li.active span {
                background: #F4B400;
                color: #003366;
                border-color: #F4B400;
            }

/* ============================================
           RESPONSIVE
           ============================================ */
@media (max-width: 992px) {
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }

    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }

        .search-filter .filter-buttons {
            justify-content: center;
        }
}

@media (max-width: 768px) {
    .products-header .title-section h2 {
        font-size: 1.1rem;
    }

    .products-header .title-section .title-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 14px;
    }

    .product-item .product-image {
        height: 180px;
    }

    .product-item .product-info {
        padding: 12px 14px 14px;
    }

        .product-item .product-info h4 {
            font-size: 0.95rem;
        }

        .product-item .product-info .product-price .current {
            font-size: 0.95rem;
        }

    .product-item .add-to-cart {
        font-size: 0.8rem;
        padding: 10px;
    }

    .product-item .wishlist-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        top: 8px;
        left: 8px;
    }

    .products-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: 14px 18px;
    }

    .search-filter {
        padding: 12px 16px;
    }

        .search-filter .filter-buttons .filter-btn {
            font-size: 0.75rem;
            padding: 6px 12px;
        }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-item .product-image {
        height: 140px;
        padding: 12px;
    }

    .product-item .product-info h4 {
        font-size: 0.85rem;
    }

    .product-item .product-info .product-category {
        font-size: 0.7rem;
    }

    .product-item .product-info .product-price .current {
        font-size: 0.85rem;
    }

    .product-item .product-badge {
        font-size: 0.6rem;
        padding: 3px 10px;
        top: 8px;
        right: 8px;
    }

    .product-item .add-to-cart {
        font-size: 0.7rem;
        padding: 8px;
        border-radius: 8px;
    }

    .product-item .wishlist-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .products-header {
        padding: 14px 16px;
    }

        .products-header .title-section .title-icon {
            width: 36px;
            height: 36px;
            font-size: 0.95rem;
        }

        .products-header .title-section h2 {
            font-size: 0.95rem;
        }

        .products-header .title-section small {
            font-size: 0.7rem;
        }

    .products-footer .products-count {
        font-size: 0.8rem;
    }

    .products-footer .pagination li a,
    .products-footer .pagination li span {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 8px;
    }

    .search-filter .search-box input {
        font-size: 0.85rem;
        padding: 8px 10px;
    }

    .search-filter .filter-buttons {
        gap: 4px;
    }

        .search-filter .filter-buttons .filter-btn {
            font-size: 0.7rem;
            padding: 4px 10px;
        }
}

/* ============================================
           SCROLLBAR
           ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

::-webkit-scrollbar-thumb {
    background: #F4B400;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #d49d00;
    }
