/**
 * AJAX Cart Styles
 * 
 * @package storzen
 * @since 1.0.3
 */

/* Add to Cart Button Loading State */
.ajax_add_to_cart.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.ajax_add_to_cart.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: szp-spin 0.6s linear infinite;
}

/* Add to Cart Button Added State */
.ajax_add_to_cart.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.ajax_add_to_cart.added::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 5px;
}

/* Spin Animation */
@keyframes szp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart Notification */
.szp-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.szp-cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.szp-cart-notification i {
    font-size: 20px;
    animation: szp-check-bounce 0.5s ease;
}

.szp-cart-notification span {
    font-weight: 500;
    font-size: 15px;
}

@keyframes szp-check-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive */
@media (max-width: 768px) {
    .szp-cart-notification {
        right: 10px;
        left: 10px;
        top: 10px;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .szp-cart-notification i {
        font-size: 18px;
    }
    
    .szp-cart-notification span {
        font-size: 14px;
    }
}

/* Product Card Hover Effect Enhancement */
.product .ajax_add_to_cart {
    transition: all 0.3s ease;
}

.product .ajax_add_to_cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Grid/List View Button Styles */
.shop-card-items .ajax_add_to_cart,
.shop-list-sidebar .ajax_add_to_cart {
    position: relative;
    overflow: hidden;
}

.shop-card-items .ajax_add_to_cart::before,
.shop-list-sidebar .ajax_add_to_cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.shop-card-items .ajax_add_to_cart:hover::before,
.shop-list-sidebar .ajax_add_to_cart:hover::before {
    width: 300px;
    height: 300px;
}

/* View Cart Button (After Product Added) */
a.added_to_cart,
a.wc-forward.added_to_cart {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #ff4545) !important;
    color: #fff !important;
    border: none !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(255, 69, 69, 0.3);
}

a.added_to_cart:hover,
a.wc-forward.added_to_cart:hover {
    background: var(--primary-hover, #e63939) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 69, 69, 0.4);
}

a.added_to_cart i,
a.wc-forward.added_to_cart i {
    font-size: 18px;
    color: #fff !important;
    margin: 0 !important;
}

/* Product card view cart button positioning */
.product .added_to_cart,
.shop-card-items .added_to_cart,
.shop-list-sidebar .added_to_cart {
    width: 100%;
    text-align: center;
}

/* Animation for view cart button */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

a.added_to_cart {
    animation: slideInUp 0.3s ease;
}
