@use "sass:math" as math;

// ------------------------------------
// CHECKOUT SHIPPING METHODS
// ------------------------------------

.woocommerce .fc-shipping-method__no-shipping-methods {
	border: $shipping-method-border;
	border-radius: $shipping-method-border-radius;
	border-color: $error-color;
	color: $error-color;
	padding: $shipping-method-padding-vertical $shipping-method-padding-horizontal;
}



#shipping_method.shipping-method__options {
	list-style-type: none;
	margin: 0;
	padding: 0;
	border: $shipping-method-border;
	border-radius: $shipping-method-border-radius;
	overflow: hidden;
}



.woocommerce ul#shipping_method li.shipping-method__option {
	display: block;
	margin: 0 0 $shipping-method-space-between-options;
	padding: 0;
	text-indent: 0;
	line-height: 1.6;
}



// Hide default radio elements with opacity to allow for keyboard navigation
.shipping-method__option input[type="radio"] {
	position: absolute;
	display: block;
	width: 1px;
	height: 1px;
	opacity: 0;
}



.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-label {
	position: relative;
	display: block;
	margin: 0;
	padding-top: $shipping-method-padding-vertical;
	padding-bottom: $shipping-method-padding-vertical;
	padding-#{ $alignment-left }: #{ $shipping-method-padding-horizontal + $shipping-method-radio-size + $global-spacing-extra-small };
	padding-#{ $alignment-right }: #{ $shipping-method-padding-horizontal + $shipping-method-price-width };
	width: 100%;
	background-color: $shipping-method-background-color;
	border-bottom: $shipping-method-border;
	font-weight: $shipping-method-font-weight;
	cursor: pointer;
	text-align: #{ $alignment-left };
	line-height: $shipping-method-radio-size;
	transition: all $global-animation-duration-fast linear;
}
.woocommerce ul#shipping_method .shipping-method__option:last-child .shipping-method__option-label {
	border-bottom: none;
}

.woocommerce ul#shipping_method .shipping-method__option input[type="radio"]:checked + .shipping-method__option-label {
	background-color: $shipping-method-checked-background-color;
	color: $shipping-method-checked-color;
}



.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-label:before {
	box-sizing: border-box;
	content: '';
	position: absolute;
	top: $shipping-method-padding-vertical;
	#{ $alignment-left }: $global-spacing-extra-small;
	#{ $alignment-right }: auto;
	display: block;
	width: $shipping-method-radio-size;
	height: $shipping-method-radio-size;
	border: $shipping-method-radio-border;
	border-radius: 100%;
	background-color: transparent;
	box-shadow: none;
	transition: all $global-animation-duration-fast linear;
}

.woocommerce ul#shipping_method .shipping-method__option input[type="radio"]:checked + .shipping-method__option-label:before {
	border-color: $success-color;
	background-color: $success-color;
}
.woocommerce ul#shipping_method .shipping-method__option input[type="radio"]:focus + .shipping-method__option-label:before {
	outline: $focus-outline-field;
	outline-offset: $focus-outline-offset-field;
}

.woocommerce ul#shipping_method .shipping-method__option.shipping-method__option .shipping-method__option-label:hover {
	background-color: $shipping-method-checked-background-color;
}
.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-label:hover:before,
.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-label:focus:before {
	border-color: darken( $shipping-method-border-color, 15% );
}

.woocommerce ul#shipping_method .shipping-method__option input[type="radio"] + .shipping-method__option-label:after {
	@include icon( 'i-check-small' );
	@include icon-size( $shipping-method-radio-size );

	position: absolute;
	top: $shipping-method-padding-vertical;
	#{ $alignment-left }: $global-spacing-extra-small;
	#{ $alignment-right }: auto;

	color: transparent;
}
.woocommerce ul#shipping_method .shipping-method__option input[type="radio"]:checked + .shipping-method__option-label:after {
	color: $white;
}



.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-description {
	display: block;
	width: 100%;
	font-size: $font-size-extra-small;
}



.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-price {
	position: absolute;
	top: $shipping-method-padding-vertical;
	#{ $alignment-left }: auto;
	#{ $alignment-right }: $shipping-method-padding-horizontal;
	display: block;
	text-align: right;
}
.woocommerce ul#shipping_method .shipping-method__option .has-tax-notes .shipping-method__option-price {
	top: #{ math.div( $shipping-method-padding-vertical, 2 ) };
	line-height: 1.2;
}

.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-price .amount {
	display: block;
	font-weight: $shipping-method-price-font-weight;
}

.woocommerce ul#shipping_method .shipping-method__option .shipping-method__option-price .tax_label {
	display: block;
}
