/**
 * WP-Conditions 1.0.0
 */

/**************************************************************
 * Conditions
 *************************************************************/
.wpc-condition-groups {

	// Condition group
	.wpc-condition-group {
		background-color: #f5f5f5;
		padding: 15px;
		border: 1px solid #e5e5e5;
		-webkit-box-shadow: 0 1px 1px rgba( 0, 0, 0, .04 );
		box-shadow: 0 1px 1px rgba( 0, 0, 0, .04 );
		min-height: 30px;
		margin: 0 -13px 1.5em;

		&:hover {
			.wpc-condition-group-actions {
				opacity: 1;
			}
		}

		.wpc-condition-group-actions {
			opacity: 0;
			margin: -10px -10px 0 0;
			font-size: 80%;

			a {
				text-decoration: none;

				&.delete {
					color: #a00;

					&:hover {
						color: #f00;
					}
				}
			}
		}

		// Condition row
		.wpc-condition-wrap {
			margin: 10px 0 5px;

			.wpc-condition {
				width: 35%;
			}
			.wpc-operator {
				width: 22.5%;
				//min-width: 140px;
			}
			.wpc-value {
				width: calc( 42.5% - 75px );
				max-width: unset;
				height: 28px;
			}
			.wpc-description {
				float: right;

				.woocommerce-help-tip {
					height: 28px;
					line-height: 28px;

					&:after {
						line-height: 28px;
					}
				}
			}
			input {
				vertical-align: top;
			}
		}
	}

	.clearfix:after {
		content: " ";
		display: block;
		height: 0;
		clear: both;
	}

	/* Add / delete icon */
	.wpc-add.button {
		//font-weight: 500;

		&:before {
			font-family: 'dashicons';
			content: "\f502";
			vertical-align: middle;
			height: 1.2em;
			line-height: 1;
			display: inline-block;
			margin-right: 5px;
			color: #667;
		}
	}
	.wpc-condition-delete.button {
		font-weight: 600;
		width: 30px;
		text-align: center;
		padding: 0;

		&:before {
			font-family: 'dashicons';
			content: "\f460";
			vertical-align: middle;
			height: 1.2em;
			line-height: 1;
			display: inline-block;
			color: #667;
		}
	}

	& > p + .wpc-condition-group-wrap p.or-text {
		display: none;
	}
	.or-text {
		margin: 1.5em 0;
	}
	.match-text {
		margin: 0 0 1em;
	}

	// Delete button
	.wpc-condition-delete {
		display: none;
		opacity: 0;
		transition: opacity .3s ease-in-out;
	}
	.wpc-condition-wrap:hover .wpc-condition-delete {
		display: inline-block;
		opacity: 1;
	}

	// Load icon
	.wpc-condition-wrap.loading {
		height: 30px;

		.loading-icon {
			width: 100%;
			clear: both;
			display: block;
			text-align: center;
			line-height: 110%;
			margin: 0 1px;
		}
	}
}


/**************************************************************
 * Select2
 *************************************************************/
.wpc-condition-wrap {

	.select2-container {
		vertical-align: top;

		.select2-selection--single {
			height: 28px;
			margin: 1px;

			.select2-selection__rendered,
			.select2-selection__arrow {
				line-height: 26px;
				height: 28px;
			}
		}
		@media screen and ( max-width: 782px ) {
			.select2-selection--single {
				height: 36px;

				.select2-selection__rendered,
				.select2-selection__arrow {
					line-height: 36px;
					height: 36px;
				}
			}
		}
		.select2-selection--multiple .select2-selection__choice {
			margin: 4px 5px 0 0;
			line-height: 12px;
			font-size: 11px;
			font-weight: 600;
		}
	}
	.select2-container--default.select2-container--focus .select2-selection--multiple {
		border-color: #aaa;
	}
	.select2-container .select2-selection--multiple {
		line-height: 0.7;
	}
}

/************************
 * Table / overview
 ***********************/
.wpc-conditions-post-table {

	.sort {
		padding: 0 4px;
		cursor: move;
		text-align: center;
		vertical-align: middle;

		&:before {
			content: "\e032";
			font-family: WooCommerce;
			text-align: center;
			line-height: 1;
			color: #999;
			display: block;
			width: 100%;
			float: left;
			height: 100%;
		}
	}
	.sort:before,
	.row-actions {
		visibility: hidden !important;
	}
	tr:hover .sort:before,
	tr:hover > td > .row-actions {
		visibility: visible !important;
	}

	/* WooCommerce Add icon */
	.add.button:before {
		font-family: WooCommerce;
		speak: none;
		font-weight: 400;
		font-variant: normal;
		text-transform: none;
		line-height: 1;
		-webkit-font-smoothing: antialiased;
		margin-right: 7px;
		content: "\e007";
	}
}
@media screen and (max-width: 782px) {
	.wpc-conditions-post-table {

		th {
			padding: 8px;
		}
		td {
			padding: 8px 10px;
		}
		tfoot .button {
			margin-bottom: 0;
		}
	}
}

// Currency
.wpc-currency {
	padding: 3px 10px;
	font-size: 14px;
	font-weight: 400;
	line-height: 19px;
	height: 30px;
	box-sizing: border-box;
	color: #555;
	text-align: center;
	background-color: #EEE;
	border: 1px solid #8c8f94;
	border-right: none;
	border-radius: 4px 0px 0px 4px;
	margin: 1px 0px 1px 1px;
	display: inline-block;
	vertical-align: middle;

	& + input {
		margin-left: -4px;
		line-height: 19px;
		width: 161px !important;
		border-left: unset;
		border-radius: 0 4px 4px 0;
		vertical-align: middle;
	}

	@media screen and (max-width: 782px) {
		font-size: 16px;
		padding: 6px 10px;
		height: 33px;
	}
}
