.circuito3d-widget {
	position: relative;
	width: 100%;
	height: min(82vh, 820px);
	min-height: 480px;
	overflow: hidden;
	border-radius: 20px;
	box-shadow: 0 20px 60px -30px rgba(20, 22, 26, .35);
	background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f3f4f5 55%, #e7e9ec 100%);
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: #1b1b1b;
}

#c3dStage {
	position: absolute;
	inset: 0;
}

#c3dStage canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

.c3d-hud {
	position: absolute;
	pointer-events: none;
	z-index: 2;
}

#c3dBrand {
	top: 26px;
	left: 32px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

#c3dBrand .c3d-kicker {
	font-size: 11px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: #8b8f95;
	font-weight: 700;
}

#c3dBrand .c3d-title {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.01em;
}

#c3dHint {
	position: static;
	margin-top: 6px;
	font-size: 12px;
	color: #8b8f95;
	letter-spacing: .02em;
	pointer-events: none;
	transition: opacity .2s ease;
}

/* ---- leyenda del ícono de Free Walking Tour: genérica junto al hint (desktop) /
   puntual junto a la dirección de la parada seleccionada (mobile, visible en la hoja asomada) ---- */
.c3d-legend {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
	font-size: 10.5px;
	color: #9aa0a6;
	letter-spacing: .01em;
}

.c3d-legend-icon {
	width: 9px;
	height: 11px;
	flex: none;
	background-color: #e1051c;
	-webkit-mask: url('../img/icon/guia.svg') no-repeat center / contain;
	mask: url('../img/icon/guia.svg') no-repeat center / contain;
}

.c3d-legend--detail {
	display: none;
}

.circuito3d-widget.compact .c3d-legend--brand {
	display: none;
}

.circuito3d-widget.compact #c3dDetail .c3d-legend--detail.show {
	display: flex;
}

#c3dTitleTag {
	top: 26px;
	right: 32px;
	text-align: right;
	opacity: 0;
	transition: opacity .18s ease;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 3px;
}

#c3dTitleTag .tt-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

#c3dTitleTag .num {
	font-size: 15px;
	font-weight: 800;
	color: #fff;
	background: #e1051c;
	min-width: 34px;
	padding: 6px 9px;
	border-radius: 999px;
	text-align: center;
	box-shadow: 0 6px 18px rgba(225, 5, 28, .35);
}

#c3dTitleTag .name {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -.01em;
	max-width: 340px;
	text-align: left;
}

#c3dTitleTag .sub {
	font-size: 13px;
	font-weight: 700;
	color: #8b8f95;
	letter-spacing: .02em;
}

#c3dTitleTag.show {
	opacity: 1;
}

.circuito3d-widget.compact #c3dBrand {
	top: 14px;
	left: 16px;
}

.circuito3d-widget.compact #c3dBrand .c3d-kicker {
	font-size: 9px;
	letter-spacing: .18em;
}

.circuito3d-widget.compact #c3dBrand .c3d-title {
	font-size: 15px;
	white-space: nowrap;
}

.circuito3d-widget.compact #c3dHint {
	display: none;
}

.circuito3d-widget.focused #c3dHint,
.circuito3d-widget.focused #c3dTitleTag {
	opacity: 0 !important;
}

.circuito3d-widget.compact #c3dHint,
.circuito3d-widget.compact #c3dTitleTag {
	display: none;
}

.circuito3d-widget.compact #c3dBrand {
	transition: opacity .3s ease;
	top: 12px;
	left: 12px;
	gap: 2px;
	background: rgba(255, 255, 255, .86);
	backdrop-filter: blur(10px);
	padding: 8px 14px;
	border-radius: 14px;
	box-shadow: 0 6px 20px -10px rgba(20, 22, 26, .3);
}

.circuito3d-widget.compact.sheet-full #c3dBrand {
	opacity: 0;
}

