*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	height: 100%;
	overflow: hidden;
	font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
	background: #000;
	color: #fff;
}

/* ── Viewer krpano ── */
#pano {
	position: absolute;
	inset: 0;
	z-index: 0;
}

/* ── UI overlay ── */
#ui {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
}

/* ── Logo dentro da Sidebar ── */
#logo {
	position: absolute;
	top: 50px;
	left: 10px;
	right: 20px;
	width: 192px;
	height: auto;
	pointer-events: none;
	display: block;
}

/* ── Logo mobile (visível apenas em telas pequenas) ── */
#logo-mobile {
	display: none;
}

/* ── Botão voltar ao menu ── */
#btn-back {
	position: absolute;
	top: 40px;
	right: 40px;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #937855;
	border: 1px solid rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	text-decoration: none;
	transition: background 0.15s, transform 0.15s;
	z-index: 30;
}

#btn-back:hover {
	background: #7a6345;
	transform: scale(1.05);
}

#btn-back svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ── Botão VR (oculto no desktop, visível só no mobile; usa estilo .icon-btn) ── */
#btn-vr {
	display: none;
}

/* ── Painel lateral ── */
#sidebar {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	pointer-events: auto;
	transition: transform 0.3s ease-in;
	z-index: 20;
	overflow: visible;
}

#sidebar:not(.open) {
	transform: translateX(-212px);
}

#sidebar-panel {
	width: 212px;
	height: 100%;
	background: #EDE6DD;
	border-radius: 0 40px 40px 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 140px 16px 100px;
	gap: 0;
	position: relative;
	overflow: visible;
}

/* ── Botão de toggle (sai pela borda direita do painel) ── */
#sidebar-toggle {
	position: absolute;
	right: -34px;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 60px;
	background: #937855;
	border: none;
	border-radius: 0 8px 8px 0;
	color: #EDE6DD;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	transition: background 0.15s;
}

#sidebar-toggle:hover {
	background: #7a6345;
}

#sidebar-toggle svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: #EDE6DD;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.35s;
}

#sidebar:not(.open) #sidebar-toggle svg {
	transform: rotate(180deg);
}

/* ── Rótulo ── */
.sidebar-label {
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #937855;
	text-transform: uppercase;
	text-align: center;
	line-height: 22.1px;
	margin-bottom: 14px;
}

/* ── Grade de andares ── */
#floor-grid {
	display: flex;
	flex-direction: column-reverse;
	gap: 8px;
	width: 100%;
	overflow-y: auto;
	max-height: calc(100vh - 300px);
	scrollbar-width: thin;
	scrollbar-color: rgba(147, 120, 85, 0.35) transparent;
}

#floor-grid::-webkit-scrollbar {
	width: 4px;
}

#floor-grid::-webkit-scrollbar-thumb {
	background: rgba(147, 120, 85, 0.35);
	border-radius: 2px;
}

.floor-row {
	display: flex;
	gap: 8px;
	justify-content: center;
}

/* ── Botão de andar (círculo) ── */
.floor-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: transparent;
	border: 1.5px solid #937855;
	color: #937855;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	flex-shrink: 0;
}

.floor-btn:hover {
	background: rgba(147, 120, 85, 0.15);
}

.floor-btn.active {
	background: #937855;
	border-color: #937855;
	color: #EDE6DD;
}

/* Destaque (cobertura): com borda escura */
.floor-btn.destaque {
	background: transparent;
	border-color: #937855;
	color: #937855;
}

.floor-btn.destaque:hover {
	background: rgba(147, 120, 85, 0.15);
	border-color: #937855;
	color: #937855;
}

.floor-btn.destaque.active {
	background: #937855;
	border-color: #937855;
	color: #EDE6DD;
}

/* ── Botões de vista (parte inferior, centralizados) ── */
#vista-buttons {
	position: absolute;
	left: 52%;
	bottom: 30px;
	transform: translateX(-50%);
	display: flex;
	gap: 12px;
	pointer-events: auto;
	z-index: 20;
}

