/* 容器样式 */
.product-2 {
    width: calc(100% + 10px);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* 单个项目样式 */
.product-2 .item {
    width: calc(25% - 10px); /* 每个项目占据25%的宽度，减去左右padding */
    margin-right: 10px;
    margin-bottom:10px;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background-color: #F8f8f8;
    height: 360px; /* 固定高度，你可以根据需要调整 */
    position: relative; /* 为了绝对定位描述文本（可选） */
}

.product-2 .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease; /* 添加过渡效果 */
}

.product-2 .item:hover img {
    transform: scale(1.02); /* 当鼠标悬停时，图片放大到原来的1.05倍 */
}

.product-2 .item h4 {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    line-height: 24px;
}

.product-2 .item p {
    position: absolute;
    bottom: 50%; /* 距离容器底部的距离 */
    left: 0;
    right: 0;
    margin: 0 auto;
    text-align: center;
    width: max-content; /* 或其他适当的宽度 */
    padding: 5px 15px; /* 可选的，为了增加可读性 */
    background-color: rgba(0, 0, 0, 0.5); /* 可选的，为了增加对比度 */
    color: white; /* 可选的，文本颜色 */
    font-size:14px;
    border-radius: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-2 .item {
        flex: 1 1 calc(50% - 20px);
        height: 220px;
    }
}

