/**
 * Clearfix
 */
@mixin clearfix() {
	*zoom: 1;

	&::before,
	&::after {
		content: " ";
		display: table;
	}

	&::after {
		clear: both;
	}
}

/**
 * Objects
 */
@mixin menu() {
	@include clearfix();

	li {
		display: inline-block;
	}
}

@mixin mediaright() {
	@include clearfix();

	img {
		float: right;
		height: auto;
	}
}

@mixin medialeft() {
	@include clearfix();

	img {
		float: right;
		height: auto;
	}
}

@mixin ir() {
	display: block;
	text-indent: -9999px;
	position: relative;
	height: 1em;
	width: 1em;
}

@mixin il() {
	display: inline-block;
	text-indent: 9999px;
	position: relative;
	height: 1em;
	width: 1em;
}

@mixin icon( $glyph: "\e001" ) {
	font-family: "WooCommerce";
	speak: none;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	margin: 0;
	text-indent: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	text-align: center;
	content: $glyph;
}

@mixin iconbefore( $glyph: "\e001" ) {
	font-family: "WooCommerce";
	speak: none;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	margin-right: 0.618em;
	content: $glyph;
	text-decoration: none;
}

@mixin iconafter( $glyph: "\e001" ) {
	font-family: "WooCommerce";
	speak: none;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	margin-left: 0.618em;
	content: $glyph;
	text-decoration: none;
}

