.dropdown {
	.theme-dropdown();
	
	@theme-item-hover-bg: #f7f7f7;
	@theme-item-color: #626262;
	@theme-item-hover-color: @theme-item-color;
	
	.transition(opacity 300ms linear);
	.opacity(0);

	bottom: 0px;
	cursor: default;
	display: none;
	font-size: 9pt;
	left: -10000px;
	position: absolute;
	position: ~"static\0/";//IE8
	z-index: 3002 !important;
    width: 100%;

	.expand & {
		.opacity(1);

		display: block;
		left: 0px;
		
		html.rtl & {
			left: auto;
			right: 0px;
		}
	}

	&.dropdown_right {
		.expand {
			left: auto;
		}
		.dropdown_helper {
			right: 0;
		}
		.dropdown_arrow {
			margin: 0px 0px 0px calc(100% - 20px);
		}
	}

	.dropdown_helper {
		left: ~"0px\0/";//IE8 hack
		position: absolute;
		top: ~"2em\0/";//IE8 hack
		z-index: 3002;
	}
	
	.dropdown_content {
		background: #ffffff;
		border: 1px solid #cbc8c0;
		border-radius: 4px 4px 4px 4px;
		box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15);
		display: block;
		max-height: 350px;
		min-width: 100px;
		overflow-x: hidden;
		overflow-y: auto;

		.dropdown_container {
			max-height: 268px;
		}
		
		&.scroll-wrap {
			overflow: hidden;
		}
		
		.item {
			background: none;
			border: 0px;
			border-radius: 0px;
			box-shadow: none;
			color: @theme-item-color;
			cursor: pointer;
			display: block;
			height: auto;
			margin: 0px;
			padding: 8px 12px;
			white-space: nowrap;
			
			&:hover {
				background: @theme-item-hover-bg;
				color: @theme-item-hover-color;
			}
			
			&.disabled {
				color: #aaaaaa;
				cursor: default;
				
				&:hover {
					background: none;
				}
			}
			
			&.selected {
				color: #333;
				background: #f0f0f0;
			}
			
			//import icons
			.icon {
				color: inherit;
				display: inline-block;
				font-size: 20px;
				vertical-align: middle;
				
				.init-icon-font();
			}
		}
	}
	
	.dropdown_arrow {
		border-bottom: 6px solid #cbc8c0;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		display: block;
		font-size: 0;
		height: 0px;
		margin: 0px 0px 0px 7px;
		position: relative;
		width: 0px;
		z-index: 1;

		html.rtl & {
			margin-left: 0px;
			margin-right: 7px;
			float: left;
		}
		
		span {
			border-bottom: 5px solid #ffffff;
			border-left: 5px solid transparent;
			border-right: 5px solid transparent;
			display: block;
			height: 0px;
			margin-left: -5px;
			position: relative;
			top: 2px;
			width: 0px;
			
			html.rtl & {
				margin-left: 0px;
				margin-right: -5px;
			}
		}

		&.bottom_arrow {
			border-top: 6px solid #cbc8c0;
			border-bottom: 0;

			span {
				border-top: 5px solid #ffffff;
				border-bottom: 0;
				margin-top: -9px;
			}
		}
	}
	
	.folders {

		.item,
		.item:hover {
			background: none !important;
			color: initial !important;
			padding: 0px;

			&:first-child {
				margin-top: 5px;
			}
			
			&:last-child {
				margin-bottom: 5px;
			}
		}
		
		.folder {
			cursor: pointer;
			display: block;
			padding: 8px 12px 8px 0px;
			
			&:hover {
				background: @theme-item-hover-bg;
				color: @theme-item-hover-color;
			}

			.title {
				cursor: inherit;
				font-weight: normal;
				padding-top: 6px;
				padding-bottom: 6px;
				padding-right: 12px;
			}
			
			&.disabled,
			&.unselectable {
				background: none;
				cursor: default;
				
				.title {
					color: #aaaaaa;
				}
			}
		}
	}
}

.custom_selector {
	display: inline-block;
	position: relative;
	
	.name {
		display: inline-block;
		
		.input& {
			width: 100%;
		}
	}
	
	.control  {
		cursor: pointer;
		display: inline-block;
		height: 1em;
		width: 1em;

		html.rtl & {
			float: left;
		}
		
		.input& {
			margin-left: -1.5em;
		}

		.icon {
			margin: 0px;

			.init-icon-font();
			
			&:before {
				content: "\e671";
				display: inline-block;
				font-size: 16px;
				margin-top: -0.4ex;
				vertical-align: middle;
			}
		}
	}

	&.expand .control .icon:before {
		content: "\e66e";
	}
	
	.dropdown {
		bottom: 0px;
		left: -10000px;
		min-width: 100%;
		position: absolute;
		visibility: hidden;
		z-index: 500;
		
		.expand& {
			left: 0px;
			visibility: visible;
		}
		
		.dropdown_arrow {
			border-bottom: 6px solid #cbc8c0;
			border-left: 6px solid transparent;
			border-right: 6px solid transparent;
			display: block;
			font-size: 0;
			height: 0px;
			margin: 0px 0px -1px 10px;
			position: relative;
			width: 0px;
			
			.right& {
				float: right;
				margin-left: 0px;
				margin-right: 10px;
				
				html.rtl & {
					float: left;
					margin-left: 10px;
					margin-right: 0px;
				}
			}
			
			span {
				border-bottom: 6px solid #ffffff;
				border-left: 6px solid transparent;
				border-right: 6px solid transparent;
				display: block;
				height: 0px;
				margin-left: -6px;
				position: relative;
				top: 2px;
				width: 0px;
			}
		}
	}
	
	.dropdown_helper {
		position: absolute;
		left: 0px;
		top: 0px;
		
		.right& {
			left: auto;
			right: 0px;
			
			html.rtl & {
				right: auto;
				left: 0px;
			}
		}
	}
	
	.dropdown_content {
		background: #ffffff;
		border: 1px solid #cbc8c0;
		border-radius: 4px 4px 4px 4px;
		box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15);
		display: inline-block;
		max-height: 200px;
		overflow-y: auto;
		padding: 10px;
		text-align: left;
		
		html.rtl & {
			text-align: right;
		}
	}
}
