/*
 Theme Name:   Junotoys Child Theme
 Theme URI:    http://junotoys.themerex.net
 Description:  Junotoys Child Theme
 Author:       ThemeREX
 Author URI:   https://themerex.net/
 Template:     junotoys
 Version:      1.0
 Tags:         flexible-header, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, full-width-template, microformats, post-formats, theme-options, threaded-comments, translation-ready
 Text Domain:  junotoys
*/


/* =Theme customization starts here
------------------------------------------------------------ */


/* Animation for the Add to Cart button */
.single_add_to_cart_button.is-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    transition: all 0.3s ease;
}

.single_add_to_cart_button.is-loading::after {
    content: "";
    position: absolute;
    right: 15px;
    top: calc(50% - 7px);
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: apollo-spin 0.6s linear infinite;
}

@keyframes apollo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure the flying image has a smooth transition */
img.clone-fly {
    transition: transform 1s ease-in-out, opacity 1s ease-in-out;
    pointer-events: none;
    /* Make sure it doesn't block clicks */
}

/* Optional: Add a little "pop" effect to the cart icon when item arrives */
@keyframes cartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.cart-icon-pop {
    animation: cartPop 0.3s ease-in-out;
}

/* When the button is waiting for the animation to finish */
.single_add_to_cart_button.animation-complete {
    pointer-events: none;
    opacity: 0.5;
}

/* Optional: add a blur to the product image while it flies */
.woocommerce-product-gallery__image img {
    transition: filter 0.3s ease;
}
.single_add_to_cart_button:active ~ .woocommerce-product-gallery__image img {
    filter: blur(2px);
}


/* Apply the pop to the WPC Cart link */
.woofc-cart-link.cart-icon-pop {
    display: inline-block; /* Required for transform scale to work */
    animation: cartPop 0.3s ease-in-out;
}