/* ================================
   Product Category Sidebar
================================ */

.product-sidebar {
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 20px;
}

/* Reset list */
.product-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 每一项 */
.cat-item {
    border-bottom: 1px dashed #ddd;
}

/* -------------------------------
   一行结构：左文字 + 右按钮
-------------------------------- */
.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
}

/* 分类文字 */
.cat-link {
    flex: 1;
    font-size: 16px;
    color: #222;
    text-decoration: none;
}

.cat-link:hover {
    color: #002f9f;
}

/* ================================
   ✅ 关键修复：只高亮当前这一行
   （不影响子分类）
================================ */
.cat-item.active > .cat-row {
    background: #18a84a;
}

.cat-item.active > .cat-row .cat-link {
    color: #fff;
}

/* -------------------------------
   右侧折叠按钮
-------------------------------- */
.cat-toggle {
    width: 32px;
    height: 32px;
    margin-left: 12px;
    background: #f2f2f2;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.cat-toggle::before {
    content: "˄";
    position: absolute;
    inset: 0;
    text-align: center;
    line-height: 32px;
    font-size: 16px;
    font-weight: bold;
    color: #555;
}

.cat-toggle:hover {
    background: #18a84a;
}

.cat-toggle:hover::before {
    color: #fff;
}

/* -------------------------------
   子分类区域
-------------------------------- */
.cat-children {
    display: block;           /* 默认展开 */
    background: #fafafa;
    padding-left: 16px;
}

/* 折叠状态 */
.cat-item.closed > .cat-children {
    display: none;
}

.cat-item.closed .cat-toggle::before {
    content: "˅";
}

/* -------------------------------
   子分类字体稍小一点（层级更清楚）
-------------------------------- */
.cat-children .cat-link {
    font-size: 14px;
    font-weight: 400;
}