/* WooCommerce n8n Recommendations Styles */

.wcn8n-recommendations {
    margin: 20px 0;
    clear: both;
}

.wcn8n-recommendations-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.wcn8n-recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
}

/* Grid Layout */
.wcn8n-layout-grid .wcn8n-recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* List Layout */
.wcn8n-layout-list .wcn8n-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wcn8n-layout-list .wcn8n-recommendation-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.wcn8n-layout-list .wcn8n-recommendation-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wcn8n-layout-list .wcn8n-recommendation-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.wcn8n-layout-list .wcn8n-recommendation-content {
    flex: 1;
}

/* Carousel Layout */
.wcn8n-layout-carousel .wcn8n-recommendations-list {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.wcn8n-layout-carousel .wcn8n-recommendation-item {
    flex: 0 0 200px;
    min-width: 200px;
}

/* Recommendation Item */
.wcn8n-recommendation-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.wcn8n-recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: #007cba;
}

.wcn8n-recommendation-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.wcn8n-recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wcn8n-recommendation-item:hover .wcn8n-recommendation-image img {
    transform: scale(1.05);
}

.wcn8n-placeholder-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: #999;
}

.wcn8n-recommendation-content {
    padding: 15px;
}

.wcn8n-recommendation-title {
    margin: 0 0 8px 0;
    font-size: 1em;
    line-height: 1.4;
}

.wcn8n-recommendation-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.wcn8n-recommendation-title a:hover {
    color: #007cba;
}

.wcn8n-recommendation-excerpt {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
    margin-bottom: 8px;
}

.wcn8n-recommendation-rating {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wcn8n-rating-count {
    font-size: 0.85em;
    color: #666;
}

.wcn8n-recommendation-price {
    font-size: 1.1em;
    font-weight: 600;
    color: #007cba;
    margin-bottom: 10px;
}

.wcn8n-recommendation-actions {
    margin-top: 10px;
}

.wcn8n-view-product {
    display: inline-block;
    padding: 8px 16px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.wcn8n-view-product:hover {
    background: #005a87;
    color: #fff;
}

/* Auto-display specific styles */
.wcn8n-auto-recommendations {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.wcn8n-auto-recommendations .wcn8n-recommendations-title {
    margin-bottom: 20px;
    text-align: center;
}

/* Single product page */
.wcn8n-single-product {
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

/* Shop page */
.wcn8n-shop {
    margin: 40px 0;
}

/* Cart page */
.wcn8n-cart {
    margin-top: 20px;
}

/* Thank you page */
.wcn8n-thankyou {
    margin: 30px 0;
    text-align: center;
}

/* Loading state */
.wcn8n-recommendations-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.wcn8n-recommendations-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: wcn8n-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes wcn8n-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.wcn8n-recommendations-error {
    text-align: center;
    padding: 20px;
    color: #d63638;
    background: #fcf0f1;
    border: 1px solid #f0b7b8;
    border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .wcn8n-layout-grid .wcn8n-recommendations-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .wcn8n-layout-list .wcn8n-recommendation-item {
        flex-direction: column;
        text-align: center;
    }
    
    .wcn8n-layout-list .wcn8n-recommendation-image {
        width: 100%;
        height: 150px;
    }
    
    .wcn8n-layout-carousel .wcn8n-recommendation-item {
        flex: 0 0 150px;
        min-width: 150px;
    }
    
    .wcn8n-auto-recommendations {
        padding: 15px;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .wcn8n-layout-grid .wcn8n-recommendations-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .wcn8n-recommendation-content {
        padding: 10px;
    }
    
    .wcn8n-recommendation-title {
        font-size: 0.9em;
    }
    
    .wcn8n-recommendation-price {
        font-size: 1em;
    }
}

/* WooCommerce integration */
.woocommerce .wcn8n-recommendations {
    margin: 2em 0;
}

.woocommerce .wcn8n-recommendations-title {
    font-size: 1.3em;
    margin-bottom: 1em;
}

/* Theme compatibility */
.theme-twenty-twenty-one .wcn8n-recommendations,
.theme-twenty-twenty-two .wcn8n-recommendations,
.theme-twenty-twenty-three .wcn8n-recommendations {
    margin: 2rem 0;
}

.theme-twenty-twenty-one .wcn8n-recommendations-title,
.theme-twenty-twenty-two .wcn8n-recommendations-title,
.theme-twenty-twenty-three .wcn8n-recommendations-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
