/* Modal 3D - Estilos Globais
   - Cobre a tela inteira com fundo escuro semi-transparente
   - Contém um botão de fechar no topo direito
   - Totalmente independente para não interferir no layout existente
*/

/* Overlay de tela cheia */
.modal3d-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* acima de qualquer conteúdo existente */
  animation: modal3d-fade-in 180ms ease-out;
}

/* Container interno para manter proporção e responsividade */
.modal3d-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Iframe ocupa toda a área disponível */
.modal3d-frame {
  width: 100dvw;
  /* height: 100%; */
  border: 0;
  background: transparent;
  z-index: 9998;
}

/* Botão de fechar no topo direito */
.modal3d-close {
  position: absolute;
  bottom: 16px;
  /* right: 50%; */
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  z-index: 9999;
}
.modal3d-close:hover {
  background: rgba(255, 255, 255, 0.12);
}
.modal3d-close:active {
  transform: scale(0.98);
}

/* Botão flutuante para abrir o modal */
.modal3d-open-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998; /* abaixo do overlay, acima do site */
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #111;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.modal3d-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 14px rgba(255, 255, 255, 0.3);
}

/* Preferência de tema escuro: botão com contraste adequado */
@media (prefers-color-scheme: dark) {
  .modal3d-open-btn {
    background: #e6e6e6;
    color: #111;
  }
}

/* Evitar scroll do body quando o modal está aberto */
body.modal3d-no-scroll {
  overflow: hidden !important;
}

/* Animações leves */
@keyframes modal3d-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
