/* =========================================================================
   Tema PDF 1.3 · Mapa interactivo de conexiones
   ========================================================================= */
.pdf-mapa {
	--mapa-avion: #1e3057;
	--mapa-tren: var(--pdf-primario);
	--mapa-tinta: #1e242e;
	--mapa-r: 1.1934;
	display: grid; grid-template-columns: minmax(280px, var(--b-col-texto, 34%)) minmax(0, 1fr);
	align-items: center; gap: clamp(20px, 3vw, 48px);
	min-height: 100vh; min-height: 100dvh;
	padding: clamp(36px, 7vh, 90px) var(--pdf-gutter);
}
.pdf-mapa__texto { align-self: center; }
.pdf-mapa__zona { display: grid; place-items: center; min-width: 0; }

/* Lienzo: mapa base + rutas (SVG) + ciudades (HTML, para que el texto se lea a cualquier tamaño) */
.pdf-mapa__lienzo {
	position: relative; width: min(100%, calc(84vh * var(--mapa-r))); width: min(100%, calc(84dvh * var(--mapa-r)));
	aspect-ratio: var(--mapa-r); container-type: inline-size;
	border-radius: 6px; overflow: hidden; background: #eaf2f9;
	box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 24px 60px -30px rgba(20, 30, 60, .45);
	-webkit-tap-highlight-color: transparent; user-select: none;
}
.pdf-mapa__base, .pdf-mapa__rutas, .pdf-mapa__puntos { position: absolute; inset: 0; width: 100%; height: 100%; }
.pdf-mapa__base { object-fit: contain; display: block; }
.pdf-mapa__rutas { overflow: visible; pointer-events: none; }
.pdf-mapa__puntos { pointer-events: none; }

/* Rutas */
.pdf-mapa__ruta { fill: none; stroke-linecap: round; }
.pdf-mapa__ruta.es-avion { stroke: var(--mapa-avion); }
.pdf-mapa__ruta.es-tren { stroke: var(--mapa-tren); stroke-linecap: butt; }
.pdf-mapa__grupo { transition: opacity .7s ease; }
.pdf-mapa__grupo.es-oculto { opacity: 0; }
.pdf-mapa__veh { transition: opacity .35s ease; }
.pdf-mapa__veh circle { fill: #fff; stroke: rgba(30, 48, 87, .18); stroke-width: .5; }
.pdf-mapa__veh.es-oculto { opacity: 0; }
.pdf-mapa__ico-avion, .pdf-mapa__veh.es-avion use { fill: var(--mapa-avion); }
.pdf-mapa__ico-tren > path:first-child { fill: var(--mapa-tren); }
.pdf-mapa__veh.es-avion { filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .18)); }

/* Destino (Sevilla): diana latente */
.pdf-mapa__destino { position: absolute; width: 0; height: 0; z-index: 3; }
.pdf-mapa__diana { position: absolute; left: 0; top: 0; width: clamp(14px, 2.6cqw, 22px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 clamp(2px, .45cqw, 3.5px) var(--mapa-tren), 0 2px 8px rgba(0, 0, 0, .2); scale: 0; transition: scale .8s cubic-bezier(.3, 1.6, .5, 1); }
.pdf-mapa__diana::after { content: ""; position: absolute; inset: 31%; border-radius: 50%; background: var(--mapa-tren); }
.pdf-mapa__diana i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--mapa-tren); opacity: 0; }
.es-iniciado .pdf-mapa__diana { scale: 1; }
.es-iniciado .pdf-mapa__diana i { animation: pdf-mapa-latido 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.es-iniciado .pdf-mapa__diana i + i { animation-delay: 1.3s; }
@keyframes pdf-mapa-latido { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(3.4); opacity: 0; } }
.pdf-mapa__destino.es-llegada .pdf-mapa__diana { animation: pdf-mapa-llegada .5s ease; }
@keyframes pdf-mapa-llegada { 40% { scale: 1.35; } }
.pdf-mapa__destino-nombre {
	position: absolute; left: 0; top: clamp(10px, 1.9cqw, 16px); translate: -50% 6px;
	padding: .38em .8em .34em; border-radius: 2px; white-space: nowrap;
	background: var(--mapa-tren); color: #fff; font-family: var(--pdf-fuente-rotulos); font-weight: 700;
	font-size: clamp(10px, 1.85cqw, 15px); letter-spacing: .16em; text-transform: uppercase; line-height: 1;
	box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); opacity: 0;
	transition: opacity .7s ease .35s, translate .7s var(--pdf-curva) .35s;
}
.es-iniciado .pdf-mapa__destino-nombre { opacity: 1; translate: -50% 0; }

