/* Estilos b8j: giroscopio, tour guiado, paneo, compartir y contadores. Todo
   lo nuevo vive aqui; no se redefine ninguna clase de app.css. */

.tour-location-btn {
	position: fixed;
	bottom: calc(1rem + var(--s-7));
	left: 1rem;
	z-index: 10;
	background: var(--vr-glass);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid var(--vr-glass-line);
	color: var(--vr-ink);
	text-decoration: none;
}

.tour-hotspot-tip {
	position: absolute;
	bottom: calc(100% + var(--s-2));
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	background: var(--vr-glass);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid var(--vr-glass-line);
	border-radius: var(--r-sm);
	color: var(--vr-ink);
	font-size: var(--fs-xs);
	padding: var(--s-1) var(--s-2);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--dur-1) var(--ease);
}

.tour-hotspot:hover .tour-hotspot-tip,
.tour-hotspot:focus-visible .tour-hotspot-tip,
.tour-hotspot-near .tour-hotspot-tip {
	opacity: 1;
}

.tour-pan {
	position: fixed;
	/* Por encima del HUD inferior (miniaturas + botonera, ~10rem): antes
	   quedaba montado sobre la tira de escenas (8bb). */
	bottom: calc(var(--s-4) + 11rem);
	left: 50%;
	transform: translateX(-50%);
	display: grid;
	grid-template-columns: repeat(3, 2.25rem);
	grid-template-rows: repeat(2, 2.25rem);
	gap: var(--s-1);
	z-index: var(--z-hud);
}

.tour-pan-btn {
	grid-row: 1;
	background: var(--vr-glass);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	color: var(--vr-ink);
	border: 1px solid var(--vr-glass-line);
	border-radius: var(--r-full);
	/* La flecha centrada en el circulo: el padding base de boton (8x16) la
	   empujaba a la esquina inferior derecha de la celda de 36px (8bb). */
	padding: 0;
	display: grid;
	place-items: center;
	line-height: 1;
}

.tour-pan-btn[data-dir="left"] {
	grid-column: 1;
}

.tour-pan-btn[data-dir="up"] {
	grid-column: 2;
}

.tour-pan-btn[data-dir="right"] {
	grid-column: 3;
}

.tour-pan-btn[data-dir="down"] {
	grid-row: 2;
	grid-column: 2;
}

.tour-guide {
	position: fixed;
	top: var(--s-4);
	right: var(--s-4);
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-2);
	z-index: var(--z-hud);
}

.tour-guide-btn.tour-guide-btn-active {
	background: var(--accent);
	color: var(--accent-ink);
	border-color: var(--accent);
}

.tour-guide-caption {
	position: fixed;
	top: var(--s-4);
	left: 50%;
	transform: translateX(-50%);
	max-width: 90%;
	text-align: center;
	padding: var(--s-2) var(--s-4);
	z-index: var(--z-hud);
}

.tour-share-modal[open] {
	border: 1px solid var(--vr-glass-line);
	border-radius: var(--r-lg);
	background: var(--surface);
	color: var(--ink);
	box-shadow: var(--shadow-2);
	padding: var(--s-5);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s-3);
}

.tour-share-modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.tour-share-qr {
	width: 200px;
	height: 200px;
}

.tour-like:disabled {
	opacity: 0.7;
}

/* Modo embebido (/t/{guid}?embed=1, el iframe de la ficha): el visor cabe en
   un hueco de 16/10, asi que el HUD se pega al borde y sus controles bajan a
   tamano compacto. */
.tour-page-embed .tour-hud-bottom {
	bottom: var(--s-2);
	left: var(--s-2);
	right: var(--s-2);
	gap: var(--s-2);
	padding: var(--s-2);
}

.tour-page-embed .tour-actions button,
.tour-page-embed .tour-stats button,
.tour-page-embed .tour-guide button {
	padding: var(--s-1) var(--s-2);
	font-size: var(--fs-xs);
}

.tour-page-embed .tour-stats {
	font-size: var(--fs-xs);
}

.tour-page-embed .tour-scene-thumb {
	width: 56px;
	height: 40px;
}

.tour-page-embed .tour-pan {
	bottom: calc(var(--s-2) + 8rem);
	grid-template-columns: repeat(3, 1.75rem);
	grid-template-rows: repeat(2, 1.75rem);
}

.tour-page-embed .tour-guide {
	top: var(--s-2);
	right: var(--s-2);
	padding: var(--s-1);
}

.tour-password {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100dvh;
}

.tour-password form {
	display: flex;
	flex-direction: column;
	gap: var(--s-3);
	width: 90%;
	max-width: 320px;
}

.tour-password-error {
	color: var(--danger);
}

.tour-scene-title {
	position: fixed;
	top: calc(var(--s-4) + 3.5rem);
	left: 50%;
	transform: translateX(-50%);
	background: rgba(10, 16, 14, 0.72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--r-sm);
	color: #fff;
	font-size: var(--fs-sm);
	font-weight: 600;
	padding: var(--s-2) var(--s-4);
	z-index: var(--z-hud);
	pointer-events: none;
	opacity: 1;
	transition: opacity 400ms var(--ease);
}

