/* 共享板块样式 */
.content-section {
    position: relative;
    padding: 40px 0;
    background-color: #d8e5fa;
}

/* 左右背景色延伸 */
.content-section::before,
.content-section::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100vw;
    height: 100%;
    background-color: inherit;
    z-index: -1;
}

.content-section::before {
    right: 100%;
}

.content-section::after {
    left: 100%;
}

/* 内容容器 */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题样式 */
.section-header {
    margin-bottom: 40px;
    position: relative;
}

.section-title {
    font-size: 2.2rem;
    color: #000;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

/* 增强的下划线 */
.section-underline {
    height: 3px;
    background: #e0e0e0;
    position: relative;
}

.section-underline::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 70px;
    height: 100%;
    background: #555;
}

/* 分类按钮组 */
.department-filter {
    display: inline-flex;
    gap: 20px;
    position: relative;
    padding: 10px 25px;
    border-radius: 30px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 5px 0;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.filter-btn.active {
    color: #000;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section-header {
        padding-bottom: 50px;
    }

    .section-title {
        position: static;
        text-align: center;
        margin-bottom: 15px !important;
    }

    .department-wrapper {
        position: absolute;
        bottom: 15px;
        left: 0;
        right: 0;
    }

    .department-filter {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 15px;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* 添加外层容器控制居中 */
.products-container-wrapper {
    max-width: 1400px; /* 与section-container保持一致 */
    margin: 0 auto;
    padding: 0 40px; /* 左右留白 */
}

.products-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    padding: 20px 0;
}

.product-item {
    display: block; /* 确保默认显示为 block */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    margin: 0 auto; /* 确保单个商品居中 */
    max-width: 260px; /* 限制最大宽度 */
    width: 100%; /* 自动宽度 */
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-title {
    font-size: 16px;
    margin: 12px 15px;
    color: #333;
    line-height: 1.4;
}

.product-price {
    color: var(--primary);
    font-size: 18px;
    font-weight: bold;
    margin: 0 15px 15px;
    text-align: right;
}

/* 响应式优化 */
@media (max-width: 1440px) {
    .products-container-wrapper {
        padding: 0 60px; /* 大屏留白更多 */
    }
}

@media (max-width: 1200px) {
    .products-container-wrapper {
        padding: 0 40px;
    }
    .products-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-container-wrapper {
        padding: 0 20px; /* 移动端适当减少留白 */
    }
    .products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .products-container-wrapper {
        padding: 0 15px;
    }
    .products-container {
        grid-template-columns: 1fr;
    }
}
