/*
 * Country code picker in the enquiry forms' phone box (phone-country.js,
 * edge_phone_field() in functions.php). The phone box keeps each form's own
 * styling; the flag + code button sits over its left edge.
 */

.phone-field {
	position: relative;
	display: block;
}

/* phone-country.js sets the exact left padding from the button's width; this is the fallback. */
.phone-field.has-country > input[type="tel"] {
	padding-left: 88px !important;
}

.phone-field .phone-field__country {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 5px;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0 8px 0 11px;
	border: 0;
	border-right: 1px solid #e3e7ee;
	border-radius: 5px 0 0 5px;
	background: transparent;
	color: #1d2b3e;
	font: 500 14px/1 'DM Sans', Arial, sans-serif;
	letter-spacing: 0;
	cursor: pointer;
	transform: none;
	box-shadow: none;
}

.phone-field .phone-field__country:hover,
.phone-field .phone-field__country[aria-expanded="true"] {
	background: rgba(255, 89, 0, 0.06);
	transform: none;
}

.phone-field .phone-field__country:focus-visible {
	outline: 2px solid #ff5900;
	outline-offset: -2px;
}

.phone-field__code {
	text-align: left;
}

.phone-field__chevron {
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-right: 1.5px solid #788392;
	border-bottom: 1.5px solid #788392;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.phone-field__country[aria-expanded="true"] .phone-field__chevron {
	margin-top: 3px;
	transform: rotate(225deg);
}

.phone-flag {
	flex: none;
	display: inline-block;
	width: 20px;
	height: 15px;
	border-radius: 2px;
	background-color: #e3e7ee;
	background-repeat: no-repeat;
	background-size: 320px auto;
	box-shadow: 0 0 0 1px rgba(12, 22, 39, 0.08);
}

/* The country list. */
.phone-panel {
	position: fixed;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	padding: 8px;
	border: 1px solid #e3e7ee;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 18px 40px -16px rgba(12, 22, 39, 0.35);
	font-family: 'DM Sans', Arial, sans-serif;
	color: #1d2b3e;
	box-sizing: border-box;
}

.phone-panel *,
.phone-panel *::before {
	box-sizing: border-box;
}

.phone-panel .phone-panel__search {
	width: 100%;
	height: 40px;
	margin: 0 0 6px;
	padding: 0 12px;
	border: 1px solid #dbe1eb;
	border-radius: 6px;
	background: #f5f6f9;
	color: #1d2b3e;
	font: 400 16px/1.2 'DM Sans', Arial, sans-serif;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.phone-panel input.phone-panel__search:focus,
.phone-panel input.phone-panel__search:focus-visible {
	border-color: #ff5900;
	background: #fff;
	outline: none;
}

.phone-list {
	max-height: 260px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

.phone-list li[role="option"] {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.35;
	cursor: pointer;
}

.phone-list__name {
	flex: 1;
	min-width: 0;
}

.phone-list__dial {
	color: #788392;
}

.phone-list li[aria-selected="true"] {
	color: #ff5900;
	font-weight: 600;
}

.phone-list li.is-active {
	background: #ff5900;
	color: #fff;
}

.phone-list li.is-active .phone-list__dial {
	color: rgba(255, 255, 255, 0.85);
}

.phone-list__divider {
	height: 1px;
	margin: 6px 4px;
	background: #e3e7ee;
}

.phone-list__empty {
	padding: 12px 10px;
	font-size: 14px;
	color: #788392;
}
