/* =======================================================
   PAINEL CLIENTE — estilos do painel do cliente (direita)
   O HTML deste painel é gerado por renderClientPanel()
   em paineis.js. Seções: container, thumbnails de
   acabamento, resumo do pedido, botão de orçamento.
======================================================= */

/* ---------- Container: card fixo à direita, duas colunas ---------- */

#client-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  margin-top: auto;
  margin-bottom: auto;
  right: 56px;
  width: 500px;
  height: 820px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  background: #ffffff;
  border-radius: 2px;
  border: 1px solid #e4e1da;
  z-index: 10;
  font-family: 'SuisseIntl', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

/* Notebook + dev.html (os DOIS painéis de 500px ao mesmo tempo — em telas
   ~1280-1600px não sobra quase nada pro produto entre eles). Só encolhe
   quando o painel dev também existe na página — no index.html do cliente
   (sem painel dev) o painel cliente sozinho continua com 500px de sempre. */
@media (min-width: 1025px) and (max-width: 1600px) {
  body:has(#dev-panel) #client-panel { right: 24px; width: 380px; }
}

.client-header {
  padding: 22px 18px 16px;
  font-size: 14px;
  color: #aaa;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid #f0eeeb;
  flex-shrink: 0;
}

.client-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: visible;
  min-height: 0;
}

.client-col {
  flex: 1;
  overflow-y: visible;
  min-width: 0;
}

