:root {
	--mh-bg: #010101;
	--mh-red: #ec474a;
	--mh-text: #ffffff;
	--mh-muted: #9a9a9a;
	--mh-height: 84px;
	--mf-bg: #f7f7f7;
	--mf-text: #181821;
	--mf-muted: #6b6b73;
	--mh-font: "DM Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Header ---------- */
.mh {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--mh-bg);
	font-family: var(--mh-font);
	transition: box-shadow .25s ease;
}
.admin-bar .mh { top: 32px; }
@media (max-width: 782px) { .admin-bar .mh { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mh { top: 0; } }

.mh.is-scrolled { box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px rgba(0, 0, 0, .35); }

/* Páginas con cabecera de imagen (.bb-hero) o con .bb-menu-transparente (Inicio): menú transparente encima y fondo al bajar */
body:has(.bb-hero, .bb-menu-transparente) .mh {
	position: fixed;
	left: 0;
	right: 0;
	background: transparent;
	transition: background-color .3s ease, box-shadow .3s ease;
}
body:has(.bb-hero, .bb-menu-transparente) .mh.is-scrolled,
body:has(.bb-hero, .bb-menu-transparente) .mh.is-open { background: var(--mh-bg); }

.mh__inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 32px;
	height: var(--mh-height);
	display: flex;
	align-items: center;
	gap: 40px;
}

.mh__logo { display: block; flex-shrink: 0; line-height: 0; }
.mh__logo img { width: 150px; height: auto; }

.mh__panel {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
}

.mh__menu,
.mf__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
}

.mh__nav { margin-left: auto; }
.mh__menu { gap: 36px; }

.mh__menu a {
	position: relative;
	display: inline-block;
	padding: 8px 0;
	color: var(--mh-text);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
}
.mh__menu a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--mh-red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s ease;
}
.mh__menu a:hover::after,
.mh__menu a:focus-visible::after,
.mh__menu .current-menu-item > a::after,
.mh__menu .current-menu-ancestor > a::after { transform: scaleX(1); }

/* Submenú (2º nivel) */
.mh__menu .menu-item-has-children { position: relative; }
.mh__menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 10px 0;
	position: absolute;
	top: calc(100% + 14px);
	left: -20px;
	min-width: 290px;
	background: var(--mh-bg);
	border-top: 1px solid rgba(255, 255, 255, .12);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	z-index: 20;
}
.mh__menu .menu-item-has-children:hover > .sub-menu,
.mh__menu .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease;
}
.mh__menu .sub-menu a {
	display: block;
	padding: 12px 20px;
	font-size: 13px;
	letter-spacing: .06em;
	white-space: nowrap;
}
.mh__menu .sub-menu a::after { left: 20px; right: 20px; bottom: 6px; }
.mh__menu .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.mh__menu .sub-menu a:hover { color: var(--mh-red); }

.mh__actions { display: flex; gap: 12px; flex-shrink: 0; }

.mh__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	border: 1px solid var(--mh-red);
	color: var(--mh-text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.mh__btn:hover,
.mh__btn:focus-visible { background: var(--mh-red); color: var(--mh-text); }
.mh__btn--solid { background: var(--mh-red); }
.mh__btn--solid:hover,
.mh__btn--solid:focus-visible { background: transparent; }

.mh a:focus-visible,
.mh button:focus-visible,
.mf a:focus-visible { outline: 2px solid var(--mh-red); outline-offset: 4px; }

.mh__toggle { display: none; }

@media (max-width: 1024px) {
	.mh__inner { padding: 0 20px; height: 72px; justify-content: space-between; }
	.mh__logo img { width: 128px; }

	.mh__toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		background: transparent;
		border: 0;
		border-radius: 0;
		cursor: pointer;
	}
	.mh__toggle:hover,
	.mh__toggle:focus,
	.mh__toggle:active { background: transparent; }
	.mh__toggle-bar,
	.mh__toggle-bar::before,
	.mh__toggle-bar::after {
		display: block;
		width: 24px;
		height: 2px;
		background: var(--mh-text);
		transition: transform .25s ease, background-color .25s ease;
	}
	.mh__toggle-bar { position: relative; }
	.mh__toggle-bar::before,
	.mh__toggle-bar::after { content: ""; position: absolute; left: 0; }
	.mh__toggle-bar::before { top: -7px; }
	.mh__toggle-bar::after { top: 7px; }
	.mh__toggle[aria-expanded="true"] .mh__toggle-bar { background: transparent; }
	.mh__toggle[aria-expanded="true"] .mh__toggle-bar::before { transform: translateY(7px) rotate(45deg); }
	.mh__toggle[aria-expanded="true"] .mh__toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

	.mh__panel {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		padding: 16px 20px 28px;
		background: var(--mh-bg);
		border-top: 1px solid rgba(255, 255, 255, .08);
		max-height: calc(100vh - 72px);
		overflow-y: auto;
		visibility: hidden;
		opacity: 0;
		transform: translateY(-8px);
		transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	}
	.mh.is-open .mh__panel {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity .2s ease, transform .2s ease;
	}

	.mh__nav { margin-left: 0; }
	.mh__menu { flex-direction: column; gap: 0; }
	.mh__menu li { border-bottom: 1px solid rgba(255, 255, 255, .08); }
	.mh__menu a { display: block; padding: 16px 0; font-size: 15px; }
	.mh__menu a::after { display: none; }
	.mh__menu .current-menu-item > a { color: var(--mh-red); }

	.mh__menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 0 16px;
		background: transparent;
		border-top: 1px solid rgba(255, 255, 255, .08);
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}
	.mh__menu .sub-menu li:last-child { border-bottom: 0; }
	.mh__menu .sub-menu a { padding: 14px 0; font-size: 14px; color: var(--mh-muted); white-space: normal; }
	.mh__menu .sub-menu .current-menu-item > a { color: var(--mh-red); }

	.mh__actions { flex-direction: column; }
	.mh__btn { padding: 15px 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.mh, .mh *, .mf * { transition: none !important; }
}

