@import '../../../libraries/wp-conditions/assets/css/wp-conditions';

@mixin transition($duration) {
	-webkit-transition: $duration;
	-moz-transition: $duration;
	-ms-transition: $duration;
	-o-transition: $duration;
	transition: $duration;
}

// General sizing
.wapl-meta-box-wrap,
.wapl-title-text-wrap {
	margin-right: 300px;
	width: 100%;
	max-width: 1200px;

	@media only screen and (max-width: 850px) {
		width: 100%;
		margin-right: 0;
		min-width: 0;
	}
}


/**************************************************************
 * Settings
 *************************************************************/
// Title field
.wapl-title-text {
	padding: 3px 8px;
	font-size: 1.7em;
	line-height: 100%;
	height: 1.7em;
	width: 100%;
	outline: none;
	margin: 0 0 3px;
	background-color: #fff;
}

// settings
.wapl-meta-box {
	display: grid;
	grid-template-columns: 1fr 1fr;

	@media (max-width: 782px) {
		grid-template-columns: 1fr;
	}
}

.wapl-column {
	display: inline-block;
	height: 100%;
	margin-right: 2%;
	vertical-align: top;
}

.wapl-meta-box input,
.wapl-meta-box select {
	align-self: start;
}

.wapl-global-option {
	display: grid;
	grid-auto-flow: column;
	padding: 7px 5px;
	grid-template-columns: 1fr 1fr;
	align-items: center;

	label {
		align-self: baseline;
		height:30px;
		line-height: 30px;
	}
}

// Expand
.wpc-expand-wrap {

	&.wpc-container-expanded {
		.wpc-toggle-expand:after {
			content: "\f347";
		}
	}
	.wpc-toggle-expand:after {
		content: "\f341";
		font-family: 'Dashicons';
		vertical-align: middle;
		font-size: 1.5em;
	}
}


/* Label settings */

.wp-picker-container input,
.wp-picker-container label {
	width: auto;
}
.wp-picker-container, .wp-picker-container:active {
	display: inline-block;
}

.wapl-toggle-advanced {
	cursor: pointer;
}
.align-custom-show {

	div {
		@media all and (max-width: 1120px) {
			display: grid;
			grid-template-columns: 1fr 1fr;
			row-gap: 14px;

			input { width: 100% !important; }
		}
	}
}

/*******************
 * Preview
 ******************/

h2.wapl-preview-title {
	margin-top: 5px !important;
	padding-left: 0 !important;
}
#wapl-global-preview,
#wapl-label-preview {
	position: relative;
	display: inline-block;
}
.label-wrap {
	float: none !important;
}
.wapl-label.wapl-alignright {
	float: none;
	text-align: right;
}
.wapl-label.wapl-alignleft {
	float: none;
	text-align: left;
}
.wapl-label.wapl-aligncenter {
	margin: initial;
	float: none;
	text-align: center;
}
#woocommerce_advanced_product_labels #wapl-label-preview p {
	padding-left: 0px;
}

.label-wrap.wapl-aligncustom {
	pointer-events: initial;
	cursor: move;
}

.color-custom-hidden,
.label-color-custom .color-custom-show,
.type-custom .type-custom-show,
.align-custom .align-custom-show,
.type-custom-hidden {
	display: grid;
}

.label-color-custom .color-custom-hidden,
.color-custom-show,
.type-custom-show,
.align-custom-show,
.type-custom .type-custom-hidden {
	display: none;
}
/**********************
 * Product Label
 *********************/
#woocommerce_advanced_product_labels .options_group input[type='text'],
#woocommerce_advanced_product_labels .options_group select {
	width: 50% !important;
}
@media all and (min-width: 1500px) {
	#woocommerce_advanced_product_labels .options_group input[type='text'],
	#woocommerce_advanced_product_labels .options_group select {
		width: 80% !important;
	}
}
@media all and (max-width: 1500px) {
	#woocommerce_advanced_product_labels .wapl-column {
		width: 100% !important;
	}
}
#woocommerce_advanced_product_labels {

	.color-custom-hidden,
	&.label-color-custom .color-custom-show,
	&.type-custom .type-custom-show,
	&.align-custom .align-custom-show,
	.type-custom-hidden {
		display: block;
	}
	.wp-picker-input-wrap label {
		float: unset;
		margin: unset;
		width: unset;
		display: block;
	}

	#wapl-variables a {
		text-decoration: none;
	}
}

/* Hide visibility from admin */
.post-type-wapl .misc-pub-visibility#visibility {
	display: none;
}


.show-if-advanced {
	display: none;
}
.advanced-enabled ~ .show-if-advanced {
	display: unset;
}

.CodeMirror {
	min-height: 100px;
	height: fit-content !important
}

.product-label:active,
.product-label:focus {
	//border-color: #2271b1;
    color: #0a4b78;
    box-shadow: 0 0 0 1px #2271b1;
}
