/**
 * 
 * 13. Form elements styling
 * 
 */


/** 13.01 Base form elements **/
input, 
textarea, 
select, 
.select2-container .select2-choice,
.select2-container .select2-selection,
.select2-container .select2-selection.select2-selection--multiple {
	@extend %form-control-input;
	height: initial;
	line-height: normal;
	text-align: left;
	font-weight: 600;
	color: $color-dark-gray;
	border: 2px solid rgba(0, 0, 0, 0);
	@include transition(border-color $duration-color $fn-cubic, background-color $duration-color $fn-cubic);

	&:focus {
		background-color: darken($color-bg-form-controls, 5%);
		@extend %outline-none;
	}

	&[type="text"],
	&[type="email"],
	textarea {
		width: 100%;  
	}
}

.select2-container-active > .select2-choice,
.select2-container-active > .select2-selection {
	background-color: darken($color-bg-form-controls, 5%);
}

.woocommerce-widget-layered-nav-dropdown + .select2.select2-container.select2-container--default {
	margin-bottom: 1em;
}

.select2 {
	&.select2-container .select2-selection.select2-selection--multiple {
		padding-top: 0.9em;
		padding-bottom: 0.9em;
	}

	&.select2-container--default.select2-container--focus .select2-selection--multiple {
		border: 2px solid rgba(0, 0, 0, 0) !important;
	}

	&.select2-container--default .select2-selection--multiple .select2-selection__choice {
		border: 0;
		border-radius: 0;
		padding: 2px 8px;

		.select2-selection__choice__remove {
			font-size: 18px;
			padding: 0;
			vertical-align: middle;
		}
	}

	&.select2-container--default .select2-selection--multiple .select2-selection__rendered {
		padding-right: 18px;
		
		.select2-search--inline {
			line-height: 2.9em;
		}

		&:before {
			@extend %ion;
			content: $ionicon-var-ios-arrow-down;
			position: absolute;
			font-size: 20px;
			top: 50%;
			right: 18px;
			margin: -10px 0 0 0;
			font-weight: bold;
			@include transition(transform 0.2s $fn-cubic);
		}
	}

	&.select2-container--default.select2-container--open .select2-selection--multiple .select2-selection__rendered {
		&:before {
			@include transform(rotate(180deg));  
		}
	}

	&.select2-container--default .select2-selection--single .select2-selection__clear {
		line-height: 16px;
		font-size: 16px;
	}
}

.select2-container .select2-dropdown {
	.select2-results__option[data-selected="true"] {
		color: darken( $color-darker-gray, 3% );
	}
}

/** 13.02 Buttons **/
input[type="submit"], input[type="button"], button[type="submit"], .button, .btn-primary {
	@include button(default, normal);
}

/** 13.03 Search forms **/
form.yith-ajaxsearchform,
form.search-form {
	> div {
		display: table;
		table-layout: auto;
		width: 100%;
	}

	.wrap-search, .wrap-submit {
		display: table-cell;

		input {
			display: block;
			height: 50px;
			padding: 0.8em 1em;
			line-height: 2em;

			.sidebar & {
				height: auto;
			}
		}
	}

	.wrap-search {
		position: relative;

		input {
			width: 100%;
			padding-right: 30px;
		}
	}

	.wrap-submit {
		width:1%;
		white-space:nowrap;

		input {
			margin-right: -1px; //fix gap
		}

		.sidebar & {
			display: none;
		}
	}

	.wrap-search + .wrap-submit {
		padding-left: 1em;
	}

	label {
		margin: 0;
		width: 100%;
	}
}


/** 13.04 Comment forms **/
.comment .children {
	padding-left: 10px;

	@include at-least($bp-xs) {
		margin-left: 50px;		
	}
}

.comment-form {
	.form-allowed-tags, .comment-notes {
		color: $color-dark-gray;
		font-size: 12px;
	}

	.alert-info {
		background-color: darken( $color-lighter-gray, 3%);
		color: $color-dark-gray;
	}
	.comment-form-author, .comment-form-email, .comment-form-url {
		width: 32%;
		margin-right: 2%;
		margin-bottom: 1.5em;
		float: left;
	}
	.comment-form-url {
		margin-right: 0;
	}

	@include until($bp-xs) {
		.comment-form-author, .comment-form-email, .comment-form-url {
			width: 100%;
			margin-right: 0;
		}
	}
}

.comments-area {
	.comment-reply-title,
	.comments-title {
		@extend %uppercase;
		font-size: 16px;
		text-align: left;
		word-wrap: break-word;
	}

	.comment-reply-link {
		padding: 0.4em 1em;
	}

	img.avatar {
		border-radius: 100px;

		@include until($bp-xxs) {
			max-width: 30px;
		}
	}

	.panel {
		background-color: $color-bg-form-controls;
		border-radius: 3px;
		padding: 15px 17px;

		.comment-meta {
			font-size: 12px;
			line-height: normal;
		}

		> footer {
			margin: 0;
			padding: 0;
			border: none;
		}
	}

	.bypostauthor .panel {
		background-color: $color-light-gray;
		border-bottom: 3px solid;
		border-color: $color-primary; /* redux[border-color: main_theme_color] */
	}

	//When in comment reply
	li.comment .comment-respond {
		margin-bottom: 4em;
	}

	.comment-edit-link {
		margin-left: 10px;
	}
}

.comment-navigation {
	a {
		@extend %text-theme;
		@include color-link-inv();
	}

	ul {
		list-style: none;
		padding: 0;
	}

	.nav-previous,
	.nav-next {
		font-weight: 700;

		i {
			display: inline;
			margin: 0 5px;
		}
	}
}

#respond {
	#wp-comment-cookies-consent {
		margin: 0 10px 0 0;
		@include transform(translateY(2px));
	}

	.comment-form-cookies-consent label {
		display: inline;
	}
}


/** 13.05 Search form on 404 page **/
.error-404 .page-content {
	text-align: center;

	form {
		max-width: 600px;
		margin: 0 auto;
	}
}