﻿/* =======================================================
   VIEWER — estilos da página e do viewport 3D
   Fonte, reset do body, container do canvas, efeitos de
   profundidade (blur + vinheta) e responsivo mobile.
======================================================= */

/* ---------- Fonte da marca ---------- */
/* Caminho absoluto da raiz: vale para viewer\ e Empresas\<nome>\.
   No deploy o Publicar.bat reescreve ../shared/ para .../shared/ */
@font-face {
  font-family: 'SuisseIntl';
  src: url('../shared/fonts/SuisseIntl-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'SuisseIntl';
  src: url('../shared/fonts/SuisseIntl-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'SuisseIntl';
  src: url('../shared/fonts/SuisseIntl-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: 'SuisseIntl';
  src: url('../shared/fonts/SuisseIntl-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

/* ---------- Reset / página ----------
   position:fixed + overflow:hidden travam o scroll/bounce
   no mobile; touch-action evita zoom por duplo toque. */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f2f2f2;
  font-family: 'SuisseIntl', Arial, sans-serif;
  touch-action: manipulation;
  position: fixed;
  inset: 0;
}

.viewer-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Efeito DOF falso ----------
   Blur só nas bordas via mask radial — o centro (produto)
   permanece nítido. pointer-events:none mantém a órbita. */
.viewer-container::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  backdrop-filter: blur(2.5px);
  mask-image: radial-gradient(circle at center, transparent 20%, rgba(0,0,0,0.2) 55%, rgba(0,0,0,0.95) 100%);
  -webkit-mask-image: radial-gradient(circle at center, transparent 20%, rgba(0,0,0,0.2) 55%, rgba(0,0,0,0.95) 100%);
  z-index: 2;
}

/* ---------- Vinheta ---------- */
.viewer-container::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 45%, rgba(0,0,0,0.10) 100%);
  z-index: 3;
}

/* ---------- Modal de aviso ----------
   Substituto do alert() nativo (gerado por mostrarAviso em
   paineis.js). Mesmo visual dos painéis: card branco, cantos
   arredondados, SuisseIntl. Persistente — fecha só no botão. */
.aviso-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(3px);
}

.aviso-card {
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  width: min(280px, calc(100vw - 64px));
  text-align: center;
  font-family: 'SuisseIntl', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  overflow: hidden;
}

.aviso-conteudo {
  padding: 20px 18px 18px;
}

.aviso-titulo {
  font-size: 17px;
  color: #222;
  font-weight: 700;
  margin-bottom: 7px;
}

.aviso-msg {
  font-size: 14px;
  color: #444;
  line-height: 1.45;
}

/* QR code no modal (botão AR em desktop) */
.aviso-qr {
  display: block;
  width: 170px;
  height: 170px;
  margin: 14px auto 4px;
  border-radius: 2px;
  border: 1px solid #f0eeeb;
}

.aviso-btn {
  width: 100%;
  padding: 13px;
  background: none;
  color: var(--cor-primaria, #000000);
  border: none;
  border-top: 1px solid #f0eeeb;
  font-size: 17px;
  font-family: 'SuisseIntl', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}

.aviso-btn:hover  { background: #f7f5f2; }
.aviso-btn:active { background: #f0eeeb; }

/* ---------- Mobile ----------
   Painel dev é ferramenta de desktop — some no celular.
   Layout de regiões FIXAS (a página em si não rola):
   barra nome+preço (64px) → viewer 3D (60%) → barra de 3 abas →
   área de conteúdo da aba (única coisa que rola) → orçamento.
   Regras das regiões em painel-cliente.css. */
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
  #dev-panel { display: none; }

  body { background: #ffffff; }

  .viewer-container {
    position: fixed;
    top: 64px;            /* abaixo da barra nome+preço */
    left: 0;
    right: 0;
    bottom: auto;
    /* Idle: viewer ocupa tela menos topbar (52) + actions (62) */
    height: calc(100vh - 64px - 62px);
    z-index: 5;
    background: #f2f2f2;
  }

  /* Conteúdo aberto: viewer encolhe para 45vh */
  body.aba-aberta .viewer-container { height: 45vh; }
}

/* Celular (só): topbar virou 2 linhas (nome + preço) — 64px não é mais
   suficiente, subiu pra 80px (ver painel-cliente.css). Tablet mantém 64px
   (topbar de 1 linha só), por isso esse ajuste não entra no bloco acima. */
@media (max-width: 767px) {
  .viewer-container {
    top: 80px;
    height: calc(100vh - 80px - 62px);
  }
}

/* ---------- Tela de carregamento ----------
   Logo da marca preenchendo com a cor + barra de progresso real,
   enquanto o modelo 3D baixa. Some (fade) quando fica pronto.
   Transforma a espera numa experiência de marca (estilo Colnago). */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: #f2f2f2;
  transition: opacity 0.6s ease;
}
.loader.hidden { opacity: 0; pointer-events: none; }

.loader-logo {
  position: relative;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}
.loader-logo .ll-base { color: #d8d3ca; }            /* contorno apagado */
.loader-logo .ll-fill {                              /* preenche com a cor da marca */
  position: absolute;
  left: 0; top: 0;
  overflow: hidden;
  white-space: nowrap;
  width: var(--p, 0%);
  color: var(--cor-primaria, #111);
  transition: width 0.25s ease;
}

/* Logo em imagem (SVG/PNG): base apagada + cor real revelada pelo progresso.
   Qualquer logo (larga, alta ou quadrada) cabe na MESMA caixa-limite —
   então o tamanho fica consistente independente do arquivo. */
.loader-logo--img {
  position: relative;
  display: inline-block;
  height: clamp(90px, 20vw, 130px);
  font-size: 0;
  line-height: 0;
}
.loader-logo--img .lli-base,
.loader-logo--img .lli-fill {
  height: 100%;
  width: auto;
  max-width: clamp(220px, 50vw, 340px);
}
.loader-logo--img .lli-base {
  display: block;
  filter: grayscale(1);
  opacity: 0.42;
}
.loader-logo--img .lli-fill {
  position: absolute;
  top: 0; left: 0;
  filter: brightness(0);             /* força preto durante o carregamento */
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
  -webkit-clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
  transition: clip-path 0.25s ease, -webkit-clip-path 0.25s ease;
}

/* Selo discreto do fabricante (rodapé da tela de carregamento) */
.loader-credit {
  position: fixed;
  bottom: 44px;
  left: 0; right: 0;
  z-index: 201;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-style: italic;
  color: #4c4c4c;
}
.loader-credit .lc-by {
  font-size: 15px;
  font-weight: 400;
}
.loader-credit .lc-brand {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}


