/**
 * Wishlist Toggle Styles
 * Uses existing YITH styling - only adds loading state and messages
 *
 * @package Risager
 * @version 1.0.0
 */

/* Loading state */
.adt-wishlist-toggle.processing {
    opacity: 0.5;
    cursor: wait;
    pointer-events: none;
}

.adt-wishlist-toggle.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e74c3c;
    border-top-color: transparent;
    border-radius: 50%;
    animation: adtWishlistSpin 0.6s linear infinite;
}

@keyframes adtWishlistSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transition when swapping heart images */
.adt-wishlist-icon {
    transition: opacity 0.2s ease;
}

.adt-wishlist-toggle.in-wishlist .adt-wishlist-icon {
    animation: adtHeartBounce 0.4s ease;
}

@keyframes adtHeartBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Temporary message tooltip */
.adt-wishlist-message {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 8px;
    pointer-events: none;
    z-index: 1000;
    animation: adtWishlistMessageSlide 0.3s ease;
}

.adt-wishlist-message::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.adt-wishlist-message.error {
    background: #e74c3c;
}

.adt-wishlist-message.error::after {
    border-top-color: #e74c3c;
}

.adt-wishlist-message.success {
    background: #27ae60;
}

.adt-wishlist-message.success::after {
    border-top-color: #27ae60;
}

@keyframes adtWishlistMessageSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .adt-wishlist-toggle {
        padding: 6px;
    }

    .adt-wishlist-icon {
        width: 20px;
        height: 20px;
    }

    .adt-wishlist-message {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* Focus styles for accessibility */
.adt-wishlist-toggle:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

.adt-wishlist-toggle:focus:not(:focus-visible) {
    outline: none;
}