@mixin loader() {
	&::before {
		height: 1em;
		width: 1em;
		display: block;
		position: absolute;
		top: 50%;
		left: 50%;
		margin-left: -0.5em;
		margin-top: -0.5em;
		-webkit-animation: spin 1s ease-in-out infinite;
		-moz-animation: spin 1s ease-in-out infinite;
		animation: spin 1s ease-in-out infinite;
		content: "";
		background: url( "../images/icons/loader.svg" ) center center;
		background-size: cover;
		line-height: 1;
		text-align: center;
		font-size: 2em;
		color: rgba( #000, 0.75 );
	}
}

@mixin noselect() {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

@mixin statuses() {
	display: inline-flex;
	color: #777;
	background: #e5e5e5;
	border-radius: 4px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.05 );
	cursor: inherit !important;
	white-space: nowrap;
	max-width: 100%;

	&.status-complete,
	&.status-paid {
		background: #c8d7e1;
		color: #2e4453;
	}

	&.status-pending,
	&.status-pending-confirmation {
		background: #f8dda7;
		color: #94660c;
	}

	&.status-cancelled {
		background: #eba3a3;
		color: #761919;
	}

	&.status-confirmed {
		background: #c6e1c6;
		color: #5b841b;
	}

	> span {
		margin: 0 0.5em;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

@mixin loading-bar($top: 0, $color: rgb(128, 128, 128)) {
	position: absolute;
	top: $top;
	left: 0;
	right: 0;
	height: 2px;
	background: transparent;
	pointer-events: none;
	overflow: hidden;
	z-index: 1001;

	&::before {
		content: "";
		position: absolute;
		height: 100%;
		width: 100%;
		left: 0%;
		background: $color;
		transform-origin: left;
		transform: translateX(0) scaleX(0);
	}

	&.is-active {
		&::before {
			animation: wcaLoadingBarSlide 1.5s ease-in-out infinite;
		}
	}
}

@mixin inline_datepicker() {
	background: #fff;
	color: #222;
	font-size: 1.1em;
	padding: 6px;
	border: 1px solid #ddd;
	border-radius: 0;
	box-shadow: 0 4px 8px rgba( 0, 0, 0, 0.18 );
	width: 17em;

	* {
		font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
	}

	table {
		width: 100%;
		font-size: 0.9em;
		border-collapse: collapse;
		margin: 0 0 0.4em;
	}

	.ui-helper-clearfix::before,
	.ui-helper-clearfix::after {
		content: "";
		display: table;
		border-collapse: collapse;
	}

	.ui-state-disabled,
	.ui-widget-content .ui-state-disabled,
	.ui-widget-header .ui-state-disabled {
		opacity: 0.35;
		filter: alpha( opacity=35 );
	}

	//* Content
	table,
	tbody {
		border: 0;
		font-size: 1em;
		margin: 0;
		width: 100%;
	}

	th {
		background: 0;
		border: 0;
		color: rgb( 43, 43, 43 );
		font-size: 0.8em;
		font-weight: 700;
		padding: 0.8em 0 !important;
		text-align: center;
		word-break: normal;
	}

	tr {
		border: 0;
		padding: 0 !important;
	}

	td {
		background: 0;
		border: none;
		padding: 0 !important;
		position: relative;
		width: 14.28571428571429%;

		a,
		span {
			box-shadow: none;
			display: block;
			text-decoration: none;
		}
	}

	td .ui-state-default {
		background: transparent;
		background-image: none !important;
		border: none;
		color: rgb( 43, 43, 43 );
		margin: 0;
		font-size: 0.8em;
		text-align: center;
		padding: 0.8em 0;
	}

	td:not(.ui-state-disabled) a.ui-state-default {
		font-weight: 600;
	}

	td:not(.ui-datepicker-current-day) a.ui-state-active,
	td:not(.ui-datepicker-current-day) a.ui-state-active.ui-state-hover {
		background-color: rgba( 0, 0, 0, 0.05 );
	}

	td.ui-datepicker-today,
	td.ui-datepicker-today a {
		color: #f6563e;
	}

	td.ui-datepicker-selected-day,
	td.ui-datepicker-current-day a,
	td.ui-datepicker-current-day a:hover {
		background-color: rgba( 0, 0, 0, 0.1 );
		opacity: 1;
	}

	// Header
	.ui-datepicker-header {
		background-color: transparent;
		background-image: none;
		border: 0;
		border-radius: 0;
		font-weight: 700;
		overflow: hidden;
		padding: 0;
		position: relative;
		width: 100%;

		a {
			color: #222;
		}
	}

	.ui-datepicker-title {
		line-height: 1;
		margin: 0 2.5em;
		padding: 0.3em 0;
		text-align: center;

		.ui-datepicker-year {
			display: inline-block;
		}
	}

	td:hover,
	.ui-state-hover,
	.ui-datepicker-prev-hover,
	.ui-datepicker-next-hover {
		background: rgba( 0, 0, 0, 0.05 );
		cursor: pointer;
		text-decoration: none;
	}

	.ui-datepicker-prev-hover,
	.ui-datepicker-next-hover,
	.ui-datepicker-next,
	.ui-datepicker-prev {
		border: none;
		border-radius: 0;
		box-shadow: none;
		height: 40px;
		width: 40px;
		position: absolute;
		top: 0;
	}

	.ui-datepicker-prev {
		left: 0;

		.rtl & {
			left: auto;
			right: 0;

			span::before {
				content: "\2192";
			}
		}
	}

	.ui-datepicker-next {
		right: 0;

		span {
			left: auto !important;
			right: 0;
		}

		.rtl & {
			left: 0;
			right: auto !important;

			span {
				left: 0;
				right: auto !important;

				&::before {
					content: "\2190";
				}
			}
		}
	}

	.ui-datepicker-next span,
	.ui-datepicker-prev span {
		background: none;
		display: block;
		margin: 0;
		position: absolute;
		left: 0;
		top: 0;
		height: 40px;
		font-weight: 400;

		&::before {
			content: "\2192";
			speak: none;
			font-size: 1.5em;
			font-weight: 400;
			font-variant: normal;
			text-transform: none;
			-webkit-font-smoothing: antialiased;
			margin: 0;
			text-indent: 0;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			text-align: center;
			line-height: 1.7;
		}
	}

	.ui-datepicker-prev span::before {
		content: "\2190";
	}

	.ui-icon-circle-triangle-e,
	.ui-icon-circle-triangle-w {
		width: 40px;
		height: 40px;
		overflow: hidden;
		text-indent: -99999px;

		.rtl & {
			text-indent: -99999px;
		}
	}

	select.ui-datepicker-month,
	select.ui-datepicker-year {
		display: inline-block;
		width: 45%;
	}

	.ui-datepicker-buttonpane {
		border-top: 1px solid #ddd;
		margin: 0.7em 0 0 0;
		padding: 0 0.2em;

		button {
			background: #f7f7f7;
			border: 1px solid #d3d3d3;
			float: right;
			margin: 0.5em 0.2em 0.4em;
			padding: 0.2em 0.6em 0.3em 0.6em;

			&.ui-datepicker-current {
				float: left;
			}
		}
	}
}
