/**
 * Scoped Select2 compatibility for calculator address controls.
 *
 * @package CommunicationAds_Elementor
 * @since   2.8.0
 */

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc) .select2-container {
	width: 100% !important;
	max-width: 100%;
	font: inherit;
}

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default
	.select2-selection--single {
	min-height: 42px;
	border: 1px solid var(--ca-border-color, #cbd5e1);
	border-radius: var(--ca-field-radius, 8px);
	background: #fff;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default.select2-container--focus
	.select2-selection--single,
:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default.select2-container--open
	.select2-selection--single {
	border-color: var(--ca-primary-color, #ff7620);
	box-shadow: 0 0 0 3px rgb(255 118 32 / 16%);
	outline: 0;
}

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default
	.select2-selection--single
	.select2-selection__rendered {
	padding: 6px 42px 6px 12px;
	color: var(--ca-text-color, #172033);
	line-height: 28px;
}

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default
	.select2-selection--single
	.select2-selection__arrow {
	top: 7px;
	right: 8px;
	width: 28px;
	height: 28px;
}

:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
	.select2-container--default
	.select2-selection--single
	.select2-selection__arrow
	b {
	display: block;
	border-color: #64748b transparent transparent;
}

.ca_calc_postcode_city_search {
	min-height: 38px;
	border: 1px solid #cbd5e1 !important;
	border-radius: 6px;
	outline: 0;
}

.ca_calc_postcode_city_search:focus {
	border-color: var(--ca-primary-color, #ff7620) !important;
	box-shadow: 0 0 0 3px rgb(255 118 32 / 16%);
}

@media (prefers-reduced-motion: reduce) {
	:where(:is(#ca_calc, .ca-calc-root), .ca-elementor-widget.ca_calc)
		.select2-container--default
		.select2-selection--single {
		transition: none;
	}
}
