/* ===================================
   POPUP MODAL - Sistema Configurável
   =================================== */

/* Overlay do Modal */
.popup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Container do Modal */
.popup-modal-container {
  position: relative;
  max-width: 800px;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
  to {
    transform: scale(1);
  }
}

/* Botão de Fechar */
.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.popup-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: rotate(90deg);
}

.popup-close-btn::before,
.popup-close-btn::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: #fff;
}

.popup-close-btn::before {
  transform: rotate(45deg);
}

.popup-close-btn::after {
  transform: rotate(-45deg);
}

/* Imagem do Popup */
.popup-modal-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.popup-modal-image.no-link {
  cursor: default;
}

/* Ícone Flutuante para Reabrir */
.popup-reopen-icon {
  position: fixed;
  right: 30px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  transition: all 0.3s ease;
  animation: bounceIn 0.5s ease;
}

/* Posicionamento do ícone */
.popup-reopen-icon.position-above {
  bottom: 160px; /* Acima do WhatsApp */
}

.popup-reopen-icon.position-below {
  bottom: 30px; /* Ao lado do WhatsApp */
  right: 100px;
}

.popup-reopen-icon.active {
  display: flex;
}

.popup-reopen-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* SVG do ícone */
.popup-reopen-icon svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* Responsividade */
@media (max-width: 768px) {
  .popup-modal-overlay {
    padding: 15px;
  }

  .popup-modal-container {
    max-width: 95%;
    border-radius: 8px;
  }

  .popup-close-btn {
    width: 35px;
    height: 35px;
    top: 10px;
    right: 10px;
  }

  .popup-close-btn::before,
  .popup-close-btn::after {
    width: 16px;
  }

  .popup-reopen-icon {
    width: 50px;
    height: 50px;
    right: 20px;
  }

  .popup-reopen-icon.position-above {
    bottom: 140px;
  }

  .popup-reopen-icon.position-below {
    bottom: 20px;
    right: 85px;
  }

  .popup-reopen-icon svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .popup-modal-overlay {
    padding: 10px;
  }

  .popup-modal-container {
    max-width: 100%;
    border-radius: 6px;
  }

  .popup-close-btn {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }

  .popup-reopen-icon {
    width: 46px;
    height: 46px;
    right: 15px;
  }

  .popup-reopen-icon.position-above {
    bottom: 130px;
  }

  .popup-reopen-icon svg {
    width: 22px;
    height: 22px;
  }
}

/* Acessibilidade */
.popup-close-btn:focus,
.popup-reopen-icon:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Animação de pulso no ícone (opcional) */
.popup-reopen-icon.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
