/* PREFIXED CSS */

.flat,
.flat div,
.flat li,
.flat div::after,
.flat .carat,
.flat .carat:after,
.flat .selected::after,
.flat:after{
	-webkit-transition: all 150ms ease-in-out;
	-moz-transition: all 150ms ease-in-out;
	-ms-transition: all 150ms ease-in-out;
	transition: all 150ms ease-in-out;
}

.flat .selected::after,
.flat.scrollable div::after{
	-webkit-pointer-events: none;
	-moz-pointer-events: none;
	-ms-pointer-events: none;
	pointer-events: none;
}

/* WRAPPER */

.flat{
	position: relative;
	width: 138px;
	cursor: pointer;
	font-weight: 200;
	background: #38b487;
	padding: 2px 0px 2px;
	
	border-radius: 4px;
	color:  #fff;
	font-size: 12px;
	margin-top:12px;
    border:1px solid #fff;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

.flat.open{
	z-index: 2;
}

.flat:hover,
.flat.focus{
	background: #38b487;
}

/* CARAT */

.flat .carat,
.flat .carat:after{
	position: absolute;
	right: 14px;
	top: 50%;
	margin-top: -3px;
	border: 6px solid transparent;
	border-top: 6px solid #FFF;
	z-index: 1;
	
	-webkit-transform-origin: 50% 20%;
	-moz-transform-origin: 50% 20%;
	-ms-transform-origin: 50% 20%;
	transform-origin: 50% 20%;
	
}

.flat:hover .carat:after{
	border-top-color: #fff;
}

.flat.focus .carat{
	border-top-color: #fff;
}

.flat.focus .carat:after{
	border-top-color: #fff;
}

.flat.open .carat{
	-webkit-transform: rotate(180deg);
	-moz-transform: rotate(180deg);
	-ms-transform: rotate(180deg);
	transform: rotate(180deg);
}

/* OLD SELECT (HIDDEN) */

.flat .old{
	position: absolute;
	left: 0;
	top: 0;
	height: 0;
	width: 0;
	overflow: hidden;
}

.flat select{
	position: absolute;
	left: 0px;
	top: 0px;
}

.flat.touch select{
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
}

/* SELECTED FEEDBACK ITEM */ 
.flat .selected {
    color: #FFF;
}

.flat .selected,
.flat li{
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	line-height: 1;
	padding: 5px 10px;
	overflow: hidden;
	white-space: nowrap;
}

.flat .selected::after{
	content: '';
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 60px;
}

.flat:hover .selected::after,
.flat.focus .selected::after{
	box-shadow: inset -55px 0 25px -20px #38b487;
}

/* DROP DOWN WRAPPER */

.flat div{
	position: absolute;
	height: 0;
	left: 0;
	right: 0;
	top: 100%;
	margin-top: 5px;
	background: #fff;
	overflow: hidden;
	opacity: 0;
	color: #04724E;
	border: 1px solid #ccc;
	border-radius: 5px;
}

.flat:hover div{
	background: #fff;
	
	border-radius: 5px;
}

/* Height is adjusted by JS on open */

.flat.open div{
	opacity: 1;
	z-index: 2;
}

/* FADE OVERLAY FOR SCROLLING LISTS */

.flat.scrollable div::after{
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 50px;
	
	box-shadow: inset 0 -50px 30px -35px #00c384;
}

.flat.scrollable:hover div::after{
	box-shadow: inset 0 -50px 30px -35px #00c384;
}

.flat.scrollable.bottom div::after{
	opacity: 0;
}

/* DROP DOWN LIST */

.flat ul{
	padding:0px;
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 100%;
	list-style: none;
	overflow: hidden;
	border-radius: 5px;
}

.flat.scrollable.open ul{
	overflow-y: auto;
}

/* DROP DOWN LIST ITEMS */

.flat li{
	list-style: none;
	color: #737383;
	padding: 14px 12px;
}

.flat li:last-child {
    border-bottom: 0;
}

/* .focus class is also added on hover */

.flat li.focus{
	background: #91d0ff;
	position: relative;
	z-index: 3;
	color: #fff;
}

.flat li.active{
	background: #91d0ff;
	color: #fff;
}