﻿


/* استایل‌های سبد خرید */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 15px;
    z-index: 9999;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-notification.success {
    border-left: 4px solid #28a745;
}

.cart-notification.error {
    border-left: 4px solid #dc3545;
}

.notification-content {
    display: flex;
    align-items: center;
}

.notification-content i {
    margin-left: 10px;
    font-size: 20px;
}

.notification-content i.bi-check-circle {
    color: #28a745;
}

.notification-content i.bi-exclamation-circle {
    color: #dc3545;
}

.close-notification {
    position: absolute;
    top: 5px;
    left: 5px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
}




/* استایل‌های آیتم‌های سبد خرید */
.cart-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

    .cart-item.updating {
        background-color: rgba(255, 255, 0, 0.1);
    }

    .cart-item.removing {
        transform: translateX(100%);
        opacity: 0;
    }

.cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: 15px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-code {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

.cart-item-price {
    display: block;
    font-weight: bold;
    margin-top: 8px;
}

.btn-close-custom {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 14px;
    color: #777;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

    .btn-close-custom:hover {
        color: #dc3545;
    }

/* استایل‌های کنترل تعداد */
.quantity-selector-cart {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn-cart {
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .quantity-btn-cart:hover {
        background: #e0e0e0;
    }

.quantity-input-cart {
    width: 40px;
    height: 28px;
    border: none;
    text-align: center;
    font-size: 14px;
}

/* استایل‌های مجموع و دکمه‌ها */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid #eee;
    font-weight: bold;
}

.cart-buttons {
    display: flex;
    padding: 0 15px 15px;
}

.btn-view-cart, .btn-checkout {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-view-cart {
    background: #f5f5f5;
    color: #333;
    margin-left: 10px;
}

.btn-checkout {
    background: #0d6efd;
    color: #fff;
}

.btn-view-cart:hover {
    background: #e0e0e0;
}

.btn-checkout:hover {
    background: #0b5ed7;
}

.empty-cart-message {
    text-align: center;
    padding: 30px 15px;
    color: #777;
}

/* استایل‌های دکمه افزودن به سبد خرید */
.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(255, 126, 26, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

    .add-to-cart-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
        z-index: -1;
    }

    .add-to-cart-btn i {
        font-size: 1rem;
        transition: transform 0.3s ease;
    }

    .add-to-cart-btn span {
        transition: all 0.3s ease;
    }

    .add-to-cart-btn:hover {
        background: linear-gradient(135deg, #ff9a44, #ff7e1a);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(255, 126, 26, 0.3);
    }

        .add-to-cart-btn:hover::before {
            left: 100%;
        }

        .add-to-cart-btn:hover i {
            transform: rotate(360deg);
        }

        .add-to-cart-btn:hover span {
            letter-spacing: 0.5px;
        }

    /* انیمیشن اضافه شدن به سبد خرید */
    .add-to-cart-btn.added {
        background: linear-gradient(135deg, #27ae60, #2ecc71);
        box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    }

        .add-to-cart-btn.added i {
            transform: scale(1.2);
        }

        .add-to-cart-btn.added span {
            opacity: 0;
            transform: translateY(-10px);
        }

        .add-to-cart-btn.added::after {
            content: 'افزوده شد!';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            animation: fadeIn 0.3s forwards;
        }

    /* استایل‌های لودینگ و ناموجود */
    .add-to-cart-btn.loading {
        opacity: 0.7;
        cursor: not-allowed;
    }

        .add-to-cart-btn.loading::after {
            content: '';
            display: inline-block;
            width: 14px;
            height: 14px;
            margin-right: 8px;
            border: 2px solid #fff;
            border-radius: 50%;
            border-top-color: transparent;
            animation: spin 0.8s linear infinite;
        }

.out-of-stock {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #f5f5f5;
    color: #dc3545;
    border-radius: 4px;
}

    .out-of-stock i {
        margin-left: 8px;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
