/**
 * ============================================
 * SISTEMA DE POPUPS REUTILIZABLES - VIAJES PERÚ
 * ============================================
 */

/* Modal Container */
.viajesperu-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.viajesperu-modal.active {
  display: flex !important;
  opacity: 1;
}

/* Overlay oscuro */
.viajesperu-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1;
}

/* Contenido del Modal */
.viajesperu-modal-content {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.9);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUpFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animación de entrada */
@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Imagen del popup */
.viajesperu-modal-image {
  position: relative;
  width: 100%;
}

.viajesperu-modal-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Contenido HTML del popup */
.viajesperu-modal-html {
  padding: 40px;
  max-width: 800px;
}

.viajesperu-modal-html h2,
.viajesperu-modal-html h3 {
  color: #D13138;
  margin-bottom: 20px;
}

.viajesperu-modal-html p {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 15px;
}

.viajesperu-modal-html img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

/* Botón Cerrar */
.viajesperu-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 32px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

.viajesperu-modal-close:hover {
  background: #D13138;
  transform: rotate(90deg);
}

/* Triggers con cursor pointer */
[class*="popup-trigger"],
.popup-trigger {
  cursor: pointer !important;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

[class*="popup-trigger"]:hover,
.popup-trigger:hover {
  transform: scale(1.05);
  opacity: 0.85;
}

/* Bloquear scroll cuando modal está abierto */
body.viajesperu-modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 1024px) {
  .viajesperu-modal-content {
    max-width: 85% !important;
    max-height: 85vh;
  }
  
  .viajesperu-modal-html {
    padding: 35px 25px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .viajesperu-modal-content {
    max-width: 95% !important;
    max-height: 90vh;
    margin: 20px;
  }
  
  .viajesperu-modal-html {
    padding: 30px 20px;
  }
  
  .viajesperu-modal-close {
    top: 10px;
    right: 10px;
    font-size: 28px;
    width: 40px;
    height: 40px;
  }
  
  .viajesperu-modal-html h2 {
    font-size: 22px;
  }
  
  .viajesperu-modal-html p {
    font-size: 15px;
  }
}

/* Móvil pequeño */
@media (max-width: 480px) {
  .viajesperu-modal-content {
    max-width: 96% !important;
    border-radius: 8px;
  }
  
  .viajesperu-modal-html {
    padding: 25px 15px;
  }
}

/* Scroll suave dentro del modal */
.viajesperu-modal-content {
  scrollbar-width: thin;
  scrollbar-color: #D13138 #f1f1f1;
}

.viajesperu-modal-content::-webkit-scrollbar {
  width: 8px;
}

.viajesperu-modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.viajesperu-modal-content::-webkit-scrollbar-thumb {
  background: #D13138;
  border-radius: 10px;
}

.viajesperu-modal-content::-webkit-scrollbar-thumb:hover {
  background: #a02329;
}
