/* ===================== CATEGORY MENU & OFFCANVAS STYLING ===================== */

/* Offcanvas Drawer */
.cat-offcanvas, .cat-offcanvas-drawer {
    width: 330px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-right: 1px solid #eaedf2;
}

.cat-offcanvas-header {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.cat-offcanvas-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

/* ===================== CATEGORY INLINE FLEX LAYOUT ===================== */
.cat-inline-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ===================== CATEGORY SEARCH BAR (FIXED AT TOP) ===================== */
.cat-search-container {
    flex-shrink: 0;
    padding: 8px 10px;
    background: #f0f5ff;
    border-bottom: 1px solid #dae3ff;
    z-index: 10;
}

.cat-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.cat-search-box:focus-within {
    background: #ffffff;
    border-color: #1250dc;
    box-shadow: 0 0 0 3px rgba(18, 80, 220, 0.15);
}

.cat-search-box i.search-icon {
    color: #1250dc;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.cat-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 500;
    color: #0f172a;
    width: 100%;
}

.cat-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.cat-search-clear-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.cat-search-clear-btn:hover {
    color: #ef4444;
}

/* ===================== CATEGORY TREE SCROLLABLE AREA ===================== */
.cat-tree-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.cat-no-results {
    text-align: center;
    padding: 20px 8px;
    color: #64748b;
    font-size: 0.82rem;
}

.cat-no-results i {
    font-size: 1.6rem;
    color: #cbd5e1;
    display: block;
    margin-bottom: 6px;
}

/* ===================== CATEGORY TREE STYLING ===================== */
.cat-tree, .cat-subtree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-node {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.cat-node:last-child {
    border-bottom: none;
}

.cat-node.search-hidden {
    display: none !important;
}

.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: 6px;
    margin: 2px 4px;
    transition: background 0.15s ease;
}

.cat-row:hover {
    background: #f8fafc;
}

.cat-row.has-active {
    background: #f1f5f9;
}

/* Tên danh mục link */
.cat-link {
    color: #334155;
    font-size: 0.835rem;
    font-weight: 500;
    text-decoration: none;
    flex-grow: 1;
    line-height: 1.35;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: block;
}

.cat-link:hover {
    color: #1250dc;
    background-color: #f1f5f9;
}

.cat-link.search-matched {
    color: #1250dc !important;
    font-weight: 700 !important;
    background-color: #eff6ff !important;
}

/* Danh mục đang được chọn (Active Selection) */
.cat-link.active-link {
    color: #0f172a !important;
    font-weight: 700 !important;
    background-color: #ede9fe !important;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* Nút Đóng / Mở danh mục */
.cat-expand-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 2px;
}

.cat-expand-btn:hover {
    background: #1250dc;
    color: #ffffff;
    border-color: #1250dc;
}

.cat-expand-btn .bi-chevron-right {
    transition: transform 0.2s ease;
}

/* Trạng thái mở rộng (is-open) */
.cat-node.is-open > .cat-row .cat-expand-btn {
    background: #eef3ff;
    color: #1250dc;
    border-color: #cbd5e1;
}

.cat-node.is-open > .cat-row .cat-expand-btn .bi-chevron-right {
    transform: rotate(90deg);
}

.cat-subtree {
    display: none;
    padding-left: 6px;
    background: #ffffff;
    border-left: 2px solid #e2e8f0;
    margin-left: 6px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.cat-node.is-open > .cat-subtree {
    display: block;
}

/* ===================== SIMPLE TREE MENU (MenuCategory) ===================== */
.cat-tree-menu, .cat-tree-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-tree-item {
    border-bottom: 1px solid #f1f5f9;
}

.cat-tree-item:last-child {
    border-bottom: none;
}

.cat-tree-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    transition: background-color 0.15s ease;
}

.cat-tree-row:hover {
    background-color: #f8fafc;
}

.cat-tree-link {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    flex-grow: 1;
    transition: color 0.15s ease;
}

.cat-tree-link:hover, .cat-tree-link.active-link {
    color: #1250dc;
    font-weight: 700;
}

.cat-tree-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.725rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cat-tree-toggle:hover {
    background-color: #1250dc;
    color: #ffffff;
    border-color: #1250dc;
}

.cat-tree-toggle .bi-chevron-right {
    transition: transform 0.2s ease;
}

.cat-tree-item.is-open > .cat-tree-row .cat-tree-toggle .bi-chevron-right {
    transform: rotate(90deg);
}

.cat-tree-submenu {
    display: none;
    padding-left: 12px;
    background-color: #f8fafc;
}

.cat-tree-submenu .cat-tree-row {
    padding: 7px 14px;
}

.cat-tree-submenu .cat-tree-link {
    font-size: 0.825rem;
    font-weight: 500;
    color: #475569;
}

.cat-tree-item.is-open > .cat-tree-submenu {
    display: block;
}

