/*
 * Sailor Popup
 */

/* CS Popups */

.cs-popup {
	margin-top: 20px;
	border: 2px solid @general_borders;
	box-shadow: rgba(0, 0, 0, 0.12) 0 15px 40px;
	padding: 20px;
	position: absolute;
	min-width: 260px;
	min-height: 200px;
	border-radius: 4px;
	transition: opacity cubic-bezier(0.77, 0, 0.175, 1) 200ms, margin cubic-bezier(0.77, 0, 0.175, 1) 200ms, transform cubic-bezier(0.77, 0, 0.175, 1) 200ms;
	opacity: 1;
	transform-origin: 50% 0%;
	-ms-transform-origin: 50% 0%;
	-webkit-transform-origin: 50% 0%;
	-webkit-transform: translateX(-50%) scale(1);
	   -moz-transform: translateX(-50%) scale(1);
	    -ms-transform: translateX(-50%) scale(1);
	     -o-transform: translateX(-50%) scale(1);
	        transform: translateX(-50%) scale(1);
	z-index: 1500000;
	background-color: @primary_content_bg;
	box-sizing: border-box;

	.minimap {
		margin: 0 0 20px 0;
	}

	.cs-help {
		position: absolute;
		right: 46px;
		top: 18px;
	}

	&:after {
		bottom: 100%;
		left: 50%;
		border: solid transparent;
		content: " ";
		height: 0;
		width: 0;
		position: absolute;
		pointer-events: none;
		border-color: rgba(255, 255, 255, 0);
		border-bottom-color: @primary_content_bg;
		border-width: 8px;
		margin-left: -8px;
	}

	&:before {
		bottom: 100%;
		left: 50%;
		border: solid transparent;
		content: " ";
		height: 0;
		width: 0;
		position: absolute;
		pointer-events: none;
		border-color: rgba(229, 229, 229, 0);
		border-bottom-color: @general_borders;
		border-width: 11px;
		margin-left: -11px;
	}

	fieldset {
		padding-bottom: 10px;
	}

	.popup-content {
		.toolbar-available {
			font-size: 0;
			display: block;
			overflow-x: hidden;
			height: 240px;
			margin: -5px;
			width: 300px;
		}

		.toolbar-btn {
			display: inline-block;
			width: 50%;
			padding: 3px;
			font-size: 12px;
			box-sizing: border-box;
			vertical-align: top;

			>div {
				display: block;
				padding: 7px;
				font-size: 11px;
				box-sizing: border-box;
				border: 2px solid @general_borders;
				background: @primary_content_bg;
				border-radius: 3px;
				cursor: pointer;

				i {
					font-size: 14px;
					margin: 0 3px 0 0;
				}

			}

		}

		.ui-sortable-placeholder {
			visibility: visible !important;
			padding: 3px;

			&:after {
				content: " ";
				border: 2px dashed @general_borders;
				background: @primary_content_bg;
				border-radius: 3px;
				display: block;
				height: 30px;
			}

		}

	}

	.popup-header {
		font-size: 12px;
		border-bottom: 1px solid @general_borders;
		margin: 0 -20px 20px -20px;
		padding: 0px 20px 20px 20px;
	}

	.cs-all-icons {
		.cs-icon-tooltip {
			color: @body_text;
			border-radius: 4px;

			&:hover {
				color: @body_text;
				background: @selection_highlight;
			}

		}

		.icon-name {
			display: none;
		}

		.cs-icon-tooltip.hidden {
			display: none;
		}

	}

	&.closed {
		opacity: 0;
		-webkit-transform: translateX(-50%) scale(0);
		   -moz-transform: translateX(-50%) scale(0);
		    -ms-transform: translateX(-50%) scale(0);
		     -o-transform: translateX(-50%) scale(0);
		        transform: translateX(-50%) scale(0);
		margin: 10px 0 0 0;
	}

	&.bottomarrow.closed {
		opacity: 0;
		margin: 0 0 10px 0;
		-webkit-transform: translateX(-50%) scale(0);
		   -moz-transform: translateX(-50%) scale(0);
		    -ms-transform: translateX(-50%) scale(0);
		     -o-transform: translateX(-50%) scale(0);
		        transform: translateX(-50%) scale(0);
	}

	&.bottomarrow {
	    transform-origin: 50% 100%;
	    -ms-transform-origin: 50% 100%;
	    -webkit-transform-origin: 50% 100%;
		margin: 0 0 20px 0;

		&:after {
			top: 100%;
			border-color: rgba(255, 255, 255, 0);
			border-top-color: #FFF;
			border-width: 10px;
			margin-left: -10px;
			border-top-color: @primary_content_bg;
		}

		&:before {
			top: 100%;
			border-color: rgba(229, 229, 229, 0);
			border-top-color: #E5E5E5;
			border-width: 13px;
			margin-left: -13px;
			border-top-color: @general_borders;
		}

	}

	&.smallmenu {
		width: 100px;
		min-width: 160px;
		max-width: 160px;
		min-height: 0px;
		padding: 0;

		ul {
			max-height: 230px;
			overflow-y: auto;
			margin: 0;
			padding: 0;

			li {
				margin: 0;
				padding: 0;

				a {
					display: block;
					padding: 9px 12px;
					font-size: 11px;
					border-bottom: 1px solid @general_borders;
					text-decoration: none;
					background-color: @primary_content_bg;
					color: @body_text;

					span {
						float: right;
						font-size: 10px;
						margin-top: 1px;
						color: @alt_text;
					}

					&:hover {
						background-color: @link_normal;
						color: @primary_content_bg;

						span {
							color: @primary_content_bg;
						}

					}

				}

				&:last-child {
					a {
						border-bottom: 0;
					}

				}

				&:only-child {
					a {
						border-bottom: 0;
					}

				}

				a[data-action="remove"] {
					color: @link_negative;

					&:hover {
						background-color: @link_negative;
						color: @primary_content_bg;
					}

				}

			}

		}

	}

	&.enhancedmenu {
		width: 100%;
		max-width: 300px;
		min-height: 0px;
		padding: 0;

		.popup-search {
			margin: 0;
			padding: 20px;
		}

		ul {
			max-height: 260px;
			overflow-y: auto;
			margin: 0;
    		padding: 15px;
			font-size: 0;

			li {
				display: inline-block;
				width: 50%;
				vertical-align: top;
				margin: 0;
				padding: 2px;
    			box-sizing: border-box;

				a {
					display: block;
					padding: 10px 10px;
					font-size: 12px;
					text-decoration: none;
					border-radius: 4px;
					background: fade(@general_borders, 30%);
					color: @body_text;

					span {
						float: right;
						font-size: 10px;
						margin-top: 1px;
						color: @alt_text;
					}

					&:hover {
						background-color: @link_hover;
						color: @primary_content_bg;

						span {
							color: @primary_content_bg;
						}

					}

				}

				&:last-child {
					a {
						border-bottom: 0;
					}

				}

				&:only-child {
					a {
						border-bottom: 0;
					}

				}

				a[data-action="remove"] {
					color: @link_negative;

					&:hover {
						background-color: @link_negative;
						color: @primary_content_bg;
					}

				}

			}

		}

	}

	&.smallestmenu {
		min-width: 120px;
		max-width: 120px;
	}

	&.scheme-filters {
		max-width: 200px;
		min-width: 200px;

		.popup-content {
			>button {
				margin-top: 20px;
			}

		}

		.ui-slider-horizontal {
			margin-top: 2px;
			margin-bottom: 4px;
		}

		label {
			text-align: center;
		}

	}

	&.scheme-variants {
		max-width: 200px;
		min-width: 200px;

		.popup-content {
			>button {
				margin-top: 20px;
			}

		}

		.color-group {
			font-size: 0;
			margin: -4px;
		}

		.variant-item {
			padding: 2px;
			font-size: 0;
			width: 50%;
			display: inline-block;
			box-sizing: border-box;
		}

		.variant-preview {
			border-radius: 3px;
			display: table;
			overflow: hidden;
			width: 100%;
			border: 2px solid #F2F2F2;
			cursor: pointer;
			-webkit-transition: all ease-in-out 200ms;
			-moz-transition: all ease-in-out 200ms;
			-ms-transition: all ease-in-out 200ms;
			-o-transition: all ease-in-out 200ms;
			transition: all ease-in-out 200ms;

			&:hover {
				border: 2px solid #AAA;
			}

			span {
				display: table-cell;
				width: 20%;
				padding-bottom: 20%;
			}

		}

		.selected {
			.variant-preview {
				border: 2px solid #000000;
			}

		}

	}

	&.rightarrow {
		&:after {
			left: auto;
			right: 27px;
			margin-right: -8px;
		}

		&:before {
			left: auto;
			right: 27px;
			margin-right: -11px;
		}

	}

	&.smallselect {
		ul {
			li {
				a {
					background-color: @primary_content_bg;
					color: @body_text;
					border-color: @general_borders;

					&:hover {
						background-color: @link_normal;
						color: @primary_content_bg;

						span {
							color: @primary_content_bg;
						}

					}

					span {
						color: @alt_text;
					}

				}

				a[data-action="remove"] {
					color: @link_negative;

					&:hover {
						background-color: @link_negative;
						color: @primary_content_bg;
					}

				}

			}

		}

	}

	&.tooltip {
		padding: 10px;
		font-size: 12px;
		text-align: center;
		width: auto;
		height: auto;
		min-height: auto;
		min-width: 60px;
	}

	&.single-field {
		padding: 0 40px 0 0;
		font-size: 12px;
		text-align: center;
		width: 100%;
		height: auto;
		min-height: auto;
		max-width: 160px;
		min-width: 60px;

		input[type="text"] {
			margin: 0;
			border: 0;
			width: 100%;
			word-wrap: break-word;
    		text-overflow: ellipsis;
		}

		.cs-popup-close {
		    top: 5px;
		    right: 5px;
		}

		.cs-popup-ok {
			position: absolute;
		    top: 5px;
		    right: 26px;
		    color: @body_text;
		    text-decoration: none;
		}
	}

}

