// ------------------------------------
// CHECKOUT VALIDATION MESSAGES
// ------------------------------------

div.woocommerce .form-row .woocommerce-error:not( .invalid-country-not-allowed ) {
	display: none;
}

div.woocommerce .form-row.woocommerce-invalid .woocommerce-error {
	display: block;
}



div.woocommerce .form-row .woocommerce-error,
div.woocommerce .shipping-method__package .woocommerce-error,
div.woocommerce .form-row .fc-mailcheck-suggestion {
	z-index: z( 'default' ) + 1;
	position: relative;
	margin: 0;
	padding: $checkout-message-error-padding;
	padding-#{ $alignment-left }: $checkout-message-error-padding-left;
	min-height: auto;
	border: 0;
	background-color: $checkout-message-error-background-color;
	font-size: $font-size-extra-small;
	text-align: #{ $alignment-left };
	line-height: 1.6;
	animation: none;
	transform: none;
}

div.woocommerce .form-row .fc-mailcheck-suggestion {
	padding: $checkout-message-suggestion-padding;
}

div.woocommerce .form-row .fc-mailcheck-suggestion .mailcheck-suggestion {
	&:focus {
		outline: $focus-outline-link !important; // Needed to override theme styles
		outline-offset: $focus-outline-offset-link !important; // Needed to override theme styles
	}
}

div.woocommerce .form-row .woocommerce-error,
div.woocommerce .shipping-method__package .woocommerce-error {
	color: $checkout-message-error-color;
}

div.woocommerce .shipping-method__package .woocommerce-error {
	padding-#{ $alignment-left }: calc( #{ $global-spacing-extra-small } + #{ $option-box-radio-size } + #{ $option-box-padding-horizontal } + remsize( .1rem ) );
	background-color: transparent;
}



div.woocommerce .form-row .woocommerce-error:before,
div.woocommerce .shipping-method__package .woocommerce-error:before {
	@include icon( $checkout-message-error-icon );
	@include icon-size( $checkout-message-error-icon-size );

	position: absolute;
	top: $checkout-message-error-icon-position-top;
	#{ $alignment-left }: $checkout-message-error-icon-position-left;
	transform: translateY( -50% );
	color: inherit;
}

div.woocommerce .shipping-method__package .woocommerce-error:before {
	#{ $alignment-left }: $global-spacing-extra-small + $global-spacing-tiny;
}



div.woocommerce .form-row .woocommerce-error:after,
div.woocommerce .shipping-method__package .woocommerce-error:after {
	display: none;
}





// ------------------------------------
// CHECKOUT FIELD VALIDATION
// ------------------------------------

// VALID FIELDS
div.woocommerce form .form-row.woocommerce-validated:not( [class*='woocommerce-invalid'] ) {
	textarea,
	select,
	input[type="email"],
	input[type="number"],
	input[type="search"],
	input[type="text"],
	input[type="date"],
	input[type="tel"],
	input[type="url"],
	input[type="password"],
	.select2-selection {
		border-color: $success-color;
	}
}

// INVALID FIELDS
div.woocommerce form .form-row[class*='woocommerce-invalid'] {
	textarea,
	select,
	input[type="email"],
	input[type="number"],
	input[type="search"],
	input[type="text"],
	input[type="date"],
	input[type="tel"],
	input[type="url"],
	input[type="password"],
	.select2-selection {
		border-color: $error-color;
	}
}
div.woocommerce form .shipping-method__package[class*='woocommerce-invalid'] {
	#shipping_method.shipping-method__options {
		border-color: $error-color;
	}
}