.vista-btn {
	padding: 14px 30px;
	border-radius: 999px;
	background: #937855;
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #EDE6DD;
	font-family: 'Montserrat', 'Segoe UI', sans-serif;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.3px;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.vista-btn:hover {
	background: #7d6547;
	transform: translateY(-1px);
}

.vista-btn:active {
	transform: translateY(0);
}

/* ── Footer da Sidebar (Ícones) ── */
#sidebar-footer {
	position: absolute;
	bottom: 40px;
	left: 20px;
	right: 20px;
	display: flex;
	justify-content: center;
	gap: 12px;
}

.icon-btn {
	flex-shrink: 0;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #937855;
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #EDE6DD;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.15s;
}

.icon-btn:hover {
	background: #7a6345;
	transform: scale(1.05);
}

.icon-btn svg {
	width: 26px;
	height: 33px;
	fill: none;
	stroke: #EDE6DD;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Toggle de ícones no fullscreen */
.icon-btn .icon-exit {
	display: none;
}

.icon-btn.is-fullscreen .icon-enter {
	display: none;
}

.icon-btn.is-fullscreen .icon-exit {
	display: block;
}

/* ── Modal Google Maps ── */
#maps-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(0, 0, 0, 0.72);
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
}

#maps-modal.open {
	display: flex;
}

#maps-modal-box {
	position: relative;
	width: min(720px, 92vw);
	height: min(500px, 75vh);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}

#maps-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

#maps-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
	z-index: 1;
}

#maps-close:hover {
	background: rgba(0, 0, 0, 0.9);
}

/* ── Planta dos finais (minimapa interativo) ── */
#final-map {
	position: absolute;
	right: 30px;
	bottom: 30px;
	width: 180px;
	pointer-events: auto;
	z-index: 25;
	filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
	user-select: none;
}

#final-map svg {
	width: 100%;
	height: auto;
	display: block;
}

#final-map .final {
	cursor: pointer;
}

#final-map .final-shape {
	fill: #EDE6DD;
	stroke: #937855;
	transition: fill 0.25s ease, stroke 0.25s ease;
}

#final-map .final-label {
	fill: #937855;
	pointer-events: none;
	transition: fill 0.25s ease;
}

#final-map .final:hover .final-shape {
	fill: #e0d6c5;
}

/* Final ativo: preenchimento bege destacado (número/contorno seguem marrom) */
#final-map .final.active .final-shape {
	fill: #DCCCB4;
	stroke: #937855;
}

#final-map-close {
	position: absolute;
	top: -33px;
	right: -10px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #937855;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #EDE6DD;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

#final-map-close:hover {
	background: #7a6345;
}

#final-map-show {
	position: absolute;
	bottom: 48px;
	right: 90px;
	width: 220px;
	display: none;
	box-sizing: border-box;
	background: #937855;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #EDE6DD;
	border-radius: 20px;
	padding: 4px 16px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.15s;
	line-height: 1.6;
	text-align: center;
	z-index: 25;
}

#final-map-show:hover {
	background: #7a6345;
}

/* ────────────────────────────────
   Responsivo — Tablet (≤ 900px)
──────────────────────────────── */
@media (max-width: 900px) {
	#btn-back {
		right: 20px;
	}

	#sidebar-panel {
		width: 180px;
		padding: 110px 12px 60px;
	}

	#sidebar:not(.open) {
		transform: translateX(-180px);
	}

	#logo {
		top: 40px;
		left: 15px;
		right: 15px;
		width: calc(100% - 30px);
	}

	#sidebar-footer {
		bottom: 30px;
		left: 15px;
		right: 15px;
	}

	#floor-grid {
		max-height: calc(100vh - 240px);
	}

	.floor-btn {
		width: 42px;
		height: 42px;
		font-size: 12px;
	}
}

