/**
 * 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 );
				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 {

	.wpc-value.select2-container {
		display: inline-block !important;
		margin: 1px;

		&.select2-container-active .select2-choice {
			border: 1px solid #666;
		}
		&.select2-drop-above .select2-choice {
			border-radius: 0 0 4px 4px;
			border: 1px solid #666;
			border-top-color: rgba(0, 0, 0, 0);
		}
		.select2-choice {
			border-color: #ddd;
			-webkit-border-radius: 5px;
			-moz-border-radius: 5px;
			border-radius: 5px;
			height: 26px;
			-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
			box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
		}
	}
	.wpc-value.select2-dropdown-open .select2-choice {
		border-bottom-color: rgba(0, 0, 0, 0);
		-webkit-box-shadow: 0 1px 0 #fff inset;
		box-shadow: 0 1px 0 #fff inset;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
		border: 1px solid #666;
		outline: 0;
	}

	// WC 2.7+
	.select2-container .select2-selection--single {
		height: 28px !important;

		#select2--container,
		.select2-selection__arrow {
			line-height: 26px;
		}
		.select2-selection__arrow { height: 28px; }
	}
}

/************************
 * 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: 27px;
	box-sizing: border-box;
	color: #555;
	text-align: center;
	background-color: #EEE;
	border: 1px solid #DDD;
	border-right: none;
	border-radius: 4px 0px 0px 4px;
	margin: 1px 0px 1px 1px;
	display: inline-block;

	& + input {
		margin-left: -4px;
		line-height: 19px ;
		width: 161px !important;
	}

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