.bricks-custom-category-tree{
    width: 100%;
}
.bricks-custom-category-tree .cat-filter-list {
    margin: 0;
    padding-left: 20px;
    list-style: none !important;
}

.bricks-custom-category-tree > .cat-filter-list {
    padding-left: 0;
    width: 100%;
}

.bricks-custom-category-tree .cat-filter-item {
    margin: 8px 0;
    list-style: none !important;
}

.bricks-custom-category-tree summary {
    list-style: none !important;
}
.bricks-custom-category-tree summary::-webkit-details-marker {
    display: none !important;
}

/* Khung bọc của danh mục có con */
.bricks-custom-category-tree .cat-summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Khung bọc của danh mục không có con */
.bricks-custom-category-tree .cat-leaf-item {
    display: flex;
    align-items: center;
    padding-left: 18px; /* Đẩy lề bằng độ rộng của icon đóng mở danh mục cha */
}

/* Thiết kế link danh mục */
.bricks-custom-category-tree .term-link {
    text-decoration: none;
    color: var(--color-neutral-darkest,#333);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
    padding: 2px 4px;
}

.bricks-custom-category-tree .term-link:hover {
    color: var(--color-cerulean-blue);
}

/* Nổi bật danh mục hiện tại đang được chọn xem */
.bricks-custom-category-tree .term-link.is-active {
    color: var(--color-cerulean-blue);
}

/* ---------------------------------------------------- */
/* TẠO ICON ĐÓNG MỞ (DẠNG MŨI TÊN XOAY)                 */
/* ---------------------------------------------------- */
.bricks-custom-category-tree .toggle-icon {
    width: 18px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bricks-custom-category-tree .toggle-icon::before {
    content: "";
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 7px;
    border-color: transparent transparent transparent var(--color-neutral-darkest,#333);
    transition: transform 0.2s ease;
}

/* Khi danh mục mở [open], xoay dọc mũi tên đi xuống */
.bricks-custom-category-tree .cat-details[open] > .cat-summary .toggle-icon::before {
    transform: rotate(90deg);
    border-color: transparent transparent transparent  var(--color-cerulean-blue, blue);

}

/* Định dạng text hiển thị số lượng count */
.bricks-custom-category-tree .count {
    font-size: 12px;
    opacity: 0.5;
    font-weight: normal !important;
}


/* ==========================================================================
   MEGA MENU STYLE ACCORDION
   ========================================================================== */

/* Bố cục khung ngoài cùng của Mega Menu */
.bricks-custom-category-tree.style-mega_menu {
    width: 100%;
    font-family: inherit;
}

/* Reset khoảng cách cho các danh sách con trong Mega Menu */
.bricks-custom-category-tree.style-mega_menu .cat-filter-list {
    margin: 0;
    padding-left: 0;
    list-style: none !important;
    width: 100%;
}

/* Từng hàng item */
.bricks-custom-category-tree.style-mega_menu .cat-filter-item {
    margin: 0;
    border-bottom: 1px solid #f0f0f0; /* Đường gạch ngang phân cách nếu cần */
}

.bricks-custom-category-tree.style-mega_menu .cat-filter-item:last-child {
    border-bottom: none;
}

/* Khung bọc danh mục có con (Cấu trúc Flexbox đẩy icon sang phải) */
.bricks-custom-category-tree.style-mega_menu .cat-summary {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Đẩy tên sang trái, icon mũi tên sang phải */
    padding: 12px 0 12px 12px;
    cursor: pointer;
    user-select: none;
}

/* Khung bọc danh mục không có con (lá) */
.bricks-custom-category-tree.style-mega_menu .cat-leaf-item {
    display: flex;
    align-items: center;
    padding: 12px 0 12px 12px;
}

/* Tùy chỉnh link danh mục */
.bricks-custom-category-tree.style-mega_menu .term-link {
    text-decoration: none;
    color: #111111;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.2s ease;
    padding: 0;
    flex-grow: 1;
    line-height: 1.5;
}

.bricks-custom-category-tree.style-mega_menu .term-link:hover,
.bricks-custom-category-tree.style-mega_menu .term-link.is-active {
    color: var(--color-cerulean-blue, #0056b3);
}

/* Style cho danh mục cấp 1 (Heading chính như 'Products') */
.bricks-custom-category-tree.style-mega_menu > .cat-filter-list > .cat-filter-item > .cat-details > .cat-summary .term-link,
.bricks-custom-category-tree.style-mega_menu > .cat-filter-list > .cat-filter-item > .cat-leaf-item .term-link {
    font-size: 16px;
    font-weight: 500;
}

/* Đẩy thụt lùi vào trong đối với các danh mục con (Cấp 2, Cấp 3...) */
.bricks-custom-category-tree.style-mega_menu .cat-details > .cat-filter-list {
    padding-left: 16px;
}

/* ---------------------------------------------------- */
/* ICON MŨI TÊN CHEVRON (ĐẨY SANG PHẢI VÀ DẠNG MỎNG >) */
/* ---------------------------------------------------- */
.bricks-custom-category-tree.style-mega_menu .toggle-icon {
    order: 2;
    width: 50%;
    padding-right:4px;
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

/* Xóa hình tam giác cũ và tạo Chevron '>' bằng Border */
.bricks-custom-category-tree.style-mega_menu .toggle-icon::before {
    content: "";
    width: 10px;
    height: 10px;
    border-style: solid;
    border-color: #333333;
    border-width: 3px 3px 0 0; /* Tạo nét góc vuông */
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Mũi tên chỉ xuống ( v ) cho Cấp 1 (Title chính) khi đóng */
.bricks-custom-category-tree.style-mega_menu > .cat-filter-list > .cat-filter-item > .cat-details > .cat-summary .toggle-icon::before {
    transform: rotate(135deg); /* Mũi tên quay xuống dưới */
    border-color: var(--color-cerulean-blue, #0056b3);
}

.bricks-custom-category-tree.style-mega_menu .cat-details .cat-details > .cat-summary .toggle-icon::before {
    transform: rotate(135deg); /* Mũi tên quay lên trên */
    border-color: #333333;
}

