/* Affiliate Products CSS */

/* Product Card Styles */
.product-card {
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.product-card .product-image {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background: #f8f9fa;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card .product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-card .badge-featured {
    background: #ffc107;
    color: #000;
}

.product-card .badge-sale {
    background: #dc3545;
    color: #fff;
}

.product-card .badge-new {
    background: #28a745;
    color: #fff;
}

.product-card .product-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-brand {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.product-card .product-description {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-card .product-rating {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-card .rating-stars {
    color: #ffc107;
    font-size: 14px;
}

.product-card .rating-count {
    font-size: 12px;
    color: #6c757d;
}

.product-card .product-price {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-card .current-price {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.product-card .original-price {
    font-size: 14px;
    color: #6c757d;
    text-decoration: line-through;
}

.product-card .discount-percentage {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.product-card .product-footer {
    padding: 0 15px 15px;
}

.product-card .affiliate-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
}

.product-card .affiliate-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.product-card .affiliate-btn.amazon {
    background: linear-gradient(135deg, #ff9900 0%, #ff6200 100%);
}

.product-card .affiliate-btn.amazon:hover {
    background: linear-gradient(135deg, #e68900 0%, #ff5500 100%);
}

.product-card .affiliate-btn.aliexpress {
    background: linear-gradient(135deg, #ff4747 0%, #ff6b6b 100%);
}

.product-card .affiliate-btn.aliexpress:hover {
    background: linear-gradient(135deg, #ff3333 0%, #ff5555 100%);
}

/* Product Grid Layout */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.products-grid.products-2 {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid.products-3 {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid.products-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
    .products-grid.products-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid.products-3,
    .products-grid.products-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Section Styles */
.products-section {
    margin-bottom: 40px;
    padding: 30px 0;
}

.products-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.products-section .section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.products-section .section-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-top: 5px;
}

.products-section .view-all-btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.products-section .view-all-btn:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}

/* Sidebar Product Styles */
.sidebar-product {
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: white;
    transition: all 0.3s ease;
}

.sidebar-product:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-product .product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.sidebar-product .product-body {
    padding: 15px;
}

.sidebar-product .product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.sidebar-product .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.sidebar-product .affiliate-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
}

/* News Article Product Integration */
.news-products {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.news-products .products-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.news-products .product-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-products .product-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.news-products .product-item:hover {
    background: #e9ecef;
}

.news-products .product-item .product-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-products .product-item .product-details {
    flex: 1;
}

.news-products .product-item .product-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.news-products .product-item .product-price {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.news-products .product-item .affiliate-btn {
    padding: 6px 12px;
    font-size: 12px;
    display: inline-block;
    width: auto;
}

/* Affiliate Disclosure */
.affiliate-disclosure {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #6c757d;
}

.affiliate-disclosure strong {
    color: #495057;
}

/* Loading States */
.product-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .news-products .product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .news-products .product-item .product-image {
        width: 100%;
        height: 200px;
    }
    
    .products-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Category Pills */
.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.category-pill {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-pill:hover {
    background: #007bff;
    color: white;
    text-decoration: none;
}

.category-pill.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

/* Product Comparison Table */
.product-comparison {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.product-comparison table {
    width: 100%;
    border-collapse: collapse;
}

.product-comparison th,
.product-comparison td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.product-comparison th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.product-comparison .product-name {
    font-weight: 600;
    color: #2c3e50;
}

.product-comparison .price-cell {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
}

.product-comparison .rating-cell {
    color: #ffc107;
}

.product-comparison .action-cell {
    text-align: center;
}

.product-comparison .compare-btn {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
}

.product-comparison .compare-btn:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}
