/* ═══════════════════════════════════════════════════════════════════════
   ENERMAC · scene-ui.css
   UI HTML sobreposta à cena 3D interativa da usina de biogás
   (#biogasScene, ver js/biogas-scene.js). Fica em arquivo próprio por
   ser um componente grande e autocontido — progresso, navegação,
   tooltip, painel técnico e fullscreen.

   ÍNDICE
   1. Camada base (.scene-ui) + barra superior (progresso/toolbar)
   2. Tooltip de hover
   3. Barra de navegação inferior (anterior/próximo)
   4. Painel técnico lateral (desktop) / bottom sheet (mobile)
   5. Modo fullscreen
   ═══════════════════════════════════════════════════════════════════════ */

/* ══ 1. CAMADA BASE + BARRA SUPERIOR ══ */
.scene-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none; /* só os filhos interativos recebem clique/drag */
}

.scene-topbar {
  position: absolute;
  top: .9rem;
  left: .9rem;
  right: .9rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur-medium) var(--ease-out), transform var(--dur-medium) var(--ease-out);
}

.solutions__scene.is-ready .scene-topbar {
  opacity: 1;
  transform: none;
}

.scene-progress {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .6rem;
  border-radius: 999px;
  background: rgba(13, 30, 50, .55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.scene-progress::-webkit-scrollbar { display: none; }

.scene-progress__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  transition: background var(--dur-small) var(--ease-out), transform var(--dur-small) var(--ease-out);
}
.scene-progress__dot:hover {
  background: rgba(255, 255, 255, .75);
}
.scene-progress__dot.is-active {
  background: var(--c-orange);
  transform: scale(1.3);
}

.scene-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  pointer-events: auto;
}

.scene-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border: none;
  border-radius: 999px;
  background: rgba(13, 30, 50, .55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-small) var(--ease-out), transform var(--dur-small) var(--ease-out);
}
.scene-btn:hover,
.scene-btn:active {
  background: rgba(13, 30, 50, .8);
  transform: translateY(-1px);
}

.scene-btn--icon {
  padding: .55rem;
}
.scene-btn--icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ══ 2. TOOLTIP DE HOVER ══ */
.scene-tooltip {
  position: absolute;
  z-index: 3;
  padding: .35rem .7rem;
  border-radius: 8px;
  background: rgba(13, 30, 50, .88);
  color: #fff;
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.scene-tooltip.is-visible {
  opacity: 1;
  transform: none;
}

/* ══ 3. BARRA DE NAVEGAÇÃO INFERIOR ══ */
.scene-nav {
  position: absolute;
  bottom: .9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .4rem .5rem .4rem .5rem;
  border-radius: 999px;
  background: rgba(13, 30, 50, .55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-out);
  max-width: calc(100% - 1.8rem);
}
.solutions__scene.is-ready .scene-nav {
  opacity: 1;
}

/* Acima de 720px o painel técnico (.scene-panel) é um overlay que desliza
   por cima do canvas a partir da direita (ver seção 4), com z-index maior
   que o desta barra. Em larguras intermediárias a barra — centralizada no
   quadro inteiro — acaba parcialmente atrás do painel, escondendo o botão
   "próxima etapa". Com o painel aberto (.has-selection), recentraliza a
   barra dentro da faixa ainda visível (a área à esquerda do painel). */
@media (min-width: 721px) {
  .solutions__scene.has-selection .scene-nav {
    left: calc((100% - min(336px, 88%)) / 2);
    max-width: calc(100% - min(336px, 88%) - 1.8rem);
  }
}

.scene-nav__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background var(--dur-small) var(--ease-out);
}
.scene-nav__btn:hover,
.scene-nav__btn:active {
  background: rgba(255, 255, 255, .28);
}
.scene-nav__btn svg {
  width: 16px;
  height: 16px;
}

.scene-nav__label {
  color: #fff;
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══ 4. PAINEL TÉCNICO ══ */
.scene-panel {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  height: 100%;
  width: min(336px, 88%);
  background: var(--c-white);
  box-shadow: -18px 0 40px rgba(13, 30, 50, .18);
  padding: 1.6rem 1.4rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--dur-medium) var(--ease-out);
  pointer-events: none;
}
.scene-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.scene-panel__close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--c-gray);
  color: var(--c-ink-soft);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-small) var(--ease-out), color var(--dur-small) var(--ease-out);
}
.scene-panel__close:hover,
.scene-panel__close:active {
  background: var(--c-orange);
  color: #fff;
}

.scene-panel__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(240, 100, 42, .1);
  color: var(--c-orange);
  margin-bottom: .9rem;
}
.scene-panel__icon svg {
  width: 26px;
  height: 26px;
}

.scene-panel__num {
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--c-ink-soft);
  margin-bottom: .3rem;
}

.scene-panel__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.2;
  margin-bottom: .7rem;
  padding-right: 1.6rem; /* não colide com o botão fechar */
}

.scene-panel__desc {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--c-ink);
  margin-bottom: 1rem;
}

.scene-panel__role-label {
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-blue);
  margin-bottom: .3rem;
}

.scene-panel__role {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--c-ink-soft);
  margin-bottom: 1.2rem;
}

.scene-panel__specs {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(13, 30, 50, .08);
}
.scene-panel__specs dt {
  padding-top: .65rem;
  font-size: .72rem;
  color: var(--c-ink-soft);
}
.scene-panel__specs dd {
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(13, 30, 50, .08);
  font-size: .92rem;
  font-weight: 700;
  color: var(--c-ink);
}

@media (max-width: 720px) {
  /* No mobile o painel deixa de ser um bottom sheet sobreposto ao
     canvas — o JS (js/biogas-scene.js) já move o elemento para fora da
     <figure> da cena, como último filho do container. Aqui ele vira um
     card comum do fluxo da página, sem overlay e sem risco de toque
     acidental por cima do 3D. */
  .scene-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    max-height: none;
    margin-top: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transform: none;
    pointer-events: auto;
    display: none;
  }
  .scene-panel.is-open {
    display: block;
  }
  .scene-nav {
    bottom: .7rem;
  }
  .scene-btn {
    padding: .5rem .8rem;
    font-size: .72rem;
  }
}

/* ══ 5. FULLSCREEN ══ */
.solutions__scene.is-fullscreen,
.solutions__scene:fullscreen,
.solutions__scene:-webkit-full-screen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
}