/* ---------- Cabecera de imagen con parallax (js/hero.js) ---------- */
.bb-hero { overflow: hidden; isolation: isolate; }
.bb-hero.has-parallax { background-image: none !important; }
.bb-hero__bg {
	position: absolute;
	left: 0;
	right: 0;
	top: -20%;
	height: 140%;
	z-index: -1;
	background-position: center;
	background-size: cover;
	will-change: transform;
}
.bb-hero.has-parallax > .e-con-inner,
.bb-hero.has-parallax > .elementor-element { will-change: transform, opacity; }

/* ---------- Páginas sin Elementor (legales, entradas) ---------- */
body:not(.elementor-page) .site-main {
	max-width: 860px;
	margin: 0 auto;
	padding: 72px 32px 96px;
	font-family: var(--mh-font);
	color: #181821;
	line-height: 1.7;
}
body:not(.elementor-page) .site-main .page-header { margin-bottom: 32px; }
body:not(.elementor-page) .site-main .page-header .entry-title {
	margin: 0;
	font-family: "Bebas Neue", var(--mh-font);
	font-size: clamp(40px, 6vw, 64px);
	font-weight: 400;
	line-height: 1;
	color: #010101;
}
body:not(.elementor-page) .site-main a { color: var(--mh-red); }

/* Contenido de artículos y páginas sin Elementor */
body.single .page-content h2 { margin: 56px 0 16px; font-size: clamp(24px, 3vw, 30px); line-height: 1.25; }
body.single .page-content h3 { margin: 32px 0 12px; font-size: 20px; line-height: 1.3; }
body.single .page-content p { margin: 0 0 18px; }
body.single .page-content ul { margin: 0 0 24px; padding-left: 1.2em; }
body.single .page-content li { margin-bottom: 10px; }
body.single .page-content li::marker { color: var(--mh-red); }

