/* ==================== AI Recommendations Section ==================== */

#aiRecommendations {
    margin: 2rem 0 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

#aiRecommendations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 200% 0%; }
}

/* Header */
.ai-rec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ai-rec-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-rec-title {
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.ai-personalized {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-size: 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Interest Tags */
.ai-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.interest-tag {
    padding: 0.25rem 0.65rem;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    font-size: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Products Scroll Container */
.ai-products-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.ai-products-scroll::-webkit-scrollbar {
    height: 6px;
}

.ai-products-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.ai-products-scroll::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

/* Product Cards */
.ai-product-card {
    flex: 0 0 220px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    animation: fadeSlideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

/* Product Image */
.ai-product-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #1e293b;
}

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

.ai-product-card:hover .ai-product-image img {
    transform: scale(1.05);
}

.ai-match-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Product Info */
.ai-product-info {
    padding: 0.85rem;
}

.ai-product-category {
    font-size: 0.7rem;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.ai-product-name {
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-product-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.ai-product-rating .stars {
    color: #fbbf24;
    font-size: 0.7rem;
}

.ai-product-rating .reviews-count {
    color: #64748b;
    font-size: 0.7rem;
}

/* AI Reason */
.ai-reason {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 0.3rem 0 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-reason i {
    color: #fbbf24;
    margin-right: 0.2rem;
}

/* Price & Cart */
.ai-product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.ai-product-price .price {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 700;
}

.ai-add-to-cart-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.ai-add-to-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Loading State */
.ai-rec-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.ai-rec-loading p {
    color: #94a3b8;
    font-size: 0.9rem;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    #aiRecommendations {
        margin: 1rem 0 2rem;
        padding: 1.25rem;
    }

    .ai-rec-title {
        font-size: 1.2rem;
    }

    .ai-product-card {
        flex: 0 0 180px;
    }

    .ai-product-image {
        height: 140px;
    }

    .ai-rec-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .ai-product-card {
        flex: 0 0 160px;
    }

    .ai-product-image {
        height: 120px;
    }

    .ai-product-info {
        padding: 0.65rem;
    }

    .ai-reason {
        display: none;
    }
}
