/* AI个性化推荐系统样式 */

/* 推荐容器 */
.recommendation-container {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recommendation-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.recommendation-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    border-radius: 2px;
}

/* 推荐商品网格 */
.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* 推荐商品卡片 */
.recommendation-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.recommendation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 推荐徽章 */
.recommendation-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 商品图片 */
.recommendation-item .product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.recommendation-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recommendation-item:hover .product-image img {
    transform: scale(1.05);
}

/* 商品信息 */
.recommendation-item .product-info {
    padding: 15px;
}

.recommendation-item .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommendation-item .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 8px;
}

/* 推荐原因 */
.recommendation-reason {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
}

/* 商品操作按钮 */
.recommendation-item .product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.recommendation-item .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.recommendation-item .btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    border: none;
    color: white;
}

.recommendation-item .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.recommendation-item .btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px;
    flex: 0 0 auto;
}

.recommendation-item .btn-outline:hover {
    background: #f8f9fa;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* 查看更多按钮 */
.recommendation-more {
    text-align: center;
    margin-top: 20px;
}

.recommendation-more .btn {
    padding: 12px 30px;
    font-size: 14px;
    border-radius: 25px;
}

/* 相似商品推荐 */
.similar-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.similar-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.similar-item:hover {
    transform: translateY(-2px);
}

.similar-item .product-image {
    height: 150px;
    overflow: hidden;
}

.similar-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-item .product-info {
    padding: 10px;
}

.similar-item .product-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.similar-item .product-price {
    font-size: 12px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .recommendation-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .recommendation-item .product-image {
        height: 160px;
    }
    
    .recommendation-item .product-name {
        font-size: 14px;
    }
    
    .recommendation-item .product-price {
        font-size: 16px;
    }
    
    .similar-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .recommendation-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .recommendation-container {
        margin: 20px 0;
        padding: 15px;
    }
    
    .recommendation-title {
        font-size: 20px;
    }
}

/* 加载状态 */
.recommendation-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.recommendation-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.recommendation-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

.recommendation-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

/* 推荐效果统计 */
.recommendation-stats {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.recommendation-stats.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
