.wishlist-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    color: var(--wp--preset--color--vivid-red);
    border: 1px solid var(--wp--preset--color--vivid-red);
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
    position: absolute;
    overflow: hidden;
    top: 5px;
    right: 5px;
    z-index: 1;
}

.single-product .custom-product .wishlist-button {
    position: relative;
    top: unset;
    right: unset;
    float: right;
}

.wishlist-button svg {
    width: 16px;
    height: 16px;
    /* SVG icon color */
}

.wishlist-button:hover {
    background-color: #eaeaea;
}

.wishlist-button.wishlisted {
    color: var(--wp--preset--color--vivid-red);
    /* Change color when product is in the wishlist */
}

.wishlist-button.wishlisted svg {
    fill: var(--wp--preset--color--vivid-red);
    stroke: var(--wp--preset--color--vivid-red);
}

/* Loading spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.wishlist-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top: 2px solid var(--wp--preset--color--vivid-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}