:root {
  --destaque: #4C5A37;
  --tinta: #22261F;
  --suave: #5E6457;
  --papel: #F7F7F3;
  --linha: #D3D6CC;
  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #cfd3cc; font-family: var(--sans); color: var(--tinta); }
a { color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

#cena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#cena.arrastar { cursor: grabbing; }
#cena.apontar { cursor: pointer; }

/* Menu lateral, estilo painel translúcido */
.menu {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 5;
  width: 280px;
  transform: translateX(0);
  transition: transform .35s ease;
}
.menu.fechado { transform: translateX(-280px); }
.menu-conteudo {
  height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 2.25rem) 2rem calc(env(safe-area-inset-bottom, 0px) + 2rem);
  background: color-mix(in srgb, var(--destaque) 86%, transparent);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex; flex-direction: column;
}
.menu-marca { font-weight: 700; font-size: 1.7rem; line-height: 1.1; margin: 0 0 3rem; }
.menu-salas { list-style: none; margin: 0; padding: 0; }
.menu-salas button {
  display: block; width: 100%; text-align: left;
  padding: .55rem 0; background: none; border: 0; color: #fff;
  font: 600 1.15rem var(--sans); cursor: pointer; opacity: .78;
}
.menu-salas button:hover, .menu-salas button[aria-current="true"] { opacity: 1; }
.menu-salas button[aria-current="true"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.menu-contacto { margin-top: auto; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.35); font-weight: 600; text-decoration: none; }
.menu-alternar {
  position: absolute; top: 50%; right: -44px; width: 44px; height: 52px;
  transform: translateY(-50%);
  background: var(--destaque); color: #fff; border: 0; cursor: pointer;
  font-size: 1.8rem; line-height: 1;
}
.menu.fechado .menu-alternar span { display: inline-block; transform: rotate(180deg); }

.contacto-topo {
  position: fixed; z-index: 4;
  top: calc(env(safe-area-inset-top, 0px) + 1.25rem); right: 1.25rem;
  padding: .7rem 1.4rem; border: 1.5px solid #fff; color: #fff;
  background: rgba(0,0,0,.18); text-decoration: none; font-weight: 600; letter-spacing: .02em;
}

.dica {
  position: fixed; z-index: 4; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  margin: 0; padding: .55rem 1rem; max-width: calc(100% - 2rem);
  background: rgba(20, 22, 18, .62); color: #fff; font-size: .875rem; text-align: center;
  border-radius: 999px; transition: opacity .6s;
}
.dica.escondida { opacity: 0; pointer-events: none; }

/* Carregamento */
.carregar {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
  background: var(--papel); padding: 2rem; text-align: center;
  transition: opacity .5s;
}
.carregar.saiu { opacity: 0; pointer-events: none; }
.carregar-titulo { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin: 0; }
.carregar-barra { width: min(320px, 80vw); height: 4px; background: var(--linha); }
.carregar-barra span { display: block; height: 100%; width: 0; background: var(--destaque); transition: width .2s; }
.carregar-erro { max-width: 52ch; color: var(--suave); margin: 0; }
.carregar-erro code { background: #e6e8e1; padding: 0 .3em; }

.botao {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.6rem;
  background: var(--destaque); color: #fff; border: 0; cursor: pointer;
  font: 600 1rem var(--sans); text-decoration: none;
}
.botao:hover { filter: brightness(.9); }

/* Ficha do móvel */
.ficha {
  width: min(960px, 100vw); max-width: 100vw; max-height: 100dvh;
  padding: 0; border: 0; background: var(--papel); color: var(--tinta);
}
.ficha[open] { display: grid; grid-template-columns: 1.15fr 1fr; }
.ficha::backdrop { background: rgba(20, 22, 18, .5); }
.ficha-modelo { position: relative; background: #E6E8E1; min-height: 360px; }
.ficha-modelo model-viewer { width: 100%; height: 100%; min-height: 360px; background: transparent; --progress-bar-color: var(--destaque); }
.botao-ar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  min-height: 42px; padding: 0 1.1rem; background: var(--tinta); color: #fff;
  border: 0; border-radius: 999px; font: 500 .9rem var(--sans); cursor: pointer;
}
.ficha-info { padding: clamp(1.5rem, 4vw, 2.5rem); overflow-y: auto; }
.ficha-sala { color: var(--destaque); font-weight: 600; margin: 0 0 .25rem; }
.ficha h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; margin: 0 0 .5rem; }
.ficha-preco { font-size: 1.3rem; font-weight: 600; margin: 0 0 1.25rem; }
.ficha-descricao { color: var(--suave); line-height: 1.6; margin: 0 0 1.5rem; }
.ficha-dados { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.5rem; margin: 0 0 2rem; padding-top: 1.25rem; border-top: 1px solid var(--linha); }
.ficha-dados dt { color: var(--suave); }
.ficha-dados dd { margin: 0; font-weight: 500; }
.fechar {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--papel); border: 1px solid var(--linha); color: var(--tinta);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}

@media (max-width: 760px) {
  .menu { width: 240px; }
  .menu.fechado { transform: translateX(-240px); }
  .menu-conteudo { padding-left: 1.5rem; padding-right: 1.5rem; }
  .contacto-topo { padding: .55rem 1rem; font-size: .9rem; }
  .ficha { height: 100dvh; }
  .ficha[open] { grid-template-columns: 1fr; grid-template-rows: 45dvh auto; }
  .ficha-modelo, .ficha-modelo model-viewer { min-height: 0; height: 45dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .menu, .carregar, .dica { transition: none; }
}
@media (min-width: 761px) {
  body:has(.menu:not(.fechado)) .dica { left: calc(50% + 140px); max-width: calc(100% - 320px); }
}