.tour-scene-title-hide {
	opacity: 0;
}

.tour-hint {
	position: fixed;
	bottom: calc(var(--s-4) + 9.5rem);
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-3) var(--s-4);
	/* Scrim oscuro, no cristal: sobre una escena clara el glass al 8% con
	   texto claro es invisible (probado contra prod 2026-09-04). */
	background: rgba(10, 16, 14, 0.72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--r-sm);
	color: #fff;
	font-size: var(--fs-sm);
	text-align: center;
	z-index: var(--z-hud);
	pointer-events: auto;
	transition: opacity 300ms var(--ease);
}

.tour-hint-hide {
	opacity: 0;
}

.tour-viewer-placing {
	cursor: crosshair;
}

.tour-stage-editor .tour-hint {
	bottom: var(--s-4);
}

.tour-hint-phone {
	display: block;
	width: 1.1rem;
	height: 1.9rem;
	border: 2px solid currentColor;
	border-radius: 0.3rem;
	animation: tour-hint-tilt 2s var(--ease) infinite;
}

@keyframes tour-hint-tilt {
	0%,
	100% {
		transform: rotate(-16deg);
	}
	50% {
		transform: rotate(16deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tour-hint-phone {
		animation: none;
	}
}

/* Chrome movil (b8ba): al entrar en pointer coarse el HUD se oculta detras
   de un panel lateral que un tap sobre el visor saca/mete. */
.tour-side-panel {
	position: fixed;
	top: 50%;
	right: var(--s-3);
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	padding: var(--s-3);
	background: rgba(10, 16, 14, 0.72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--r-sm);
	z-index: var(--z-hud);
}

.tour-side-panel button {
	width: 100%;
	/* Fuera del HUD los botones caen al estilo lime por defecto; aqui siguen
	   el lenguaje glass del visor. */
	background: color-mix(in srgb, var(--vr-ink) 12%, transparent);
	color: var(--vr-ink);
	border: 1px solid var(--vr-glass-line);
	border-radius: var(--r-md);
	padding: var(--s-2) var(--s-3);
}

.tour-side-panel .tour-exit-btn,
.tour-actions .tour-exit-btn {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
}

.tour-side-panel .tour-gyro-active {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}

.tour-side-panel .tour-actions,
.tour-side-panel .tour-controls {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}

.tour-mobile:not(.tour-chrome-open) .tour-hud-bottom,
.tour-mobile:not(.tour-chrome-open) .tour-side-panel,
.tour-mobile:not(.tour-chrome-open) .tour-guide,
.tour-mobile:not(.tour-chrome-open) .tour-map,
.tour-mobile:not(.tour-chrome-open) .tour-location-btn,
.tour-mobile:not(.tour-chrome-open) .tour-contact-btn {
	opacity: 0;
	pointer-events: none;
	transition: opacity 300ms var(--ease);
}

/* Embed movil de la ficha (b8ba): mientras no esta en fullscreen, todo el
   chrome queda oculto y solo se ve el boton de pantalla completa. */
.tour-embed-idle .tour-hud-bottom,
.tour-embed-idle .tour-side-panel,
.tour-embed-idle .tour-guide,
.tour-embed-idle .tour-map,
.tour-embed-idle .tour-location-btn,
.tour-embed-idle .tour-contact-btn,
.tour-embed-idle .tour-pan,
.tour-embed-idle .tour-marquee {
	display: none;
}

.tour-embed-fullscreen {
	position: fixed;
	left: 50%;
	bottom: var(--s-4);
	transform: translateX(-50%);
	background: rgba(10, 16, 14, 0.72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--r-sm);
	color: #fff;
	font-size: var(--fs-sm);
	padding: var(--s-2) var(--s-4);
	z-index: var(--z-hud);
}

.tour-page:not(.tour-embed-idle) .tour-embed-fullscreen {
	display: none;
}

@media (pointer: coarse) {
	.tour-pan {
		display: none;
	}
}

/* Modo VR/cardboard (b8az): dos ojos lado a lado sobre fondo negro; en
   vertical se esconden y un aviso pide girar el movil a horizontal. */
.tour-vr-stage {
	position: fixed;
	inset: 0;
	display: flex;
	background: #000;
	z-index: calc(var(--z-hud) + 1);
}

.tour-vr-eye {
	position: relative;
	flex: 1 1 50%;
	height: 100%;
}

.tour-vr-eye + .tour-vr-eye {
	border-inline-start: 1px solid #000;
}

.tour-vr-rotate {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: none;
	flex-direction: column;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-3) var(--s-4);
	background: rgba(10, 16, 14, 0.72);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: var(--r-sm);
	color: #fff;
	font-size: var(--fs-sm);
	text-align: center;
}

@media (orientation: portrait) {
	.tour-vr-stage .tour-vr-eye {
		visibility: hidden;
	}

	.tour-vr-rotate {
		display: flex;
	}
}

.tour-vr .tour-side-panel,
.tour-vr .tour-hud-bottom,
.tour-vr .tour-map,
.tour-vr .tour-guide,
.tour-vr .tour-location-btn,
.tour-vr .tour-contact-btn,
.tour-vr .tour-marquee {
	display: none;
}
