.page-content {
    display: flex;
    flex-direction: column;
    /* 添加这个属性，使子元素垂直排列 */
    min-height: calc(100vh - 140px);
    margin: 0px 105px;
}

.content-section {
    display: flex;
    /* 添加这个属性，使侧边栏和主内容水平排列 */
    width: 100%;
}

/* 图片背景 */
.header {
    position: relative;
    background-image: url('../img/product-center1.jpg');
    background-size: cover;
    background-position: center;
    height: 40vh;
    min-height: 200px;
    max-height: 200px;
    display: flex;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.header .container {
    position: relative;
    z-index: 1;
    color: white;
    width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header h1 {
    font-size: 6rem;
    margin: auto;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    max-width: 1200px;
    word-break: break-word;
}

.header p {
    margin-top: 10px;
    font-size: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* 添加移动端适配 */
@media (max-width: 767px) {
    .page-content {
        margin: 0px 10px;
        /* 减小移动端边距 */
    }
}

/* 修改侧边栏基础样式 */
.sidebar {
    width: 25%;
    /* 基础宽度25% */
    min-width: 150px;
    /* 最小宽度限制，防止过窄 */
    max-width: 280px;
    /* 最大宽度限制，防止过宽 */
    padding: 15px 20px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    flex-shrink: 0;
    /* 移除margin-left: auto; 这行导致侧边栏靠右 */
}

.sidebar-container {
    padding: 15px;
    background-color: #fff;
}

/* 新增分类筛选标签样式 */
.sidebar-container label {
    font-size: 16px;
    /* 增大字体大小，原默认约14px */
    line-height: 1.8;
    /* 增加行高，提升可读性 */
}

/* 可选：增大标题字体以保持层级感 */
.sidebar-container h3 {
    font-size: 18px;
    /* 原默认约16px */
    margin-bottom: 15px;
    /* 增加标题下方间距 */
}

.main {
    flex: 1;
    /* 自动占据剩余75%宽度 */
    padding: 20px 30px;
    /* 增加右侧内边距，平衡视觉重量 */
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 8px;
    font-size: 16px;
}

.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 每行三个 */
    gap: 20px;
}

.product {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* 添加过渡效果 */
    transition: all 0.3s ease;
    /* 防止内容溢出 */
    overflow: hidden;
}

/* 添加鼠标悬停效果 */
.product:hover {
    /* 轻微放大 */
    transform: translateY(-5px) scale(1.02);
    /* 增强阴影 */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    /* 边框颜色变化 */
    border-color: #999;
}

.product img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    /* 改为contain确保完整显示 */
    object-position: center;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
    /* 添加背景色避免空白突兀 */
    padding: 10px;
    /* 增加内边距 */
}

/*
.product img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    object-position: center;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
    background-color: #f9f9f9;
}
*/
/* 鼠标悬停时图片轻微放大 */
.product:hover img {
    transform: scale(1.03);
}

.product h4 {
    margin: 10px 0 5px;
    /* 添加居中对齐和加粗样式 */
    text-align: center;
    font-weight: bold;
    /* 可选：增加字体大小以增强视觉效果 */
    font-size: 18px;
}

.pagination {
    margin-top: 20px;
    text-align: center;
    width: 100%;
    /* 确保容器宽度充满父元素 */
}

.pagination button {
    margin: 0 5px;
    padding: 6px 12px;
}

/* 父子分类样式 */
.category-group {
    margin-bottom: 15px;
}

.subcategories {
    margin-left: 20px;
    /* 子分类缩进 */
    margin-top: 5px;
    margin-bottom: 10px;
}

/* 优化复选框与文字对齐 */
.sidebar-container input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

/* 优化小屏幕产品网格布局 */
@media (max-width: 900px) {
    .page-content {
        margin: 0px;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .page-content {
        margin: 0px;
    }

    .banner {
        margin-left: 0px;
        margin-right: 0px;
        width: 100%;
    }

    .sidebar {
        padding: 0px;
    }

    .products {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 15px;
    }
}