.cs-popup-close {
	position: absolute;
	top: 19px;
	right: 18px;
	text-decoration: none;

	i {
		color: #000;
		font-weight: 400;
		font-size: 16px;
	}

}

/**
 * Sailor Alert Dialogs
 */

.scheme-overlay-open #wpwrap {
	filter: blur(5px);
}

.sailor-help .ui-widget-overlay,
.sailor-alert .ui-widget-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	opacity: 0.85;
	z-index: 999990;
	background-color: fade( @overlay_bg, 80% );
}

.sailor-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	transform-origin: 0 0 0;
	background: @primary_content_bg;
	width: 100%;
	min-width: 300px;
	z-index: 1200000;
	border-radius: 8px;
	min-height: 32px;
	transition: all cubic-bezier(0.6, 0, 0, 0.6) 200ms;
	opacity: 1;
	visibility: visible;
	margin-top: 0;
	box-shadow: rgba(0, 0, 0, 0.1) 0 20px 40px;

	.modal-title {
		font-weight: 600;
		font-size: 18px;
		padding: 30px;
		line-height: 100%;
		margin: 0;

		i {
			font-size: 32px;
			margin: 0 0 10px 0;
			display: block;
		}

	}

	.modal-content {
		font-weight: 400;
		font-size: 14px;
		padding: 0 30px 30px 30px;
		line-height: 130%;
		margin: -20px 0 0 0;
		border: 0;
		border-radius: 0;
		display: block;

		p {
			margin: 0 0 15px 0;
		}

		p:last-child {
			margin: 0;
		}

		fieldset {

			&:not(:last-child) {
				padding: 0 0 15px 0;
			}

			label {
				display: block;
				margin: 5px 0;
			}

			textarea {
				display: block;
				width: 100%;
				min-height: 80px;
			}

		}

		input[type="text"] {
			width: 100%;
			box-sizing: border-box;
		}

	}

	.modal-footer {
		border-top: 1px solid @general_borders;
		padding: 17px 20px;
		text-align: right;
		font-size: 0;

		button {
			border-radius: 0;
			padding: 10px 15px;
			display: inline-block;
			background: transparent;
			border: 0;
			box-shadow: none;
			outline: none;
			margin: 0 0 0 5px;
			cursor: pointer;
			font-size: 14px;
			line-height: 100%;
			margin-top: -1px;
			color: black;
			background: fade(black,8%);
			border-radius: 20px;

			&:hover {
				background: fade(black,15%);
			}

			&:last-child {
				font-weight: bold;
			}
		}

	}

	&.loading {
		opacity: 0;
		visibility: hidden;
		margin-top: -18px;
		transform: translate(-50%, -50%);
		box-shadow: none;
	}

	&.small {
		max-width: 300px;
	}

	&.medium {
		max-width: 420px;
	}

	&.large {
		max-width: 720px;
	}

}

