.dge-mapa-maestro {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--dge-map-max-width, 1440px);
	margin-inline: auto;
	padding: var(--dge-map-padding, 32px);
	background: var(--dge-map-background, #fff);
	font-family: inherit;
}

.dge-mapa-maestro *,
.dge-mapa-maestro *::before,
.dge-mapa-maestro *::after {
	box-sizing: border-box;
}

.dge-mapa-maestro__hero {
	margin: 0 0 32px;
}

.dge-mapa-maestro__title {
	margin: 0;
	padding: var(--dge-title-padding, 22px);
	border-radius: var(--dge-title-radius, 12px);
	background: var(--dge-title-bg, #34495e);
	color: var(--dge-title-color, #fff);
	font-family: var(--dge-title-family, inherit);
	font-size: var(--dge-title-size, 34px);
	font-weight: var(--dge-title-weight, 500);
	line-height: 1.15;
	text-align: center;
	letter-spacing: .02em;
}

.dge-mapa-maestro__description {
	margin: 12px 0 0;
	color: var(--dge-description-color, #5f6b76);
	font-size: var(--dge-description-size, 15px);
	line-height: 1.6;
	text-align: center;
}

.dge-mapa-maestro__grid {
	display: grid;
	grid-template-columns: repeat(var(--dge-map-columns-desktop, 5), minmax(0, 1fr));
	gap: var(--dge-map-gap, 24px);
	align-items: start;
}

.dge-mapa-maestro__section {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 14px;
	padding: var(--dge-section-padding, 0);
	border: 1px solid var(--dge-section-border-color, #d7e0e7);
	border-radius: var(--dge-section-radius, 12px);
	background: var(--dge-section-background, #fff);
	box-shadow: var(--dge-section-shadow, 0 8px 24px rgba(23, 53, 83, .1));
	overflow: hidden;
}

.dge-mapa-maestro__section-header {
	display: flex;
	min-height: 168px;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px 18px;
	background: var(--dge-section-header-bg, #2f78be);
	color: var(--dge-section-header-color, #fff);
	text-align: center;
}

.dge-mapa-maestro__section-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	font-size: var(--dge-section-icon-size, 40px);
	line-height: 1;
}

.dge-mapa-maestro__section-copy {
	min-width: 0;
}

.dge-mapa-maestro__section-title {
	margin: 0;
	color: inherit;
	font-family: var(--dge-section-title-family, inherit);
	font-size: var(--dge-section-title-size, 24px);
	font-weight: var(--dge-section-title-weight, 600);
	line-height: 1.15;
	word-break: break-word;
}

.dge-mapa-maestro__section-description {
	margin: 10px 0 0;
	color: var(--dge-section-description-color, #fff);
	font-size: var(--dge-section-description-size, 14px);
	line-height: 1.45;
}

.dge-mapa-maestro__items {
	display: flex;
	flex-direction: column;
	gap: var(--dge-section-items-gap, 10px);
	padding: 0 12px 14px;
}

.dge-mapa-maestro__item {
	display: flex;
	width: 100%;
	min-height: 44px;
	align-items: center;
	gap: 9px;
	padding: var(--dge-item-padding, 12px);
	border: 1px solid var(--dge-item-border-color, #c8d5df);
	border-radius: var(--dge-item-radius, 8px);
	background: var(--dge-item-bg, #fff);
	box-shadow: var(--dge-item-shadow, none);
	color: var(--dge-item-color, #1f2d3d);
	font-family: var(--dge-item-family, inherit);
	font-size: var(--dge-item-size, 15px);
	font-weight: var(--dge-item-weight, 500);
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	transition: transform .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.dge-mapa-maestro a.dge-mapa-maestro__item:hover,
.dge-mapa-maestro a.dge-mapa-maestro__item:focus-visible {
	background: var(--dge-item-hover-bg, #eef5fb);
	color: var(--dge-item-hover-color, #173553);
	transform: translateY(-1px);
}

.dge-mapa-maestro a.dge-mapa-maestro__item:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--dge-item-border-color, #2f78be) 65%, #fff);
	outline-offset: 2px;
}

.dge-mapa-maestro__item.is-unlinked {
	opacity: .62;
	cursor: default;
}

.dge-mapa-maestro__item-icon {
	flex: 0 0 auto;
	font-size: var(--dge-item-icon-size, 16px);
	line-height: 1;
}

.dge-mapa-maestro__item-label {
	min-width: 0;
	word-break: break-word;
}

.dge-mapa-maestro__services {
	width: 100%;
	margin-top: 32px;
	border-radius: var(--dge-services-radius, 8px);
	overflow: hidden;
}

.dge-mapa-maestro__services-title {
	margin: 0;
	padding: var(--dge-services-padding, 16px);
	background: var(--dge-services-bg, #2f78be);
	color: var(--dge-services-color, #fff);
	font-size: var(--dge-services-title-size, 18px);
	font-weight: var(--dge-services-title-weight, 700);
	line-height: 1.2;
	text-transform: uppercase;
}

.dge-mapa-maestro__services-items {
	display: grid;
	grid-template-columns: repeat(var(--dge-services-columns, 6), minmax(0, 1fr));
	gap: var(--dge-services-gap, 10px);
	padding: 14px;
	border: 1px solid color-mix(in srgb, var(--dge-services-bg, #2f78be) 45%, #fff);
	border-top: 0;
	background: #fff;
}

.dge-mapa-maestro__services .dge-mapa-maestro__item {
	justify-content: center;
	text-align: center;
}

@media (max-width: 1100px) {
	.dge-mapa-maestro__grid {
		grid-template-columns: repeat(var(--dge-map-columns-tablet, 2), minmax(0, 1fr));
	}

	.dge-mapa-maestro__services-items {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.dge-mapa-maestro {
		padding: max(16px, calc(var(--dge-map-padding, 32px) / 2));
	}

	.dge-mapa-maestro__title {
		font-size: clamp(24px, 8vw, var(--dge-title-size, 34px));
	}

	.dge-mapa-maestro__grid {
		grid-template-columns: repeat(var(--dge-map-columns-mobile, 1), minmax(0, 1fr));
	}

	.dge-mapa-maestro__section-header {
		min-height: 140px;
	}

	.dge-mapa-maestro__services-items {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dge-mapa-maestro__item {
		transition: none;
	}
}

/* Jerarquía padre-hijo: sin flechas, con sangría y guía opcional. */
.dge-mapa-maestro__node {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: var(--dge-tree-gap, 8px);
}

.dge-mapa-maestro__children {
	position: relative;
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: var(--dge-tree-gap, 8px);
	margin-left: var(--dge-tree-indent, 18px);
	padding: var(--dge-tree-children-padding, 8px 0 0 14px);
}

.dge-mapa-maestro__children::before {
	position: absolute;
	top: 8px;
	bottom: 0;
	left: 0;
	display: var(--dge-tree-guide-display, block);
	width: var(--dge-tree-guide-width, 2px);
	border-radius: 999px;
	background: var(--dge-tree-guide-color, #d7e0e7);
	content: "";
}

.dge-mapa-maestro__node.is-group > .dge-mapa-maestro__item,
.dge-mapa-maestro__node.has-children > .dge-mapa-maestro__item {
	font-weight: var(--dge-tree-parent-weight, 700);
}

.dge-mapa-maestro__node.is-note > .dge-mapa-maestro__item {
	min-height: 0;
	line-height: 1.45;
}

.dge-mapa-maestro__node.is-group > .dge-mapa-maestro__item.is-unlinked,
.dge-mapa-maestro__node.has-children > .dge-mapa-maestro__item.is-unlinked,
.dge-mapa-maestro__node.is-note > .dge-mapa-maestro__item.is-unlinked {
	opacity: 1;
}

@media (max-width: 640px) {
	.dge-mapa-maestro__children {
		margin-left: min(var(--dge-tree-indent, 18px), 12px);
		padding-left: 10px;
	}
}

/* v1.1.2: títulos responsivos en una sola línea. */
.dge-mapa-maestro__section-copy {
	width: 100%;
}

.dge-mapa-maestro__section-title {
	display: block;
	width: 100%;
	max-width: 100%;
	white-space: nowrap;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}

/* En cuadrículas densas se libera el ancho del título y se reduce de forma fluida. */
@media (min-width: 1101px) {
	.dge-mapa-maestro__section-header {
		flex-direction: column;
		gap: 10px;
		padding-right: 10px;
		padding-left: 10px;
	}

	.dge-mapa-maestro__section-title {
		font-size: clamp(16px, 1.65vw, var(--dge-section-title-size, 24px));
	}
}
