/* Container for top action buttons */
.masonry-item {
    position: relative;
}

/* Action buttons styling */
.favorite-btn,
.cart-btn {
    width: 30px;
    height: 30px;
    backdrop-filter: blur(8px);
    border: none;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity:0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.masonry-item:hover .favorite-btn{
    opacity: 1;
}
.masonry-item:hover .cart-btn{
    opacity: 1;
}
/* ==========================================
   FAVORITE BUTTON STYLES
   ========================================== */

.favorite-btn {
    color: #ef4444;
}

.favorite-btn i {
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.favorite-btn:hover i {
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Favorited state - add background highlight */
.favorite-btn.favorited {
    background: #fecaca;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4);
}

.favorite-btn.favorited i {
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* ==========================================
   CART BUTTON STYLES
   ========================================== */

.cart-btn {
    color: #22c55e;
}

.cart-btn i {
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.cart-btn:hover i {
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* In cart state - add background highlight */
.cart-btn.in-cart {
    background: #bbf7d0;
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.4);
}

.cart-btn.in-cart i {
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

/* ==========================================
   LOADING STATE
   ========================================== */

.favorite-btn.loading,
.cart-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.favorite-btn.loading i,
.cart-btn.loading i {
    animation: spin 1s linear infinite;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Notification toast styling */
.action-toast {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 50;
    background: #1a2332;
    border: 1px solid #22c55e;
    border-radius: 0.75rem;
    padding: 1rem;
    max-width: 20rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease-out;
}

.action-toast.error {
    border-color: #ef4444;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}