/* 主容器 */
.product-categories-display {
    display: flex;
    width: 100%;
    margin: 0 auto;
    min-height: 400px;
    background: #fff;
}

/* 左侧分类列 */
.categories-column {
    flex: 0 0 280px;
    background: #f5f5f5;
    border-right: 1px solid #eee;
    padding: 15px 0;
}

/* 右侧内容区域 */
.right-content-area {
    flex: 1;
    display: flex;
    min-width: 0;
    padding: 15px;
    position: relative;
    overflow-y: auto;
    height: 100%;
}

/* 子分类容器 */
.subcategories-container {
    display: none;
    width: 100%;
    height: 100%;
    background: #fff;
    position: static !important;
}

.subcategories-container.has-subcategories.active {
    display: flex;
    gap: 20px;
}

.subcategories-container.no-subcategories.active {
    display: block;
}

.subcategories-container.has-subcategories .subcategories-column,
.subcategories-container.has-subcategories .products-column {
    flex: 0 0 50%;
    overflow-y: auto;
    height: 100%;
}

/* 子分类列表样式 */
.subcategories-list {
    padding: 0;
    list-style: none;
}

.subcategory-item {
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    position: relative;
}

.subcategory-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--theme-palette-color-4);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding-right: 20px;
}
.subcategory-item.active a,
.subcategory-link:hover {
    color: var(--theme-palette-color-2);
}

/* 产品容器样式 */
.products-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
}

.products-container.active,
.subcategory-item.active + .products-container {
    display: block;
}

/* 产品列表样式 */
.products-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.product-item {
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.product-item:last-child {
    margin-bottom: 10px;
}

.product-item a {
    display: block;
    color: var(--theme-palette-color-4);
    text-decoration: none;
}
.product-item:hover a {
    color: var(--theme-palette-color-2);
}

/* 无子分类时的产品布局 */
.no-subcategories .products-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 容器激活状态 */
.subcategories-container.active {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-categories-display {
        flex-direction: column;
    }
    
    .categories-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--theme-palette-color-7);
    }
    
    .right-content-area {
        flex-direction: column;
    }
    
    .subcategories-column,
    .products-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--theme-palette-color-7);
    }
    
    .products-list.two-columns,
    .products-container {
        grid-template-columns: 1fr;
    }
}

.category-item {
    padding: 12px 15px;
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.category-item:last-child {
    border-bottom: none;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--theme-palette-color-4);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
}

.category-link .arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--theme-palette-color-3);
    border-bottom: 2px solid var(--theme-palette-color-3);
    transform: rotate(-45deg);
    transition: all 0.3s ease;
    margin-left: 8px;
    position: relative;
    top: 0;
}

.category-item:hover,
.category-item.active {
    background: #fff;
}

.category-item:hover a,
.category-item.active a{
    color: var(--theme-palette-color-2);
}

.category-item:hover .arrow,
.category-item.active .arrow {
    border-color: var(--theme-palette-color-2);
}

/* 子分类激活样式 */
.subcategory-item.active {
    color: var(--theme-palette-color-2);
}

/* 产品显示区域 */
.products-container.active {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    position: static;
    height: auto;
    padding: 0;
}

.no-subcategories .products-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.subcategories-column {
    position: relative;
}

.subcategories-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
}

.category-item.active + .subcategories-container,
.subcategories-container.active {
    display: block;
}
.subcategory-products {
    display: none;
    padding: 10px 0 0 15px;
    margin-top: 10px;
    border-top: 1px dashed #eee;
}

.subcategory-item.active .subcategory-products {
    display: block;
}

.subcategory-products .product-item {
    padding: 10px 0;
    margin: 0;
    border-radius: 0;
}

.subcategory-products .product-item a {
    color: var(--theme-palette-color-4);
    font-weight: normal;
    font-size: 14px;
}

.subcategory-products .product-item a:hover {
    color: var(--theme-palette-color-2);
}

.subcategory-link {
    display: block;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.subcategory-link:hover {
    color: var(--theme-palette-color-2);
}

.products-column {
    position: relative;
}

.products-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    background: #fff;
}

.subcategory-item.active + .products-container,
.products-container.active {
    display: block;
}

.products-list.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 20px;
}

@media (max-width: 768px) {
    .product-categories-display {
        flex-direction: column;
    }
    
    .categories-column,
    .subcategories-column {
        flex: 1;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .products-list.two-columns,
    .subcategory-products {
        grid-template-columns: 1fr;
    }
    
    .subcategory-item {
        padding: 10px;
    }
    
    .subcategory-products {
        padding-left: 10px;
    }
    
    .subcategory-products .product-item {
        padding: 6px 0;
    }
}

/* VIEW ALL 按钮样式 */
.view-all-item {
    margin-top: 15px;
}

.view-all-item a {
    position: relative;
    display: inline-block;
    padding: 8px 20px 0 0;
    color: var(--theme-palette-color-1);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}
.view-all-item .view-all-btn:after {
    content: "";
    position: absolute;
    right: 0;
    top: 60%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--theme-palette-color-1);
    border-bottom: 2px solid var(--theme-palette-color-1);
    transform: translateY(-50%) rotate(-45deg);
    transition: all 0.3s ease;
}

.categories-column .view-all-item a {
    display: block;
    padding: 12px 15px;
    color: var(--theme-palette-color-4);
}
.view-all-item:hover a,
.categories-column .view-all-item:hover a {
    color: var(--theme-palette-color-2);
}
.categories-column .view-all-item .view-all-btn:after {
    right: 15px;
    top: 50%;
    border-color: var(--theme-palette-color-3);
}
.view-all-item:hover .view-all-btn:after,
.categories-column .view-all-item:hover .view-all-btn:after {
    border-color: var(--theme-palette-color-2);
}

/* 动画效果 */
.subcategory-products {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.subcategory-item.active .subcategory-products {
    max-height: 1000px;
}

.subcategory-link {
    position: relative;
    padding-right: 20px;
}

.subcategory-link:after {
    content: "";
    position: absolute;
    right: 5px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--theme-palette-color-3);
    border-bottom: 2px solid var(--theme-palette-color-3);
    transform: translateY(-50%) rotate(-45deg);
    transition: all 0.3s ease;
}

.subcategory-item.active .subcategory-link:after {
    border-color: var(--theme-palette-color-2);
}