/* WooCommerce Product Recommender - Frontend Styles (Mobile-First) */

.wcpr-recommendations {
    margin: 40px 0 0 0;
    padding: 25px 0;
    background: #f9f9f9;
    border-top: 1px solid #e5e5e5;
}

.wcpr-recommendations h2 {
    margin: 0 0 20px 0;
    padding: 0 20px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: left;
}

/* Horizontal scroll container */
.wcpr-products {
    display: flex;
    gap: 15px;
    padding: 0 20px 10px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.wcpr-products::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Individual product card */
.wcpr-product {
    flex: 0 0 160px;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.wcpr-product:active {
    transform: scale(0.98);
}

.wcpr-product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wcpr-product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
}

.wcpr-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcpr-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #e74c3c;
    color: #fff;
    z-index: 1;
}

.wcpr-product h4 {
    margin: 0;
    padding: 12px 12px 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 34px;
}

.wcpr-price {
    padding: 0 12px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
}

.wcpr-price del {
    opacity: 0.6;
    font-weight: 400;
    font-size: 13px;
    margin-right: 4px;
}

.wcpr-price ins {
    text-decoration: none;
    color: #e74c3c;
}

.wcpr-add-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-top: 1px solid #e5e5e5;
    background: #fff;
    color: #4a7c59;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
}

.wcpr-add-btn:hover,
.wcpr-add-btn:active {
    background: #4a7c59;
    color: #fff;
}

/* Scroll indicator dots (optional) */
.wcpr-scroll-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 15px 0 0 0;
}

.wcpr-scroll-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
}

.wcpr-scroll-indicator span.active {
    background: #4a7c59;
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .wcpr-recommendations h2 {
        font-size: 24px;
        text-align: center;
        padding: 0 30px;
    }
    
    .wcpr-products {
        padding: 0 30px 10px 30px;
        gap: 20px;
    }
    
    .wcpr-product {
        flex: 0 0 200px;
    }
    
    .wcpr-product h4 {
        font-size: 14px;
        padding: 15px 15px 8px;
    }
    
    .wcpr-price {
        padding: 0 15px 15px;
        font-size: 16px;
    }
    
    .wcpr-add-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .wcpr-recommendations {
        padding: 30px 0;
    }
    
    .wcpr-products {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 0 30px;
        overflow-x: visible;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .wcpr-product {
        flex: none;
    }
    
    .wcpr-product:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
    
    .wcpr-product:active {
        transform: translateY(-2px);
    }
    
    .wcpr-scroll-indicator {
        display: none;
    }
}

/* Large desktop (1400px+) */
@media (min-width: 1400px) {
    .wcpr-product {
        flex: 0 0 220px;
    }
}
