﻿/* 🎨 دکمه افزودن به سبد خرید (سازگار با NopCommerce) */
.cart-button {
    background: linear-gradient(135deg, #2962ff, #1565c0);
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-family: "Poppins", sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

    /* جلوه نوری روی hover */
    .cart-button::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: 0.5s;
    }

    .cart-button:hover::before {
        left: 100%;
    }

    /* افکت hover */
    .cart-button:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(41, 98, 255, 0.4);
    }

    /* حالت کلیک */
    .cart-button:active {
        transform: scale(0.95) translateY(2px);
        box-shadow: 0 0 5px rgba(41, 98, 255, 0.2);
    }

/* آیکن سبد */
.cart-icon {
    display: inline-block;
    margin-right: 8px;
    transition: all 0.3s ease;
}

    .cart-icon svg {
        vertical-align: middle;
        width: 20px;
        height: 20px;
    }

.cart-button:hover .cart-icon svg {
    transform: scale(1.1);
}

/* نوار پیشرفت پایین دکمه */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    width: 0;
}

/* 🔵 حالت افزودن */
.adding {
    pointer-events: none;
    opacity: 0.8;
}

    .adding .progress-bar {
        animation: progress 1s ease-in-out forwards;
    }

@keyframes progress {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

/* 🟢 حالت موفقیت */
.success {
    background: linear-gradient(135deg, #00c853, #009624) !important;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.4);
}

    .success .cart-icon {
        animation: addedToCart 0.5s ease-in-out;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
    }

/* انیمیشن چرخش آیکن هنگام موفقیت */
@keyframes addedToCart {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4) rotate(45deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

/* انیمیشن subtle pulse مداوم */
@keyframes subtle-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(41, 98, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(41, 98, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(41, 98, 255, 0);
    }
}

.cart-button {
    animation: subtle-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* برای دستگاه‌هایی با کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
    .cart-button,
    .cart-button:hover,
    .cart-button:active {
        transition: none;
        animation: none;
        transform: none;
    }
}
.ajax-loading-block-window {
    display: none !important;
}
