*,
*::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;
}

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

#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;
	/* Centraliza o conteúdo (filtros) verticalmente */
	padding: 40px 20px;
	position: relative;
}

/* ── Logo dentro da Sidebar ── */
#logo {
	position: absolute;
	top: 100px;
	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;
}

/* ── Toggle da Sidebar ── */
#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;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.15s;
}

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

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

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

/* ── Área dos botões de filtro na Sidebar ── */
#filter-btns {
	display: flex;
	flex-direction: column;
	gap: 25px;
}

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

/* ── Botão de filtro (Cápsula) ── */
.filter-btn {
	width: 100%;
	height: 52px;
	padding: 0 12px;
	background: transparent;
	border: 2px solid #937855;
	border-radius: 26px;
	color: #937855;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	cursor: pointer;
	text-align: center;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

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

/* ── Imagens condicionais desktop/mobile ── */
#btn-back .img-mobile {
	display: none;
}

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

/* ── Botões de ícone ── */
.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);
}

/* ── 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;
}

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

	#sidebar-panel {
		width: 180px;
		padding: 30px 16px;
	}

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

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

/* ────────────────────────────────
   Responsivo — Mobile (≤ 600px)
 ──────────────────────────────── */
@media (max-width: 600px) {
	/* Logo desktop oculto; logo mobile aparece fixo no topo */
	#logo {
		display: none;
	}

	#logo-mobile {
		display: block;
		position: fixed;
		top: 0;
		left: 90px;
		transform: translateX(-50%);
		width: auto;
		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 vira drawer que sobe do fundo */
	#sidebar {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		flex-direction: column;
		align-items: stretch;
		overflow: visible;
		transition: transform 0.3s 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;
	}

	/* Toggle: tab retangular centralizada acima do painel (espelho do desktop) */
	#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;
	}

	/* Seta aponta para cima quando aberto */
	#sidebar-toggle svg {
		transform: rotate(-90deg);
	}

	/* Seta aponta para baixo quando fechado */
	#sidebar:not(.open) #sidebar-toggle svg {
		transform: rotate(90deg);
	}

	/* Painel ocupa largura total, altura automática */
	#sidebar-panel {
		order: 1;
		width: 100%;
		height: auto;
		border-radius: 20px 20px 0 0;
		padding: 14px 16px 28px;
		justify-content: flex-start;
		gap: 14px;
	}

	/* Í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;
		gap: 16px;
		margin: 0 0 14px;
	}

	/* Filtros em grid de 2 colunas */
	#filter-btns {
		order: 0;
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	/* Último botão ímpar: centralizado, mesma largura dos outros */
	#filter-btns .filter-btn:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		justify-self: center;
		width: calc(50% - 5px);
	}

	.filter-btn {
		height: 44px;
		font-size: 10px;
		letter-spacing: 0.8px;
	}

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

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