/* ⚡ RELATED PRODUCTS CSS - Dynamic Grid Layout */

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.related-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.related-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.related-product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 20px;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.product-name a:hover {
    color: #ec2d2d;
}

.product-price {
    margin-bottom: 10px;
}

.sale-price {
    color: #ec2d2d;
    font-weight: bold;
    font-size: 16px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
    margin-left: 8px;
}

.contact-price {
    color: #ec2d2d;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}

.stock.in-stock {
    background: #e8f5e8;
    color: #28a745;
}

.stock.out-of-stock {
    background: #ffeaea;
    color: #dc3545;
}

.stock.low-stock {
    background: #fff3cd;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 13px;
        height: 18px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    
    .sale-price {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-name {
        font-size: 12px;
        height: 16px;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    
    .sale-price {
        font-size: 13px;
    }
}

/* Loading State */
.related-products-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.related-products-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ec2d2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.related-products-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}