/* ==========================================================================
   TERRA & FORMA Atelier de Arquitetura - Boa Vista, RR
   Efeitos Visuais: Árvore à Esquerda (Talos Fora da Tela),
   Botão Vertical WhatsApp (100% Ancorado) e Tilt 3D
   ========================================================================== */

/* 1. COPA TROPICAL À ESQUERDA (5 GALHOS INDEPENDENTES, TALOS FORA DA TELA) */
.left-canopy-system {
  position: fixed;
  top: 0;
  left: 0;
  width: 480px;
  max-width: 32vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5; /* Fica rigorosamente abaixo de todos os textos, containers e cards (z-index: 10) */
  overflow: visible;
}

.tree-branch {
  position: absolute;
  pointer-events: none;
  transform-origin: 0% 50%;
  will-change: transform;
}

.tree-branch img {
  width: 100%;
  height: auto;
  display: block;
}

/* Galho 1: Topo Superior (desce com leve inclinação e escala suave) */
.branch-top {
  top: -4%;
  left: -150px;
  width: 440px;
  z-index: 3;
  opacity: 0.92;
}

/* Galho 2: Alto Intermediário (mais viçoso e flexível) */
.branch-upper-mid {
  top: 18%;
  left: -130px;
  width: 490px;
  z-index: 4;
}

/* Galho 3: Centro (galho principal em destaque) */
.branch-mid {
  top: 40%;
  left: -140px;
  width: 530px;
  z-index: 5;
}

/* Galho 4: Baixo Intermediário (camada frondosa inferior) */
.branch-lower-mid {
  top: 62%;
  left: -135px;
  width: 480px;
  z-index: 4;
}

/* Galho 5: Base Inferior (folhas apontadas levemente para cima) */
.branch-bottom {
  top: 82%;
  left: -150px;
  width: 440px;
  z-index: 3;
  opacity: 0.94;
}

/* 2. BOTÃO VERTICAL DE WHATSAPP (100% ANCORADO NA BORDA DIREITA, NUNCA DESCOLA) */
.vertical-whatsapp-dock {
  position: fixed;
  right: 0 !important; /* Sempre colado na borda direita */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #133a2f 0%, #0d2820 100%);
  border: 1.5px solid rgba(200, 162, 97, 0.4);
  border-right: none;
  border-radius: 18px 0 0 18px;
  box-shadow: -8px 12px 35px rgba(0, 0, 0, 0.45), 0 0 20px rgba(37, 211, 102, 0.2);
  padding: 1.1rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, padding-left 0.25s ease;
}

/* No hover: JAMAIS usar translateX que afaste da borda! Ele expande a almofada esquerda mantendo right: 0 */
.vertical-whatsapp-dock:hover {
  background: linear-gradient(180deg, #18473a 0%, #103329 100%);
  border-color: #25d366;
  box-shadow: -12px 16px 45px rgba(0, 0, 0, 0.55), 0 0 30px rgba(37, 211, 102, 0.45);
  padding-left: 0.95rem; /* Expansão sutil para a esquerda sem descolar da direita */
}

.vert-wa-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.vert-wa-icon-box {
  width: 44px;
  height: 44px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.55);
  position: relative;
}

.vert-wa-icon-box svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.vert-wa-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: waPulseAnim 2s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes waPulseAnim {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.vert-wa-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  padding: 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.vertical-whatsapp-dock:hover .vert-wa-text {
  color: #25d366;
}

.vert-wa-status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: #25d366;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
}

.vert-wa-dot {
  width: 7px;
  height: 7px;
  background-color: #25d366;
  border-radius: 50%;
  box-shadow: 0 0 8px #25d366;
}

/* 3. VITRINE INTERATIVA DE MATERIAIS COM TEXTURA 100% VISÍVEL */
.materials-interactive-box {
  background: #112620;
  border: 1px solid var(--border-gold-subtle);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: var(--shadow-elevated);
}

.materials-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
  margin-top: 1.5rem;
  align-items: stretch;
}

/* Vitrine de Textura em Tamanho Grande e Limpo */
.material-texture-showcase {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--color-gold-accent);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  min-height: 320px;
  background-size: cover;
  background-position: center;
  transition: background-image 0.4s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
}

.material-texture-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.mat-showcase-badge {
  position: relative;
  z-index: 5;
  align-self: flex-start;
  background: rgba(11, 37, 30, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-gold-accent);
  color: var(--color-gold-accent);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mat-showcase-caption {
  position: relative;
  z-index: 5;
  background: rgba(11, 37, 30, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Ficha Técnica ao Lado */
.material-info-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.material-detail-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(200, 162, 97, 0.25);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.material-detail-card h4 {
  color: var(--color-gold-accent);
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}

.material-detail-item {
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
}

.material-detail-item strong {
  color: var(--color-gold-accent);
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.material-detail-item span {
  color: rgba(255, 255, 255, 0.9);
}

/* 4. CARDS COM TILT 3D */
.tilt-3d-card {
  transform: perspective(1000px);
  will-change: transform;
}

/* 5. BOTÃO VOLTAR AO TOPO */
.floating-top-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 46px;
  height: 46px;
  background: rgba(14, 33, 27, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200, 162, 97, 0.3);
  border-radius: 50%;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 950;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.floating-top-btn.visible {
  display: flex;
}

.floating-top-btn:hover {
  background: var(--color-gold-accent);
  color: var(--color-forest-deep);
  transform: translateY(-4px);
}

/* Responsividade da Vitrine de Materiais e Copa Vegetal à Esquerda */
@media (max-width: 991px) {
  .materials-split-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .material-texture-showcase {
    min-height: 260px;
  }
  .left-canopy-system {
    width: 320px;
    max-width: 45vw;
  }
  .tree-branch {
    opacity: 0.8;
  }
  .branch-top { width: 320px; left: -110px; }
  .branch-upper-mid { width: 340px; left: -100px; }
  .branch-mid { width: 360px; left: -110px; }
  .branch-lower-mid { width: 330px; left: -100px; }
  .branch-bottom { width: 310px; left: -110px; }
}

@media (max-width: 768px) {
  .left-canopy-system {
    width: 220px;
    max-width: 40vw;
  }
  .tree-branch {
    opacity: 0.65;
  }
  .branch-top { width: 220px; left: -80px; }
  .branch-upper-mid { width: 240px; left: -80px; }
  .branch-mid { width: 260px; left: -85px; }
  .branch-lower-mid { width: 230px; left: -80px; }
  .branch-bottom { width: 210px; left: -80px; }
}
