.clear {
	&:after {
		content: "";
		display: block;
		clear: both;
	}
}
.pbe-hide {
	display: none !important;
}
.pbe-letf {
	width: 50%;
	float: left;
}
.pbe-right {
	width: 50%;
	float: right;
}

.pbe-wrap {
	.button {
		&.has-icon {
			position: relative;
			padding-left: 25px;
			.dashicons {
				font-size: 16px;
				position: absolute;
				width: auto;
				height: auto;
				top: 50%;
				left: 5px;
				transform: translateY(-50%);
			}
		}
	}
}

@keyframes spinner {
	to {
		transform: rotate(360deg);
	}
}

.nav-sub-tabs {
	&.list-sub-tabs {
		margin: 5px 0;
		list-style: none;
		padding: 0;
		font-size: 13px;
		color: #666;

		&::before {
			display: table;
			content: " ";
			clear: both;
		}

		li {
			display: inline-block;
			margin: 0;
			padding: 0;
			white-space: nowrap;

			a {
				line-height: 2;
				padding: 0.2em;
				text-decoration: none;
				&.current-section {
					color: #000;
					font-weight: 600;
					border: none;
				}
			}
		}
	}
}
.nav-tab-wrapper {
	margin-bottom: 15px;
	display: block;
}
.pbe-find-group {
	border: 1px solid #ededed;
	background: #f5f5f5;
	padding: 1em 1em 0;
	margin-bottom: 1em;
}
.pbe-box {
	background: #ffffff;
	padding: 15px;
	h3 {
		margin-top: 0px;
	}
	&.hide {
		display: none;
	}
	.pbe-actions {
		> * {
			margin-right: 15px;
			&:last-child {
				margin-right: 0px;
			}
		}
	}
}
.pbe-find-conditions {
	min-height: 30px;
	display: block;
}
.pbe-find-input-field {
	display: flex;
	margin-bottom: 15px;
	// max-width: 800px;
	align-items: center;
	justify-content: flex-start;
	.field-type {
		flex-basis: 200px;
	}
	.field-cond {
		flex-basis: 150px;
	}
	.field-val {
		flex-basis: 30%;
	}
	.wide {
		width: 100%;
	}
	&:first-child {
		&:last-child {
			.pde-remove-col {
				visibility: hidden;
			}
		}
	}
	> * {
		//flex-grow: 1;
		margin-right: 15px;
		&:last-child {
			margin-right: 0px;
		}
	}
}

.pbe-input-wrap {
	&.hide {
		display: none !important;
		flex-basis: 0 !important;
	}
}

.pde-remove-cond {
	text-decoration: none;
	color: red;
	display: inline-block;
	cursor: pointer;
}

/* List preview poructs */
#pbe-previews {
	min-height: 150px;
	display: block;
	position: relative;

	.widefat tfoot td, .widefat th, .widefat thead td {
		font-weight: bold;
	}
	&.loading {
		&:before {
			content: " ";
			position: absolute;
			display: block;
			top: 0px;
			left: 0px;
			right: 0px;
			bottom: 0px;
			background-color: rgba(255, 255, 255, 0.6);
			background-image: url("../img/loading.gif");
			background-position: center center;
			background-repeat: no-repeat;
			z-index: 99;
		}
	}
	.column-thumbnail {
		width: 40px;
		img {
			max-width: 100%;
			height: auto;
			border: 1px solid #ccc;
			display: inline-block;
			background: #fff;
		}
	}
	.post-edit-link {
		font-weight: bold;
	}
	.post-state {
		font-weight: 600;
	}
	.product-name {
		mark {
			font-weight: 700;
			background: transparent none;
			line-height: 1;
		}
		.instock {
			color: #7ad03a;
		}
		.onbackorder {
			color: #eaa600;
		}
		.outofstock {
			color: #aa4444;
		}
	}
	.child-row {
		.product-name {
			display: block;
			position: relative;
			padding-left: 25px;
			&::before {
				width: 20px;
				height: 2px;
				background: currentColor;
				opacity: 0.8;
				content: "";
				display: block;
				position: absolute;
				top: 50%;
				left: 0px;
			}
		}
	}
}

