/* Visalia · Prefijo teléfono (GV-184) — Figma «Prefijo · Desplegable» */

.vp-iti,
.vp-iti-dropdown {
	--vp-texto: #3f3f50;      /* Neutrals/Base */
	--vp-texto-2: #717181;    /* Neutrals/40 */
	--vp-fondo: #f9f9fc;      /* Neutrals/05 */
	--vp-filete: #d2d2de;     /* Neutrals/20 */
	--iti-flag-width: 20px;
	--iti-hover-color: transparent;
	--iti-border-color: transparent;
	--iti-icon-color: var(--vp-texto);
}

/* ---------- Campo ---------- */

.vp-iti:not(.vp-iti-dropdown) {
	display: block;
	width: 100%;
}

.vp-iti .iti__selected-country {
	gap: 4px;
	padding: 0 0 0 14px; /* mismo padding lateral que el input actual */
	cursor: pointer;
}

/* Orden del diseño: bandera · +34 · chevron · filete */
.vp-iti .iti__selected-country-primary {
	display: contents;
}

/* Filete separador: 12px de aire a la izquierda, 22px de alto */
.vp-iti .iti__selected-country::after {
	content: "";
	order: 3;
	display: block;
	width: 1px;
	height: 22px;
	margin: 0 6px 0 8px;
	background: var(--vp-filete);
}

.vp-iti .iti__selected-dial-code {
	order: 1;
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--vp-texto);
}

/* Chevron 20px (sustituye la flecha de la librería) */
.vp-iti .iti__arrow {
	order: 2;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 0;
	transform: none;
	background-color: var(--vp-texto);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
}

.vp-iti .iti__arrow--up {
	margin: 0;
	transform: rotate(180deg);
}

.vp-iti .iti__selected-country:focus-visible {
	outline: 2px solid #0089c4;
	outline-offset: -2px;
	border-radius: 4px;
}

/* Bandera 20×14, radio 2, filete 0,5px */
.vp-iti .iti__flag,
.vp-iti-dropdown .iti__flag {
	height: 14px;
	border-radius: 2px;
	box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
	background-position-y: center;
}

/* ---------- Desplegable (montado en <body> para salir del modal) ---------- */

.vp-iti-dropdown.iti--detached-country-selector {
	z-index: 100010; /* por encima del popup de Impreza (10002) */
	margin-top: 1px;  /* 3px de la librería + 1px = 4px del diseño */
}

.vp-iti-dropdown .iti__country-selector {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	background: #fff;
	border: 0;
	border-radius: 8px;
	box-shadow: 0 2px 16px rgba(43, 86, 129, 0.08);
	height: 280px !important; /* alto del componente en Figma; la librería fija otro medido con sus estilos por defecto */
	font-family: "Titillium Web", sans-serif;
	font-size: 14px;
	line-height: 1.6;
	overflow: hidden;
}

/* Buscador */
.vp-iti-dropdown .iti__search-input-wrapper {
	border: 0;
}

.vp-iti-dropdown .iti__search-icon {
	left: 16px;
}

.vp-iti-dropdown .iti__search-icon-svg {
	width: 24px;
	height: 24px;
	stroke: var(--vp-texto-2);
	stroke-width: 2;
}

.vp-iti-dropdown input.iti__search-input {
	height: auto;
	margin: 0;
	padding: 10px 36px 10px 52px; /* 16 + icono 24 + 12 */
	border: 0;
	border-radius: 100px;
	background: var(--vp-fondo);
	box-shadow: none;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.6;
	color: var(--vp-texto);
}

.vp-iti-dropdown input.iti__search-input::placeholder {
	color: var(--vp-texto-2);
	opacity: 1;
}

.vp-iti-dropdown input.iti__search-input:focus {
	outline: none;
	box-shadow: none;
}

.vp-iti-dropdown .iti__search-clear {
	right: 12px;
}

/* Lista: ocupa el resto de los 280px (como en Figma, la 5.ª fila queda cortada para invitar a hacer scroll) */
.vp-iti-dropdown .iti__country-list {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8px;
	min-height: 0;
	height: auto;
	max-height: none;
	scrollbar-width: thin;
	scrollbar-color: var(--vp-filete) transparent;
	overflow-x: hidden;
	overflow-y: auto;
}

.vp-iti-dropdown .iti__country {
	flex-shrink: 0;
	gap: 4px;
	padding: 6px 12px;
	border-radius: 100px;
	background: var(--vp-fondo);
	color: var(--vp-texto-2);
	min-height: 36px;
}

.vp-iti-dropdown .iti__country-list .iti__flag {
	margin-right: 4px;
}

.vp-iti-dropdown .iti__country-name {
	flex-grow: 1;
	color: inherit;
}

.vp-iti-dropdown .iti__dial-code {
	margin-left: 4px;
	color: inherit;
}

/* Resaltado (ratón / teclado) y seleccionado: texto oscuro, mismo fondo que el diseño */
.vp-iti-dropdown .iti__country.iti__highlight,
.vp-iti-dropdown .iti__country:hover {
	background: var(--vp-fondo);
	color: var(--vp-texto);
}

.vp-iti-dropdown .iti__country[aria-selected="true"] {
	color: var(--vp-texto);
}

.vp-iti-dropdown .iti__country-check {
	width: 24px;
	height: 24px;
	margin-left: 4px;
	background-color: var(--vp-texto);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 12.5l3 3 6-6.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 12.5l3 3 6-6.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}

.vp-iti-dropdown .iti__country-check-svg {
	display: none;
}

.vp-iti-dropdown .iti__no-results {
	padding: 16px 0;
	color: var(--vp-texto-2);
}