body.single .wp-block-table { margin: 24px 0 32px; overflow-x: auto; }
body.single .wp-block-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
body.single .wp-block-table th,
body.single .wp-block-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid #e6e6ea; text-align: left; vertical-align: top; }
body.single .wp-block-table thead th { background: #010101; color: #fff; font-weight: 500; }
body.single .wp-block-table tbody tr:nth-child(even) td { background: #f7f7f7; }
body.single .wp-block-table tbody tr:last-child td { border-bottom: 2px solid var(--mh-red); }
@media (max-width: 767px) {
	body:not(.elementor-page) .site-main { padding: 48px 20px 64px; }
}

/* Listado del blog y archivos */
body.blog .site-main,
body.archive .site-main,
body.search .site-main { max-width: 1320px; }

body.blog .page-content,
body.archive .page-content,
body.search .page-content {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 40px 32px;
}
body.blog .page-content > article,
body.archive .page-content > article,
body.search .page-content > article {
	display: flex;
	flex-direction: column;
	margin: 0;
}
body.blog article .entry-title,
body.archive article .entry-title,
body.search article .entry-title {
	order: 2;
	margin: 20px 0 8px;
	font-family: var(--mh-font);
	font-size: 20px;
	font-weight: 500;
	line-height: 1.35;
}
body.blog article .entry-title a,
body.archive article .entry-title a,
body.search article .entry-title a { color: #010101; text-decoration: none; }
body.blog article .entry-title a:hover,
body.archive article .entry-title a:hover,
body.search article .entry-title a:hover { color: var(--mh-red); }
body.blog article > a,
body.archive article > a,
body.search article > a { order: 1; display: block; overflow: hidden; line-height: 0; }
body.blog article img,
body.archive article img,
body.search article img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform .4s ease;
}
body.blog article > a:hover img,
body.archive article > a:hover img,
body.search article > a:hover img { transform: scale(1.04); }
body.blog article p,
body.archive article p,
body.search article p { order: 3; margin: 0; font-size: 15px; color: #5c5c66; }
body.blog .pagination,
body.archive .pagination { grid-column: 1 / -1; }

/* ---------- Formulario de contacto (CF7) ---------- */
.mcf-form { font-family: var(--mh-font); }
.mcf-form p { margin: 0; }
.mcf { display: flex; flex-direction: column; gap: 15px; }

.mcf-form .wpcf7-form-control-wrap { display: block; }

.mcf-form input[type="text"],
.mcf-form input[type="email"],
.mcf-form input[type="tel"],
.mcf-form textarea {
	width: 100%;
	min-height: 47px;
	padding: 12px 16px;
	background: #f8f8f8;
	border: 1px solid transparent;
	border-radius: 8px;
	color: #000;
	font-family: inherit;
	font-size: .9rem;
	font-weight: 400;
	line-height: 1.5;
	transition: border-color .2s ease, background-color .2s ease;
}
.mcf-form textarea { min-height: 0; resize: vertical; }
@media (max-width: 767px) {
	.mcf-form input[type="text"],
	.mcf-form input[type="email"],
	.mcf-form input[type="tel"],
	.mcf-form textarea { font-size: 16px; }
}
.mcf-form input::placeholder,
.mcf-form textarea::placeholder { color: #7a7a7a; opacity: 1; }
.mcf-form input:focus,
.mcf-form textarea:focus {
	outline: none;
	background: #fff;
	border-color: var(--mh-red);
}

.mcf__accept { font-size: .85rem; color: #333; line-height: 1.5; }
.mcf__accept .wpcf7-list-item { margin: 0; }
.mcf__accept label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.mcf__accept input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: #e72f22;
}
.mcf__accept a { color: #e72f22; text-decoration: underline; }

.mcf__submit { position: relative; }
.mcf-form input[type="submit"] {
	width: 100%;
	padding: 14px 24px;
	background: #e72f22;
	border: 0;
	border-radius: 8px;
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .2s ease;
}
.mcf-form input[type="submit"]:hover,
.mcf-form input[type="submit"]:focus-visible { background: #f7511a; }
.mcf-form input[type="submit"]:focus-visible { outline: 2px solid #e72f22; outline-offset: 3px; }
.mcf-form input[type="submit"]:disabled { opacity: .5; cursor: not-allowed; }
.mcf-form .wpcf7-spinner { position: absolute; right: 12px; top: 50%; margin: -12px 0 0; }

.mcf-form .wpcf7-not-valid { border-color: #e72f22; }
.mcf-form .wpcf7-not-valid-tip { margin-top: 6px; color: #e72f22; font-size: .8rem; }
.mcf-form .wpcf7-response-output {
	margin: 15px 0 0 !important;
	padding: 12px 16px !important;
	border-radius: 8px;
	font-size: .9rem;
}
.mcf-form.sent .wpcf7-response-output { border-color: #2e7d32 !important; color: #2e7d32; }

/* ---------- Footer ---------- */
.mf {
	background: var(--mf-bg);
	color: var(--mf-text);
	font-family: var(--mh-font);
	font-size: 14px;
}

.mf__inner { max-width: 1320px; margin: 0 auto; padding: 0 32px; }

.mf__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	padding: 48px 0 36px;
}

.mf__logo { line-height: 0; flex-shrink: 0; }
.mf__logo img { width: 140px; height: auto; }

.mf__menu { gap: 12px 32px; }
.mf__menu a {
	color: var(--mf-text);
	text-decoration: none;
	transition: color .2s ease;
}
.mf__menu a:hover,
.mf__menu a:focus-visible { color: var(--mh-red); }

.mf__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	flex-wrap: wrap;
	padding: 20px 0 28px;
	border-top: 1px solid rgba(24, 24, 33, .1);
	color: var(--mf-muted);
	font-size: 13px;
}

.mf__copy { margin: 0; }
.mf__menu--legal { gap: 8px 24px; }
.mf__menu--legal a { color: var(--mf-muted); }

@media (max-width: 767px) {
	.mf__inner { padding: 0 20px; }
	.mf__top { flex-direction: column; align-items: flex-start; padding: 40px 0 28px; }
	.mf__nav .mf__menu { flex-direction: column; gap: 14px; }
	.mf__bottom { flex-direction: column-reverse; align-items: flex-start; }
}

/* ---------- Enlace a página de servicio en las cajas de Servicios ---------- */
.eael-infobox .infobox-button { margin-top: 18px; }
.eael-infobox a.eael-infobox-button {
	display: inline-block;
	padding: 10px 20px;
	border: 1px solid var(--mh-red);
	border-radius: 0;
	background: transparent;
	color: var(--mh-text);
	font-family: var(--mh-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	transition: background-color .2s ease;
}
.eael-infobox a.eael-infobox-button:hover,
.eael-infobox a.eael-infobox-button:focus-visible { background: var(--mh-red); color: var(--mh-text); }
