/* DOMMA Tour 3D 2.0 — jornada Fachada → Pavimento → Apartamento → Interior.
   Usa as mesmas variáveis do tour original (--sand, --line, --display, --body). */
:root {
  --jr-fundo: #1a1c17;                 /* grafite da lâmina, fundo da planta 3D */
  --jr-tijolo: #c9683c;                /* destaque: tijolo queimado */
  --jr-vidro: rgba(22, 24, 19, .74);
}

/* ---------- o que cada etapa mostra ---------- */
#levels { display: none !important; }                       /* a régua de pavimentos substitui a fileira antiga */
.brand #sub { display: none; }
.brand .jr-by { font-size: 12px; letter-spacing: .04em; margin: 9px 0 0; color: var(--sand-dim); white-space: nowrap; }
body.jr-fachada #domma-location, body.jr-planta #domma-location,
body.jr-fachada #domma-dock, body.jr-planta #domma-dock,
body.jr-fachada #mini, body.jr-planta #mini,
body.jr-fachada #marcos, body.jr-planta #marcos,
body.jr-fachada #lockhint, body.jr-planta #lockhint,
body.jr-fachada #cross, body.jr-planta #cross,
body.jr-fachada #domma-guide, body.jr-planta #domma-guide,
body.jr-fachada #domma-drone-open.domma-drone-floating, body.jr-planta #domma-drone-open.domma-drone-floating,
body.jr-fachada #domma-pilot.domma-pilot-floating, body.jr-planta #domma-pilot.domma-pilot-floating,
body.jr-fachada #utags { display: none !important; }
body.jr-fachada .vignette, body.jr-planta .vignette { background: linear-gradient(180deg, rgba(8, 11, 8, .5), transparent 20%, transparent 70%, rgba(8, 11, 8, .46)); }
/* contraste e saturação finais da imagem 3D (a exposição é ajustada em 05-acabamento.js) */
@media (pointer: fine) { #view { filter: contrast(1.13) saturate(1.09) !important; } }
/* no tour interno a moldura escura do original cobria um terço da tela; fica só nas bordas, e o nome do
   ambiente tem fundo próprio */
body.jr-interior .vignette { background: linear-gradient(180deg, rgba(8, 11, 8, .44), transparent 15%, transparent 76%, rgba(8, 11, 8, .4)); }
html.jr-boot #loading.off { opacity: 1; visibility: visible; pointer-events: auto; }
#domma-scene-preview.jr-off { display: none !important; }
/* nome do ambiente legível também sobre cenas claras (brita do rooftop, concreto do terraço) */
#domma-location { text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 2px 14px rgba(0, 0, 0, .6); }
#domma-location::before { content: ''; position: absolute; z-index: -1; inset: -34px -70px -30px -40px; pointer-events: none;
  background: radial-gradient(ellipse at 34% 56%, rgba(10, 12, 9, .5), rgba(10, 12, 9, .26) 46%, transparent 72%); }
/* atalhos do tour original: o piloto do Final 01 só no 7º; a vista do drone só no 7º, 8º e 9º */
body[data-jr-floor]:not([data-jr-floor="p7"]) #domma-pilot { display: none !important; }
body[data-jr-floor]:not([data-jr-floor="p7"]):not([data-jr-floor="lazer"]):not([data-jr-floor="atico"]) #domma-drone-open { display: none !important; }

/* ---------- camada que recebe o gesto de girar / aproximar ---------- */
#jr-stage { position: fixed; inset: 0; z-index: 3; touch-action: none; cursor: grab; outline: none; display: none; }
#jr-stage:active { cursor: grabbing; }
#jr-stage.jr-pick { cursor: pointer; }
body.jr-fachada #jr-stage, body.jr-planta #jr-stage { display: block; }
#jr-veil { position: fixed; inset: 0; z-index: 3; background: var(--jr-fundo); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
#jr-veil.on { opacity: 1; }
/* a transição avisa quando um ambiente novo ainda está sendo preparado */
#jr-veil::before { content: ''; position: absolute; left: 50%; top: 50%; width: 132px; height: 2px; margin: -1px 0 0 -66px; border-radius: 2px; opacity: 0; background: var(--line); transition: opacity .25s ease; }
#jr-veil::after { content: 'Preparando o ambiente'; position: absolute; left: 0; right: 0; top: calc(50% + 18px); text-align: center; opacity: 0;
  font: 500 10.5px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--sand-dim); transition: opacity .25s ease; }