/* ────────────────────────────────
   Responsivo — Altura curta (≤ 800px, desktop largo)
──────────────────────────────── */
@media (max-height: 800px) and (min-width: 901px) {
	#logo {
		top: 50px;
		width: calc(100% - 50px);
	}

	#sidebar-panel {
		padding: 115px 16px 55px;
	}

	#sidebar-footer {
		bottom: 16px;
	}

	.icon-btn {
		width: 52px;
		height: 52px;
	}

	.icon-btn svg {
		width: 22px;
		height: 22px;
	}

	.sidebar-label {
		font-size: 12px;
		line-height: 1.4;
		margin-bottom: 8px;
	}

	#floor-grid {
		max-height: calc(100vh - 210px);
		gap: 6px;
	}

	.floor-row {
		gap: 6px;
	}

	.floor-btn {
		width: 42px;
		height: 42px;
		font-size: 14px;
	}
}

/* ────────────────────────────────
   Responsivo — Mobile (≤ 600px)
 ──────────────────────────────── */
@media (max-width: 600px) {
	#logo {
		display: none;
	}

	#final-map {
		display: none;
		width: 150px;
		left: auto;
		transform: none;
		top: auto;
		right: 12px;
		bottom: 40px;
	}

	#vista-buttons {
		display: none;
		bottom: 16px;
		gap: 8px;
		width: calc(100% - 24px);
		justify-content: center;
	}

	.vista-btn {
		padding: 14px 22px;
		font-size: 14px;
	}

	#final-map-close {
		display: none;
	}

	#final-map-show {
		display: none !important;
	}

	#logo-mobile {
		display: block;
		position: fixed;
		top: 0;
		left: 90px;
		transform: translateX(-50%);
		width: 160px;
		max-width: 160px;
		pointer-events: none;
		z-index: 30;
	}

	#btn-back {
		right: 12px;
		top: 10px;
		width: 44px;
		height: 44px;
	}

	#btn-back svg {
		width: 20px;
		height: 20px;
	}

	/* Botão VR: visibilidade controlada por JS (showVRButton) — só aparece em
	   dispositivos com suporte real a VR imersivo (WebXR), seja mobile ou desktop. */

	#sidebar {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		flex-direction: column;
		align-items: stretch;
		overflow: visible;
		transition: transform 0.4s ease;
	}

	/* Fechado: painel some; sobram o toggle e os ícones acima dele */
	#sidebar:not(.open) {
		transform: none;
	}

	#sidebar:not(.open) #sidebar-panel {
		display: none;
	}

	/* Aberto: os ícones somem (e o painel encolhe, sem eles) */
	#sidebar.open #sidebar-footer {
		display: none;
	}

	#sidebar-toggle {
		order: 0;
		position: relative;
		top: auto;
		right: auto;
		align-self: center;
		width: 60px;
		height: 34px;
		border-radius: 8px 8px 0 0;
		transform: none;
		margin-bottom: 0;
	}

	#sidebar-toggle svg {
		transform: rotate(-90deg);
	}

	#sidebar:not(.open) #sidebar-toggle svg {
		transform: rotate(90deg);
	}

	#sidebar-panel {
		order: 1;
		width: 100%;
		height: auto;
		max-height: 72vh;
		overflow-y: auto;
		border-radius: 20px 20px 0 0;
		padding: 14px 16px 28px;
		justify-content: flex-start;
		align-items: stretch;
		gap: 12px;
	}

	/* Ícones flutuam acima do toggle (visíveis só com o menu fechado) */
	#sidebar-footer {
		order: -1;
		position: relative;
		bottom: auto;
		left: auto;
		right: auto;
		justify-content: center;
		padding-right: 140px;
		gap: 16px;
		margin: 0 0 14px;
	}

	.sidebar-label {
		margin-bottom: 0;
		text-align: center;
	}

	#floor-grid {
		display: grid;
		grid-template-columns: repeat(7, 1fr);
		gap: 6px;
		max-height: none;
		overflow-y: visible;
	}

	.floor-row {
		display: contents;
	}

	.floor-btn {
		width: 34px;
		height: 34px;
		max-width: 100%;
		aspect-ratio: 1;
		justify-self: center;
		font-size: 11px;
	}

	.icon-btn {
		width: 50px;
		height: 50px;
	}

	.icon-btn svg {
		width: 20px;
		height: 20px;
	}
}