/* Banner 复用 */
.page-banner {
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-text {
    text-align: center;
    color: #fff;
}

.banner-text h1 {
    font-size: 40px;
    margin-bottom: 10px;
}

.product-page-section {
    background-color: #fff;
    padding: 60px 0 80px;
}

/* === 核心布局：使用 Flex 实现左窄右宽 === */
.product-layout-box {
    display: flex;
    align-items: flex-start;
    /* 顶部对齐 */
    gap: 30px;
    /* 左右间距 */
    position: relative;
}

/* === 1. 左侧侧边栏 (固定宽度 + 粘性定位) === */
.sidebar-wrapper {
    width: 230px;
    /* 缩小宽度 */
    flex-shrink: 0;
    /* 防止被压缩 */
    border: 1px solid #eee;
    background: #fff;

    /* --- 核心：粘性定位 --- */
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    /* 距离顶部导航栏的高度，根据实际情况微调 */
    z-index: 10;
}

.sidebar-header {
    background-color: var(--brand-color);
    /* 绿色 */
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    border-bottom: 1px solid #eee;
    position: relative;
}

.menu-item:last-child {
    border-bottom: none;
}

/* 一级菜单容器 */
.menu-item-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.menu-item-inner:hover {
    background-color: #f9f9f9;
}

/* 一级链接 (点击跳转) */
.menu-link {
    flex-grow: 1;
    padding: 14px 10px 14px 20px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.menu-link:hover {
    color: var(--brand-color);
}

/* 右侧折叠开关 (单独点击展开，不跳转) */
.menu-toggle-icon {
    padding: 14px 10px;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    border-left: 1px solid transparent;
}

.menu-toggle-icon:hover {
    color: var(--brand-color);
}

/* 选中高亮状态 */
.menu-item.active>.menu-item-inner {
    background-color: #f0fbf5;
    /* 浅绿背景 */
    border-left: 3px solid var(--brand-color);
}

.menu-item.active .menu-link {
    color: var(--brand-color);
    font-weight: bold;
}

/* 展开时箭头旋转 */
.menu-item.expanded .menu-toggle-icon i {
    display: block;
    transform: rotate(90deg);
    transition: transform 0.3s;
    color: var(--brand-color);
}

/* 二级子菜单 */
.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fcfcfc;
    display: none;
    /* 默认隐藏 */
    border-top: 1px solid #f5f5f5;
}

.sub-menu li a {
    display: block;
    padding: 10px 20px 10px 35px;
    /* 缩进 */
    font-size: 13px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px dashed #eee;
    transition: 0.3s;
}

.sub-menu li a:hover,
.sub-menu li.current a {
    color: var(--brand-color);
    padding-left: 40px;
}

/* === 2. 右侧产品列表 (自适应宽度) === */
.product-grid-wrapper {
    flex-grow: 1;
    /* 占满剩余空间 */
    min-width: 0;
    /* 防止溢出 */
}

.prod-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* PC端一行4个 */
    gap: 20px;
}

.prod-item {
    background: #fff;
    transition: all 0.3s;
    text-align: center;
    padding: 15px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    /* 去掉卡片边框，更简洁 */
}

.prod-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
}

/* 图片容器 (不固定高度) */
.prod-img-box {
    width: 100%;
    /* 删除了 height: 180px */
    /* 如果需要最小高度防止文字跳动，可以加 min-height: 150px; */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prod-img-box img {
    width: 100%;
    height: auto;
    /* 高度自适应 */
    object-fit: contain;
    transition: transform 0.3s;
}

.prod-item:hover .prod-img-box img {
    transform: scale(1.05);
}

.prod-title {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin-top: auto;
    /* 文字沉底 */
}

.prod-item:hover .prod-title {
    color: var(--brand-color);
}

/* 分页 */
.pagination {
    justify-content: center;
    margin-top: 50px;
}

/* === 响应式适配 === */
@media (max-width: 991.98px) {
    .product-layout-box {
        flex-direction: column;
    }

    .sidebar-wrapper {
        width: 100%;
        position: static;
        /* 手机端取消粘性 */
        margin-bottom: 20px;
    }

    .prod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}