.sailor-alert {

	&.with-tooltip {
		.sailor-modal {
			max-width: 180px;
			transform: translateX(-50%) scale(1);
			transform-origin: top;
			position: absolute !important;
			top: auto;
			text-align: center;
			left: auto;
	    	box-shadow: rgba(0,0,0,0.1) 0 18px 42px, rgba(0,0,0,0.12) 0 30px 160px;

			.modal-footer {
				display: table;
				padding: 0;
				width: 100%;
				text-align: center;

				button {
					width: 50%;
					display: table-cell;
					padding: 20px;
					margin: 0;
					border-radius: 0;
					background: transparent;
					color: @body_text;

					&:first-child {
						border-right: 1px solid @general_borders;
					}

					&:hover {
						background-color: fade( @general_borders, 40% );
					}
				}
			}

			&.loading {
				transform: translateX(-50%) scale(0);
			}
		}
	}

	&.view-version,
	&.view-snippet {

		.code-block {
			max-height: 500px;
			overflow: auto;
			border: 2px solid @general_borders;
			border-radius: 3px;
			font-size: 12px;
		    -webkit-touch-callout: all; /* iOS Safari */
		    -webkit-user-select: all; /* Safari */
		    -khtml-user-select: all; /* Konqueror HTML */
		    -moz-user-select: all; /* Firefox */
		    -ms-user-select: all; /* Internet Explorer/Edge */
		    user-select: all; /* Chrome and Opera */
		}
	}

	&.manage-group {

		.ver-list {
			.empty-list {
				text-align: center;
				padding: 30px;
				border: 2px dashed @general_borders;
				background: @primary_content_bg;
				border-radius: 3px;
			}
			.loading-list {
				text-align: center;
				padding: 30px;
				border: 2px dashed @general_borders;
				background: @primary_content_bg;
				border-radius: 3px;

				.spinner {
					visibility: visible;
					opacity: 1;
					margin: 0;
					float: none;
				}
			}

			.row-list {
				margin: 0 -10px;

				.col-2 {
					display: inline-block;
					padding: 0 10px;
					box-sizing: border-box;
					width: 50%;
					vertical-align: top;

					h4 {
						padding: 0;
						margin: 0 0 15px 0;
						font-weight: 400;
					}
				}
			}

			.final-list {
				border-radius: 3px;
				border: 2px solid @general_borders;
				max-height: 200px;
				overflow: auto;

				.empty-list {
					margin: -2px;
				}

				.ver-item {
					padding: 10px;
				    width: 100%;
				    box-sizing: border-box;
				    display: table;
					border-bottom: 1px solid @general_borders;
					transition: all 100ms;
					cursor: pointer;
					line-height: 100%;

					&:last-child,
					&:only-child {
						border-bottom: 0;
					}

					&:hover {
						background-color: fade( @secondary_content_bg, 50% );
					}

					&.selected {
						background: @link_normal;
						color: @primary_content_bg !important;

						.date {
							color: @primary_content_bg;
						}
					}

					.name {
						display: table-cell;
						vertical-align: middle;
						width: 60%;
					}

					.date {
						display: table-cell;
						vertical-align: middle;
						width: 40%;
						text-align: right;
						font-size: 11px;
						color: @alt_text;
						transition: color 100ms;
					}
				}
			}
		}

	}

}


