/* Country picker for the phone field (phone-input.js). Colours and sizes follow
   .contacts-form in src/scss/components/forms.scss: label 20px + 4px gap, field 48px, radius 8px. */

.fol-phone-group {
	position: relative;
}

.contacts-form__middle input.fol-phone-input {
	padding-left: 64px;
}

.fol-phone__toggle {
	position: absolute;
	top: 25px; /* label line 20px + margin 4px + field border 1px */
	left: 1px;
	height: 46px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px 0 14px;
	background: transparent;
	border: 0;
	border-right: 1px solid rgba(0, 0, 0, .10);
	border-radius: 7px 0 0 7px;
	color: rgba(0, 0, 0, .40);
	cursor: pointer;
}

.fol-phone__toggle:hover,
.fol-phone.is-open .fol-phone__toggle {
	background-color: rgba(127, 90, 240, .06);
}

.fol-phone__toggle:focus-visible {
	outline: 2px solid rgba(127, 90, 240, 1);
	outline-offset: -2px;
}

.fol-phone__flag,
.fol-phone__option img {
	display: block;
	width: 20px;
	height: 15px;
	flex: none;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.fol-phone__arrow {
	transition: transform .2s;
}

.fol-phone.is-open .fol-phone__arrow {
	transform: rotate(180deg);
}

.fol-phone__panel {
	position: absolute;
	top: 76px; /* under the field */
	left: 0;
	right: 0;
	z-index: 30;
	padding: 8px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .10);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}

.fol-phone__panel[hidden] {
	display: none;
}

.contacts-form .fol-phone__search {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, .10);
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
	line-height: 18px;
}

.contacts-form .fol-phone__search:focus {
	outline: none;
	border-color: rgba(127, 90, 240, 1);
}

.fol-phone__list {
	max-height: 240px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.fol-phone__list li[hidden] {
	display: none;
}

.fol-phone__option {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: rgba(0, 0, 0, .80);
	font-size: 14px;
	line-height: 18px;
	text-align: left;
	cursor: pointer;
}

.fol-phone__option:hover,
.fol-phone__option:focus-visible {
	background-color: rgba(127, 90, 240, .08);
	outline: none;
}

.fol-phone__list [aria-selected="true"] .fol-phone__option {
	font-weight: 600;
	color: rgba(0, 0, 0, 1);
}

.fol-phone__name {
	flex: 1;
	min-width: 0;
}

.fol-phone__code {
	flex: none;
	color: rgba(0, 0, 0, .60);
}
