/* ============================================================
   HEADER UNIFICADO — Child Theme Astra
   Prefijo: cdx- para evitar colisiones con Astra
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

@font-face {
	font-family: 'DINPro-bold';
	src: url('./DINPro-Bold.ttf') format('truetype');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'DINPro';
	src: url('./DINPro.otf') format('opentype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'DINPro-medium';
	src: url('./DINPro-medium.otf') format('opentype');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

/* Reset del header de Astra */
.site-header,
.ast-site-header-wrap,
#masthead {
	display: none !important;
}

/* Reset líneas y bordes residuales de Astra */
.ast-above-header-bar,
.ast-below-header-bar,
.ast-primary-header-bar,
#ast-desktop-header,
.ast-builder-grid-row-container {
	display: none !important;
}

body {
	border-top: none !important;
}

#wpadminbar {
	z-index: 99999 !important;
}

/* Cuando está el admin bar, el header baja */
.admin-bar .cdx-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .cdx-header {
		top: 46px;
	}
}

/* Spacer para compensar el fixed */
.cdx-header-spacer {
	height: 70px;
}

/* Header principal */
.cdx-header {
	background-color: #ffffff;
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	box-shadow: 0px 5px 7px #00000029;
	z-index: 100000;
	height: 70px;
}

/* Nav contenedor */
.cdx-nav-contenedor {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
	font-family: 'Roboto', sans-serif;
	font-weight: 500;
}

/* Logo */
.cdx-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	height: 41px;
	width: 189px;
	margin: 0;
	flex-shrink: 0;
}

.cdx-logo img {
	height: 100%;
	width: 100%;
	object-fit: contain;
}

/* Links container — replica exacta del estático */
.cdx-enlaces {
	display: flex;
	align-items: center;
	width: 70%;
	height: 100%;
	margin-left: 10px;
	flex-wrap: nowrap;
}

/* Cada item — replica .navigation del estático */
.cdx-navigation {
	position: relative;
	cursor: pointer;
	width: 27%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: solid #1c82eb 0px;
	transition: border-bottom 300ms ease-in-out;
	flex-shrink: 1;
}

@media (min-width: 1024px) {
	.cdx-navigation {
		min-height: 5rem;
		transition: all 100ms ease-in-out;
	}
}

/* Link base */
.cdx-link {
	text-align: center;
	text-decoration: none;
	color: #000000;
	font-family: 'DINPro-bold', 'Roboto', sans-serif;
	font-size: 16px;
	font-weight: bold;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: color 0.2s ease;
	line-height: 1.2;
}

.cdx-link:hover {
	color: #1a6dc4;
	text-decoration: none;
}

/* Link activo (BLOG en el blog) */
.cdx-link-active {
	color: #1a6dc4;
}

/* Cada item del nav */
.cdx-navigation {
	position: relative;
}

/* Arrow icon del submenu */
.cdx-arrow-icon {
	width: 12px;
	height: 12px;
	transition: transform 0.3s ease;
}

.cdx-has-submenu.open .cdx-arrow-icon {
	transform: rotate(180deg);
}

/* Submenu vertical */
.cdx-menuVertical {
	display: none;
	position: absolute;
	top: calc(100% + 16px);
	left: 0;
	background-color: #ffffff;
	box-shadow: 0px 5px 15px #00000020;
	border-top: 2px solid #1a6dc4;
	padding: 12px 0;
	min-width: 240px;
	z-index: 200;
	flex-direction: column;
}

.cdx-menuVertical.open {
	display: flex;
}

