/* Related Products */
.related-products {
    padding: 2rem 5%;
}

.related-products h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.related-products .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.related-products .product-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-products .product-card:hover {
    transform: translateY(-5px);
}

.related-products .product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-products .product-info {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-products .product-info .product-title{
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    height: 2.4em;
    line-height: 1.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    max-width: 100%;
    white-space: normal;
    text-decoration: none;
    color: deeppink;
}

.related-products .price {
    color: #007bff;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.related-products .product-actions {
    align-items: center;
    margin-top: auto;
    text-align: center;
    font-weight: 600;
}

.related-products .view-detail {
    text-decoration: none;
    font-size: 0.8rem;
}

.related-products .add-to-cart {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 0.4rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.8rem;
}

.related-products .add-to-cart:hover {
    background-color: #0056b3;
}

/* Medium devices (tablets) */
@media (min-width: 769px) and (max-width: 1024px) {
    .related-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small devices (tablets and mobile) */
@media (max-width: 768px) {
    .related-products {
        padding: 1rem 0;
    }

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

/* Extra small devices (mobile) */
@media (max-width: 480px) {
    .related-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .related-products .product-card img {
        height: 140px;
        object-fit: fill !important;
    }

    .related-products .product-info {
        padding: 0.6rem;
    }

    .related-products .product-info h3 {
        font-size: 0.8rem;
    }

    .related-products .price {
        font-size: 0.9rem;
    }
}
