/**
 * Product Archive Wishlist Button Styles
 */

/* Position the product images container relatively for absolute positioning */
.product-images {
    position: relative;
}

/* Wishlist button positioning */
.product-wishlist-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show wishlist button on hover or when active */
.product-card:hover .product-wishlist-button,
.product-wishlist-button.yith-wcwl-wishlistexistsbrowse,
.product-wishlist-button.yith-wcwl-wishlistaddedbrowse {
    opacity: 1;
}

/* Style the YITH wishlist container */
.product-wishlist-button .yith-wcwl-add-to-wishlist {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.product-wishlist-button .yith-wcwl-add-to-wishlist:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Style the wishlist link/button */
.product-wishlist-button .add_to_wishlist,
.product-wishlist-button .yith-wcwl-wishlistexistsbrowse a,
.product-wishlist-button .yith-wcwl-wishlistaddedbrowse a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    text-decoration: none !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

/* Heart icon styling */
.product-wishlist-button .fa-heart-o,
.product-wishlist-button .fa-heart {
    font-size: 16px !important;
    color: #666 !important;
    transition: color 0.3s ease;
}

.product-wishlist-button .add_to_wishlist:hover .fa-heart-o,
.product-wishlist-button .yith-wcwl-wishlistexistsbrowse a:hover .fa-heart,
.product-wishlist-button .yith-wcwl-wishlistaddedbrowse a:hover .fa-heart {
    color: #e74c3c !important;
}

/* When product is in wishlist - filled heart */
.product-wishlist-button .yith-wcwl-wishlistexistsbrowse .fa-heart,
.product-wishlist-button .yith-wcwl-wishlistaddedbrowse .fa-heart {
    color: #e74c3c !important;
}

/* Hide text labels - we only want the icon */
.product-wishlist-button .add_to_wishlist span:not(.fa):not([class*="fa-"]),
.product-wishlist-button .yith-wcwl-wishlistexistsbrowse a span:not(.fa):not([class*="fa-"]),
.product-wishlist-button .yith-wcwl-wishlistaddedbrowse a span:not(.fa):not([class*="fa-"]) {
    display: none !important;
}

/* Prevent wishlist button from interfering with product link */
.product-wishlist-button a {
    position: relative;
    z-index: 11;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .product-wishlist-button {
        top: 8px;
        right: 8px;
        opacity: 1; /* Always show on mobile */
    }
    
    .product-wishlist-button .yith-wcwl-add-to-wishlist {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .product-wishlist-button .fa-heart-o,
    .product-wishlist-button .fa-heart {
        font-size: 14px !important;
    }
}

/* Loading state */
.product-wishlist-button .yith-wcwl-add-to-wishlist.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success feedback */
.product-wishlist-button .yith-wcwl-add-to-wishlist.feedback {
    animation: wishlist-pulse 0.6s ease-in-out;
}

@keyframes wishlist-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* disable wishlist button if user not logged in */

.wishlist_disabled_btn a.yith-wcwl-add-to-wishlist-button {
    pointer-events: none !important;
}