.cdx-inactive-link {
	display: block;
	padding: 10px 20px;
	text-decoration: none;
	color: #000000;
	font-size: 12px;
	font-family: 'Roboto', sans-serif;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cdx-inactive-link:hover {
	background-color: #f5f5f5;
	color: #1a6dc4;
	text-decoration: none;
}

/* ============================================================
   MOBILE BURGER
   ============================================================ */

.cdx-navBtn {
	display: none;
	cursor: pointer;
}

.cdx-menu-btn {
	width: 28px;
	height: 20px;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	cursor: pointer;
}

.cdx-menu-btn__burger,
.cdx-menu-btn::before,
.cdx-menu-btn::after {
	content: '';
	display: block;
	width: 100%;
	height: 2px;
	background-color: #000000;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.cdx-menu-btn::before,
.cdx-menu-btn::after {
	position: absolute;
	left: 0;
}

.cdx-menu-btn::before { top: 0; }
.cdx-menu-btn::after  { bottom: 0; }

/* Burger abierto → X */
.cdx-menu-btn.open::before {
	transform: rotate(45deg) translate(6px, 6px);
}
.cdx-menu-btn.open .cdx-menu-btn__burger {
	opacity: 0;
}
.cdx-menu-btn.open::after {
	transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
	.cdx-link {
		font-size: 12px;
	}
}

@media (max-width: 900px) {

	.cdx-navBtn {
		display: flex;
	}

	/* Fallback: burger nativo de Astra mientras no está header-content.php */
	#icono_menu {
		display: flex !important;
	}

	.cdx-enlaces.open,
	#enlaces.open {
		display: flex !important;
	}

	#enlaces {
		display: none;
		position: fixed;
		top: 70px;
		left: 0;
		width: 100%;
		height: calc(100vh - 70px);
		background-color: #ffffff;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 24px;
		box-sizing: border-box;
		overflow-y: auto;
		z-index: 99999;
	}

	.cdx-enlaces {
		display: none;
		position: fixed;
		top: 70px;
		left: 0;
		width: 100%;
		height: calc(100vh - 70px);
		background-color: #ffffff;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 24px;
		box-sizing: border-box;
		gap: 0;
		overflow-y: auto;
		z-index: 99999;
	}

	.cdx-enlaces.open {
		display: flex;
	}

	.cdx-navigation {
		width: 100%;
		border-bottom: 1px solid #eeeeee;
	}

	.cdx-link {
		display: flex;
		padding: 16px 0;
		font-size: 14px;
		width: 100%;
	}

	.cdx-menuVertical {
		position: static;
		box-shadow: none;
		border-top: none;
		border-left: 3px solid #1a6dc4;
		padding: 0 0 0 16px;
		margin-bottom: 8px;
	}

	.cdx-menuVertical.open {
		display: flex;
	}
}

/* ============================================================
   FOOTER UNIFICADO
   $light-blue2 (sucursales) → #003f5e   (ajustar si difiere)
   $light-blue1 (contenido)  → #00557e   (confirmado)
   $light-blue  (redes bg)   → #1c82eb   (ajustar si difiere)
   ============================================================ */

/* Ocultar footer de Astra */
.site-footer,
#colophon,
.ast-site-footer-wrap {
	display: none !important;
}

/* Footer wrapper */
.cdx-footer {
	width: 100%;
	font-family: 'Roboto', sans-serif;
	position: relative;
	z-index: 1001;
}

/* --- Banda sucursales --- */
.cdx-footer-sucursales {
	background-color: #99b9d1; /* $light-blue2 */
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3rem;
	padding: 1.2rem 1rem;
}

.cdx-sucursal {
	position: relative;
}

.cdx-sucursal a {
	text-decoration: none;
	font-family: 'Roboto', sans-serif;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 200px;
	gap: 10px;
	font-size: 14px;
}