#jr-veil i { position: absolute; left: 50%; top: 50%; width: 132px; height: 2px; margin: -1px 0 0 -66px; overflow: hidden; border-radius: 2px; opacity: 0; transition: opacity .25s ease; }
#jr-veil i::before { content: ''; position: absolute; inset: 0; width: 46%; background: linear-gradient(90deg, transparent, var(--sand), transparent); will-change: transform; }
#jr-veil.on.espera::before, #jr-veil.on.espera::after, #jr-veil.on.espera i { opacity: 1; }
#jr-veil.on.espera i::before { animation: jr-espera 1.25s ease-in-out infinite; }
@keyframes jr-espera { from { transform: translateX(-110%); } to { transform: translateX(330%); } }

/* ---------- navegação principal ---------- */
#jr-nav { position: fixed; z-index: 6; top: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--jr-vidro); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); max-width: calc(100vw - 36px); overflow-x: auto; scrollbar-width: none; }
#jr-nav::-webkit-scrollbar { display: none; }
#jr-nav button { min-height: 36px; padding: 0 15px; border: 0; background: transparent; font-size: 13px; letter-spacing: .015em; color: var(--sand-dim); flex: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#jr-nav button:hover { color: var(--sand); }
#jr-nav button[aria-current="page"] { background: #ece5d5; color: #26271e; }
#jr-nav button svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
body.locked #jr-nav, body.locked #jr-back { opacity: .35; transition: opacity .25s; }

/* ---------- régua de pavimentos ---------- */
#jr-ladder { position: fixed; z-index: 5; right: 30px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 4px; width: 216px; padding: 10px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--jr-vidro); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
body.jr-fachada #jr-ladder, body.jr-planta #jr-ladder { display: flex; }
#jr-ladder h2 { margin: 2px 4px 6px; font: 500 10px/1.2 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--sand-dim); }
#jr-ladder button { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 10px; border-color: transparent; background: transparent; text-align: left; white-space: normal; backdrop-filter: none; -webkit-backdrop-filter: none; }
#jr-ladder button b { font: 500 19px/1 var(--display); letter-spacing: .005em; color: var(--sand); white-space: nowrap; }
#jr-ladder button span { font-size: 11px; line-height: 1.3; color: var(--sand-dim); }
#jr-ladder button:hover, #jr-ladder button.jr-hover { background: rgba(245, 240, 230, .08); border-color: var(--line); }
#jr-ladder button[aria-current="true"] { background: #ece5d5; border-color: #ece5d5; }
#jr-ladder button[aria-current="true"] b { color: #26271e; }
#jr-ladder button[aria-current="true"] span { color: rgba(38, 39, 30, .72); }
#jr-ladder button:disabled { opacity: .5; cursor: default; }
#jr-ladder button:disabled:hover { background: transparent; border-color: transparent; }

/* ---------- bloco de contexto (canto inferior esquerdo) ---------- */
#jr-info { position: fixed; z-index: 4; left: 30px; bottom: 34px; max-width: min(420px, calc(100vw - 310px)); display: none; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); pointer-events: none; }
body.jr-fachada #jr-info, body.jr-planta #jr-info { display: block; }
#jr-eyebrow { margin: 0 0 9px; font-size: 11px; letter-spacing: .17em; text-transform: uppercase; line-height: 1.5; color: #e8ddc5; }
#jr-title { margin: 0 0 9px; font: 500 clamp(30px, 3.2vw, 44px)/1.06 var(--display); letter-spacing: -.012em; }
#jr-meta { margin: 0; font-size: 13px; line-height: 1.55; color: rgba(255, 251, 241, .82); }
#jr-note { display: flex; gap: 9px; align-items: flex-start; margin: 14px 0 0; padding: 10px 13px; max-width: 390px; border: 1px solid var(--line); border-radius: 12px; background: var(--jr-vidro); font-size: 11.5px; line-height: 1.5; color: var(--sand-dim); text-shadow: none; pointer-events: auto; }
#jr-note i { flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--jr-tijolo); }
#jr-units { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; max-width: 400px; pointer-events: auto; text-shadow: none; }
#jr-units button { min-height: 40px; min-width: 46px; padding: 0 12px; font-size: 13px; background: var(--jr-vidro); }
#jr-units button b { font: 500 18px/1 var(--display); letter-spacing: .02em; }
#jr-units button[aria-pressed="true"] { background: #ece5d5; color: #26271e; border-color: #ece5d5; }
#jr-hint { margin: 14px 0 0; font-size: 11px; letter-spacing: .015em; color: rgba(245, 240, 230, .6); }

