/* ==========================================================================
   Elementor Org Chart Widget — org-chart.css
   ========================================================================== */

/* ── Contenedor raíz ────────────────────────────────────────────────────── */
.eocw-org-chart {
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-x: auto;
	padding: 16px 8px 24px;
	box-sizing: border-box;
}

/* ── Nodo ────────────────────────────────────────────────────────────────── */
.eocw-node {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.eocw-node__card {
	position: relative;
	width: 140px;   /* overridden by Elementor control */
	height: 160px;  /* overridden by Elementor control */
	border-radius: 12px;
	overflow: hidden;
	background-color: #c8d8e8;
	background-size: cover;
	background-position: center top;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-shadow: 0 4px 12px rgba(0,0,0,0.18);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.eocw-node__card--clickable {
	cursor: pointer;
}

.eocw-node__card--clickable:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

/* ── Franja de etiqueta ─────────────────────────────────────────────────── */
.eocw-node__label {
	background-color: rgba(30, 70, 150, 0.88);
	padding: 6px 8px;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

.eocw-node__name {
	margin: 0 0 2px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #ffffff;
	line-height: 1.2;
	white-space: normal;
	word-break: break-word;
}

.eocw-node__separator {
	width: 100%;  /* overridden by Elementor control */
	height: 2px;
	background-color: #4cbb87;
	margin: 3px 0;
	border: none;
	align-self: center; /* overridden by Elementor control */
	flex-shrink: 0;
}

.eocw-node__position {
	margin: 0;
	font-size: 0.68rem;
	color: rgba(255,255,255,0.85);
	line-height: 1.2;
	white-space: normal;
	word-break: break-word;
}

/* ── Subárbol ───────────────────────────────────────────────────────────── */
.eocw-node__subtree {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 48px; /* overridden by Elementor control */
}

/* ── Conectores ─────────────────────────────────────────────────────────── */

/* Línea vertical que baja desde la card padre */
.eocw-connector-v {
	width: 2px;
	height: 24px;  /* overridden */
	background-color: #4cbb87;
	flex-shrink: 0;
}

/* Envoltura de la línea horizontal */
.eocw-connector-h-wrap {
	width: 100%;
	display: flex;
	justify-content: center;
}

/* Línea horizontal que une los drops */
.eocw-connector-h {
	width: 100%;
	height: 2px;   /* overridden */
	background-color: #4cbb87;
}

/* Línea vertical que cae hacia cada hijo */
.eocw-connector-drop {
	width: 2px;    /* overridden */
	height: 24px;
	background-color: #4cbb87;
	margin: 0 auto;
	flex-shrink: 0;
}

/* ── Fila de hijos ──────────────────────────────────────────────────────── */
.eocw-children {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 24px;     /* overridden */
	flex-wrap: nowrap;
}

.eocw-child-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* ==========================================================================
   Popup
   ========================================================================== */

.eocw-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background-color: rgba(0,0,0,0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.eocw-popup-overlay[hidden] {
	display: none !important;
}

.eocw-popup {
	position: relative;
	background-color: #1e4696;
	border-radius: 12px;
	max-width: 640px;
	width: 100%;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,0.4);
	animation: eocw-popup-in 0.22s ease;
}

@keyframes eocw-popup-in {
	from { opacity: 0; transform: scale(0.92); }
	to   { opacity: 1; transform: scale(1); }
}

.eocw-popup__close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	color: rgba(255,255,255,0.75);
	font-size: 1.25rem;
	cursor: pointer;
	line-height: 1;
	padding: 4px 6px;
	z-index: 2;
	transition: color 0.15s;
}

.eocw-popup__close:hover,
.eocw-popup__close:focus {
	color: #ffffff;
	background: none !important;
}

.eocw-popup__inner {
	display: flex;
	flex-direction: row;
	gap: 24px;
	padding: 28px 28px 28px 24px;
	box-sizing: border-box;
	align-items: flex-start;
}

/* ── Columna imagen ─────────────────────────────────────────────────────── */
.eocw-popup__left {
	flex-shrink: 0;
}

.eocw-popup__img {
	width: 140px;
	height: 140px;
	object-fit: cover;
	border-radius: 12px;  /* overridden by Elementor control */
	display: block;
	box-sizing: border-box;
}

/* ── Columna texto ──────────────────────────────────────────────────────── */
.eocw-popup__right {
	flex: 1;
	min-width: 0;
	padding-top: 4px;
}

.eocw-popup__name {
	margin: 0 0 4px;
	font-size: 1.1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #ffffff;
}

.eocw-popup__position {
	margin: 0 0 8px;
	font-size: 0.875rem;
	color: rgba(255,255,255,0.80);
}

.eocw-popup__separator {
	width: 100%;  /* overridden by Elementor control */
	height: 2px;
	background-color: #4cbb87;
	margin: 0 0 12px;
	border: none;
}

.eocw-popup__desc {
	font-size: 0.875rem;
	color: rgba(255,255,255,0.90);
	line-height: 1.6;
}

.eocw-popup__desc > *:last-child {
	margin-bottom: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
	.eocw-popup__inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 24px 20px 20px;
	}

	.eocw-popup__separator {
		width: 60%;
		margin: 0 auto 12px;
	}
}