/* ---- panel de detalle ---- */
#c3dDetail {
	position: absolute;
	z-index: 4;
	box-sizing: border-box;
	top: 0;
	right: 0;
	width: min(44vw, 580px);
	height: 100%;
	padding: clamp(24px, 4vw, 48px) clamp(22px, 3vw, 40px);
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow-y: auto;
	background: #fff;
	box-shadow: -24px 0 60px -30px rgba(20, 22, 26, .28);
	opacity: 0;
	transform: translate3d(24px, 0, 0);
	pointer-events: none;
	transition: opacity .34s cubic-bezier(.22, .61, .36, 1), transform .44s cubic-bezier(.22, .61, .36, 1);
	will-change: opacity, transform;
	border-radius: 0 20px 20px 0;
}

.circuito3d-widget.focused #c3dDetail {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

#c3dDetail .head {
	display: flex;
	align-items: center;
	gap: 14px;
}

#c3dDetail .badge {
	font-size: 17px;
	font-weight: 800;
	color: #fff;
	background: #e1051c;
	min-width: 44px;
	height: 44px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	box-shadow: 0 8px 22px rgba(225, 5, 28, .32);
	flex: none;
}

#c3dDetail .badge.is-closed {
	background: #9aa0a6;
	box-shadow: none;
}

#c3dDetail h2 {
	margin: 0;
	font-size: clamp(20px, 2.1vw, 28px);
	line-height: 1.15;
	letter-spacing: -.015em;
}

#c3dDetail .sub {
	margin: 9px 0 0;
	font-size: 13px;
	color: #8b8f95;
	font-weight: 600;
	letter-spacing: .02em;
}

#c3dDetail .sub .badge-closed {
	margin-left: 8px;
	font-size: 11px;
	font-weight: 800;
	color: #6d7278;
	background: #f0f1f3;
	border-radius: 99px;
	padding: 3px 10px;
	letter-spacing: .02em;
	white-space: nowrap;
}

#c3dDetail .photo {
	aspect-ratio: 16/10;
	border-radius: 14px;
	overflow: hidden;
	background: #f1f2f4;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: #a7abb1;
	letter-spacing: .06em;
	text-transform: uppercase;
	font-weight: 700;
	border: 1px dashed #d9dbdf;
}

#c3dDetail .photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

#c3dDetail .photo.has-img {
	border: 0;
}

#c3dDetail .body {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.62;
	color: #3a3d42;
	text-wrap: pretty;
}

#c3dDetail .body p {
	margin: 0 0 .9em;
}

#c3dDetail .body strong {
	color: #1b1d21;
}

#c3dDetail .back {
	margin-top: auto;
	align-self: flex-start;
	display: flex;
	align-items: center;
	gap: 9px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: #1b1d21;
	background: #f3f4f6;
	border: 0;
	border-radius: 999px;
	padding: 12px 20px;
	cursor: pointer;
	transition: background .18s ease, transform .18s ease;
}

#c3dDetail .back:hover {
	background: #e7e9ec;
	transform: translateX(-2px);
}

#c3dDetail .back svg {
	width: 14px;
	height: 14px;
}

#c3dDetail .walk-tour {
	display: none;
	align-items: flex-start;
	gap: 10px;
	background: #fdf1f2;
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 12.5px;
	line-height: 1.45;
	color: #7a2530;
}

#c3dDetail .walk-tour.show {
	display: flex;
}

#c3dDetail .walk-tour-icon {
	width: 17px;
	height: 21px;
	flex: none;
	margin-top: 1px;
	background-color: #e1051c;
	-webkit-mask: url('../img/icon/guia.svg') no-repeat center / contain;
	mask: url('../img/icon/guia.svg') no-repeat center / contain;
}

/* ---- desktop/notebook: texto en una columna, foto vertical al lado (la mayoría de las fotos son verticales) ---- */
@media (min-width: 760px) {
	#c3dDetail {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(190px, 46%);
		grid-template-rows: auto auto minmax(0, 1fr) auto auto;
		column-gap: 24px;
		row-gap: 4px;
	}

	#c3dDetail .head {
		grid-column: 1;
		grid-row: 1;
	}

	#c3dDetail .sub {
		grid-column: 1;
		grid-row: 2;
		margin-bottom: 10px;
	}

	#c3dDetail .body {
		grid-column: 1;
		grid-row: 3;
		overflow-y: auto;
		font-size: 14px;
		line-height: 1.5;
	}

	#c3dDetail .body p {
		margin: 0 0 .7em;
	}

	#c3dDetail .walk-tour {
		grid-column: 1;
		grid-row: 4;
		margin-top: 6px;
	}

	#c3dDetail .back {
		grid-column: 1;
		grid-row: 5;
		margin-top: 0;
		align-self: start;
	}

	#c3dDetail .photo {
		grid-column: 2;
		grid-row: 1 / span 5;
		aspect-ratio: auto;
		width: 100%;
		height: 100%;
		max-height: none;
	}
}

