/**
 * Estilos para el sistema de Wishlist/Lista de Deseos
 * MrCell - E-commerce
 */

/* Botón principal de wishlist */
.wishlist-btn, .btn-wishlist {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    min-width: 44px;
    min-height: 44px;
}

.wishlist-btn:hover, .btn-wishlist:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.wishlist-btn.active, .btn-wishlist.active,
.wishlist-btn.in-wishlist, .btn-wishlist.in-wishlist {
    border-color: #ff6b6b;
    background: #ff6b6b;
    color: #fff;
}

.wishlist-btn.active:hover, .btn-wishlist.active:hover,
.wishlist-btn.in-wishlist:hover, .btn-wishlist.in-wishlist:hover {
    background: #ff5252;
    border-color: #ff5252;
    transform: translateY(-1px);
}

/* Botón compacto para cards de productos */
.wishlist-btn-compact {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.wishlist-btn-compact:hover {
    background: rgba(255, 255, 255, 1);
    color: #ff6b6b;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wishlist-btn-compact.active,
.wishlist-btn-compact.in-wishlist {
    background: #ff6b6b;
    color: #fff;
    border-color: #ff6b6b;
}

.wishlist-btn-compact.active:hover,
.wishlist-btn-compact.in-wishlist:hover {
    background: #ff5252;
    border-color: #ff5252;
}

/* Botón con texto */
.wishlist-btn-text {
    gap: 8px;
    padding: 10px 16px;
}

.wishlist-btn-text .wishlist-text {
    font-size: 13px;
    font-weight: 500;
}

/* Estados de carga */
.wishlist-btn:disabled, .btn-wishlist:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.wishlist-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Contador de wishlist en header */
.wishlist-counter {
    position: relative;
    display: inline-block;
}

.wishlist-badge, .wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 18px;
    padding: 0 2px;
}

/* Animaciones */
.wishlist-btn-animate {
    animation: wishlistPulse 0.6s ease-out;
}

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

/* Estilos para diferentes tamaños */
.wishlist-btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 36px;
    min-height: 36px;
}

.wishlist-btn-lg {
    padding: 12px 20px;
    font-size: 16px;
    min-width: 52px;
    min-height: 52px;
}

/* Estilos para modo oscuro */
@media (prefers-color-scheme: dark) {
    .wishlist-btn, .btn-wishlist {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .wishlist-btn:hover, .btn-wishlist:hover {
        background: #333;
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
    
    .wishlist-btn-compact {
        background: rgba(42, 42, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ccc;
    }
    
    .wishlist-btn-compact:hover {
        background: rgba(42, 42, 42, 1);
        color: #ff6b6b;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wishlist-btn-text .wishlist-text {
        display: none;
    }
    
    .wishlist-btn-text {
        padding: 8px;
        min-width: 40px;
    }
    
    .wishlist-btn-compact {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }
}

/* Integración con cards de productos */
.product-card {
    position: relative;
}

.product-card .wishlist-btn-compact {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .wishlist-btn-compact {
    opacity: 1;
}

/* Siempre visible en móvil */
@media (max-width: 768px) {
    .product-card .wishlist-btn-compact {
        opacity: 1;
    }
}

/* Estilos para lista de wishlist */
.wishlist-item {
    position: relative;
}

.wishlist-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.wishlist-item:hover .remove-btn {
    opacity: 1;
}

.wishlist-item .remove-btn:hover {
    background: #ff6b6b;
    color: #fff;
    transform: scale(1.1);
}

/* Mensaje de wishlist vacía */
.wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.wishlist-empty .icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.wishlist-empty h3 {
    margin-bottom: 10px;
    color: #333;
}

.wishlist-empty p {
    margin-bottom: 30px;
    font-size: 16px;
}

/* Tooltip personalizado */
.wishlist-tooltip {
    position: relative;
}

.wishlist-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.wishlist-tooltip:hover::after {
    opacity: 1;
}