/* ---------- cartão do apartamento / ambiente ---------- */
#jr-card { position: fixed; z-index: 7; left: 50%; bottom: 30px; transform: translateX(-50%); display: none; align-items: center; gap: 22px; padding: 16px 16px 16px 24px; max-width: calc(100vw - 36px);
  border: 1px solid var(--line); border-radius: 20px; background: rgba(23, 25, 20, .9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 18px 60px rgba(0, 0, 0, .32); }
body.jr-planta #jr-card.on { display: flex; }
#jr-card-num { font: 500 54px/.9 var(--display); letter-spacing: .01em; color: var(--sand); }
#jr-card-num small { display: block; margin-bottom: 7px; font: 500 9.5px/1 var(--body); letter-spacing: .18em; color: #cdbb91; }
#jr-card-num.jr-nome { font-size: 30px; line-height: 1.05; max-width: 210px; }
#jr-card-body { min-width: 0; flex: 1 1 auto; }
#jr-card-title { margin: 0 0 5px; font-size: 15px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
#jr-card-parts { margin: 0; font-size: 12px; line-height: 1.5; color: var(--sand-dim); max-width: 330px; }
#jr-card { width: max-content; }
#jr-card-style { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: #d9c79c; max-width: 330px; }
#jr-card-style b { font-weight: 500; color: #f0e2bd; }
#jr-style { position: fixed; z-index: 6; left: 156px; top: 104px; margin: 0; min-height: 44px; display: none; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--jr-vidro); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; color: var(--sand); white-space: nowrap; }
body.jr-interior #jr-style:not([hidden]) { display: inline-flex; }
body.locked #jr-style { opacity: .35; }
#jr-card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
#jr-enter { min-height: 46px; }
#jr-enter svg { width: 18px; height: 18px; }
#jr-card-close { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border-color: transparent; }
body.jr-planta.jr-sel #jr-info { opacity: 0; visibility: hidden; }
#utags .utag { transition: background .2s, border-color .2s, color .2s; }
#utags .utag.jr-on { background: #ece5d5; border-color: #ece5d5; color: #26271e; }
#utags .utag.jr-on small { color: rgba(38, 39, 30, .7); }
#utags .utag.jr-hover { border-color: rgba(245, 240, 230, .7); }

/* ---------- etiqueta do pavimento sob o cursor (fachada) ---------- */
#jr-tag { position: fixed; z-index: 4; left: 0; top: 0; display: none; padding: 8px 13px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(23, 25, 20, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; white-space: nowrap; will-change: transform; }
body.jr-fachada #jr-tag.on { display: block; }
#jr-tag b { display: block; font: 500 20px/1.05 var(--display); }
#jr-tag small { display: block; margin-top: 3px; font-size: 11px; color: var(--sand-dim); }

/* ---------- voltar à planta (interior) ---------- */
#jr-back { position: fixed; z-index: 6; left: 30px; top: 104px; display: none; align-items: center; gap: 9px; min-height: 44px; padding: 0 17px 0 13px; background: #ece5d5; color: #26271e; border-color: #ece5d5; font-weight: 500; box-shadow: 0 5px 25px rgba(0, 0, 0, .12); }
body.jr-interior #jr-back { display: inline-flex; }
#jr-back:hover { background: #fff9ee; border-color: #fff9ee; }
#jr-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- vistas reais ---------- */
#jr-vista { width: 560px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px 30px 26px; border: 1px solid var(--line); border-radius: 22px; background: #20261c; }
#jr-vista h2 { margin: 14px 0 8px; font: 500 38px/1.05 var(--display); }
#jr-vista > p { margin: 0 0 20px; font-size: 13px; line-height: 1.65; color: #bdbfb4; }
#jr-vista-list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
#jr-vista-list li { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 14px; border: 1px solid rgba(245, 240, 230, .1); border-radius: 12px; }
#jr-vista-list b { font: 500 21px/1 var(--display); }
#jr-vista-list span { font-size: 12px; line-height: 1.4; color: var(--sand-dim); }
#jr-vista-list em { font-style: normal; font-size: 11px; padding: 6px 10px; border-radius: 999px; border: 1px dashed rgba(245, 240, 230, .28); color: var(--sand-dim); white-space: nowrap; }
#jr-vista-list li.jr-ok { border-color: rgba(201, 216, 180, .45); background: rgba(201, 216, 180, .06); }
#jr-vista-list button { min-height: 40px; padding: 0 14px; font-size: 12px; }
#jr-vista footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
#jr-vista footer a { font-size: 12px; color: #d7c59e; text-underline-offset: 3px; }

