/* ===== 产品分类页 ===== */
.container {
    max-width: 1280px;
    margin: 0 auto 20px auto;
    padding: 0 32px;
}

/* 面包屑 */
.breadcrumb {
    padding: 12px 0 24px;
    font-size: 0.9rem;
    color: var(--text-light, #64748b);
}
.breadcrumb a {
    color: var(--text-light, #64748b);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: var(--primary-color, #179744);
}
.breadcrumb .sep {
    margin: 0 8px;
    color: #cbd5e1;
}
.breadcrumb .current {
    color: var(--text-dark, #1f2937);
    font-weight: 500;
}

/* 左右布局 */
.archive-wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

/* ===== 左侧分类 ===== */
.archive-sidebar {
    flex: 0 0 340px;
    background: var(--bg-white, #fff);
    border-radius: 12px;
    padding: 24px 20px;
    border: 1px solid var(--border-light, #e2e8f0);
}

/* 侧边栏头部（标题 + 汉堡按钮） */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light, #e2e8f0);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bg-dark, #1e293b);
    margin: 0;
}

/* 汉堡按钮 - 默认在大屏隐藏 */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sidebar-toggle .toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
}

.sidebar-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-dark, #1f2937);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 汉堡按钮动画 - 展开时变成 X */
.sidebar-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.sidebar-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.sidebar-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* 分类列表容器 */
.category-list-wrapper {
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.category-list .cat-item {
    margin-bottom: 2px;
}

.cat-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.cat-item-wrapper:hover {
    background: rgba(23, 151, 68, 0.05);
}
.cat-item.active > .cat-item-wrapper {
    background: rgba(23, 151, 68, 0.08);
}

.cat-link {
    flex: 1;
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--text-dark, #1f2937);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-link .count {
    font-size: 0.75rem;
    color: var(--text-light, #64748b);
    font-weight: 400;
}
.cat-item.active > .cat-item-wrapper .cat-link {
    color: var(--primary-color, #179744);
    font-weight: 500;
}

/* 角标按钮 */
.cat-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-light, #64748b);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}
.cat-toggle:hover {
    background: rgba(23, 151, 68, 0.1);
    color: var(--primary-color, #179744);
}
.cat-toggle svg {
    transition: transform 0.3s ease;
}
.cat-toggle.expanded svg {
    transform: rotate(180deg);
}

/* 二级分类 */
.sub-categories {
    list-style: none;
    margin: 2px 0 2px 16px;
    padding: 0;
    border-left: 2px solid var(--border-light, #e2e8f0);
    padding-left: 12px;
    display: none;
}
.sub-categories .cat-item {
    margin-bottom: 1px;
}
.sub-categories .cat-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--text-gray, #475569);
    transition: all 0.2s;
}
.sub-categories .cat-item a:hover {
    background: rgba(23, 151, 68, 0.05);
    color: var(--text-dark, #1f2937);
}
.sub-categories .cat-item.active a {
    background: rgba(23, 151, 68, 0.08);
    color: var(--primary-color, #179744);
    font-weight: 500;
}
.sub-categories .cat-item .count {
    font-size: 0.7rem;
    color: var(--text-light, #64748b);
    font-weight: 400;
}

/* ===== 热门产品 ===== */
.sidebar-hot-products {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-light, #e2e8f0);
}

.sidebar-hot-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-dark, #1e293b);
    margin-bottom: 14px;
}

.hot-products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hot-product-item {
    margin-bottom: 12px;
}

.hot-product-item:last-child {
    margin-bottom: 0;
}

.hot-product-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg-light, #f8fafc);
}

.hot-product-item a:hover {
    background: rgba(23, 151, 68, 0.08);
    transform: translateX(4px);
}

.hot-product-thumb {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-white, #ffffff);
}

.hot-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-product-info {
    flex: 1;
    min-width: 0;
}

.hot-product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark, #1f2937);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.hot-product-item a:hover .hot-product-name {
    color: var(--primary-color, #179744);
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .sidebar-hot-products {
        margin-top: 20px;
        padding-top: 16px;
    }
    .hot-product-thumb {
        width: 40px;
        height: 40px;
    }
    .hot-product-name {
        font-size: 0.85rem;
    }
}

/* ===== 右侧产品列表 ===== */
.archive-content {
    flex: 1;
    min-width: 0;
}

.category-description {
    padding: 16px 20px;
    background: var(--bg-light, #f8fafc);
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 0.95rem;
    color: var(--text-gray, #475569);
    line-height: 1.6;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.product-card {
    background: var(--bg-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e2e8f0);
    transition: all 0.3s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color, #179744);
}
.product-card > a {
    text-decoration: none;
    display: block;
}

.product-thumb {
    height: 200px;
    background: var(--bg-light, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card:hover .product-thumb img {
    transform: scale(1.05);
}
.product-thumb .no-image {
    color: var(--text-light, #64748b);
    font-size: 0.9rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-dark, #1e293b);
    margin: 12px 16px 6px;
    line-height: 1.4;
}
.product-excerpt {
    font-size: 0.85rem;
    color: var(--text-light, #64748b);
    margin: 0 16px 12px;
    line-height: 1.5;
}
.product-link {
    display: inline-block;
    margin: 0 16px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-color, #179744);
    text-decoration: none;
    transition: all 0.2s;
}
.product-link:hover {
    transform: translateX(4px);
}

/* 分页 */
.pagination {
    margin-top: 40px;
    text-align: center;
}
.pagination-links {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-dark, #1f2937);
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-light, #e2e8f0);
    transition: all 0.2s;
}
.pagination-links a:hover {
    background: rgba(23, 151, 68, 0.06);
    border-color: var(--primary-color, #179744);
    color: var(--primary-color, #179744);
}
.pagination-links .current {
    background: var(--primary-color, #179744);
    color: #fff;
    border-color: var(--primary-color, #179744);
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light, #64748b);
    background: var(--bg-light, #f8fafc);
    border-radius: 12px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .archive-sidebar {
        flex: 0 0 200px;
    }
}

@media (max-width: 768px) {
    .archive-wrapper {
        flex-direction: column;
        gap: 30px;
        align-items: stretch;
    }
    
    .archive-sidebar {
        flex: none;
        width: 100%;
        padding: 16px;
    }
    
    /* 移动端显示汉堡按钮 */
    .sidebar-toggle {
        display: flex;
    }
    
    /* 移动端分类列表默认折叠 */
    .category-list-wrapper {
        max-height: 0;
    }
    
    /* 展开状态 */
    .category-list-wrapper.open {
        max-height: 800px;
    }
    
    /* 分类列表样式调整 */
    .category-list {
        display: block;
        padding-top: 12px;
        border-top: 1px solid var(--border-light, #e2e8f0);
    }
    
    .category-list .cat-item {
        margin-bottom: 2px;
    }
    
    .cat-item-wrapper {
        padding: 6px 8px;
    }
    
    .cat-link {
        font-size: 0.9rem;
        padding: 2px 4px;
    }
    
    .cat-link .count {
        display: inline;
    }
    
    .sub-categories {
        margin-left: 12px;
        padding-left: 10px;
    }
    
    .category-list .has-children .cat-toggle {
        display: flex;
    }
    
    /* 产品网格移动端调整 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .product-thumb {
        height: 150px;
    }
    
    .container {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-thumb {
        height: 180px;
    }
    .breadcrumb {
        font-size: 0.8rem;
    }
}