@charset "UTF-8";
@import "../core/_var";
@import "../mixin/_common";
@import "../mixin/_layout";

// font-size & color definition
$fontSize: 12px;

$white: #fff;
$black: $color-black-dark;

$gray: #f5f7fa;
$gray-i: $color-black;
$gray-ii: $color-black-light;
$gray-iii: #ced3d9;
$gray-iv: #dae0e6;
$gray-v: #e6ecf2;
$gray-vi: #a1aab2;
$gray-vii: #b2b2b2;

$blue: $color-blue;
$red: $color-red;

$color-disabled: #edf0f2;

$shadow-color: rgba(0, 33, 66, .1);

// ---------

.select {
	@extend %inline-block;
	min-width: 80px;
	padding-right: 26px;
	position: relative;
	font-size: $fontSize;
	line-height: 1.5;
	color: $black;
	border-radius: 3px;
	background: $white;
	border: 1px solid $gray-iii;
	vertical-align: top;

	&-none-border {
		border: 0 none;
	}

	&.hover, &:hover {
		border-color: $gray-vi;
	}

	&.focus {
		border-color: $blue;
	}

	.select-title {
		cursor: pointer;
		white-space: nowrap;
		overflow: hidden;

		.hide{
			display: block;
		}

		.select-label {
			@extend %inline-block;
			padding: 5px 10px;
			background: $gray;
			border-right: 1px solid $gray-iii;
			color: $gray-i;
			border-radius: 3px 0 0 3px;
		}
	}

	&.disabled {
		cursor: not-allowed;
		color: $gray-vii;
		border: 1px solid $gray-iii;
		background: $color-disabled;

		&.hover, &:hover {
			border-color: $gray-iii;
		}

		.select-title {
			cursor: not-allowed;

			.select-label {
				background: $color-disabled;
				color: $gray-vii;
			}
		}
	}

	.select-selected {
		@extend %inline-block;
		padding: 5px 0 5px 10px;
		text-decoration: none;
		white-space: nowrap;
	}
	.select-arrow {
		box-sizing: content-box;
		position: absolute;
		padding: 0 5px;
		right: 0;
		top: 50%;
		margin-top: -8px;
		width: 16px;
		height: 16px;
		line-height: 1;
		transition: transform .2s ease;

		.micon {
			margin-right: 0;
		}
	}
	.select-list {
		display: none;
		background: $white;
		position: absolute;
		left: -1px;
		top: 100%;
		margin-top: 1px;
		min-width: 100%;
		*width: 100%;
		border: 1px solid $gray-iii;
		border-radius: 3px;
		box-shadow: 2px 2px 3px $shadow-color;
		z-index: 66;
	}
	.select-list-wrap {
		overflow: auto;
		max-height: 300px;
		*height: 300px;
		padding: 5px 0;
		min-width: 100%;
		*width: 100%;
	}
	.select-opt {
		padding: 5px 10px;
		color: $gray-i;
		display: block;
		word-wrap: break-word;
		text-decoration: none;
		&.hide{
			display: none;
		}

		&:hover,
		&.hover,
		&.selected {
			color: $gray-i;
			background: $gray-v;
		}
		&.disabled {
			border: 0 none;
			cursor: not-allowed;
			color: $gray-vii;
			background: none;
			&:hover {
				background: none;
			}
		}
	}

	.select-group {
		padding: 0 10px;

		.select-opt {
			margin-left: -10px;
			margin-right: -10px;
		}
		&:after {
			height: 0;
			content: "";
			display: block;
			padding: 0 10px;
			margin: 5px 0;
			border-bottom: 1px solid $gray-iv;
			box-sizing: border-box;
		}
		&:last-of-type:after {
			margin: 0;
			padding: 0;
			border: 0 none;
		}
	}
	.select-opt-label {
		padding: 5px 0;
		font-weight: bold;
	}
	&.open {
		z-index: 110;
		.select-arrow {
			transform: rotate(180deg);
		}
		.select-list {
			display: block;
		}
	}
	&.top {
		.select-list {
			top: auto;
			bottom: 100%;
			margin-bottom: 1px;
			border: 1px solid $gray-iii;
			border-bottom: 0 none;
		}
	}

	// 分页
	.select-tabs-wrap {
		text-align: center;
		border-bottom: 1px solid $gray-iv;
		margin: 0 10px;
		font-size: 0;
	}

	.select-tabs {
		@extend %inline-block;
		font-size: $fontSize;
		padding: 8px 10px;
		margin: 0 auto -9px -5px;
		white-space: nowrap;
	}

	.select-tab {
		color: $gray-ii;
		@extend %inline-block;
		margin-right: 10px;
		padding-bottom: 8px;
		border-bottom: 2px solid transparent;
		cursor: pointer;

		&.active {
			color: $black;
			border-bottom: 2px solid $red;
			cursor: default;
		}
	}
}