#pbe-action-form {
	position: relative;
	&.disabled {
		&::before {
			content: "";
			position: absolute;
			background: none;
			top: 0px;
			left: 0px;
			right: 0px;
			bottom: 0px;
			z-index: 100;
		}
		.form-inner {
			position: relative;
			z-index: 3;
			opacity: 0.6;
		}
	}
	.action-row {
		margin-bottom: 15px;
		.wp-editor-container {
			iframe {
				min-height: 300px !important;
			}
		}
		.wp-editor-wrap.html-active {
			.wp-editor-area {
				min-height: 300px;
			}
		}
	}
	.action-field {
		display: inline-block;
		vertical-align: top;
		p {
			&:first-child {
				margin-top: 0px;
			}
		}
		&.field-name {
			.select2 {
				min-width: 280px;
			}
		}
		.input-label {
			margin-left: 5px;
			margin-right: 5px;
		}
	}

	.select2,
	.input-tax {
		min-width: 200px;
		display: inline-block;
		width: auto !important;
	}
	.input-text:not(.input-find-text):not(.input-val-text) {
		min-width: 250px;
		width: 100%;
		display: block;
	}
	.action-buttons-row,
	.action-schedule-extra {
		> * {
			margin-right: 15px;
			&:last-child {
				margin-right: 0px;
			}
		}
	}

	.pbe-edit-image {
		.preview-image {
			width: 60px;
			height: 60px;
			background: #f5f5f5;
			border: 1px solid #cccc;
			display: inline-flex;
			cursor: pointer;
			object-fit: cover;
			overflow: hidden;
			align-items: center;
			justify-content: center;
			color: #999;
			font-size: 22px;
		}
		img {
			width: 100%;
			height: auto;
			display: inline-block;
			object-fit: cover;
		}
	}
	.pbe-edit-gallery {
		img,
		.g-edit {
			width: 60px;
			height: 60px;
			display: inline-flex;
			object-fit: cover;
			margin: 0px 3px;
			border: 1px solid #cccc;
			align-items: center;
			justify-content: center;
			float: left;
			color: #999;
			background: #f5f5f5;
			text-decoration: none;
			font-size: 22px;
		}
		display: inline-block;
		.preview-image {
			display: inline-block;
		}
	}
}

.pbe-edit-files {
	margin-top: 1em;
	table {
		th,
		td {
			vertical-align: middle;
		}
		.sort {
			width: 10px;
		}
		.ui-sortable {
			.sort {
				cursor: move;
				&:before {
					content: "\f349";
					font-family: dashicons;
				}
			}
		}
	}
	input {
		&[type="text"] {
			width: 100%;
		}
	}
}

.action-variation-condtions {
	h3 {
		font-size: 1.2em;
		font-weight: 600;
	}
}
.extra_editor {
	display: none;
}
.pbe-small-input {
	width: 45px;
}

.ui-timepicker-div .ui-widget-header {
	margin-bottom: 8px;
}
.ui-timepicker-div dl {
	text-align: left;
}
.ui-timepicker-div dl dt {
	float: left;
	clear: left;
	padding: 0 0 0 5px;
}
.ui-timepicker-div dl dd {
	margin: 0 10px 10px 40%;
}
.ui-timepicker-div td {
	font-size: 90%;
}
.ui-tpicker-grid-label {
	background: none;
	border: none;
	margin: 0;
	padding: 0;
}
.ui-timepicker-div .ui_tpicker_unit_hide {
	display: none;
}

.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input {
	background: none;
	color: inherit;
	border: none;
	outline: none;
	border-bottom: solid 1px #555;
	width: 95%;
}
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus {
	border-bottom-color: #aaa;
}