/* Ciudades */
.pdf-mapa__ciudad {
	position: absolute; width: 30px; height: 30px; padding: 0; margin: -15px 0 0 -15px; border-radius: 50%; border: 0; background: none; cursor: pointer;
	pointer-events: auto; z-index: 2; opacity: 0; scale: .4;
	transition: opacity .45s ease, scale .55s cubic-bezier(.3, 1.6, .5, 1);
	transition-delay: var(--aparece, 0ms);
	font: inherit; color: var(--mapa-tinta); -webkit-tap-highlight-color: transparent;
}
.es-iniciado .pdf-mapa__ciudad { opacity: 1; scale: 1; }
.pdf-mapa__punto {
	position: absolute; left: 50%; top: 50%; width: clamp(9px, 1.55cqw, 13px); aspect-ratio: 1; translate: -50% -50%;
	border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 clamp(1.6px, .32cqw, 2.4px) var(--mapa-tinta), 0 1px 3px rgba(0, 0, 0, .2);
	transition: scale .35s cubic-bezier(.3, 1.6, .5, 1), background-color .25s, box-shadow .25s;
}
.pdf-mapa__nombre {
	position: absolute; white-space: nowrap; pointer-events: none;
	font-family: var(--pdf-fuente-rotulos); font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
	font-size: clamp(8px, 1.42cqw, 12.5px); line-height: 1; color: var(--mapa-tinta);
	text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 8px rgba(255, 255, 255, .9);
	transition: color .25s, letter-spacing .3s;
}
.pdf-mapa__nombre .es-corto { display: none; }
.pdf-mapa__ciudad--a .pdf-mapa__nombre, .pdf-mapa__ciudad--b .pdf-mapa__nombre { white-space: normal; width: max-content; max-width: 9.5em; text-align: center; line-height: 1.12; }
.pdf-mapa__nombre { transition: color .25s, letter-spacing .3s, margin-left .4s ease; }
.pdf-mapa__ciudad--d .pdf-mapa__nombre { left: calc(50% + clamp(7px, 1.3cqw, 11px)); top: 50%; translate: 0 -50%; }
.pdf-mapa__ciudad--i .pdf-mapa__nombre { right: calc(50% + clamp(7px, 1.3cqw, 11px)); top: 50%; translate: 0 -50%; }
.pdf-mapa__ciudad--a .pdf-mapa__nombre { left: 50%; bottom: calc(50% + clamp(7px, 1.3cqw, 11px)); translate: -50% 0; }
.pdf-mapa__ciudad--b .pdf-mapa__nombre { left: 50%; top: calc(50% + clamp(7px, 1.3cqw, 11px)); translate: -50% 0; }
.pdf-mapa__ciudad:hover, .pdf-mapa__ciudad:focus-visible, .pdf-mapa__ciudad.es-activa { z-index: 4; }
.pdf-mapa__ciudad:hover .pdf-mapa__punto, .pdf-mapa__ciudad:focus-visible .pdf-mapa__punto, .pdf-mapa__ciudad.es-activa .pdf-mapa__punto {
	scale: 1.45; background: var(--mapa-avion); box-shadow: inset 0 0 0 clamp(2px, .4cqw, 3px) #fff, 0 0 0 clamp(1.5px, .3cqw, 2.5px) var(--mapa-avion), 0 4px 10px rgba(0, 0, 0, .25);
}
.pdf-mapa__ciudad.es-tren-sola:hover .pdf-mapa__punto, .pdf-mapa__ciudad.es-tren-sola.es-activa .pdf-mapa__punto { background: var(--mapa-tren); box-shadow: inset 0 0 0 clamp(2px, .4cqw, 3px) #fff, 0 0 0 clamp(1.5px, .3cqw, 2.5px) var(--mapa-tren), 0 4px 10px rgba(0, 0, 0, .25); }
.pdf-mapa__ciudad:hover .pdf-mapa__nombre, .pdf-mapa__ciudad.es-activa .pdf-mapa__nombre { color: var(--mapa-avion); }
.pdf-mapa__ciudad:focus-visible { outline: none; }
.pdf-mapa__ciudad:focus-visible .pdf-mapa__nombre { text-decoration: underline; text-underline-offset: 3px; }

/* Ventana (bocadillo) de precios, en el centro del mapa */
.pdf-mapa__ventana {
	position: absolute; left: 50%; top: 50%; z-index: 10; transform: translate(-50%, -50%);
	width: min(360px, 88%); max-height: 90%; overflow: auto;
	background: #fff; color: var(--mapa-tinta); border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 30px 70px -20px rgba(15, 25, 50, .55);
	font-size: clamp(12px, 2.3cqw, 15px);
}
.pdf-mapa__ventana[hidden] { display: none; }
.pdf-mapa__ventana-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: .7em .7em .7em 1.1em; background: var(--mapa-avion); color: #fff; }
.pdf-mapa__ventana-titulo { margin: 0; font-family: var(--pdf-fuente-rotulos); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 1.02em; line-height: 1.2; }
.pdf-mapa__ventana-titulo small { display: block; margin-top: .25em; font-weight: 600; letter-spacing: .14em; font-size: .68em; opacity: .7; }
.pdf-mapa__cerrar {
	flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
	border-radius: 9px; border: 2px solid rgba(255, 255, 255, .9); background: transparent; color: #fff;
	transition: background-color .2s, color .2s;
}
.pdf-mapa__cerrar:hover, .pdf-mapa__cerrar:focus-visible { background: #fff; color: var(--mapa-avion); outline: none; }
.pdf-mapa__ventana-sub { margin: 0; padding: .8em 1.1em .2em; font-size: .72em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6b7787; }
.pdf-mapa__tabla { list-style: none; margin: 0; padding: .3em .6em .9em; }
.pdf-mapa__tabla li { display: grid; grid-template-columns: 2.1em minmax(0, 1fr) auto; align-items: center; gap: .55em; padding: .62em .5em; border-radius: 4px; }
.pdf-mapa__tabla li:nth-child(odd) { background: #f4f4f4; }
.pdf-mapa__tabla svg { width: 2.1em; height: 1.6em; overflow: visible; }
.pdf-mapa__tabla .es-medio { display: block; font-size: .7em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6b7787; margin-bottom: .15em; }
.pdf-mapa__tabla .es-op { line-height: 1.25; }
.pdf-mapa__tabla .es-precio { font-family: var(--pdf-fuente-titulos); font-weight: 700; font-size: 1.32em; color: var(--mapa-avion); white-space: nowrap; }
.pdf-mapa__tabla li.es-tren .es-precio { color: var(--mapa-tren); }
.pdf-mapa__tiempo { display: block; height: 3px; background: rgba(30, 48, 87, .1); }
.pdf-mapa__tiempo i { display: block; height: 100%; background: var(--mapa-tren); transform-origin: left center; }
.pdf-mapa__ventana.es-sin-tiempo .pdf-mapa__tiempo { display: none; }

/* Leyenda y ayuda */
.pdf-mapa__leyenda { list-style: none; margin: 1.6em 0 0; padding: 1.1em 0 0; border-top: 1px solid rgba(0, 0, 0, .1); display: grid; gap: .55em; font-size: .86em; }
.pdf-mapa__leyenda li { display: flex; align-items: center; gap: .7em; }
.pdf-mapa__leyenda svg { width: 3.4em; height: 1em; flex: none; overflow: visible; }
.pdf-mapa__ley-linea { fill: none; stroke: var(--mapa-avion); stroke-width: 1.6; }
.pdf-mapa__leyenda .es-tren .pdf-mapa__ley-linea { stroke: var(--mapa-tren); stroke-dasharray: 4 3; }
.pdf-mapa__ayuda { margin: 1.1em 0 0; font-size: .82em; color: var(--pdf-suave); display: flex; gap: .55em; align-items: baseline; }
.pdf-mapa__ayuda::before { content: ""; flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--mapa-tren); translate: 0 -.05em; animation: pdf-mapa-ayuda 2.4s ease-in-out infinite; }
@keyframes pdf-mapa-ayuda { 50% { opacity: .25; } }

/* Tabletas y móviles: el mapa debajo del texto, a todo el ancho */
@media (max-width: 1100px) {
	.pdf-mapa { grid-template-columns: minmax(0, 1fr); align-content: center; }
	.pdf-mapa__lienzo { width: min(100%, calc(70vh * var(--mapa-r))); width: min(100%, calc(70dvh * var(--mapa-r))); }
	.pdf-mapa__leyenda { display: flex; flex-wrap: wrap; gap: .5em 1.6em; }
}
@media (max-width: 699px) {
	.pdf-mapa { padding-left: 14px; padding-right: 14px; gap: 18px; }
	.pdf-mapa__texto { padding: 0 6px; }
	.pdf-mapa__lienzo { width: 100%; border-radius: 4px; }
	.pdf-mapa__ventana { width: min(310px, 92%); }
	.pdf-mapa__cerrar { width: 30px; height: 30px; border-radius: 8px; }
}
/* Mapa estrecho: nombres cortos */
@container (max-width: 560px) {
	.pdf-mapa__nombre .es-corto { display: inline; }
	.pdf-mapa__nombre .es-corto ~ .es-largo, .pdf-mapa__nombre .es-largo:has(+ .es-corto) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.pdf-mapa__ciudad, .pdf-mapa__diana, .pdf-mapa__destino-nombre { transition: none; }
	.es-iniciado .pdf-mapa__diana i, .pdf-mapa__ayuda::before { animation: none; }
}
