/*! ClimaExplica - Buscador por problema v1.0.0
 * Se apoya en la identidad visual existente: tipografía heredada del tema, colores de la paleta de Astra
 * (--ast-global-color-*) con los valores medidos en el sitio como respaldo, y el verde de marca #0f6b78.
 * No carga fuentes ni imágenes externas.
 */
.cxb {
	--cxb-primario: #0f6b78;
	--cxb-titulos: var(--ast-global-color-2, #1e293b);
	--cxb-texto: var(--ast-global-color-3, #334155);
	--cxb-suave: #f6f8fa;
	--cxb-linea: var(--ast-global-color-7, #d1d5db);
	--cxb-borde-campo: var(--ast-global-color-8, #111111);
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	color: var(--cxb-texto);
	font-family: inherit;
	font-size: inherit;
	line-height: 1.5;
}

.cxb *,
.cxb *::before,
.cxb *::after {
	box-sizing: border-box;
}

.cxb [hidden] {
	display: none !important;
}

.cxb .cxb__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Cabecera ------------------------------------------------------------ */
.cxb .cxb__titulo {
	margin: 0 0 0.35em;
	color: var(--cxb-titulos);
}

.cxb .cxb__intro {
	margin: 0 0 1.1em;
}

/* Campo --------------------------------------------------------------- */
.cxb .cxb__form {
	margin: 0;
	padding: 0;
}

.cxb .cxb__campo {
	position: relative;
	margin: 0;
}

.cxb .cxb__icono {
	position: absolute;
	top: 50%;
	left: 16px;
	width: 20px;
	height: 20px;
	margin: 0;
	transform: translateY(-50%);
	color: var(--cxb-primario);
	pointer-events: none;
}

.cxb .cxb__input {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 12px 14px 12px 46px;
	font-family: inherit;
	font-size: 16px; /* >=16 px: iOS no hace zoom al enfocar */
	line-height: 1.4;
	color: var(--cxb-texto);
	background: #ffffff;
	border: 1px solid var(--cxb-borde-campo);
	border-radius: 8px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.cxb .cxb__input::placeholder {
	color: #64748b;
	opacity: 1;
}

.cxb .cxb__input:focus,
.cxb .cxb__input:focus-visible {
	color: var(--cxb-texto);
	background: #ffffff;
	border-style: solid; /* Astra pone border-style: dotted al enfocar */
	border-color: var(--cxb-primario);
	box-shadow: none;
	outline: 3px solid var(--cxb-primario);
	outline-offset: 2px;
}

/* Sugerencias rápidas -------------------------------------------------- */
/* >860 px: cuatro botones en una sola fila (anchos naturales) */
.cxb .cxb__chips {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.cxb .cxb__chips > li {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cxb .cxb__chips > li::before {
	content: none;
}

.cxb .cxb__chip {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	font-family: inherit;
	font-size: inherit;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	white-space: normal;
	color: var(--cxb-titulos);
	background: var(--cxb-suave);
	border: 1px solid var(--cxb-linea);
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cxb .cxb__chip:hover {
	color: var(--cxb-primario);
	background: #ffffff;
	border-style: solid;
	border-color: var(--cxb-primario);
}

.cxb .cxb__chip:active {
	background: #e8eef2;
}

.cxb .cxb__chip:focus {
	outline: none;
}

.cxb .cxb__chip:focus-visible {
	color: var(--cxb-primario);
	background: #ffffff;
	border-style: solid;
	border-color: var(--cxb-primario);
	outline: 3px solid var(--cxb-primario);
	outline-offset: 2px;
}

/* 361-860 px: rejilla 2 x 2 */
@media (max-width: 860px) {
	.cxb .cxb__chips {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
}

/* <=360 px: una sola columna */
@media (max-width: 360px) {
	.cxb .cxb__chips {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Resultados ---------------------------------------------------------- */
.cxb .cxb__salida {
	margin: 20px 0 0;
}

.cxb .cxb__salida:empty {
	display: none;
}

.cxb .cxb__ayuda {
	margin: 18px 0 0;
}

.cxb .cxb__lista {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--cxb-linea);
}

.cxb .cxb__item {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 24px;
	align-items: center;
	margin: 0;
	padding: 18px 0;
	list-style: none;
	border-bottom: 1px solid var(--cxb-linea);
}

.cxb .cxb__cuerpo {
	min-width: 0;
}

.cxb .cxb__hub {
	margin: 0 0 4px;
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--cxb-primario);
}

.cxb .cxb__item-titulo {
	margin: 0;
	padding: 0;
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.3;
	color: var(--cxb-titulos);
}

/* Fila entera clicable sobre un enlace HTML real (el ::after cubre la fila) */
/* Especificidad 0,3,0: gana a `.ast-single-post .entry-content a` (Astra subraya los enlaces del contenido) */
.cxb .cxb__item-titulo .cxb__enlace {
	color: inherit;
	text-decoration: none;
}

.cxb .cxb__item-titulo .cxb__enlace::after {
	content: "";
	position: absolute;
	inset: 0;
}

.cxb .cxb__item-titulo .cxb__enlace:hover,
.cxb .cxb__item:hover .cxb__item-titulo .cxb__enlace {
	color: var(--cxb-primario);
	text-decoration: underline;
}

.cxb .cxb__item-titulo .cxb__enlace:focus {
	outline: none;
}

.cxb .cxb__item-titulo .cxb__enlace:focus-visible::after {
	outline: 3px solid var(--cxb-primario);
	outline-offset: 2px;
	border-radius: 6px;
}

.cxb .cxb__desc {
	margin: 6px 0 0;
}

.cxb .cxb__cta {
	font-weight: 600;
	white-space: nowrap;
	color: var(--cxb-primario);
}

@media (max-width: 860px) {
	.cxb .cxb__item {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 8px;
	}
}

/* Sin resultados ------------------------------------------------------- */
.cxb .cxb__vacio {
	margin: 0;
	padding: 16px 18px;
	background: var(--cxb-suave);
	border: 1px solid var(--cxb-linea);
	border-radius: 12px;
}

.cxb .cxb__vacio-titulo {
	margin: 0 0 4px;
	font-weight: 600;
	color: var(--cxb-titulos);
}

.cxb .cxb__vacio-ayuda {
	margin: 0;
}

.cxb .cxb__areas-titulo {
	margin: 24px 0 8px;
}

.cxb .cxb__nojs {
	margin: 12px 0 0;
}

/* Integración en la Home (Fase 2): la Home alinea sus cajas con un pequeño translateX (tarjetas de "¿Qué necesitas
 * resolver?" +6 px; el buscador anterior +7 px) mientras sus títulos y párrafos quedan a 0. Se replica solo en las
 * cajas del componente (no en el título ni la intro) y a partir de 769 px, igual que el buscador anterior. */
@media (min-width: 769px) {
	.cxb .cxb__form,
	.cxb .cxb__chips,
	.cxb .cxb__ayuda,
	.cxb .cxb__salida {
		transform: translateX(6px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cxb .cxb__chip {
		transition: none;
	}
}

@media (forced-colors: active) {
	.cxb .cxb__input,
	.cxb .cxb__chip {
		border-color: ButtonText;
	}
}