.ui-timepicker-rtl {
	direction: rtl;
}
.ui-timepicker-rtl dl {
	text-align: right;
	padding: 0 5px 0 0;
}
.ui-timepicker-rtl dl dt {
	float: right;
	clear: right;
}
.ui-timepicker-rtl dl dd {
	margin: 0 40% 10px 10px;
}

/* Shortened version style */
.ui-timepicker-div.ui-timepicker-oneLine {
	padding-right: 2px;
}
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
.ui-timepicker-div.ui-timepicker-oneLine dt {
	display: none;
}
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label {
	display: block;
	padding-top: 2px;
}
.ui-timepicker-div.ui-timepicker-oneLine dl {
	text-align: right;
}
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div {
	display: inline-block;
	margin: 0;
}
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before {
	content: ":";
	display: inline-block;
}
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before {
	content: ".";
	display: inline-block;
}
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before {
	display: none;
}

.datetime-input {
	min-width: 240px;
}

.action-confirm-delete {
	display: none;
}
.pbe-danger-notice {
	color: red;
}

.pbe-bg-overlay {
	position: fixed;
	background: rgba(0, 0, 0, 0.3);
	top: 0px;
	left: 0px;
	bottom: 0px;
	right: 0px;
	display: none;
	z-index: 999;
}

.pbe-task-confirm {
	* {
		box-sizing: border-box;
	}
	width: 400px;
	padding: 2em;
	background: #fff;
	text-align: center;
	border: 1px solid #e5e5e5;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	position: fixed;
	top: 50%;
	left: 50%;
	display: none;
	transform: translate(-50%, -50%);
	z-index: 9999;
	.pbe-modal-check {
		margin: 25px 0px;
	}

	.pbe-modal-desc {
		max-width: 350px;
		margin: 0 auto;
		font-style: italic;
	}
	.pbe-actions {
		margin-top: 15px;
		.button {
			padding: 6px 25px;
			height: auto;
			text-transform: uppercase;
		}
	}
	.pbe-modal-close {
		display: none;
	}
}

// Define vars we'll be using
$brand-success: #5cb85c;
$loader-size: 7em;
$check-height: $loader-size/2;
$check-width: $check-height/2;
$check-left: ($loader-size/6 + $loader-size/12);
$check-thickness: 3px;
$check-color: $brand-success;

.circle-loader {
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-left-color: $check-color;
	animation: loader-spin 1.2s infinite linear;
	position: relative;
	display: inline-block;
	vertical-align: top;
	border-radius: 50%;
	width: $loader-size;
	height: $loader-size;
}

.load-complete {
	-webkit-animation: none;
	animation: none;
	border-color: $check-color;
	transition: border 500ms ease-out;
}

.checkmark {
	display: none;

	&.draw:after {
		animation-duration: 800ms;
		animation-timing-function: ease;
		animation-name: checkmark;
		transform: scaleX(-1) rotate(135deg);
	}

	&:after {
		opacity: 1;
		height: $check-height;
		width: $check-width;
		transform-origin: left top;
		border-right: $check-thickness solid $check-color;
		border-top: $check-thickness solid $check-color;
		content: "";
		left: $check-left;
		top: $check-height;
		position: absolute;
	}
}
.load-complete {
	.checkmark {
		display: inline-block;
	}
}

@keyframes loader-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@keyframes checkmark {
	0% {
		height: 0;
		width: 0;
		opacity: 1;
	}
	20% {
		height: 0;
		width: $check-width;
		opacity: 1;
	}
	40% {
		height: $check-height;
		width: $check-width;
		opacity: 1;
	}
	100% {
		height: $check-height;
		width: $check-width;
		opacity: 1;
	}
}

