.related-posts {
    margin: 0 auto 50px;
    border-radius: 12px;
}

.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.related-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.view-all-link {
    font-size: 14px;
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
    margin-right: 10px;
}

.view-all-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.related-posts .related-list {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 12px; /* tránh bị che khuất */
    scroll-padding-left: 16px;
    scroll-padding-right: 16px;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #999 transparent;
    scroll-snap-type: x mandatory;
}

/* Chrome, Edge, Safari */
.related-posts .related-list::-webkit-scrollbar {
    height: 8px;
}

.related-posts .related-list::-webkit-scrollbar-track {
    background: transparent;
}

.related-posts .related-list::-webkit-scrollbar-thumb {
    background-color: #999;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.related-posts .related-list::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

/* Card nhỏ gọn hơn */
.related-posts .product-card {
    flex: 0 0 200px; /* nhỏ hơn 1 chút */
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f9fafb; /* nền dịu mắt hơn */
    transition: box-shadow 0.4s ease, transform 0.3s ease;
    scroll-snap-align: start;
    cursor: pointer;
}

.related-posts .product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transform: translateY(-5px);
}

.related-posts .product-image {
    width: 100%;
    height: 130px; /* nhỏ hơn */
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 1px solid #e3e3e3;
}

.related-posts .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-posts .product-card:hover .product-image img {
    transform: scale(1.05);
}

.related-posts .product-info {
    padding: 12px 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.related-posts .product-name {
    font-size: 15px;
    margin: 0 0 6px;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
    min-height: 42px; /* giữ chiều cao đều */
    overflow: hidden;
    text-overflow: ellipsis;
}