/* ---- mobile: hoja inferior en dos estados (asomada / abierta) ---- */
#c3dDetail .grab,
#c3dDetail .more {
	display: none;
}

.circuito3d-widget.compact #c3dDetail {
	top: auto;
	bottom: 0;
	right: 0;
	left: 0;
	width: 100%;
	/* +20px sobre el peek base: le da lugar a la leyenda chiquita de Free Walking
	   Tour (.c3d-legend--detail) sin que el overflow:hidden se la recorte */
	height: calc(170px + env(safe-area-inset-bottom));
	border-radius: 24px 24px 0 0;
	padding: 10px 20px calc(16px + env(safe-area-inset-bottom));
	gap: 12px;
	overflow: hidden;
	opacity: 1;
	pointer-events: auto;
	transform: none;
	box-shadow: 0 -22px 46px -26px rgba(20, 22, 26, .30);
	transition: height .42s cubic-bezier(.22, .61, .36, 1);
	touch-action: pan-y;
}

.circuito3d-widget.compact.sheet-full #c3dDetail {
	height: calc(76% + env(safe-area-inset-bottom));
	overflow-y: auto;
}

.circuito3d-widget.compact #c3dDetail .grab {
	display: block;
	width: 38px;
	height: 4px;
	border-radius: 99px;
	background: #dcdee2;
	border: 0;
	padding: 0;
	margin: 0 auto 2px;
	flex: none;
}

.circuito3d-widget.compact #c3dDetail .head {
	gap: 12px;
}

.circuito3d-widget.compact #c3dDetail .badge {
	min-width: 38px;
	height: 38px;
	font-size: 15px;
}

.circuito3d-widget.compact #c3dDetail h2 {
	font-size: 18px;
	line-height: 1.2;
}

.circuito3d-widget.compact #c3dDetail .sub {
	font-size: 12px;
	margin-top: 6px;
}

.circuito3d-widget.compact #c3dDetail .more {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 34px;
	height: 34px;
	margin-left: auto;
	border: 0;
	border-radius: 99px;
	background: #f3f4f6;
	color: #1b1d21;
	cursor: pointer;
	transition: transform .34s cubic-bezier(.22, .61, .36, 1), background .18s ease;
}

.circuito3d-widget.compact #c3dDetail .more svg {
	width: 15px;
	height: 15px;
}

.circuito3d-widget.compact.sheet-full #c3dDetail .more {
	transform: rotate(180deg);
}

.circuito3d-widget.compact #c3dDetail .photo {
	aspect-ratio: 4/3;
}

.circuito3d-widget.compact #c3dDetail .body {
	font-size: 14px;
	line-height: 1.52;
}

.circuito3d-widget.compact #c3dDetail .walk-tour {
	font-size: 11.5px;
	padding: 10px 12px;
	margin-top: 4px;
}

.circuito3d-widget.compact #c3dDetail .back {
	margin-top: 4px;
	padding: 11px 18px;
}

.circuito3d-widget.compact #c3dDetail .photo,
.circuito3d-widget.compact #c3dDetail .body,
.circuito3d-widget.compact #c3dDetail .walk-tour,
.circuito3d-widget.compact #c3dDetail .back {
	opacity: 0;
	transition: opacity .2s ease;
}

.circuito3d-widget.compact.sheet-full #c3dDetail .photo,
.circuito3d-widget.compact.sheet-full #c3dDetail .body,
.circuito3d-widget.compact.sheet-full #c3dDetail .walk-tour,
.circuito3d-widget.compact.sheet-full #c3dDetail .back {
	opacity: 1;
	transition: opacity .3s ease .12s;
}

/* ---- riel de paradas ---- */
#c3dRail {
	position: absolute;
	z-index: 3;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 5px;
	padding: 14px 10px;
	touch-action: none;
	cursor: grab;
}

