/* ==========================================================================
   Crear: componentes (botones, íconos, calculadora, contenido, listados, 404)
   ========================================================================== */

/* --- Botones ------------------------------------------------------------- */

.b1,
.b2 {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	font-size: .90625rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	border-radius: var(--r-ctl);
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.b1 {
	padding: 12px 20px;
	background: var(--azul);
	color: var(--blanco);
	border: 0;
}

.b1:hover {
	background: var(--azul-hondo);
}

.b2 {
	padding: 10px 18px;
	background: transparent;
	color: var(--azul);
	border: 2px solid var(--azul);
}

.b2:hover {
	background: var(--nube);
}

.b1:active,
.b2:active {
	transform: translateY(1px);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* --- Íconos -------------------------------------------------------------- */

.icon {
	flex: none;
	width: 20px;
	height: 20px;
}

/* Texto solo para lectores de pantalla generado por WordPress */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Encabezado de página ----------------------------------------------- */

.page-head {
	margin-bottom: clamp(28px, 4vw, 44px);
}

.page-head__title {
	font-size: var(--fs-4);
}

/* --- Contenido editorial (páginas legales y noticias) ------------------- */

.prose {
	max-width: var(--medida);
	font-size: 1.0625rem;
	line-height: 1.65;
}

.prose > * + * {
	margin-top: 1em;
}

.prose h2 {
	margin-top: 1.8em;
	font-size: 2rem;
}

.prose h3 {
	margin-top: 1.6em;
	font-size: 1.5rem;
}

.prose h4 {
	margin-top: 1.4em;
	font-size: var(--fs-1);
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
	margin-top: .6em;
}

.prose ul,
.prose ol {
	padding-left: 1.25em;
}

.prose li + li {
	margin-top: .35em;
}

.prose blockquote {
	margin-inline: 0;
	padding-left: 1em;
	border-left: 4px solid var(--amarillo);
}

.prose figure {
	margin-inline: 0;
}

.prose figcaption {
	margin-top: 8px;
	color: var(--gris);
	font-size: var(--fs--1);
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.prose th,
.prose td {
	padding: .6em .75em;
	border-bottom: 1px solid var(--linea);
	text-align: left;
	vertical-align: top;
}

.prose thead th {
	border-bottom: 1.5px solid var(--tinta);
}

.prose .wp-block-table {
	overflow-x: auto;
}

/* --- Entrada / página ---------------------------------------------------- */

.entry__head {
	max-width: 24ch;
	margin-bottom: clamp(24px, 4vw, 40px);
}

.entry__title {
	font-size: var(--fs-4);
}

.entry__kicker {
	margin-bottom: 14px;
	font-size: var(--fs--1);
	font-weight: 600;
}

.entry__date {
	display: block;
	margin-top: 16px;
	color: var(--gris);
	font-size: var(--fs--1);
}

.entry__media {
	margin: 0 0 clamp(28px, 4vw, 44px);
	max-width: 900px;
}

.entry__media img {
	width: 100%;
	border-radius: var(--r-panel);
}

.entry__back {
	margin-top: 48px;
	font-weight: 600;
}

/* --- Listado de noticias (filas, no tarjetas) --------------------------- */

.post-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1.5px solid var(--tinta);
}

.post-list > li {
	border-bottom: 1px solid #DBE2EE;
}

.post-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 240px;
	gap: 18px 40px;
	align-items: center;
	padding-block: 26px;
}

.post-row:not(:has(.post-row__media)) {
	grid-template-columns: minmax(0, 1fr);
}

.post-row__date {
	color: var(--gris);
	font-size: var(--fs--1);
}

.post-row__title {
	margin-top: 6px;
	font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
	line-height: 1;
}

.post-row__title a {
	color: var(--tinta);
	text-decoration: none;
}

.post-row__title a:hover {
	box-shadow: inset 0 -10px 0 var(--amarillo);
}

.post-row__excerpt {
	max-width: 60ch;
	margin-top: 10px;
	color: var(--gris);
}

.post-row__media img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}

@media (max-width: 639.98px) {
	.post-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-row__media {
		order: -1;
	}
}

/* --- Paginación ---------------------------------------------------------- */

.pager {
	margin-top: 36px;
}

.pager .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	color: var(--tinta);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	border: 1.5px solid var(--linea-fuerte);
	border-radius: var(--r-ctl);
}

.pager a.page-numbers:hover {
	border-color: var(--azul);
}

.pager .page-numbers.current {
	background: var(--azul);
	color: var(--blanco);
	border-color: var(--azul);
}

.pager .page-numbers.dots {
	border-color: transparent;
}

/* --- Estado vacío -------------------------------------------------------- */

.empty {
	display: grid;
	justify-items: start;
	gap: 18px;
	padding-block: 28px;
	border-top: 1.5px solid var(--tinta);
	color: var(--gris);
}

/* --- 404 ----------------------------------------------------------------- */

.notfound__text {
	max-width: 40rem;
}

.notfound__code {
	color: var(--acero);
	font-size: clamp(5.5rem, 3rem + 12vw, 11rem);
	font-stretch: 68%;
	font-weight: 800;
	line-height: .8;
	font-variant-numeric: tabular-nums;
}

