/* =================================================================================================================
   CABECERA (modulos/header.php) - rediseño del 13/10/2026
   Una sola linea, fija arriba (sticky) y algo mas estrecha al bajar.
   Escritorio >= 992px: logo | menu | telefono + «¿Te ayudamos?» (despliega el formulario de llamada).
   Movil < 992px: logo | telefono, llamada y hamburguesa (iconos); el menu en un panel debajo.
   ================================================================================================================= */
:root {
	--hd-alto: 68px;
	--hd-alto-scroll: 60px;
	--hd-azul: var(--as-azul, #1f4f92);
	--hd-azul-osc: #12335f;
	--hd-naranja: var(--as-naranja, #ff6200);
	--hd-naranja-hover: var(--as-naranja-hover, #eb5a00);
	--hd-texto: #14294b;
	--hd-gris: #5b6b80;
}
@media (max-width: 991.98px) {
	:root { --hd-alto: 60px; --hd-alto-scroll: 56px; }
}

/* Que los enlaces a anclas no queden tapados por la cabecera fija */
html { scroll-padding-top: calc(var(--hd-alto) + 12px); }

.hd {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: linear-gradient(100deg, var(--hd-azul-osc) 0%, #1a467f 55%, var(--hd-azul) 100%);
	color: #fff;
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
	transition: box-shadow .25s ease, background-color .25s ease;
}
.hd--scroll { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(8, 26, 54, .28); }
.hd a { text-decoration: none; }
.hd button { font: inherit; }

.hd-barra {
	max-width: 1480px;
	height: var(--hd-alto);
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	gap: 20px;
	transition: height .25s ease;
}
.hd--scroll .hd-barra { height: var(--hd-alto-scroll); }

/* ---------- Logo */
.hd-marca { display: flex; flex-direction: column; justify-content: center; flex-shrink: 0; color: #fff; }
.hd-marca img { display: block; width: auto; height: 28px; transition: height .25s ease; }
.hd--scroll .hd-marca img { height: 25px; }
.hd-marca-texto { margin-top: 5px; color: rgba(255, 255, 255, .72); font-size: 10.5px; line-height: 1; letter-spacing: .03em; white-space: nowrap; }

/* ---------- Menu (escritorio) */
.hd-menu { flex: 1 1 auto; min-width: 0; }
.hd-lista {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hd-lista > li { position: relative; margin: 0; }
.hd-enlace {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 38px;
	padding: 0 12px;
	border-radius: 10px;
	color: rgba(255, 255, 255, .86) !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.hd-enlace:hover, .hd-enlace:focus-visible, .hd-desplegable.show > .hd-enlace, .hd-enlace.show {
	background: rgba(255, 255, 255, .1);
	color: #fff !important;
}
.hd-enlace:focus { outline: none; box-shadow: none; }
.hd-enlace:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.hd .dropdown-toggle::after { display: none; content: none; }
.hd-flecha { opacity: .8; transition: transform .2s ease; }
.hd-desplegable.show .hd-flecha, .hd-enlace.show .hd-flecha { transform: rotate(180deg); }

/* Seccion activa (por el id del body): texto blanco y rayita naranja debajo */
.hd-enlace::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 3px;
	width: 0;
	height: 3px;
	border-radius: 3px;
	background: var(--hd-naranja);
	transform: translateX(-50%);
	transition: width .2s ease;
}
body#inicio .hd-enlace.nav-ini, body#salud .hd-enlace.nav-salud, body#autonomos .hd-enlace.nav-aut,
body#pymes .hd-enlace.nav-aut, body#dental .hd-enlace.nav-den, body#decesos .hd-enlace.nav-decesos,
body#vida .hd-enlace.nav-vida, body#viaje .hd-enlace.nav-via, body#mascotas .hd-enlace.nav-mas,
body#otros .hd-enlace.nav-otros { color: #fff !important; }
body#inicio .hd-enlace.nav-ini::after, body#salud .hd-enlace.nav-salud::after, body#autonomos .hd-enlace.nav-aut::after,
body#pymes .hd-enlace.nav-aut::after, body#dental .hd-enlace.nav-den::after, body#decesos .hd-enlace.nav-decesos::after,
body#vida .hd-enlace.nav-vida::after, body#viaje .hd-enlace.nav-via::after, body#mascotas .hd-enlace.nav-mas::after,
body#otros .hd-enlace.nav-otros::after { width: 18px; }

/* Submenu «Mas seguros»: cada seguro con su icono y una linea de explicacion */
.hd-submenu.dropdown-menu {
	min-width: 320px;
	margin-top: 10px !important;
	padding: 8px;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 22px 48px rgba(10, 30, 60, .24);
}
.hd-submenu li { margin: 0; } /* el CSS general da margin-bottom a todos los li */
.hd-submenu .dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: 11px;
	color: var(--hd-texto);
	white-space: normal;
}
.hd-sub-icono {
	display: grid;
	place-items: center;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: #eef3fa;
	color: var(--hd-azul);
	font-size: 17px;
	transition: background-color .15s ease, color .15s ease;
}
.hd-sub-textos { display: grid; gap: 1px; line-height: 1.25; }
.hd-sub-textos strong { font-size: 14.5px; font-weight: 700; }
.hd-sub-textos small { font-size: 12.5px; color: var(--hd-gris); }
.hd-submenu .dropdown-item:hover, .hd-submenu .dropdown-item:focus { background: #f4f7fb; color: var(--hd-azul); }
.hd-submenu .dropdown-item:hover .hd-sub-icono, .hd-submenu .dropdown-item:focus .hd-sub-icono { background: var(--hd-naranja); color: #fff; }
@media (min-width: 992px) {
	.hd-submenu.dropdown-menu { left: 50%; right: auto; transform: translateX(-50%); }
	/* En escritorio se abre tambien al pasar el raton */
	.hd-desplegable:hover > .hd-submenu { display: block; }
	.hd-desplegable:hover .hd-flecha { transform: rotate(180deg); }
	/* Puente invisible para no perder el hover al bajar al submenu */
	.hd-desplegable::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
}

/* ---------- Telefono y «¿Te ayudamos?» */
.hd-acciones { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }

/* Telefono de nuevas contrataciones: ligero, sobre el azul */
.hd-tel {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 6px 4px 4px;
	border-radius: 999px;
	color: #fff;
	white-space: nowrap;
	transition: background-color .15s ease;
}
.hd-tel-icono {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
	font-size: 16px;
	transition: background-color .15s ease;
}
.hd-tel-textos { display: grid; line-height: 1.1; text-align: left; }
.hd-tel-textos small { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #ffb27f; }
.hd-tel-textos strong { font-size: 17px; font-weight: 800; letter-spacing: .01em; color: #fff; }
.hd-tel:hover { color: #fff; }
.hd-tel:hover .hd-tel-icono { background: var(--hd-naranja); box-shadow: none; }

/* «¿Te ayudamos?»: boton naranja que despliega el formulario */
.hd-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--hd-naranja);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 8px 20px -6px rgba(255, 98, 0, .6);
	transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hd-cta .ib { font-size: 18px; }
.hd-cta:hover { background: var(--hd-naranja-hover); transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(255, 98, 0, .7); }
.hd-cta[aria-expanded="true"] { background: #fff; color: var(--hd-naranja); box-shadow: none; transform: none; }
.hd-cta:focus-visible, .hd-tel:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.hd-menu-pie { display: none; }
.hd-hamburguesa { display: none; }

/* En escritorio el menu siempre visible (el .collapse de Bootstrap solo actua en movil) */
@media (min-width: 992px) {
	.hd-menu.collapse:not(.show), .hd-menu.collapsing { display: block !important; height: auto !important; }
}

/* Escritorio estrecho: menu mas compacto */
@media (min-width: 992px) and (max-width: 1299.98px) {
	.hd-barra { gap: 12px; padding: 0 16px; }
	.hd-marca img { height: 24px; }
	.hd-marca-texto { font-size: 9.5px; }
	.hd-enlace { padding: 0 9px; font-size: 14px; }
	.hd-cta { padding: 0 16px 0 13px; font-size: 14px; }
	.hd-tel-textos small { display: none; }
}
/* Si no cabe todo: el boton de llamada se queda solo con el icono y luego se quita el texto del logo */
@media (min-width: 992px) and (max-width: 1149.98px) {
	.hd-cta { width: 44px; padding: 0; }
	.hd-cta-texto { display: none; }
	.hd-marca-texto { display: none; }
	.hd-enlace { padding: 0 7px; font-size: 13.5px; }
}

/* ---------- Desplegable «¿Te ayudamos?» (formulario de llamada) */
.hd-llamada {
	position: absolute;
	top: 100%;
	right: max(16px, calc((100vw - 1480px) / 2 + 24px));
	width: 400px;
	max-width: calc(100vw - 32px);
	padding-top: 10px;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .2s ease, transform .2s ease;
}
.hd-llamada--abierto { opacity: 1; transform: none; }
.hd-llamada[hidden] { display: none; }
.hd-llamada-caja {
	max-height: calc(100vh - var(--hd-alto) - 24px);
	max-height: calc(100dvh - var(--hd-alto) - 24px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 20px;
	background: #fff;
	color: var(--hd-texto);
	box-shadow: 0 28px 60px rgba(8, 26, 54, .35);
}
.hd-llamada-cab {
	position: relative;
	padding: 20px 52px 16px 22px;
	background: linear-gradient(135deg, #1c4a82, var(--hd-azul-osc));
	color: #fff;
}
.hd-llamada-cinta {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #ffd2b5;
}
.hd-llamada-titulo { margin: 0 0 4px; font-size: 21px; font-weight: 800; line-height: 1.2; color: #fff; }
.hd-llamada-sub { margin: 0; font-size: 14px; line-height: 1.45; color: #d7e4f5; }
.hd-llamada-cerrar {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	transition: background-color .15s ease;
}
.hd-llamada-cerrar:hover { background: rgba(255, 255, 255, .26); }
.hd-llamada-cerrar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hd-llamada-cuerpo { position: relative; min-height: 300px; padding: 10px 20px 4px; }
.hd-llamada-marco { display: block; width: 100%; height: 300px; border: 0; opacity: 0; transition: opacity .2s ease; }
.hd-llamada--listo .hd-llamada-marco { opacity: 1; }
.hd-llamada-cargando { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.hd-llamada--listo .hd-llamada-cargando { display: none; }
.hd-llamada-cargando span { width: 9px; height: 9px; border-radius: 50%; background: #c9d6e8; animation: hdPunto 1s infinite ease-in-out; }
.hd-llamada-cargando span:nth-child(2) { animation-delay: .15s; }
.hd-llamada-cargando span:nth-child(3) { animation-delay: .3s; }
@keyframes hdPunto { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.hd-llamada-pie { display: grid; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid #edf1f6; background: #f7f9fc; }
.hd-llamada-tel { display: flex; align-items: center; gap: 10px; color: var(--hd-texto); font-size: 14px; line-height: 1.3; }
.hd-llamada-tel .ib { flex: 0 0 auto; font-size: 18px; color: var(--hd-naranja); }
.hd-llamada-tel strong { color: var(--hd-azul); font-size: 15px; white-space: nowrap; }
.hd-llamada-tel small { display: block; color: var(--hd-gris); font-size: 12px; }
.hd-llamada-tel:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.hd-llamada-cliente { font-size: 12px; line-height: 1.4; color: var(--hd-gris); }
.hd-llamada-cliente strong { color: var(--hd-texto); white-space: nowrap; }
.hd-llamada-cliente:hover { color: var(--hd-gris); }
.hd-llamada-cliente:hover strong { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
	.hd, .hd-barra, .hd-marca img, .hd-llamada, .hd-llamada-marco { transition: none; }
	.hd-llamada-cargando span { animation: none; }
}

/* ---------- Movil y tablet */
@media (max-width: 991.98px) {
	.hd-barra { padding: 0 10px 0 16px; gap: 8px; }
	.hd-marca img { height: 22px; }
	.hd--scroll .hd-marca img { height: 21px; }
	.hd-marca-texto { font-size: 9.5px; }
	.hd-acciones { gap: 6px; }
	.hd-tel { padding: 0; }
	.hd-tel-icono { width: 42px; height: 42px; }
	.hd-tel-textos { display: none; }
	.hd-cta { width: 42px; height: 42px; padding: 0; }
	.hd-cta-texto { display: none; }

	.hd-hamburguesa {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 42px;
		height: 42px;
		padding: 0 10px;
		border: 0;
		border-radius: 10px;
		background: transparent;
		cursor: pointer;
	}
	.hd-hamburguesa:hover { background: rgba(255, 255, 255, .1); }
	.hd-hamburguesa span { display: block; height: 2.5px; border-radius: 3px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
	.hd-hamburguesa:not(.collapsed) span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
	.hd-hamburguesa:not(.collapsed) span:nth-child(2) { opacity: 0; }
	.hd-hamburguesa:not(.collapsed) span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

	/* Panel del menu */
	.hd-menu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - var(--hd-alto));
		max-height: calc(100dvh - var(--hd-alto));
		overflow-y: auto;
		background: #fff;
		box-shadow: 0 16px 30px rgba(10, 30, 60, .2);
	}
	.hd-lista { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px; }
	.hd-lista > li { border-bottom: 1px solid #edf1f6; }
	.hd-enlace {
		display: flex;
		width: 100%;
		height: auto;
		padding: 15px 8px;
		border-radius: 0;
		color: var(--hd-texto) !important;
		font-size: 16px;
	}
	.hd-enlace:hover, .hd-enlace:focus-visible, .hd-desplegable.show > .hd-enlace, .hd-enlace.show { background: transparent; color: var(--hd-azul) !important; }
	.hd-enlace::after { left: -12px; top: 12px; bottom: 12px; width: 4px !important; height: auto; transform: none; opacity: 0; }
	body#inicio .hd-enlace.nav-ini, body#salud .hd-enlace.nav-salud, body#autonomos .hd-enlace.nav-aut,
	body#pymes .hd-enlace.nav-aut, body#dental .hd-enlace.nav-den, body#decesos .hd-enlace.nav-decesos,
	body#vida .hd-enlace.nav-vida, body#viaje .hd-enlace.nav-via, body#mascotas .hd-enlace.nav-mas,
	body#otros .hd-enlace.nav-otros { color: var(--hd-naranja) !important; }
	body#inicio .hd-enlace.nav-ini::after, body#salud .hd-enlace.nav-salud::after, body#autonomos .hd-enlace.nav-aut::after,
	body#pymes .hd-enlace.nav-aut::after, body#dental .hd-enlace.nav-den::after, body#decesos .hd-enlace.nav-decesos::after,
	body#vida .hd-enlace.nav-vida::after, body#viaje .hd-enlace.nav-via::after, body#mascotas .hd-enlace.nav-mas::after,
	body#otros .hd-enlace.nav-otros::after { opacity: 1; }
	.hd-flecha { margin-left: auto; }

	.hd-submenu.dropdown-menu { position: static !important; transform: none !important; min-width: 0; margin: 0 0 10px !important; padding: 4px; box-shadow: none; background: #f4f7fb; }
	.hd-sub-icono { background: #fff; }

	.hd-menu-pie { display: grid; gap: 10px; padding: 14px 20px 20px; }
	.hd-boton {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		height: 48px;
		border: 0;
		border-radius: 12px;
		font-size: 16px;
		font-weight: 700;
		cursor: pointer;
	}
	.hd-boton--tel { border: 1.5px solid #d5deea; background: #fff; color: var(--hd-azul); }
	.hd-boton--cta { background: var(--hd-naranja); color: #fff; }
	.hd-menu-pie-titulo { margin: 0 0 -2px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hd-gris); }
	.hd-cliente-movil {
		display: grid;
		gap: 4px;
		margin-top: 6px;
		padding: 12px 14px;
		border-radius: 12px;
		background: #f4f7fb;
		font-size: 14px;
		line-height: 1.35;
		color: var(--hd-gris);
		text-align: center;
	}
	.hd-cliente-movil strong { font-size: 16px; color: var(--hd-azul); }
	.hd-cliente-movil .ib { margin-right: 4px; font-size: 13px; }

	/* El formulario de llamada ocupa todo el ancho, pegado a la cabecera */
	.hd-llamada { left: 0; right: 0; width: auto; max-width: none; padding-top: 0; }
	.hd-llamada-caja { border-radius: 0 0 20px 20px; max-height: calc(100vh - var(--hd-alto)); max-height: calc(100dvh - var(--hd-alto)); }
	.hd-llamada-cab { padding: 16px 50px 14px 18px; }
	.hd-llamada-titulo { font-size: 19px; }
	.hd-llamada-cuerpo { padding: 8px 16px 2px; }
	.hd-llamada-pie { padding: 12px 18px 18px; }
}
@media (max-width: 380px) {
	.hd-marca-texto { display: none; }
}

/* Elementos fijos de otras partes que iban a top: 20px: que queden por debajo de la cabecera */
#recentArticlesAside, .sticky-container { top: calc(var(--hd-alto) + 20px); }

/* Iconos SVG propios (sin Font Awesome) */
.ib{display:inline-block;width:1em;height:1em;vertical-align:-.125em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;overflow:visible;flex-shrink:0}