.circuito3d-widget.compact #c3dRail {
	display: flex;
}

.circuito3d-widget.compact.sheet-full #c3dRail {
	opacity: .25;
	pointer-events: none;
	transition: opacity .3s ease;
}

#c3dRail i {
	display: block;
	width: 11px;
	height: 2px;
	border-radius: 2px;
	background: #b9bdc3;
	transition: width .2s ease, background .2s ease;
}

#c3dRail i.near {
	width: 17px;
	background: #8b9096;
}

#c3dRail i.on {
	width: 26px;
	height: 3px;
	background: #e1051c;
}

#c3dRailPill {
	position: absolute;
	z-index: 3;
	/* fijo arriba a la derecha (no sigue al tick del riel): si acompañaba la parada
	   activa terminaba tapado por la hoja inferior en las paradas de más abajo.
	   top corrido para no pisar el título/kicker de #c3dBrand en mobile compact */
	top: 68px;
	right: 14px;
	pointer-events: none;
	font-size: 12px;
	font-weight: 800;
	color: #fff;
	background: #14161a;
	padding: 6px 12px;
	border-radius: 99px;
	opacity: 0;
	white-space: nowrap;
	box-shadow: 0 6px 16px -6px rgba(20, 22, 26, .5);
	transition: opacity .2s ease;
}

.circuito3d-widget.compact #c3dRail.scrub~#c3dRailPill,
#c3dRailPill.show {
	opacity: 1;
}

#c3dSwipe {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	bottom: calc(186px + env(safe-area-inset-bottom));
	display: none;
	justify-content: center;
	pointer-events: none;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	color: #6d7278;
	transition: opacity .4s ease;
}

#c3dSwipe span {
	background: rgba(255, 255, 255, .86);
	backdrop-filter: blur(10px);
	padding: 7px 14px;
	border-radius: 99px;
	box-shadow: 0 6px 20px -10px rgba(20, 22, 26, .3);
}

.circuito3d-widget.compact #c3dSwipe {
	display: flex;
}

.circuito3d-widget.compact.moved #c3dSwipe,
.circuito3d-widget.compact.sheet-full #c3dSwipe {
	opacity: 0;
}

#c3dDetail::-webkit-scrollbar {
	width: 8px;
}

#c3dDetail::-webkit-scrollbar-thumb {
	background: #e2e4e7;
	border-radius: 99px;
}

.circuito3d-widget.compact #c3dDetail {
	scrollbar-width: none;
}

.circuito3d-widget.compact #c3dDetail::-webkit-scrollbar {
	width: 0;
	height: 0;
}

@media (max-width: 759px) {
	.circuito3d-widget {
		height: min(88vh, 720px);
		min-height: 560px;
		border-radius: 16px;
	}
}

/* ---- notebooks / ventanas bajas: compactar el panel de detalle para que el texto entre sin scroll ---- */
@media (min-width: 760px) and (max-height: 1000px) {
	#c3dDetail {
		width: min(50vw, 620px);
		padding: clamp(10px, 2vw, 20px) clamp(14px, 2vw, 28px);
		column-gap: 20px;
		row-gap: 6px;
	}

	#c3dDetail .head {
		gap: 8px;
	}

	#c3dDetail .badge {
		min-width: 32px;
		height: 32px;
		font-size: 13px;
	}

	#c3dDetail h2 {
		font-size: clamp(16px, 1.6vw, 20px);
	}

	#c3dDetail .sub {
		margin-top: -2px;
		font-size: 11.5px;
		margin-bottom: 8px;
	}

	#c3dDetail .body {
		font-size: 12.5px;
		line-height: 1.34;
	}

	#c3dDetail .body p {
		margin: 0 0 .45em;
	}

	#c3dDetail .back {
		padding: 6px 14px;
		font-size: 12.5px;
	}
}

@media (min-width: 760px) and (max-height: 760px) {
	.circuito3d-widget {
		min-height: 420px;
	}

	#c3dDetail .body {
		font-size: 12px;
		line-height: 1.28;
	}
}

@media (prefers-reduced-motion: reduce) {
	#c3dDetail {
		transition-duration: .01ms;
	}
}
