/* Resized & square product thumbnails */
.woocommerce img.attachment-woocommerce_thumbnail,
.woocommerce-LoopProduct-link img,
ul.products li.product img,
.product img {
width: 140px !important;
height: 140px !important;
max-width: 140px !important;
max-height: 140px !important;
object-fit: contain !important;
object-position: center !important;
margin: 0 auto !important;
display: block !important;
}
/* Image container centering */
.woocommerce-LoopProduct-link,
ul.products li.product .woocommerce-loop-product__thumbnail,
ul.products li.product a {
display: flex !important;
justify-content: center !important;
align-items: center !important;
width: 100% !important;
}
/* Base active button styles with rounded corners */
html body .elementor-button.solace-extra-button:not([aria-label^="Read more"]):not(.out-of-stock),
html body a.add_to_cart_button:not([aria-label^="Read more"]):not(.out-of-stock),
html body .product .button:not([aria-label^="Read more"]):not(.out-of-stock) {
border-radius: 20px !important;
transition: all 0.3s ease-in-out !important;
display: inline-block !important;
}
/* Active buttons hover state: background color change & zoom effect */
html body .elementor-button.solace-extra-button:not([aria-label^="Read more"]):not(.out-of-stock):hover,
html body a.add_to_cart_button:not([aria-label^="Read more"]):not(.out-of-stock):hover,
html body .product .button:not([aria-label^="Read more"]):not(.out-of-stock):hover {
background-color: #fcb06a !important;
background: #fcb06a !important;
color: #56096f !important;
border-color: #fcb06a !important;
transform: scale(1.08) !important;
}
/* Inner text color on hover */
html body .elementor-button.solace-extra-button:not([aria-label^="Read more"]):not(.out-of-stock):hover *,
html body a.add_to_cart_button:not([aria-label^="Read more"]):not(.out-of-stock):hover * {
color: #56096f !important;
}
/* Base Out of Stock button styling */
html body a[aria-label^="Read more"],
html body .elementor-button.solace-extra-button.out-of-stock,
html body a.add_to_cart_button.out-of-stock {
display: inline-block !important;
background-color: #ffffff !important;
background: #ffffff !important;
color: #56096f !important;
border: 2px solid #56096f !important;
border-radius: 20px !important;
cursor: pointer !important;
pointer-events: auto !important;
transition: transform 0.3s ease-in-out !important;
}
/* Inner text color for Out of Stock button */
html body a[aria-label^="Read more"] *,
html body .elementor-button.solace-extra-button.out-of-stock *,
html body a.add_to_cart_button.out-of-stock * {
color: #56096f !important;
}
/* Hover state: retains white background & purple border while zooming */
html body a[aria-label^="Read more"]:hover,
html body .elementor-button.solace-extra-button.out-of-stock:hover,
html body a.add_to_cart_button.out-of-stock:hover {
background-color: #ffffff !important;
background: #ffffff !important;
color: #56096f !important;
border-color: #56096f !important;
transform: scale(1.08) !important;
cursor: pointer !important;
}
/* Hide the 'View basket' text injected after adding to cart */
html body .added_to_cart,
html body a.added_to_cart,
html body a.added_to_cart.wc-forward {
display: none !important;
}
document.addEventListener('DOMContentLoaded', function() {
// 1. Disable click action on 'Out of Stock' buttons
document.body.addEventListener('click', function(e) {
var outOfStockBtn = e.target.closest('a[aria-label^="Read more"]');
if (outOfStockBtn) {
e.preventDefault();
e.stopPropagation();
return;
}
// 2. Clear '.added' class before second click so it repeats AJAX add-to-cart instead of navigating
var addToCartBtn = e.target.closest('.add_to_cart_button, .solace-extra-button');
if (addToCartBtn && addToCartBtn.classList.contains('added')) {
addToCartBtn.classList.remove('added');
}
}, true);
// 3. Automatically remove WooCommerce '.added' state class after AJAX request finishes
if (typeof jQuery !== 'undefined') {
jQuery(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) {
if ($button && $button.length) {
setTimeout(function() {
$button.removeClass('added');
}, 300);
}
});
}
});