/* Wishlist Widget Styles */
.cew-wishlist-wrapper,
.cew-wishlist-count-wrapper,
.cew-wishlist-link-wrapper {
    display: inline-block;
    margin: 10px 0;
}

/* Wishlist Button Styles */
.cew-wishlist-form {
    display: inline-block;
}

.cew-wishlist-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
    background: transparent;
    color: #666;
    line-height: 1;
}

.cew-wishlist-button:hover {
    color: #333;
}

.cew-wishlist-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Style Variants */
.cew-wishlist-button.cew-style-default {
    background: transparent;
    color: #666;
}

.cew-wishlist-button.cew-style-default:hover {
    color: #333;
}

.cew-wishlist-button.cew-style-minimal {
    background: transparent;
    color: #666;
    border: none;
    padding: 0;
}

.cew-wishlist-button.cew-style-minimal:hover {
    background: transparent;
    color: #333;
}

.cew-wishlist-button.cew-style-outlined {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
}

.cew-wishlist-button.cew-style-outlined:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #ccc;
}

.cew-wishlist-button.cew-style-gradient {
    background: transparent;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 20px;
}

.cew-wishlist-button.cew-style-gradient:hover {
    background: #f5f5f5;
    color: #333;
}

/* Wishlist Count Styles */
.cew-wishlist-count-link,
.cew-wishlist-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cew-wishlist-count-link:hover,
.cew-wishlist-link:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateY(-1px);
}

.cew-wishlist-badge {
    background: var(--cew-wishlist-color, #e74c3c);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Heart Icons */
.cew-icon-heart:before {
    content: "♡";
    font-size: 16px;
    color: inherit;
}

.cew-icon-heart-filled:before {
    content: "♥";
    font-size: 16px;
    color: #e74c3c;
}

/* Wishlist Page Styles */
.cew-wishlist-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cew-wishlist-page h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #333;
}

.cew-wishlist-items {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.cew-wishlist-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cew-wishlist-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.cew-item-image {
    flex-shrink: 0;
}

.cew-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cew-item-details {
    flex: 1;
}

.cew-item-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.cew-item-title a {
    color: #333;
    text-decoration: none;
}

.cew-item-title a:hover {
    color: var(--cew-wishlist-color, #e74c3c);
}

.cew-item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--cew-wishlist-color, #e74c3c);
}

.cew-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.cew-remove-button {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cew-remove-button:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cew-empty-wishlist {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Floating wishlist icon/button (optional helper class)
 * Usage: In Elementor, add CSS class `cew-wishlist-floating` to a Wishlist widget
 * (typically the "Wishlist Item Count" type). This will pin it to the
 * bottom-right corner on both desktop and mobile.
 */
.cew-wishlist-floating {
    position: fixed;
    right: 16px;
    bottom: 16px;
    top: auto;
    left: auto;
    transform: none;
    z-index: 9999;
}

.cew-wishlist-floating .cew-wishlist-count-link,
.cew-wishlist-floating .cew-wishlist-link {
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
    .cew-wishlist-floating {
        right: 12px;
        bottom: 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cew-wishlist-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .cew-wishlist-page {
        padding: 15px;
    }
    
    .cew-wishlist-page h2 {
        font-size: 24px;
    }
    
    .cew-wishlist-items {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cew-wishlist-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .cew-item-image {
        align-self: center;
    }
    
    .cew-item-actions {
        align-self: stretch;
    }
    
    .cew-remove-button {
        width: 100%;
        text-align: center;
        display: block;
    }
}

/* WooCommerce Compatibility */
.woocommerce .cew-wishlist-wrapper,
.woocommerce-page .cew-wishlist-wrapper {
    margin: 15px 0;
}

/* Animation */
@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cew-wishlist-added {
    animation: heartbeat 0.6s ease-in-out;
}

/* AJAX Loading States */
.cew-wishlist-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.cew-wishlist-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Feedback */
.cew-wishlist-success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.cew-wishlist-error {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}