/* ---------- telas menores ---------- */
@media (max-width: 1240px) {
  #domma-top-actions #domma-images span, #domma-top-actions #domma-guide span { display: none; }
  #domma-top-actions #domma-images, #domma-top-actions #domma-guide { width: 44px; padding: 0 !important; }
}
@media (max-width: 1099px) {
  #jr-nav { top: 84px; left: 18px; right: 18px; transform: none; max-width: none; justify-content: flex-start; width: max-content; }
  #jr-back { top: 140px; left: 18px; }
  #jr-style { top: 140px; left: 144px; }
}
@media (max-width: 760px) {
  #jr-nav { top: 76px; left: 12px; right: 12px; width: auto; }
  #jr-nav button { min-height: 38px; padding: 0 13px; font-size: 12.5px; }
  #jr-back { top: 130px; left: 12px; min-height: 42px; font-size: 13px; }
  #jr-style { top: 130px; left: 132px; min-height: 42px; font-size: 12px; padding: 0 12px; max-width: calc(100vw - 144px); overflow: hidden; text-overflow: ellipsis; }
  #jr-ladder { right: 10px; top: 132px; transform: none; width: auto; padding: 5px; gap: 2px; border-radius: 14px; }
  #jr-ladder h2 { display: none; }
  #jr-ladder button { display: block; min-height: 40px; min-width: 62px; padding: 4px 9px; text-align: center; }
  #jr-ladder button b { font-size: 17px; }
  #jr-ladder button span { display: none; }
  #jr-ladder button:disabled { display: none; }
  #jr-info { left: 16px; right: 92px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); max-width: none; }
  #jr-title { font-size: 29px; }
  #jr-eyebrow { font-size: 10px; letter-spacing: .13em; margin-bottom: 6px; }
  #jr-meta { font-size: 12px; }
  #jr-note { font-size: 10.5px; padding: 8px 10px; margin-top: 10px; }
  #jr-units { gap: 5px; margin-top: 12px; }
  #jr-units button { min-height: 40px; min-width: 42px; padding: 0 9px; }
  #jr-hint { display: none; }
  #jr-card { left: 10px; right: 10px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; max-width: none; flex-wrap: wrap; gap: 12px 16px; padding: 16px; border-radius: 18px; }
  #jr-card-title { white-space: normal; }
  #jr-card-num { font-size: 44px; }
  #jr-card-num.jr-nome { font-size: 25px; max-width: none; }
  #jr-card-body { flex: 1 1 150px; }
  #jr-card-actions { width: 100%; }
  #jr-enter { flex: 1; }
  body.jr-planta.jr-sel #jr-ladder { display: none; }
  #jr-vista { padding: 22px; border-radius: 18px; }
  #jr-vista h2 { font-size: 31px; }
  #jr-vista-list li { grid-template-columns: 58px 1fr; }
  #jr-vista-list li > :last-child { grid-column: 1 / -1; justify-self: start; }
}
@media (max-height: 520px) {
  #jr-nav { top: 13px; left: auto; right: 150px; transform: none; max-width: calc(100vw - 330px); }
  #jr-back { top: 66px; }
  #jr-ladder { top: 62px; transform: none; max-height: calc(100dvh - 74px); overflow-y: auto; }
  #jr-note, #jr-hint { display: none; }
  #jr-info { bottom: 14px; }
  #jr-title { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { #jr-veil { transition: none; } }
