/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* 产品页侧边栏分类样式优化 */
.custom-product-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-product-categories-list-item {
    border-radius: 4px;
    margin-bottom: 4px;
}

.custom-product-categories-list-item.current-cat-main {
    background-color: rgba(0, 0, 0, 0.03);
}

.custom-product-categories-list-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    gap: 8px;
}

.custom-product-categories-list-item__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.custom-product-categories-list-item__link:hover {
    color: var(--wp--preset--color--primary, #0073aa);
}

.custom-product-categories-list-item__name {
    display: inline-block;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-product-categories-list-item-count {
    font-size: 12px;
    color: #888;
    margin-right: 4px;
}

.custom-product-categories-toggle {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.custom-product-categories-toggle::before {
    content: "\25B8"; /* 右箭头 */
    font-size: 14px;
    color: #666;
    transition: transform 0.2s ease, color 0.2s ease;
}

.custom-product-categories-list-item.expanded > .custom-product-categories-list-item__header .custom-product-categories-toggle::before {
    transform: rotate(90deg);
    color: var(--wp--preset--color--primary, #0073aa);
}

.custom-product-categories-toggle:hover::before {
    color: var(--wp--preset--color--primary, #0073aa);
}

.custom-product-categories-children {
    margin: 0;
    padding-left: 14px;
    border-left: 1px solid rgba(0, 0, 0, 0.04);
}

.custom-product-categories-children.is-collapsed {
    display: none;
}

.custom-product-categories-children.is-expanded {
    display: block;
}

/* 次级分类字号略小 */
.custom-product-categories-list--depth-1 .custom-product-categories-list-item__name,
.custom-product-categories-list--depth-2 .custom-product-categories-list-item__name {
    font-size: 13px;
}

/* 当前分类强调 */
.custom-product-categories-list-item.is-active .custom-product-categories-list-item__link {
    font-weight: 600;
    color: var(--wp--preset--color--primary, #0073aa);
}

/* WooCommerce Blocks 默认“产品分类”区块 —— 更大气的布局 / 交互 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-1,
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-2,
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-3 {
    margin-top: 6px;
    padding-left: 14px;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
}

/* 层级更明显：不同深度不同缩进/竖线 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-1 {
    padding-left: 16px;
    border-left-color: rgba(0, 0, 0, 0.10);
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-2 {
    padding-left: 20px;
    border-left-color: rgba(0, 0, 0, 0.08);
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-3 {
    padding-left: 24px;
    border-left-color: rgba(0, 0, 0, 0.06);
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list-item {
    position: relative;
    margin: 6px 0;
    border-radius: 10px;
}

/* 让标题区域更易点、更舒服 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list-item > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 44px 10px 12px; /* 右侧给按钮留空间 */
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list-item > a:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--wp--preset--color--primary, #0073aa);
}

/* 子分类字体/间距逐级优化 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item > a {
    padding: 9px 44px 9px 12px;
    font-size: 14px;
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item > a {
    padding: 8px 44px 8px 12px;
    font-size: 13.5px;
    background: rgba(0, 0, 0, 0.01);
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-3 > .wc-block-product-categories-list-item > a {
    padding: 8px 44px 8px 12px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.012);
}

/* 子分类“节点”提示：左侧小圆点 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-1 > .wc-block-product-categories-list-item > a::before,
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-2 > .wc-block-product-categories-list-item > a::before,
.wp-block-woocommerce-product-categories .wc-block-product-categories-list--depth-3 > .wc-block-product-categories-list-item > a::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    display: inline-block;
    flex: 0 0 6px;
}

/* 图标更清晰一点 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 22px;
}

/* 计数靠右，视觉更整齐 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list-item-count {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #8a8a8a;
    pointer-events: none;
}

/* 右侧展开按钮：更大、更像控件 */
.wp-block-woocommerce-product-categories .wc-block-product-categories-list-item > a .wc-block-product-categories-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-toggle::before {
    content: "\25BE"; /* 向下小三角 */
    font-size: 14px;
    color: #555;
    transition: transform 0.2s ease, color 0.2s ease;
}

.wp-block-woocommerce-product-categories .wc-block-product-categories-toggle:hover {
    border-color: rgba(0, 0, 0, 0.16);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.wp-block-woocommerce-product-categories .wc-cat-expanded > .wc-block-product-categories-toggle::before {
    transform: rotate(-180deg);
    color: var(--wp--preset--color--primary, #0073aa);
}

.wp-block-woocommerce-product-categories .wc-cat-children.wc-cat-collapsed {
    display: none;
}

.wp-block-woocommerce-product-categories .wc-cat-children.wc-cat-expanded {
    display: block;
}

/* 当前分类更明显一些 */
.wp-block-woocommerce-product-categories .wc-cat-active > a {
    background: rgba(0, 115, 170, 0.08);
    color: var(--wp--preset--color--primary, #0073aa);
    font-weight: 700;
}
 
