/* Searchable country code on phone fields. */

.phone-country {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.phone-country.is-open {
	z-index: 40;
}

.phone-country__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex: none;
	margin: 0;
	padding: 5px 8px;
	border: 1px solid #e4e4e7;
	border-radius: 6px;
	background: #fff;
	color: #8b909a;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
}

.phone-country__trigger:hover,
.phone-country__trigger:focus-visible {
	border-color: #c8c8ce;
	color: #5c6370;
	outline: none;
}

.phone-country__trigger:focus-visible {
	outline: 2px solid var(--wimira-red, #e22c28);
	outline-offset: 2px;
}

.phone-country__code {
	font-variant-numeric: tabular-nums;
}

.phone-country__chevron {
	display: block;
	flex: none;
}

.phone-country.is-open .phone-country__chevron {
	transform: rotate(180deg);
}

.phone-country > input[type="tel"] {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.phone-country__menu {
	position: absolute;
	z-index: 41;
	top: calc(100% + 6px);
	left: 0;
	width: min(320px, calc(100vw - 32px));
	padding: 8px;
	border: 1px solid rgba(18, 21, 38, 0.12);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(18, 21, 38, 0.14);
	box-sizing: border-box;
}

.phone-country__menu.is-up {
	top: auto;
	bottom: calc(100% + 6px);
}

.phone-country__search,
.co-form--inquiry .phone-country__search,
.co-contact-form .wpcf7-form .co-form--inquiry .phone-country__search,
.crm-landing-form .phone-country__search,
.cap-p-form .phone-country__search {
	display: block;
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid rgba(18, 21, 38, 0.16);
	border-bottom: 1px solid rgba(18, 21, 38, 0.16);
	border-radius: 8px;
	background: #fff;
	color: #121526;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	box-shadow: none;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.phone-country__search:focus,
.co-form--inquiry .phone-country__search:focus,
.co-contact-form .wpcf7-form .co-form--inquiry .phone-country__search:focus,
.crm-landing-form .phone-country__search:focus,
.cap-p-form .phone-country__search:focus {
	outline: none;
	border-color: var(--wimira-red, #e22c28);
	border-bottom-color: var(--wimira-red, #e22c28);
	box-shadow: none;
}

.phone-country__list {
	max-height: 220px;
	margin: 8px 0 0;
	padding: 0;
	overflow: auto;
}

.phone-country__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #121526;
	font: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}

.phone-country__option[hidden],
.phone-country__empty[hidden] {
	display: none !important;
}

.phone-country__option:hover,
.phone-country__option.is-active {
	background: rgba(226, 44, 40, 0.08);
}

.phone-country__option.is-selected .phone-country__name {
	font-weight: 600;
}

.phone-country__dial {
	flex: none;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

.phone-country__empty {
	margin: 8px 0 0;
	padding: 8px 10px;
	color: #5b6070;
	font-size: 13px;
	line-height: 1.4;
}

/* Contact, careers, and CRM underline fields. */
.co-form--inquiry .phone-country,
.crm-landing-form .phone-country,
.co-contact-form .phone-country {
	border-bottom: 1px solid rgba(18, 21, 38, 0.35);
}

.co-form--inquiry .phone-country:focus-within,
.crm-landing-form .phone-country:focus-within,
.co-contact-form .phone-country:focus-within {
	border-bottom-color: var(--wimira-red, #e22c28);
}

.co-form--inquiry .phone-country > input[type="tel"],
.co-contact-form .wpcf7-form .co-form--inquiry .phone-country > input[type="tel"],
.crm-landing-form .phone-country > input[type="tel"] {
	width: auto;
	padding: 10px 0 12px;
	border: 0;
	border-bottom: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.crm-landing-form .phone-country > input[type="tel"] {
	padding: 8px 0 10px;
}

.co-form--inquiry .phone-country:has(input.wpcf7-not-valid),
.crm-landing-form .phone-country:has(input.wpcf7-not-valid) {
	border-bottom-color: var(--wimira-red, #e22c28);
}

/* Boxed phone fields (partnership forms). */
.cap-p-form .phone-country {
	min-height: 48px;
	padding: 0 10px;
	border: 1px solid rgba(18, 21, 38, 0.14);
	border-radius: 10px;
	background: #fff;
}

.cap-p-form .phone-country:focus-within {
	outline: 2px solid rgba(43, 108, 232, 0.25);
	border-color: var(--cap-blue, #2b6ce8);
}

.cap-p-form .phone-country > input[type="tel"] {
	width: auto;
	min-height: 0;
	padding: 12px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.cap-p-form .phone-country__search {
	min-height: 0;
	padding: 8px 10px;
}

/* Dark homepage contact field. */
.section--contact .phone-country {
	height: 56px;
	align-items: flex-end;
	padding-bottom: 7px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.section--contact .phone-country:focus-within {
	border-bottom-color: #fff;
}

.section--contact .formrow--has-country > .form__label {
	left: 86px;
}

.section--contact .phone-country > input.form__input {
	height: auto;
	padding: 0 16px 0 0;
	border: 0;
	border-bottom: 0;
	background: transparent;
	color: #fff;
}

.section--contact .phone-country__trigger {
	margin-bottom: 2px;
	border-color: rgba(255, 255, 255, 0.35);
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
}

.section--contact .phone-country__trigger:hover,
.section--contact .phone-country__trigger:focus-visible {
	border-color: #fff;
	color: #fff;
}
