/* === FAVORITES SYSTEM === */

/* Heart button on product cards */
.fav-heart-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: all;
}

.mega-card:hover .fav-heart-btn,
.product-card:hover .fav-heart-btn,
.fav-heart-btn.liked {
    opacity: 1;
}

.fav-heart-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.15);
}

.fav-heart-btn.liked {
    color: #ff4b6e;
    background: rgba(255,75,110,0.15);
}

.fav-heart-btn.liked:hover {
    background: rgba(255,75,110,0.3);
}

/* Badge count on header heart */
.fav-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4b6e;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(255,75,110,0.4);
}

/* Overlay */
#favorites-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#favorites-overlay.visible {
    opacity: 1;
}

/* Panel */
#favorites-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#favorites-panel.visible {
    right: 0;
}

.fav-panel-header {
    padding: 18px 20px;
    background: #111;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.fav-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fav-panel-header h3 i {
    color: #ff4b6e;
}

#fav-panel-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}

#fav-panel-close:hover {
    background: rgba(255,255,255,0.2);
}

/* List */
.fav-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Empty state */
.fav-panel-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9ca3af;
    text-align: center;
    padding: 40px 20px;
}

.fav-panel-empty p {
    font-weight: 600;
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

.fav-panel-empty span {
    font-size: 0.8rem;
}

/* Favorite item card */
.fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    transition: all 0.25s ease;
}

.fav-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.fav-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e5e7eb;
}

.fav-item-info {
    flex: 1;
    min-width: 0;
}

.fav-item-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: #111;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fav-item-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    margin-top: 2px;
}

.fav-item-price {
    font-weight: 800;
    font-size: 0.85rem;
    color: #059669;
    margin-top: 2px;
}

.fav-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.fav-item-go,
.fav-item-remove {
    background: transparent;
    border: 1px solid #e5e7eb;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.fav-item-go:hover {
    background: #111;
    color: white;
    border-color: #111;
}

.fav-item-remove:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* Mobile */
@media (max-width: 480px) {
    #favorites-panel {
        width: 100vw;
        max-width: 100vw;
    }
}