/**
 * Sailor Popups
 */
.sailor-popups {
	position: fixed;
	bottom: 40px;
	z-index: 999991;
	right: 40px;
}

.sailor-popups a {
	display: block;
}

.sailor-popups .popup-item {
	display: none;
	background: fade(@overlay_bg, 95%);
	color: @overlay_text;
	box-shadow: rgba(0, 0, 0, 0.15) 0 20px 48px;
	width: 360px;
	box-sizing: border-box;
	border-radius: 10px;
	margin: 5px 0;
	font-size: 13px;
	padding: 20px 15px 22px 52px;
	position: relative;
}

.sailor-popups .popup-item i {
	position: absolute;
    left: 15px;
    top: 17px;
	border-radius: 50%;
	border: 2px solid;
	line-height: 20px;
	width: 24px;
	box-sizing: border-box;
	height: 24px;
	display: inline-block;
	text-align: center;
	vertical-align: middle;
	font-size: 18px;
	margin: 0 5px 0 0;
	color: @overlay_text;
	font-family: 'dashicons';
}

.sailor-popups .popup-item i.sailor-loader {
	font-size: 0;
	text-indent: -9999em;
	border-top: 2px solid fade(@overlay_bg, 20%);
	border-right: 2px solid fade(@overlay_bg, 20%);
	border-bottom: 2px solid fade(@overlay_bg, 20%);
	border-left: 2px solid @overlay_text;
	-webkit-transform: translateZ(0);
	-ms-transform: translateZ(0);
	transform: translateZ(0);
	-webkit-animation: load8 0.5s infinite linear;
	animation: load8 0.5s infinite linear;
}


