/* Servicios Fénix: desplegables con el diseño de la marca en todo el sitio.
   Lo usan el pago de la tienda (País, Departamento, Tipo de documento) y los formularios de Elementor
   (Agendar servicio, Empresas). La lista abierta es la del componente de WooCommerce (selectWoo),
   no la del sistema operativo, para que tenga los mismos colores, bordes y esquinas en todas partes.
   Los colores salen de los colores globales del kit de Elementor. */

body {
	--fxt-azul: var(--e-global-color-primary, #0054C7);
	--fxt-profundo: var(--e-global-color-secondary, #003B8F);
	--fxt-tinta: var(--e-global-color-text, #0B1F3F);
	--fxt-gris: var(--e-global-color-fxgris, #5B6B84);
	--fxt-fondo: var(--e-global-color-fxfondo, #F3F7FD);
	--fxt-linea: var(--e-global-color-fxlinea, #DCE6F5);
	--fxt-borde: var(--e-global-color-fxborde, #C9D6EA);
	--fxt-rojo: var(--e-global-color-fxrojo, #E5252A);
	--fxt-foco: 0 0 0 3px rgba(0, 84, 199, .15);
	--fxt-alto: 50px;
	--fxt-radio: 12px;
	--fxt-fuente: var(--e-global-typography-text-font-family, "Montserrat"), system-ui, Arial, sans-serif;
	--fxt-flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B84' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	--fxt-icono-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.5v.01'/%3E%3C/svg%3E");
}

/* ---------- Formularios de Elementor: el campo cerrado ---------- */
/* La flecha es la misma del pago (en vez del triángulo de Elementor). Así se ve también
   antes de que cargue el script y si el navegador no lo ejecuta. */
.elementor-field-type-select .elementor-select-wrapper .select-caret-down-wrapper {
	display: none;
}
.elementor-field-type-select .elementor-select-wrapper select {
	padding-right: 44px;
	background-image: var(--fxt-flecha);
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 18px 18px;
	cursor: pointer;
}

/* ---------- Campo cerrado del componente (pago y formularios) ---------- */
.woocommerce .select2-container .select2-selection--single,
.elementor-field-type-select .select2-container .select2-selection--single {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	padding: 0;
	border: 1px solid var(--fxt-borde);
	border-radius: var(--fxt-radio);
	background-color: #fff;
	color: var(--fxt-tinta);
	font-family: var(--fxt-fuente);
	outline: 0;
	transition: border-color .15s, box-shadow .15s;
}
.woocommerce .select2-container .select2-selection--single {
	height: var(--fxt-alto);
	min-height: var(--fxt-alto);
}
/* En los formularios el alto lo copia el script del campo original, para quedar parejo con los demás campos. */
.elementor-field-type-select .select2-container .select2-selection--single {
	height: auto;
	min-height: 44px;
}
.woocommerce .select2-container .select2-selection--single .select2-selection__rendered,
.elementor-field-type-select .select2-container .select2-selection--single .select2-selection__rendered {
	flex: 1 1 auto;
	padding: 0 44px 0 16px;
	line-height: 1.3;
	color: var(--fxt-tinta);
	font-size: 1rem;
}
.elementor-field-type-select .select2-container .select2-selection--single .select2-selection__rendered {
	padding-left: 14px;
}
.woocommerce .select2-container .select2-selection--single .select2-selection__placeholder,
.elementor-field-type-select .select2-container .select2-selection--single .select2-selection__placeholder {
	color: var(--fxt-gris);
}
body .woocommerce form .form-row .select2-container.select2-container--default .select2-selection--single .select2-selection__arrow,
.woocommerce .select2-container .select2-selection--single .select2-selection__arrow,
.elementor-field-type-select .select2-container .select2-selection--single .select2-selection__arrow {
	top: 0;
	right: 0;
	width: 46px;
	height: 100%;
	background: var(--fxt-flecha) no-repeat center / 18px 18px;
	transition: transform .15s;
}
.woocommerce .select2-container .select2-selection--single .select2-selection__arrow b,
.elementor-field-type-select .select2-container .select2-selection--single .select2-selection__arrow b {
	display: none;
}
.woocommerce .select2-container--open .select2-selection--single .select2-selection__arrow,
.elementor-field-type-select .select2-container--open .select2-selection--single .select2-selection__arrow {
	transform: rotate(180deg);
}
.woocommerce .select2-container--focus .select2-selection--single,
.woocommerce .select2-container--open .select2-selection--single,
.elementor-field-type-select .select2-container--focus .select2-selection--single,
.elementor-field-type-select .select2-container--open .select2-selection--single {
	border-color: var(--fxt-azul);
	box-shadow: var(--fxt-foco);
}
/* Abierto, el campo conserva sus esquinas: la lista va separada 6 px (select2.css las aplana). */
body .woocommerce .select2-container.select2-container--open .select2-selection--single,
body .elementor-field-type-select .select2-container.select2-container--open .select2-selection--single {
	border-radius: var(--fxt-radio);
}
/* Error de validación del formulario. */
.elementor-field-group.elementor-error .select2-container .select2-selection--single {
	border-color: var(--fxt-rojo);
}

/* ---------- Lista abierta (se dibuja al final de la página, fuera del formulario) ---------- */
/* Con "body" delante gana a select2.css, que puede cargarse después. */
body .select2-container--default .select2-dropdown {
	margin-top: 6px;
	border: 1px solid var(--fxt-borde);
	border-radius: var(--fxt-radio);
	background: #fff;
	color: var(--fxt-tinta);
	box-shadow: 0 14px 34px rgba(0, 59, 143, .16);
	overflow: hidden;
	font-size: .95rem;
}
body .select2-container--default .select2-dropdown--above {
	margin-top: -6px;
}
body .select2-container--default .select2-search--dropdown {
	padding: 10px 10px 6px;
}
/* Buscador de la lista: sin el anillo cian del kit ni el contorno negro del tema. */
body .select2-container--default .select2-search--dropdown input.select2-search__field {
	box-sizing: border-box;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--fxt-borde);
	border-radius: 10px;
	background: #fff;
	color: var(--fxt-tinta);
	font-family: var(--fxt-fuente);
	font-size: .95rem;
	box-shadow: none;
	outline: 0;
}
body .select2-container--default .select2-search--dropdown input.select2-search__field:focus,
body .select2-container--default .select2-search--dropdown input.select2-search__field:focus-visible {
	border-color: var(--fxt-azul);
	box-shadow: var(--fxt-foco);
	outline: 0;
}
body .select2-container--default .select2-results > .select2-results__options {
	max-height: 260px;
	padding: 4px 6px 6px;
	scrollbar-width: thin;
	scrollbar-color: var(--fxt-borde) transparent;
}
body .select2-container--default .select2-results__option {
	margin: 0;
	padding: 10px 12px;
	font-family: var(--fxt-fuente);
	font-size: .95rem;
	border-radius: 8px;
	color: var(--fxt-tinta);
	line-height: 1.3;
}
body .select2-container--default .select2-results__option--highlighted[aria-selected],
body .select2-container--default .select2-results__option--highlighted[data-selected] {
	background: var(--fxt-fondo);
	color: var(--fxt-azul);
}
body .select2-container--default .select2-results__option[aria-selected="true"],
body .select2-container--default .select2-results__option[data-selected="true"] {
	background: var(--fxt-azul);
	color: #fff;
	font-weight: 600;
}
body .select2-container--default .select2-results__option.select2-results__message {
	color: var(--fxt-gris);
}

@media (max-width: 600px) {
	body .select2-container--default .select2-results__option {
		padding: 12px;
	}
}
