/* 商品页面样式 */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
}


.products-section h1 {
    /* text-align: center; */
    margin-top: 1.5rem;
    /* margin-bottom: 2rem; */
    color: #000;
    font-size: 3.5rem;
    font-weight: 400;
}

.products-section p {
    margin-bottom: 2rem;
    color: #81838c;
}

/* 九宫格布局 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列布局 */
    gap: 2rem; /* 网格间距 */
    margin-bottom: 3rem;
}

/* 商品卡片样式 */
.product-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 360px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* 分割线 */
.product-divider {
    height: 1px;
    background-color: #eee;
    margin: 20px auto;
    width: 80%;
}

.product-card h3 {
    padding: 0 1rem 0.5rem;
    margin: 0;
    color: #000;
    font-size: 0.9rem;
    font-weight: 400;
    /*限制只显示 2 行，超过的部分显示...*/
    overflow: hidden;
    display: -webkit-box;          /* 使用弹性盒子布局 */
    -webkit-line-clamp: 2;         /* 限制显示 2 行 */
    line-clamp: 2;                 /* 标准属性，提供更好的兼容性 */
    -webkit-box-orient: vertical;  /* 垂直方向排列 */
    text-overflow: ellipsis;      /* 超出部分显示省略号 */
    text-align: left;
    line-height: 1.5;            /* 可选：调整行高，使两行更美观 */
    max-height: 3rem;             /* 可选：计算两行的高度，防止溢出 */
}

.product-price  {
    text-align: left;
    /* padding: 0 1rem; */
    margin: 0;
    /* color: #e74c3c; */
    font-weight: 700;
    font-size: 1.5rem  !important;
}

.product-card p {
    padding: 0.5rem 1rem 1rem;
    margin: 0;
    color: #000;
    font-size: 0.9rem;
    flex-grow: 1; /* 让描述区域占据剩余空间 */
}

.product-btn {
    background-color: #416FF4;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    margin: 0 auto 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    width: 60%;
    display: block;
}

.product-btn:hover {
    background-color: #002fa7;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 平板设备显示2列 */
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr; /* 手机设备显示1列 */
        gap: 1.5rem;
    }

    .products-section {
        padding: 1.5rem 1rem;
    }

    .product-image {
        height: 180px;
    }
}