.ui-slider {
	position: relative;
	text-align: left;
}
.ui-slider .ui-slider-handle {
	position: absolute;
	z-index: 2;
	width: 1.2em;
	height: 1.2em;
	cursor: move;
	-ms-touch-action: none;
	touch-action: none;
}
.ui-slider .ui-slider-range {
	position: absolute;
	z-index: 1;
	font-size: .7em;
	display: block;
	border: 0;
	background-position: 0 0;
}

/* support: IE8 - See #6727 */
.ui-slider.ui-state-disabled .ui-slider-handle,
.ui-slider.ui-state-disabled .ui-slider-range {
	filter: inherit;
}

.ui-slider-horizontal {
	height: 16px;
	position: relative;
	margin: 0 8px;
}
.ui-slider-horizontal:before {
	content: "";
	top: 8px;
	left: -8px;
	right: -8px;
	position: absolute;
	z-index: 0;
	height: 2px;
	background-color: @inputs_border;
}
.ui-slider-horizontal .ui-slider-handle {
	width: 16px;
	height: 16px;
	background-color: @button_switcher;
	box-shadow: rgba(0,0,0,0.2) 0 2px 4px, rgba(0,0,0,0.2) 0 0 1px;
	border-radius: 50%;
	top: 0;
	margin-left: -8px;
}
.ui-slider-horizontal .ui-slider-range {
	top: 8px;
	height: 2px;
	background-color: @button_switcher_bg;
}
.ui-slider-horizontal .ui-slider-range-min {
	left: -8px;
}
.ui-slider-horizontal .ui-slider-range-max {
	right: -8px;
}

.ui-slider-vertical {
	width: .8em;
	height: 100px;
}
.ui-slider-vertical .ui-slider-handle {
	left: -.3em;
	margin-left: 0;
	margin-bottom: -.6em;
}
.ui-slider-vertical .ui-slider-range {
	left: 0;
	width: 100%;
}
.ui-slider-vertical .ui-slider-range-min {
	bottom: 0;
}
.ui-slider-vertical .ui-slider-range-max {
	top: 0;
}

.wpview {
	box-sizing: border-box
}

/* Pointer */

.wp-pointer-content {
	border: 1px solid @general_borders;
	border-radius: 4px;
	background-color: @primary_content_bg;
	box-shadow: rgba(0,0,0,0.2) 0 12px 32px;
}

.wp-pointer-content h3 {
	background-color: @link_normal;
	color: @section_heading;
	margin: -1px -1px 20px -1px;
	border: 0;
	padding: 20px 20px 20px 60px;
	border-radius: 4px 4px 0 0;
}

.wp-pointer-content h3:before {
	background-color: @section_heading;
	color: @link_normal;
	top: 14px;
    left: 20px;
}

.wp-pointer-content p {
	padding: 0 20px;
	margin: 0 0 20px 0;
}

.wp-pointer-top .wp-pointer-arrow-inner, .wp-pointer-undefined .wp-pointer-arrow-inner {
	border-bottom-color: @link_normal;
}

.wp-pointer-buttons a.close:hover:before {
	color: @link_hover;
}

.wp-pointer-buttons a.close:before {
	color: @link_normal;
}

#woocommerce-coupon-data .panel-wrap, #woocommerce-product-data .panel-wrap {
	background-color: @primary_content_bg;
}

/* Debug */

.sailor-wrapper > font > .xdebug-error,
.sailor-wrapper > .xdebug-var-dump {
	margin: 64px 0 0 220px;
}
