/*
 * Centro Español — Plano Interactivo
 * Todos los colores y medidas expuestas como custom properties las escribe
 * Elementor desde la pestaña Estilo. Los valores aquí son los del diseño Figma.
 */

.cef-plano {
	--cef-plan-width: 42%;
	--cef-zone-stroke: #0d910d;
	--cef-zone-stroke-width: 3px;
	--cef-num-bg: #ffffff;
	--cef-num-color: #1c1b1f;
	--cef-num-size: 18;

	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: stretch;
}

/* --------------------------------------------------------------------- */
/* Panel del plano                                                        */
/* --------------------------------------------------------------------- */

.cef-plano__plan {
	flex: 0 1 var(--cef-plan-width);
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background-color: #bdbdbd;
	border-radius: 16px;
	padding: 24px;
	box-sizing: border-box;
}

.cef-plano__canvas {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cef-plano__svg {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	overflow: visible;
}

.cef-plano__hint {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #5f5f5f;
	text-align: center;
}

/* En un teléfono no hay cursor que pasar: se cambia el texto, no el diseño. */
.cef-plano__hint-touch {
	display: none;
}

@media (hover: none), (pointer: coarse) {
	.cef-plano__hint-mouse {
		display: none;
	}

	.cef-plano__hint-touch {
		display: inline;
	}
}

/* Zonas interactivas ---------------------------------------------------- */

.cef-zone {
	cursor: pointer;
	transition: opacity 0.2s ease, fill 0.2s ease, filter 0.2s ease;
}

.cef-zone,
.cef-zone * {
	transition: inherit;
}

.cef-zone:focus {
	outline: none;
}

.cef-zone.is-active,
.cef-zone.is-active *,
.cef-zone.is-hint,
.cef-zone.is-hint *,
.cef-zone:focus-visible,
.cef-zone:focus-visible * {
	stroke: var(--cef-zone-stroke);
	stroke-width: var(--cef-zone-stroke-width);
	vector-effect: non-scaling-stroke;
	stroke-linejoin: round;
	paint-order: stroke fill;
}

.cef-zone.is-active,
.cef-zone.is-hint {
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
}

.cef-plano.has-active .cef-zone:not(.is-active) {
	opacity: 1;
}

/* Números dibujados por el plugin (opcional) */

.cef-num {
	pointer-events: none;
}

.cef-num__bg {
	fill: var(--cef-num-bg);
	stroke: rgba(0, 0, 0, 0.15);
	stroke-width: 1;
	vector-effect: non-scaling-stroke;
}

.cef-num__t {
	fill: var(--cef-num-color);
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-weight: 700;
	text-anchor: middle;
	dominant-baseline: central;
}

/* --------------------------------------------------------------------- */
/* Panel de la tarjeta                                                    */
/* --------------------------------------------------------------------- */

.cef-plano__panel {
	flex: 1 1 0;
	min-width: 0;
	background-color: #ffffff;
	border: 1px solid #e9e9e9;
	border-radius: 16px;
	padding: 32px;
	box-sizing: border-box;
	position: relative;
}

.cef-card {
	display: none;
	flex-direction: column;
	gap: 16px;
	align-items: flex-start;
}

.cef-card[hidden] {
	display: none;
}

.cef-card.is-active {
	display: flex;
	animation: cef-fade 0.24s ease both;
}

@keyframes cef-fade {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.cef-card > * {
	max-width: 100%;
}

.cef-card__title {
	margin: 0;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 36px;
	line-height: 44px;
	font-weight: 400;
	color: #1c1b1f;
	align-self: stretch;
}

.cef-card__badge {
	margin: 0;
	display: inline-flex;
	align-items: center;
	align-self: stretch;
	background-color: #9f8366;
	color: #ffffff;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	padding: 8px 20px;
	border-radius: 40px;
	box-sizing: border-box;
}

.cef-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	align-self: flex-start;
	background-color: #0d910d;
	color: #ffffff;
	fill: #ffffff;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	padding: 12px 28px;
	border-radius: 40px;
	text-decoration: none;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.cef-card__cta:hover,
.cef-card__cta:focus-visible {
	background-color: #0a700a;
	color: #ffffff;
	text-decoration: none;
	transform: translateY(-1px);
}

.cef-card__cta-icon {
	width: 1.25em;
	height: 1.25em;
	flex: 0 0 auto;
}

.cef-card__desc {
	margin: 0;
	align-self: stretch;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 22px;
	color: #49454f;
}

.cef-card__desc p {
	margin: 0 0 0.85em;
}

.cef-card__desc p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------- */
/* Listado de espacios (estado en reposo)                                 */
/* --------------------------------------------------------------------- */

.cef-card--menu {
	gap: 8px;
}

.cef-menu__title {
	margin: 0;
	align-self: stretch;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 24px;
	line-height: 32px;
	font-weight: 600;
	color: #1c1b1f;
}

.cef-menu__intro {
	margin: 0;
	align-self: stretch;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: #6b6b6b;
}

.cef-menu__list {
	--cef-menu-thumb-w: 104px;
	--cef-menu-thumb-ratio: 4/3;

	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	align-self: stretch;
	width: 100%;
	border-top: 1px solid #e3e3e3;
	box-sizing: border-box;
	/* Doce filas son ~1200px. Elementor reescribe esto desde «Alto máximo del
	   listado» (con más especificidad); esto solo evita que la página se
	   estire sin freno si alguien vacía ese control. */
	max-height: 520px;
	overflow-y: auto;
}

.cef-menu__row + .cef-menu__row {
	border-top: 1px solid #e3e3e3;
}

.cef-menu__item {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 10px;
	margin: 0;
	border: 0;
	border-radius: 8px;
	background-color: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.cef-menu__thumb {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--cef-menu-thumb-w);
	aspect-ratio: var(--cef-menu-thumb-ratio);
	background-color: #d9d9d9;
	border-radius: 8px;
	overflow: hidden;
}

.cef-menu__thumb > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cef-menu__thumb--empty {
	color: rgba(0, 0, 0, 0.28);
}

.cef-menu__thumb--empty svg {
	width: 40%;
	max-width: 32px;
	height: auto;
}

.cef-menu__name {
	flex: 1 1 auto;
	min-width: 0;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 24px;
	font-weight: 500;
	color: #1c1b1f;
	transition: color 0.18s ease;
}

.cef-menu__chevron {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: currentColor;
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.cef-menu__chevron svg {
	width: 100%;
	height: 100%;
}

.cef-menu__item:hover .cef-menu__chevron,
.cef-menu__item:focus-visible .cef-menu__chevron {
	opacity: 1;
	transform: none;
}

/* Botón «Volver» ------------------------------------------------------- */

.cef-card__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #6b6b6b;
	transition: color 0.18s ease;
}

.cef-card__back svg {
	width: 18px;
	height: 18px;
}

.cef-card__back:hover,
.cef-card__back:focus-visible {
	color: #0d910d;
}

/* --------------------------------------------------------------------- */
/* Carrusel                                                               */
/* --------------------------------------------------------------------- */

.cef-carousel {
	--cef-slides: 2;
	--cef-slide-gap: 12px;
	--cef-arrow-size: 36px;
	--cef-slide-ratio: 4/3;
	--cef-dot-color: #9f8366;

	align-self: stretch;
	width: 100%;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas:
		"prev vp next"
		"dots dots dots";
	align-items: center;
	column-gap: 8px;
	row-gap: 10px;
}

.cef-carousel__viewport {
	grid-area: vp;
	overflow: hidden;
}

.cef-carousel__track {
	display: flex;
	gap: var(--cef-slide-gap);
	transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.cef-carousel__slide {
	position: relative;
	flex: 0 0 calc((100% - (var(--cef-slides) - 1) * var(--cef-slide-gap)) / var(--cef-slides));
	aspect-ratio: var(--cef-slide-ratio);
	background-color: #d9d9d9;
	border-radius: 12px;
	overflow: hidden;
}

.cef-carousel__slide > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cef-carousel__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--cef-arrow-size);
	height: var(--cef-arrow-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: transparent;
	color: #49454f;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.cef-carousel__nav--prev {
	grid-area: prev;
}

.cef-carousel__nav--next {
	grid-area: next;
}

.cef-carousel__nav svg {
	width: 100%;
	height: 100%;
}

.cef-carousel__nav:hover {
	transform: scale(1.08);
}

.cef-carousel__nav[disabled] {
	opacity: 0.3;
	cursor: default;
	transform: none;
}

.cef-carousel__nav[hidden] {
	display: none;
}

.cef-carousel__dots {
	grid-area: dots;
	display: flex;
	gap: 6px;
	justify-content: center;
	color: var(--cef-dot-color);
}

.cef-carousel__dots:empty {
	display: none;
}

.cef-carousel__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: currentColor;
	opacity: 0.3;
	cursor: pointer;
	transition: opacity 0.2s ease, width 0.2s ease;
}

.cef-carousel__dot.is-active {
	opacity: 1;
	width: 20px;
	border-radius: 4px;
}

/* Posición de las flechas ---------------------------------------------- */

.cef-plano[data-arrows="inside"] .cef-carousel {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"vp"
		"dots";
	position: relative;
}

.cef-plano[data-arrows="inside"] .cef-carousel__nav {
	position: absolute;
	top: calc(50% - var(--cef-arrow-size) / 2);
	z-index: 2;
	background-color: rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.cef-plano[data-arrows="inside"] .cef-carousel__nav--prev {
	left: 8px;
}

.cef-plano[data-arrows="inside"] .cef-carousel__nav--next {
	right: 8px;
}

.cef-plano[data-arrows="bottom"] .cef-carousel {
	grid-template-columns: 1fr auto auto 1fr;
	grid-template-areas:
		"vp vp vp vp"
		". prev next ."
		"dots dots dots dots";
}

/* Video ---------------------------------------------------------------- */

.cef-carousel__video {
	position: absolute;
	inset: 0;
	background-color: #111111;
}

.cef-carousel__poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cef-carousel__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.cef-carousel__play:hover {
	background-color: rgba(0, 0, 0, 0.75);
	transform: scale(1.06);
}

.cef-carousel__play svg {
	width: 28px;
	height: 28px;
}

.cef-carousel__video iframe,
.cef-carousel__video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	object-fit: cover;
}

/* --------------------------------------------------------------------- */
/* Aviso del editor                                                       */
/* --------------------------------------------------------------------- */

.cef-plano__notice {
	flex: 1 1 100%;
	margin: 8px 0 0;
	padding: 12px 16px;
	border-left: 4px solid #d9822b;
	background-color: #fff8ef;
	color: #7a4a10;
	font-size: 13px;
	line-height: 1.5;
	border-radius: 4px;
}

/* --------------------------------------------------------------------- */
/* Accesibilidad y responsive                                             */
/* --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.cef-plano *,
	.cef-plano *::before,
	.cef-plano *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/*
 * Red de seguridad. Elementor escribe estos mismos valores desde los controles
 * responsive (con más especificidad, así que los suyos mandan), pero si alguien
 * vacía el control de móvil el plano no debe quedarse en dos columnas de 42%.
 */
@media (max-width: 767px) {
	.cef-plano {
		--cef-plan-width: 100%;
	}

	.cef-carousel {
		--cef-slides: 1;
		/* Con las flechas fuera, en un teléfono cada píxel que ocupan se lo
		   quita a la foto. Se encogen para que la imagen respire. */
		--cef-arrow-size: 28px;
		column-gap: 6px;
	}

	.cef-plano__panel {
		padding: 24px 20px;
	}

	.cef-card__title {
		font-size: 28px;
		line-height: 34px;
	}

	.cef-card__cta {
		align-self: stretch;
	}

	.cef-menu__list {
		--cef-menu-thumb-w: 76px;
	}

	.cef-menu__item {
		gap: 12px;
		padding: 8px;
	}

	.cef-menu__title {
		font-size: 22px;
		line-height: 28px;
	}

	/* En táctil el chevron es la única pista de que la fila se pulsa. */
	.cef-menu__chevron {
		opacity: 1;
		transform: none;
	}
}