.notfound__code::after {
	content: "";
	display: inline-block;
	width: .22em;
	height: .62em;
	margin-left: .12em;
	background: var(--amarillo);
	transform: skewX(var(--sk));
}

.notfound__title {
	margin-top: 22px;
	font-size: var(--fs-3);
}

.notfound__lead {
	margin-top: 16px;
	color: var(--gris);
	font-size: var(--fs-1);
}

.notfound__links {
	margin: 26px 0 30px;
	padding: 0;
	list-style: none;
	border-top: 1.5px solid var(--tinta);
}

.notfound__links li {
	padding-block: 14px;
	border-bottom: 1px solid #DBE2EE;
}

.notfound__links a {
	color: var(--tinta);
	font-size: 1.25rem;
	font-weight: 700;
	text-decoration: none;
}

.notfound__links a:hover {
	box-shadow: inset 0 -8px 0 var(--amarillo);
}

/* --- Calculadora --------------------------------------------------------- */

.calc {
	width: 100%;
	max-width: 380px;
	padding: 22px 22px 18px;
	background: var(--blanco);
	color: var(--tinta);
	border-radius: var(--r-panel);
	box-shadow: var(--sombra-panel);
}

.calc--full,
.calc--product {
	max-width: 480px;
}

.calc__title {
	margin: 0 0 14px;
	font-size: 1.3125rem; /* 21 */
	font-stretch: 100%;
	font-weight: 700;
	line-height: 1.2;
}

.calc__seg {
	display: grid;
	grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
	margin-bottom: 16px;
	overflow: hidden;
	border: 1.5px solid var(--linea-fuerte);
	border-radius: var(--r-ctl);
}

.calc__seg button {
	min-width: 0;
	min-height: 36px;
	padding: 8px 4px;
	font-size: var(--fs--2);
	font-weight: 600;
	line-height: 1.2;
	overflow-wrap: anywhere;
	background: var(--blanco);
	color: var(--tinta);
	border: 0;
	border-right: 1.5px solid var(--linea-fuerte);
	cursor: pointer;
}

.calc__seg button:last-child {
	border-right: 0;
}

.calc__seg button:hover {
	background: var(--nube);
}

.calc__seg button[aria-pressed="true"] {
	background: var(--azul);
	color: var(--blanco);
}

/* El grupo recorta el contorno: el foco va por dentro. */
.calc__seg button:focus-visible {
	outline-offset: -4px;
}

.calc__seg button[aria-pressed="true"]:focus-visible {
	outline-color: var(--amarillo);
}

.calc__field {
	margin-bottom: 14px;
}

.calc__field label {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	font-size: .84375rem; /* 13.5 */
	font-weight: 600;
}

.calc__field input[type="range"] {
	display: block;
	width: 100%;
	height: 22px;
	margin: 0;
	accent-color: var(--azul);
	cursor: pointer;
}

.calc__res {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	padding-top: 12px;
	border-top: 1px dashed #CFD8E6;
}

.calc__res span {
	font-size: .8125rem; /* 13 */
	color: var(--gris);
}

.calc__res strong {
	font-size: 2.5rem;
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.calc__fee {
	margin-top: 4px;
	font-size: .8125rem;
	color: var(--gris);
	font-variant-numeric: tabular-nums;
}

.calc__fee[hidden] {
	display: none;
}

.calc__note {
	display: block;
	margin-top: 6px;
	font-size: .75rem;
	line-height: 1.4;
	color: var(--gris);
}

.calc__cta {
	width: 100%;
	margin-top: 12px;
}

@media (max-width: 480px) {
	.calc {
		max-width: none;
		padding: 18px;
	}
}

/* Botón flotante de WhatsApp. z-index por debajo de la cabecera (40), que contiene el panel del menú. */
.wa-float {
	position: fixed;
	right: max(14px, env(safe-area-inset-right));
	bottom: max(14px, env(safe-area-inset-bottom));
	z-index: 30;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	/* Verde de WhatsApp oscurecido: el ícono blanco sobre #25D366 daba ~2:1; sobre este, 4.3:1 (mín. 3:1 para gráficos). */
	background: #128C4A;
	color: #fff;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.wa-float svg {
	width: 28px;
	height: 28px;
}

/* wa-float.mjs lo aparta mientras tapa la calculadora o sus botones. */
.wa-float.is-tucked {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Hover y foco: un verde más oscuro (5.4:1 con el ícono blanco); el foco conserva además el anillo global. */
.wa-float:hover,
.wa-float:focus-visible {
	background: #0F7A41;
}

@media (prefers-reduced-motion: no-preference) {
	.wa-float {
		transition: opacity .15s ease, visibility 0s;
	}

	.wa-float.is-tucked {
		transition: opacity .15s ease, visibility 0s .15s;
	}
}

@media (max-width: 559.98px) {
	.wa-float {
		right: max(12px, env(safe-area-inset-right));
		bottom: max(12px, env(safe-area-inset-bottom));
		width: 52px;
		height: 52px;
	}

	.wa-float svg {
		width: 26px;
		height: 26px;
	}
}

@media print {
	.wa-float {
		display: none;
	}
}

/* Calculadora: selector de crédito (variante full). */
.calc__picker select {
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--borde, #c9ced6);
	border-radius: 8px;
	background: var(--blanco);
	color: inherit;
	font: inherit;
}
