/**
 * Collapsible Product Categories Widget - Styles
 *
 * @package Collapsible_Product_Categories
 */

.custom-product-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.custom-product-categories li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-product-categories > li {
    border-bottom: 1px solid #f0f0f0;
}

.custom-product-categories > li:last-child {
    border-bottom: none;
}

.custom-product-categories a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.custom-product-categories .has-children > a {
    padding-left: 35px;
}

/* Category name (clickable, no link) */
.custom-product-categories .category-name {
    display: block;
    padding: 12px 40px 12px 15px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.custom-product-categories .category-name:hover {
    background-color: #f8f8f8;
    color: #0073aa;
}

.custom-product-categories a:hover {
    background-color: #f8f8f8;
    color: #0073aa;
}

/* Current category styling */
.custom-product-categories .current-cat > a,
.custom-product-categories .current-cat-parent > a {
    background-color: #0073aa;
    color: #fff;
    font-weight: 600;
}

.custom-product-categories .current-cat > a:hover,
.custom-product-categories .current-cat-parent > a:hover {
    background-color: #005a87;
}

/* Count badge */
.custom-product-categories .count {
    display: inline-block;
    background-color: #e8e8e8;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
    position: absolute;
    right: 0;
    top: 25px;
    transform: translateY(-50%);
}

.custom-product-categories .current-cat .count,
.custom-product-categories .current-cat-parent .count {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Toggle button */
.custom-product-categories .category-toggle {
    position: absolute;
    right: 8px;
    top: 25px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
    border-radius: 4px;
    background-color: transparent;
}


.custom-product-categories .current-cat .category-toggle:hover,
.custom-product-categories .current-cat-parent .category-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.custom-product-categories .category-toggle svg {
    transition: transform 0.3s ease;
    color: #666;
}

.custom-product-categories .current-cat .category-toggle svg,
.custom-product-categories .current-cat-parent .category-toggle svg {
    color: #fff;
}

.custom-product-categories .expanded > .category-toggle svg {
    transform: rotate(180deg);
}

/* Subcategories (children) */
.custom-product-categories .children {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    border-top: 1px solid #f0f0f0;
    display: none;
}

.custom-product-categories .children li {
    border-bottom: 1px solid #f0f0f0;
}

.custom-product-categories .children li:last-child {
    border-bottom: none;
}

.custom-product-categories .children a {
    padding-left: 25px;
    font-size: 13px;
}

.custom-product-categories .children .has-children > a {
    padding-left: 65px;
}



/* Third level categories */
.custom-product-categories .children .children {
    background-color: #f5f5f5;
}

.custom-product-categories .children .children a {
    padding-left: 65px;
    font-size: 12px;
}

.custom-product-categories .children .children .has-children > a {
    padding-left: 85px;
}





/* All category item styling */
.custom-product-categories .cat-item-all {
    background-color: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.custom-product-categories .cat-item-all a {
    font-weight: 600;
    color: #0073aa;
    padding-left: 25px;
}

.custom-product-categories .cat-item-all a:hover {
    background-color: #e8f4f8;
    color: #005a87;
}

/* Adjust toggle position for nested items */
.custom-product-categories .children .category-toggle {
    right: 28px;
}

.custom-product-categories .children .children .category-toggle {
    right: 48px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-product-categories a {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    
    .custom-product-categories .children a {
        padding-left: 32px;
    }
    
    .custom-product-categories .children .children a {
        padding-left: 55px;
    }
}

/* Smooth animations */
.custom-product-categories li {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Widget title styling */
.widget_cpc_product_categories .widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    color: #333;
}