/* Task */
.pbe-task-table {
	thead {
		th {
			font-weight: bold;
		}
	}
	th,
	td {
		vertical-align: top;
	}
	.col-id {
		width: 50px;
		font-weight: bold;
	}
	.col-date {
		width: 180px;
	}
	.col-status {
		width: 140px;
		.task-status {
			margin-left: 0px;
		}
		time {
			display: block;
			font-size: 12px;
			margin-top: 6px;
		}
	}
	.task-action-val {
		font-weight: bold;
	}
	.col-product {
		width: 80px;
	}

	.col-actions {
		width: 80px;
		text-align: right;
	}
	.col-conditions {
	}
	.cond-row > span {
		margin-right: 10px;
		&:last-child {
			margin-right: 0px;
		}
	}
	.cond-title {
		font-weight: bold;
	}
	.cond-val {
		font-weight: bold;
		&.val-empty {
			font-style: italic;
			color: #888888;
		}
	}
	.sub-glue {
		font-weight: normal;
		margin: 0px 3px;
		display: inline-block;
	}
}

.val-empty {
	font-style: italic;
	color: #888888;
}

.pbe-wrap {
	h3.wp-heading-inline {
		display: inline-block;
		margin-right: 5px;
	}
	.task-status-item {
		font-weight: 600;
		font-size: 13px;
	}
}

.task-status {
	width: 80px;
	text-align: center;
	display: inline-block;
	text-transform: uppercase;
	font-size: 11px;
	margin-left: 0px;
}
.task-status-item,
.task-status {
	margin-left: 4px;
	padding: 4px 8px;
	position: relative;
	top: 0px;
	text-decoration: none;
	border: none;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #f7f7f7;
	text-shadow: none;

	line-height: normal;
	color: currentColor;
	cursor: normal;
	&.active,
	&:hover,
	&:focus {
		border-color: #6c757d;
		background-color: #6c757d;
		color: #fff;

		&.status-pending,
		&[data-status="pending"] {
			border-color: #ffc107;
			background-color: #ffc107;
			color: #333;
		}
		&.status-completed,
		&[data-status="completed"] {
			border-color: #28a745;
			background-color: #28a745;
			color: #fff;
		}
		&.status-scheduled,
		&[data-status="scheduled"] {
			border-color: #17a2b8;
			background-color: #17a2b8;
			color: #fff;
		}
		&.status-cancled,
		&[data-status="reverted"] {
			border-color: #cccccc;
			background-color: #f5f5f5;
			color: #666;
		}
		&.status-cancled,
		&[data-status="cancled"] {
			border-color: #dc3545;
			background-color: #dc3545;
			color: #fff;
		}
	}
}

.task-action {
	display: inline-block;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #f7f7f7;
	padding: 4px 4px;
	font-size: 10px;
	&.loading {
		.dashicons {
			animation: spinner 0.6s linear infinite;
			&::before {
				content: "\f463";
			}
		}
	}
}

.task-status-item {
	position: relative;
	&.loading {
		padding-left: 25px;
		&::before {
			content: "\f463";
			position: absolute;
			font-family: dashicons;
			line-height: 1;
			display: inline-block;
			font-size: 16px;
			top: 4px;
			left: 4px;
			animation: spinner 0.6s linear infinite;
		}
	}
}

.task-row {
	&[data-status="scheduled"] {
		.task-continue {
			display: none;
		}
	}
	&[data-status="canceled"] {
		.task-cancel {
			display: none;
		}
	}
}

/* Dashboard */
.pbed-box {
	h3 {
		font-weight: normal;
		text-transform: uppercase;
		font-size: 16px;
	}
	&.box-actions {
		.pbed-box-item {
			height: 50px;
		}
	}
}
.pbed-box-inner {
	&::after {
		content: "";
		clear: both;
		display: block;
	}
	.pebd-item-heading {
		font-weight: bold;
		font-size: 14px;
		margin-bottom: 15px;
	}
	.pbed-box-item {
		width: 150px;
		display: block;
		height: 80px;
		background: #fff;
		border: 1px solid #ccc;
		float: left;
		margin: 0 15px 15px 0;
		padding: 15px;
		&:last-child {
			margin-right: 0px;
		}
	}
	a.pbed-box-item {
		text-decoration: none;
		color: currentColor;
		&:hover {
			text-decoration: underline;
			background: #ededed;
		}
	}
}
