/**
 * 收藏功能样式
 */

/* 收藏弹窗 */
.favorites-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.favorites-modal.active {
    opacity: 1;
    visibility: visible;
}

.favorites-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.favorites-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 1200px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.favorites-modal.active .favorites-modal-content {
    transform: scale(1);
}

/* 弹窗头部 */
.favorites-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 20px 20px 0 0;
}

.favorites-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.favorites-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
}

.favorites-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 弹窗主体 */
.favorites-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.favorites-modal-body::-webkit-scrollbar {
    width: 8px;
}

.favorites-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.favorites-modal-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.favorites-modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 空收藏夹 */
.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #9ca3af;
    text-align: center;
}

.favorites-empty i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
    color: #ef4444;
}

.favorites-empty p {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #6b7280;
}

.favorites-empty small {
    font-size: 14px;
    color: #9ca3af;
}

/* 收藏网格 */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* 收藏项 */
.favorite-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.favorite-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #ef4444;
}

.favorite-item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f3f4f6;
}

.favorite-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.favorite-item:hover .favorite-item-image img {
    transform: scale(1.1);
}

.favorite-item-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #9ca3af;
    font-size: 48px;
}

/* 收藏项悬停遮罩 */
.favorite-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.favorite-item:hover .favorite-item-overlay {
    opacity: 1;
}

.favorite-view-btn,
.favorite-remove-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.favorite-view-btn {
    background: white;
    color: #6366f1;
}

.favorite-view-btn:hover {
    background: #6366f1;
    color: white;
    transform: scale(1.1);
}

.favorite-remove-btn {
    background: #ef4444;
    color: white;
}

.favorite-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* 收藏项信息 */
.favorite-item-info {
    padding: 16px;
}

.favorite-item-info h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.favorite-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #6b7280;
}

.favorite-item-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.favorite-item-meta .price {
    font-size: 16px;
    font-weight: 700;
    color: #ef4444;
}

.favorite-item-meta .price-free {
    font-size: 13px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

/* 弹窗底部 */
.favorites-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 20px 32px;
    background: #f9fafb;
    border-radius: 0 0 20px 20px;
}

.favorites-modal-footer .btn-outline {
    border: 2px solid #e5e7eb;
    color: #6b7280;
    padding: 12px 24px;
}

.favorites-modal-footer .btn-outline:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* 心形按钮动画 */
.fa-heart {
    transition: all 0.3s ease;
}

.fa-heart.fas {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.2);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .favorites-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .favorites-modal-header {
        padding: 20px;
    }

    .favorites-modal-header h2 {
        font-size: 20px;
    }

    .favorites-modal-body {
        padding: 20px;
    }

    .favorite-item-info h4 {
        font-size: 14px;
    }

    .favorite-view-btn,
    .favorite-remove-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* 收藏按钮状态 */
.model-overlay .btn-icon .fa-heart.fas {
    color: #ef4444 !important;
}
