/* ── Odoo Catalog Tree Widget ─────────────────────────────────────────────── */
#oct-catalog-tree {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.4;
}

/* Loading state */
#oct-catalog-tree .oct-loading {
    padding: 12px;
    color: #7f8c8d;
    text-align: center;
    font-style: italic;
}

/* ── Tree Levels ─────────────────────────────────────────────────────────── */
.oct-tree-ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Level 1 – System */
.oct-level-system > .oct-tree-ul {
    padding-left: 0;
}

/* Level 2+ indentation */
.oct-level-brand   > .oct-tree-ul { padding-left: 14px; }
.oct-level-series  > .oct-tree-ul { padding-left: 14px; }
.oct-level-device  > .oct-tree-ul { padding-left: 14px; }

/* ── Row ─────────────────────────────────────────────────────────────────── */
.oct-row {
    display: flex;
    align-items: center;
    padding: 5px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    gap: 4px;
}
.oct-row:hover {
    background: #f0f4f8;
}

/* Active / selected row */
.oct-row.oct-active {
    background: #fff3e0;
    font-weight: 600;
    color: #e67e22;
}

/* ── Toggle Arrow ────────────────────────────────────────────────────────── */
.oct-toggle {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: transform 0.2s, background 0.15s;
    color: #7f8c8d;
    font-size: 10px;
}
.oct-toggle:hover {
    background: #dde3ea;
    color: #2c3e50;
}
.oct-toggle.oct-open {
    transform: rotate(90deg);
    color: #e67e22;
}
/* Spacer when no children */
.oct-toggle-spacer {
    flex-shrink: 0;
    width: 18px;
}

/* ── Label (clickable link) ──────────────────────────────────────────────── */
.oct-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    text-decoration: none;
}
.oct-label:hover {
    color: #e67e22;
    text-decoration: underline;
}

/* ── Count Badge ─────────────────────────────────────────────────────────── */
.oct-count {
    flex-shrink: 0;
    background: #e67e22;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    line-height: 16px;
}

/* ── Level-specific styles ───────────────────────────────────────────────── */
.oct-level-system > li > .oct-row {
    font-weight: 700;
    font-size: 13px;
    padding: 7px 4px;
    border-bottom: 1px solid #eaeaea;
}
.oct-level-system > li:last-child > .oct-row {
    border-bottom: none;
}

.oct-level-brand > li > .oct-row {
    font-weight: 600;
    font-size: 12.5px;
    color: #34495e;
    padding: 4px 4px;
}

.oct-level-series > li > .oct-row {
    font-size: 12px;
    color: #555;
    padding: 3px 4px;
}

.oct-level-device > li > .oct-row {
    font-size: 11.5px;
    color: #666;
    padding: 2px 4px;
}

/* ── Collapsed children ──────────────────────────────────────────────────── */
.oct-children {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.oct-children.oct-expanded {
    max-height: 9999px;
}

/* ── Scrollable container ────────────────────────────────────────────────── */
#oct-catalog-tree {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}
#oct-catalog-tree::-webkit-scrollbar {
    width: 4px;
}
#oct-catalog-tree::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}