.client-col:last-child { border-left: 1px solid #f0eeeb; }

.client-section {
  padding: 12px 16px;
  border-bottom: 1px solid #f5f3f0;
}

.client-section-title {
  font-size: 14px;
  color: #bbb;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ---------- Acabamento: grupos de thumbnails por material ---------- */

.texture-group { padding-bottom: 16px; margin-bottom: 16px; }
.texture-group:not(:last-child) { border-bottom: 1px solid #f0eeeb; }

.texture-title {
  font-size: 10.5px;
  font-weight: 600;
  color: #999;
  font-family: 'SuisseIntl', Arial, sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* Grid horizontal de bolinhas — desktop e mobile */
.texture-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.texture-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  margin-left: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.12s;
}

.texture-item:hover { background: #f0eeeb; }

.texture-item-nome { display: none; }

/* Nome do selecionado — linha abaixo do título, desktop */
.texture-sel-nome {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  min-height: 20px;
  margin-bottom: 10px;
  margin-top: 0;
}

/* Nome do selecionado embutido no título — mobile */
.texture-title-sel { display: none; }

.texture-thumb {
  width: 44px;
  height: 44px;
  display: block;
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.texture-item:hover .texture-thumb { border-color: #4a4a4ac8; }

/* ---------- Resumo: produto + seleção atual de cada material ---------- */

/* Mesma hierarquia da coluna Acabamento: rótulo no estilo dos
   títulos de grupo (Estofado/Estrutura) e o valor abaixo. */
.client-resumo-item { margin-bottom: 12px; }

.client-resumo-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #999;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.client-resumo-value {
  display: flex;
  align-items: center;
  gap: 9px;              /* mesmo espaçamento bolinha-nome do Acabamento */
  padding: 3px 0;        /* mesma altura de linha dos itens do Acabamento */
  font-size: 13px;
  color: #777;
  font-weight: 400;
}

/* Amostra do acabamento escolhido — mesmo tratamento da coluna Acabamento */
.client-resumo-thumb {
  width: 44px;
  height: 44px;
  display: inline-block;
  vertical-align: middle;
  background-size: cover;
  background-position: center;
  background-blend-mode: multiply;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

/* Modelos extras adicionados à cena */
.client-resumo-adicional {
  color: #666;
  font-weight: 400;
}

.client-resumo-none {
  font-size: 14px;
  color: #ccc;
}

/* ---------- Elementos exclusivos do mobile ----------
   Barra do topo, barra de abas e seção Medidas só existem no
   layout mobile (media query no fim do arquivo). No desktop,
   .client-conteudo é transparente na árvore (display:contents). */

.client-topbar,
.client-tabbar,
.client-fab,
.client-medidas-inline { display: none; }

.client-conteudo { display: none; }

/* ---------- Tab bar (desktop) ---------- */

.cp-tabbar {
  display: none;
  flex-shrink: 0;
  justify-content: space-between;
  padding: 24px 16px 0;
  border-bottom: 1px solid #f0eeeb;
}

.cp-tab {
  padding: 0 0 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 10.5px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  color: #999;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: border-color 0.15s, color 0.15s;
}

.cp-tab:hover { color: #555; }

.cp-tab.active {
  color: #222;
  font-weight: 600;
  border-bottom-color: #222;
}

/* ---------- Conteúdo de aba (desktop) ---------- */

.cp-tab-content { display: none; }

.cp-tab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.cp-tab-empty {
  font-size: 13px;
  color: #bbb;
  padding: 8px 0;
}

.cp-resumo-sep {
  height: 1px;
  background: #f0eeeb;
  margin: 8px -16px 14px;
}

/* ---------- Rodapé de ações ---------- */

.client-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 20px;
  border-top: 1px solid #f0eeeb;
  flex-shrink: 0;
}

.cp-preco {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 4px;
}

/* Sem preço cadastrado: texto com voz própria, não um campo vazio */
.cp-preco-consulta {
  font-weight: 400;
  font-style: italic;
  color: #999;
}

.cp-actions-right {
  display: flex;
  gap: 8px;
  flex: 1;
}

/* Ver no Meu Ambiente: AR Quick Look no iOS, WebXR no Android (ar.js)
   Lado a lado com o Orçamento: secundário menor, primário maior */
.client-ar-btn {
  display: none;   /* AR agora e FAB (canto inferior) em todos os devices */
  flex: 1;
  box-sizing: border-box;
  padding: 19px 10px;
  background: #fff;
  color: #222;
  border: 1.5px solid #222;
  border-radius: 2px;
  font-size: 13px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s;
}

.client-ar-btn:hover { background: #f5f3f0; }

.client-ar-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.client-order-btn {
  flex: 1;
  box-sizing: border-box;
  padding: 19px 10px;
  background: var(--cor-primaria, #000000);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s;
}

/* Hover: a cor da marca escurecida 15% (derivada automaticamente) */
.client-order-btn:hover {
  background: color-mix(in srgb, var(--cor-primaria, #000000) 85%, #000);
}

/* WhatsApp / Ver o Site — segundo botão de ação (config decide) */
.client-whats-btn {
  flex: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 19px 10px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  text-transform: none;
  cursor: pointer;
  transition: background 0.15s;
}

.client-whats-btn:hover { background: #1fb858; }

.client-whats-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Variante "Ver o Site": neutro, com borda (não é o verde do Whats) */
.client-site-btn {
  background: #fff;
  color: #222;
  border: 1.5px solid #222;
}

.client-site-btn:hover { background: #f5f3f0; }

/* ---------- Botao "Produtos" (navegacao) ----------
   Desktop/tablet: na barra de acoes (estilo secundario, lugar do antigo Ver em AR).
   Celular: vai pro topbar (.client-topbar-produtos). */
.client-produtos-btn {
  flex: 1;
  padding: 19px 10px;
  background: #fff;
  color: #222;
  border: 1.5px solid #222;
  border-radius: 2px;
  font-size: 13px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s;
}
.client-produtos-btn:hover { background: #f5f3f0; }

.client-topbar-produtos {
  display: none;            /* aparece so no celular (regra abaixo) */
  background: none;
  border: none;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-size: 13px;
  color: #222;
  cursor: pointer;
  padding: 6px 2px;
  letter-spacing: 0.3px;
}

/* ---------- Modal de Orçamento ----------
   Mesmo idioma visual do painel: SuisseIntl, cantos 14px, sombra suave.
   Overlay idêntico ao .aviso-overlay (blur + escurecimento leve).
   Ações no rodapé: iOS-dialog — botões de texto separados por linha fina.
   Formulário: labels uppercase aaa, inputs com foco na cor da marca. */

.orc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(3px);
  padding: 20px;
}

.orc-card {
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.07);
  width: 100%;
  max-width: 380px;
  font-family: 'SuisseIntl', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  overflow: hidden;
}

.orc-corpo { padding: 22px 22px 14px; }

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

/* Resumo: produto + materiais escolhidos (read-only) */
.orc-resumo { margin-bottom: 14px; }

.orc-resumo-produto {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.orc-resumo-itens {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.orc-resumo-itens span {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

/* Linha separadora entre resumo e campos */
.orc-sep {
  height: 1px;
  background: #f0eeeb;
  margin: 0 -22px 16px;
}

/* Campos */
.orc-campo { margin-bottom: 12px; }

.orc-label {
  display: block;
  font-size: 10px;
  color: #bbb;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 5px;
}
.orc-opcional {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 10px;
  color: #ccc;
}

.orc-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1.5px solid #e8e8e8;
  border-radius: 2px;
  font-size: 14px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  color: #222;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
  -webkit-appearance: none;
}

.orc-input:focus { border-color: var(--cor-primaria, #000000); }
.orc-input::placeholder { color: #d0d0d0; }

/* Contador de quantidade */
.orc-qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.orc-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #e8e8e8;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  font-family: Arial, sans-serif;
}

.orc-qty-btn:hover { border-color: #bbb; background: #f7f5f2; }

.orc-qty-val {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  min-width: 24px;
  text-align: center;
}

/* Rodapé: botões no mesmo estilo dos botões de ação do painel */
.orc-rodape {
  display: flex;
  gap: 8px;
  padding: 10px 22px 18px;
  border-top: 1px solid #f0eeeb;
}

.orc-rodape.orc-rodape-coluna { flex-direction: column; }

.orc-btn {
  flex: 1;
  padding: 16px 8px;
  border: none;
  border-radius: 2px;
  font-size: 13px;
  font-family: 'SuisseIntl', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s;
  background: transparent;
  outline: none;
}

.orc-btn-sec {
  background: #fff;
  color: #222;
  border: 1.5px solid #222;
}

.orc-btn-sec:hover { background: #f5f3f0; }

.orc-btn-pri {
  background: var(--cor-primaria, #000000);
  color: #fff;
  border: none;
  font-weight: 600;
}

.orc-btn-pri:hover {
  background: color-mix(in srgb, var(--cor-primaria, #000000) 80%, #fff);
}

/* Estado de sucesso */
.orc-sucesso {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 18px;
}

.orc-check {
  font-size: 34px;
  color: var(--cor-primaria, #000000);
  margin-bottom: 10px;
  line-height: 1;
}

.orc-sub {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-top: 6px;
}

.orc-btn-wha {
  color: #fff !important;
  background: #25d366;
  font-weight: 400;
  border-top: 1px solid #f0eeeb;
}

.orc-btn-wha:hover { background: #1fb858; }

.orc-btn-fechar {
  color: var(--cor-primaria, #000000);
  font-weight: 600;
}

.orc-btn-fechar:hover { background: #f7f5f2; }

/* Mobile: modal centralizado flutuante (mesma experiência que desktop) */
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
  .orc-overlay { padding: 20px; }
  .orc-card { max-width: 360px; }
}

/* ---------- Mobile: FABs flutuantes + conteúdo rolável + actions fixo ----------
   Regiões fixas, de cima a baixo:
   1. Topbar nome+preço (64px)
   2. Viewer 3D (viewer.css — idle: calc(100vh-114px), aberto: 45vh)
   3. FAB esquerdo: Personalizar · FAB direito: AR (flutuantes no viewer)
   4. Conteúdo rolável (acabamento + medidas) — só quando personalizar ativo
   5. Actions (62px) — rodapé sempre fixo */
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
  #client-panel {
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: block;
  }

  .client-header { display: none; }

  /* ----- 1. Topbar ----- */

  .client-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #f0eeeb;
    z-index: 30;
  }

  .client-topbar-nome {
    font-size: 14px;
    font-weight: 600;
    color: #222;
  }

  .client-topbar-preco {
    font-size: 13px;
    font-weight: 600;
    color: #222;
  }

  .client-topbar-preco-consulta {
    font-weight: 400;
    font-style: italic;
    color: #999;
  }

  /* ----- FABs flutuantes ----- */

  /* Tamanho e respiro únicos pros 4 FABs (Personalizar/AR embaixo,
     Captura/Girar em cima) — mesma distância das bordas laterais
     usada como gap vertical entre os dois andares. */
  .client-fab {
    display: flex;
    position: fixed;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cor-primaria, #000000);
    color: #fff;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    bottom: calc(74px + env(safe-area-inset-bottom)); /* acima da barra de acoes (agora mais alta) */
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  /* Painel aberto: FABs na borda inferior do viewer, justo acima do conteúdo */
  body.aba-aberta .client-fab {
    bottom: auto;
    top: calc(64px + 45vh - 64px); /* na borda inferior do viewer */
  }

  .client-fab:active { transform: scale(0.92); }
  .client-fab svg { width: 24px; height: 24px; }

  .client-fab-esq { left: 12px; }
  .client-fab-dir { right: 12px; }

  .fab-icon-close { display: none; }
  body.aba-aberta .client-fab-esq .fab-icon-open  { display: none; }
  body.aba-aberta .client-fab-esq .fab-icon-close { display: block; }

  /* ----- Conteúdo rolável: acabamento + medidas ----- */

  .client-conteudo {
    display: none;
    position: fixed;
    top: calc(64px + 45vh);
    bottom: 62px;
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-top: 1px solid #f0eeeb;
    z-index: 15;
  }

  #client-panel.aba-personalizar .client-conteudo { display: block; }

  .client-body {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .client-col { overflow-y: visible; }
  .client-col:last-child { border-left: none; }

  .client-section {
    padding: 12px 16px 4px;
    border-bottom: none;
  }

  .client-section-title { font-size: 11px; margin-bottom: 8px; }

  .cp-tabbar { display: none !important; }
  .cp-tab-content { display: none !important; }

  .texture-group { margin-bottom: 12px; }
  .texture-title { font-size: 12px; margin-bottom: 6px; }

  .texture-title-sel {
    display: inline;
    color: #888;
    font-weight: 400;
    text-transform: none; /* herdava CAIXA-ALTA do .texture-title pai — nome do item deve ir como cadastrado */
  }

  .texture-sel-nome { display: none; }

  .texture-item { padding: 0; }

  .texture-thumb { width: 36px; height: 36px; }

  /* ----- Medidas: dentro do conteúdo rolável, abaixo dos acabamentos ----- */

  .client-medidas-inline {
    display: block;
    padding: 4px 16px 16px;
    border-top: 1px solid #f0eeeb;
    margin-top: 4px;
  }

  .client-medida-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #f5f3f0;
    font-size: 13px;
    color: #666;
  }

  .client-medida-row:last-of-type { border-bottom: none; }
  .client-medida-row b { color: #222; font-weight: 600; }

  .medida-pol {
    color: #aaa;
    font-weight: 400;
    font-size: 12px;
    margin-left: 5px;
  }

  .client-medida-nota {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
  }

  /* ----- Actions: rodapé fixo ----- */

  .client-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -1px 0 #f0eeeb;
    z-index: 20;
    border-top: none;
    border-radius: 0;
  }

  .client-actions .client-ar-btn { display: none; }

  .client-order-btn,
  .client-whats-btn {
    font-size: 13px;
    padding: 14px 8px;
  }
}

/* ---------- Tablet em retrato: respiro ----------
   Botoes nao vao ate a borda (centralizados com margem) e os FABs
   ficam mais afastados das laterais. Celular fica como esta. */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  /* barra de acoes vira um card flutuante (sobe do fundo, nao cola na borda) —
     e fica só com os 3 botões: o preço mudou pro topbar (canto superior direito) */
  .client-actions {
    left: 18px;
    right: 18px;
    bottom: 40px;
    padding: 16px; /* mesmo respiro nos 4 lados, em vez do 14/16/20 assimétrico da base */
    border-radius: 2px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
  }
  .cp-preco { display: none; }
  /* preço saiu daqui (foi pro topbar) — .cp-actions-right é o único filho
     agora, então pode esticar pra ocupar a bandeja inteira sem brigar com
     nada. Os 3 botões dividem esse espaço em partes exatamente iguais. */
  .cp-actions-right { flex: 1; }
  .client-produtos-btn,
  .client-order-btn,
  .client-whats-btn {
    flex: 1 1 0;
    white-space: nowrap;
  }   /* os tres do mesmo tamanho, dividindo a bandeja igualmente */
  /* FABs e conteudo sobem junto pra nao sobrepor a barra flutuante */
  .client-fab { bottom: 160px; } /* mais respiro da bandeja de baixo */
  .client-fab-esq { left: 30px; }
  .client-fab-dir { right: 30px; }

  /* Abas de verdade dentro da gaveta (Acabamentos/Componentes/Resumo/
     Produtos) em vez da lista empilhada do celular — tablet tem largura de
     sobra pra isso. Reaproveita o mesmo par cp-tabbar/cp-tab-content do
     desktop (mesmo cpSetTab() em painel-cliente.js, só show/hide de
     classe) — só muda ONDE eles ficam plantados: dentro da gaveta que o
     FAB Personalizar abre/fecha, no lugar da lista .client-conteudo.
     #client-panel.aba-personalizar vira o próprio container flex da
     gaveta, então cp-tabbar (flex-shrink:0) + cp-tab-content.active
     (flex:1) se comportam igual ao desktop, sem calcular altura da barra
     de abas na mão. .client-conteudo (a lista empilhada) fica desligada
     por completo aqui — não precisa mais de bottom:110px próprio, já que
     nunca é exibida neste breakpoint. */
  .client-conteudo { display: none !important; }

  #client-panel.aba-personalizar {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: calc(64px + 45vh);
    bottom: 110px;
    left: 0;
    right: 0;
    margin: 0; /* zera o margin-top/bottom:auto do #client-panel base (desktop),
                  senão a caixa encolhe pro tamanho do conteúdo e centraliza
                  dentro do intervalo top/bottom em vez de esticar — foi isso
                  que empurrou a gaveta pra cima, tapando FABs/produto */
    background: #ffffff;
    border-top: 1px solid #f0eeeb;
    overflow: hidden;
    z-index: 15;
  }

  #client-panel.aba-personalizar .cp-tabbar {
    display: flex !important;
    justify-content: center;
    gap: 28px;
  }
  #client-panel.aba-personalizar .cp-tab-content.active { display: flex !important; }

  /* acabamentoDesktopHTML (é o que a aba usa aqui) mostra o nome do
     material selecionado embaixo do título — a regra de celular ali em
     cima esconde esse elemento pro layout empilhado, que nem usa ele. */
  .cp-tab-content .texture-sel-nome { display: block; }
}

/* ---------- Celular (só): botão Produtos no topbar, preço embaixo do nome ----------
   Estas regras viviam num bloco combinado "celular OU tablet retrato" e
   vazavam pro tablet (que tem espaço de sobra e usa outro layout, preço na
   mesma linha). Aqui ficam só onde o aperto de tela é real. Nome e preço
   viram 2 linhas (grid) — "Produtos" ocupa as duas, alinhado à direita. */
@media (max-width: 767px) {
  .client-produtos-btn { display: none; }      /* sai da barra de acoes */
  .client-topbar-produtos { display: inline-flex; align-items: center; }

  /* 2 linhas (nome + preço) precisam de mais altura que a faixa original
     de 64px — sobe pra 80px. .client-conteudo (embaixo, neste arquivo) e
     o viewer (viewer.css) têm o mesmo ajuste de +16px pra não descolar. */
  .client-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-content: center;
    row-gap: 4px;
    height: 80px;
  }
  .client-topbar-nome { grid-column: 1; grid-row: 1; }
  .client-topbar-preco {
    display: block;
    grid-column: 1; grid-row: 2;
    font-size: 12px;
  }
  .client-topbar-produtos { grid-column: 2; grid-row: 1 / 3; }

  .client-conteudo { top: calc(80px + 45vh); } /* acompanha a topbar de 80px */

  .cp-preco { display: none; }
  .cp-actions-right { flex: 1; }
  .cp-actions-right .client-order-btn,
  .cp-actions-right .client-whats-btn { flex: 1; }
}

/* ---------- Desktop: tab bar + botões do rodapé compactos ---------- */
@media (min-width: 1025px), (min-width: 768px) and (orientation: landscape) {
  .cp-tabbar { display: flex; }
  .client-produtos-btn { display: none; } /* acesso a Produtos já é a aba .cp-tab-produtos aqui */

  .cp-actions-right { justify-content: flex-end; }

  .cp-actions-right .client-order-btn,
  .cp-actions-right .client-whats-btn {
    flex: 1 1 0;
    max-width: 200px;
    padding: 15px 12px;
  }
}

/* ---------- Desktop/notebook: AR vira FAB no canto inferior ESQUERDO ----------
   (no painel, o lugar do "Ver em AR" passou a ser o botao "Produtos") */
@media (min-width: 1025px), (min-width: 768px) and (orientation: landscape) {
  .client-fab-dir {
    display: flex;
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cor-primaria, #000000);
    color: #fff;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 25;
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .client-fab-dir:active { transform: scale(0.92); }
  .client-fab-dir svg { width: 30px; height: 30px; }
}

/* ===== Botão de captura ===== */
.captura-fab {
  position: fixed;
  bottom: 24px;
  left: 94px; /* ao lado do FAB AR: 24 + 60 + 10 */
  z-index: 25;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #fff;
  color: var(--cor-primaria, #000);
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.captura-fab:active { transform: scale(0.92); }
.captura-fab:disabled { opacity: 0.5; cursor: wait; }
.captura-fab svg { width: 28px; height: 28px; }

/* Mobile: empilha em cima do Personalizar (mesma coluna, esquerda) —
   AR/Girar ficam na coluna da direita. Gap entre andares = respiro
   lateral (12px), pro espaçamento ficar visualmente uniforme. */
@media (max-width: 767px) {
  .captura-fab {
    left: 12px;
    right: auto;
    width: 52px;
    height: 52px;
    bottom: calc(74px + env(safe-area-inset-bottom) + 52px + 12px);
  }
  .captura-fab svg { width: 24px; height: 24px; }
  body.aba-aberta .captura-fab {
    bottom: auto;
    top: calc(45vh - 52px - 12px); /* acompanha o Personalizar quando painel sobe */
  }
}
/* Tablet retrato: acima do FAB AR com espaço */
/* Mesma lógica do mobile: empilha em cima do Personalizar (esquerda) —
   AR/Girar ficam na coluna da direita. Gap = respiro lateral (30px). */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .captura-fab {
    left: 30px;
    right: auto;
    width: 52px;
    height: 52px;
    bottom: 242px; /* 160px Personalizar + 52px + 30px gap */
  }
  .captura-fab svg { width: 24px; height: 24px; }
  body.aba-aberta .captura-fab {
    bottom: auto;
    top: calc(45vh - 52px - 30px);
  }
}
/* Tablet landscape / desktop: ao lado direito do AR (left: 94px) */
@media (min-width: 768px) and (orientation: landscape),
       (min-width: 1025px) {
  .captura-fab { left: 94px; right: auto; bottom: 24px; }
}

/* ===== Botão 360° (rotate-btn) ===== */
.rotate-fab {
  position: fixed;
  bottom: 24px;
  left: 164px; /* captura: 94px + 60px + 10px */
  z-index: 25;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #fff;
  color: var(--cor-primaria, #000);
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.rotate-fab:active { transform: scale(0.92); }
.rotate-fab svg { width: 36px; height: 36px; }
.rotate-fab.active {
  background: var(--cor-primaria, #000);
  color: #fff;
}

/* Mobile: empilha em cima do AR (coluna da direita) — mesmo gap
   (12px) e mesmo tamanho (52px) que o Captura/Personalizar da esquerda. */
@media (max-width: 767px) {
  .rotate-fab {
    left: auto;
    right: 12px;
    width: 52px;
    height: 52px;
    bottom: calc(74px + env(safe-area-inset-bottom) + 52px + 12px);
  }
  .rotate-fab svg { width: 30px; height: 30px; }
  body.aba-aberta .rotate-fab {
    bottom: auto;
    top: calc(45vh - 52px - 12px); /* acompanha o AR quando painel sobe */
  }
}
/* Mesma lógica do mobile: empilha em cima do AR (direita). */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .rotate-fab {
    left: auto;
    right: 30px;
    width: 52px;
    height: 52px;
    bottom: 242px; /* 160px AR + 52px + 30px gap */
  }
  .rotate-fab svg { width: 30px; height: 30px; }
  body.aba-aberta .rotate-fab {
    bottom: auto;
    top: calc(45vh - 52px - 30px);
  }
}
@media (min-width: 768px) and (orientation: landscape),
       (min-width: 1025px) {
  .rotate-fab { left: 164px; right: auto; bottom: 24px; }
}

/* ===== Componentes (troca de mesh) ===== */
.comp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.comp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid #e0e0e0;
  border-radius: 2px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 64px;
  font-family: inherit;
}
.comp-item:hover { border-color: var(--cor-primaria, #000); }
.comp-item.active {
  border-color: var(--cor-primaria, #000);
  background: rgba(0,0,0,0.04);
}
.comp-thumb {
  width: 36px; height: 36px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  background-color: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
}
.comp-thumb-icon svg { width: 18px; height: 18px; color: #aaa; stroke: #aaa; }
.comp-nome {
  font-size: 11px;
  color: #333;
  text-align: center;
  line-height: 1.2;
}

/* ===== Sofá Modular ===== */
.modular-cena {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.modular-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f5f5f5;
  border-radius: 2px;
  font-size: 13px;
}
.modular-item-nome { flex: 1; }
.modular-item-del {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}
.modular-item-del:hover { color: #e53935; }
.modular-item-swap {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}
.modular-item-swap:hover,
.modular-item-swap.active { color: var(--cor-primaria, #000); }
.modular-item.swap-active {
  outline: 1.5px solid var(--cor-primaria, #000);
  outline-offset: -1.5px;
}
.modular-troca-hint {
  font-size: 12px;
  color: var(--cor-primaria, #000);
  margin-bottom: 8px;
}
.modular-vazio {
  font-size: 12px;
  color: #aaa;
  padding: 6px 0;
}
.modular-adicionar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modular-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px dashed #ccc;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.modular-add-btn:hover {
  border-color: var(--cor-primaria, #000);
  color: var(--cor-primaria, #000);
}
.modular-add-thumb {
  width: 28px; height: 28px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  background-color: #eee;
}