.cdx-sucursal a img {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* --- Contenido principal --- */
.cdx-footer-contenido {
	background-color: #00557e;
	display: flex;
	align-items: center;
	justify-content: space-evenly;
	flex-direction: column;
	row-gap: 3rem;
	padding: 2rem 1rem 1rem;
	overflow: hidden;
}

/* --- Links del footer --- */
.cdx-footer-enlaces {
	width: 70%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.cdx-footer-link {
	text-decoration: none;
	color: #ffffff;
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	transition: opacity 0.2s ease;
}

.cdx-footer-link:hover {
	opacity: 0.75;
	text-decoration: none;
	color: #ffffff;
}

/* --- Redes sociales --- */
.cdx-footer-redes {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.cdx-red {
	width: 40px;
	height: 40px;
	background-color: #1c82eb; /* $light-blue */
	border-radius: 50%;
	flex-shrink: 0;
}

.cdx-red a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	text-decoration: none;
}

.cdx-red img {
	width: 50%;
	height: 50%;
	object-fit: contain;
}

/* --- Derechos --- */
.cdx-footer-derechos p {
	color: #99b9d1; /* $light-blue2 */
	font-family: 'Roboto', sans-serif;
	font-size: 13px;
	margin: 0;
	text-align: center;
}

/* --- Botón scroll top --- */
.cdx-footer-up {
	position: absolute;
	bottom: 1rem;
	right: 1rem;
	cursor: pointer;
	margin: 0;
}

.cdx-footer-up img {
	width: 40px;
	height: 40px;
}

/* --- WhatsApp flotante --- */
.cdx-whatsapp-flotante {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 52px;
	height: 52px;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cdx-whatsapp-flotante img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* --- Responsive footer --- */
@media (max-width: 768px) {

	.cdx-footer-sucursales {
		flex-direction: column;
		gap: 1rem;
	}

	.cdx-footer-enlaces {
		width: 90%;
		justify-content: center;
		text-align: center;
	}

	.cdx-footer-up {
		bottom: 0.5rem;
		right: 0.5rem;
	}
}

/* ============================================================
   TIPOGRAFÍA BLOG — DINPro + Roboto
   ============================================================ */

/* Pisar variables de color de Astra */
:root {
	--ast-global-color-0: #1c82eb !important;
	--ast-global-color-2: #00557e !important;
	--ast-global-color-3: #1a1a2e !important;
}

/* Body general del blog */
body,
.ast-single-post .entry-content,
.ast-archive-post .entry-content,
.site-content {
	font-family: 'Roboto', sans-serif !important;
	font-size: 16px;
	line-height: 1.75;
	color: #1a1a2e;
}

/* H1 — título del post */
.entry-title,
.page-title,
h1,
.entry-content h1 {
	font-family: 'DINPro-bold', sans-serif !important;
	font-size: clamp(2rem, 4vw, 3rem) !important;
	color: #00557e !important;
	line-height: 1.2;
	margin-bottom: 1.5rem;
}

/* H2 — subtítulos dentro del post */
.entry-content h2,
h2 {
	font-family: 'DINPro-bold', sans-serif !important;
	font-size: clamp(1.4rem, 2.5vw, 1.9rem) !important;
	color: #00557e !important;
	line-height: 1.3;
	margin-top: 2rem;
	margin-bottom: 1rem;
}

/* H3 */
.entry-content h3,
h3 {
	font-family: 'DINPro-medium', sans-serif !important;
	font-size: clamp(1.1rem, 2vw, 1.4rem) !important;
	color: #1c82eb !important;
	line-height: 1.3;
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
}

/* H4, H5, H6 */
.entry-content h4,
.entry-content h5,
.entry-content h6,
h4, h5, h6 {
	font-family: 'DINPro-medium', sans-serif !important;
	color: #00557e !important;
	line-height: 1.3;
	margin-top: 1.2rem;
	margin-bottom: 0.5rem;
}

/* Párrafos */
.entry-content p,
.entry-summary p {
	font-family: 'Roboto', sans-serif !important;
	font-size: 16px !important;
	line-height: 1.8;
	color: #1a1a2e !important;
	margin-bottom: 1.25rem;
}

/* Bold dentro del contenido */
.entry-content strong,
.entry-content b {
	font-family: 'DINPro-bold', sans-serif !important;
	color: #00557e !important;
}

/* Links dentro del contenido */
.entry-content a {
	color: #1c82eb !important;
	text-decoration: underline;
	transition: color 0.2s ease;
}

.entry-content a:hover {
	color: #00557e !important;
}

/* Tarjetas de post en el archivo/blog index */
.ast-archive-post .entry-title a,
.ast-article-post .entry-title a {
	font-family: 'DINPro-bold', sans-serif !important;
	color: #00557e !important;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ast-archive-post .entry-title a:hover,
.ast-article-post .entry-title a:hover {
	color: #1c82eb !important;
}

/* Excerpt en el listado */
.ast-archive-post .entry-summary,
.ast-article-post .entry-summary {
	font-family: 'Roboto', sans-serif !important;
	font-size: 15px;
	color: #444;
	line-height: 1.7;
}

/* Meta: fecha, autor, categoría */
.entry-meta,
.posted-on,
.byline,
.cat-links {
	font-family: 'DINPro', sans-serif !important;
	font-size: 13px;
	color: #1c82eb !important;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Fix layout full width */
.ast-narrow-container {
	--wp--custom--ast-content-width-size: 1200px;
	--wp--custom--ast-wide-width-size: 750px;
}

.ast-narrow-container .site-content > .ast-container {
	max-width: 1200px;
}