@import "../common/mixin.scss";
@import "../common/popper.scss";

@include b(tree-select-dropdown) {
	position: absolute;
	z-index: #{$--index-top + 1};
	border-radius: $--border-radius-base;
	box-sizing: border-box;
	box-shadow: $--box-shadow-convex;
	background-color: $--color-background;
	margin: 0 0 5px;

	@include b(tree-select-dropdown__wrap) {
		max-height: $--tree-select-dropdown-max-height;
	}

	@include b(tree-select-dropdown__list) {
		list-style: none;
		padding: $--tree-select-dropdown-padding;
		margin: 0;
		box-sizing: border-box;
		.tu-tree-node {
			&:focus {
				> .tu-tree-node__content:not(.is-disabled) {
					background: $--color-hover-background;
				}
			}
			.tu-tree-node__content {
				transition: background-color 0.3s;
				color: $--color-text-primary;
				.tu-tree-node__content-text {
					font-size: 14px;
				}
				&:hover:not(.is-disabled),
				&:focus:not(.is-disabled) {
					background: $--color-hover-background;
					color: $--color-text-primary;
				}
				&.is-disabled {
					cursor: not-allowed;
					> span:not(.tu-tree-node__expand-icon) {
						color: $--color-text-secondary;
					}
				}
				> .is-selected {
					color: $--color-primary;
				}
			}
		}
	}

	@include m(mini) {
		@include b(tree-select-dropdown__wrap) {
			max-height: $--tree-select-mini-dropdown-max-height;
		}
	}

	@include m(small) {
		@include b(tree-select-dropdown__wrap) {
			max-height: $--tree-select-small-dropdown-max-height;
		}
	}

	@include m(large) {
		@include b(tree-select-dropdown__wrap) {
			max-height: $--tree-select-large-dropdown-max-height;
		}
	}
}
