.input-dropdown-jstree {
    position: relative;
    touch-action: manipulation;
}

/* Mobile — tap ຕອບສະໜອງ, ບໍ່ zoom ຕອນ focus (iOS) */
@media (max-width: 767.98px) {
    .input-dropdown-jstree .jstree-dd-display,
    .input-dropdown-jstree .jstree-dd-search {
        font-size: 16px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
    }

    .input-dropdown-jstree .jstree-dd-toggle,
    .input-dropdown-jstree .input-dropdown-clear {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .input-dropdown-jstree .jstree-dd-panel {
        max-height: min(50dvh, 320px);
    }

    .input-dropdown-jstree .jstree-dd-tree {
        max-height: min(42dvh, 260px);
        -webkit-overflow-scrolling: touch;
    }
}

.input-dropdown-jstree .jstree-dd-display {
    padding-right: 3rem;
    cursor: pointer;
    background-color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
}

.input-dropdown-jstree.has-value .jstree-dd-display {
    padding-right: 5.15rem;
}

.input-dropdown-jstree.jstree-dd-has-prepend .jstree-dd-display {
    padding-right: 2rem;
}

.input-dropdown-jstree.jstree-dd-has-prepend.has-value .jstree-dd-display {
    padding-right: 2.25rem;
}

.input-dropdown-jstree .jstree-dd-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    cursor: pointer;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    line-height: 1;
    padding: 0;
    border-radius: 12px;
    touch-action: manipulation;
}

.input-dropdown-jstree.has-value .jstree-dd-toggle {
    right: 40px;
}

.input-dropdown-jstree.jstree-dd-open .jstree-dd-toggle ion-icon {
    transform: rotate(180deg);
}

.input-dropdown-jstree .jstree-dd-toggle:hover {
    color: #007bff;
}

.prod-filter-input-dropdown {
    position: relative;
    width: 100%;
}

.prod-filter-input-dropdown .input-dropdown-jstree {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.prod-filter-input-dropdown .input-dropdown-jstree .jstree-dd-display {
    border-radius: 0.25rem;
}

.input-dropdown-jstree .input-dropdown-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    cursor: pointer;
    color: #999;
    pointer-events: auto;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    touch-action: manipulation;
}

.input-dropdown-jstree.has-value .input-dropdown-clear {
    display: inline-flex;
}

.input-dropdown-jstree .input-dropdown-clear:hover {
    color: #333;
}

.input-dropdown-jstree .jstree-dd-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1060;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    padding: 0.35rem;
    touch-action: pan-y;
}

.input-dropdown-jstree .jstree-dd-search {
    margin-bottom: 0.35rem;
}

.input-dropdown-jstree .jstree-dd-tree {
    max-height: 220px;
    overflow: auto;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-anchor {
    font-size: 0.9rem;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
    white-space: normal;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    touch-action: manipulation;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-wholerow {
    height: 42px;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-ocl {
    min-width: 36px;
    min-height: 36px;
}

/* jsTree theme icons — Font Awesome folder/file (types plugin) */
.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon {
    background-image: none !important;
    background: transparent !important;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.fas,
.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.far {
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    font-style: normal;
    font-size: 0.85rem;
    line-height: 24px;
    color: #6c757d;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.fas {
    font-weight: 900;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.text-warning {
    color: #ffc107 !important;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.text-primary {
    color: #007bff !important;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-themeicon.text-muted {
    color: #adb5bd !important;
}

/* Expand/collapse — use sprite from plugins/jstree/32px.png */
.input-dropdown-jstree .jstree-dd-tree .jstree-node {
    background-image: none !important;
}

.input-dropdown-jstree .jstree-dd-tree .jstree-ocl {
    background-image: url('../../plugins/jstree/32px.png') !important;
}
