.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.popup-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-box {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  display: none;
  animation: popupSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.popup-box.show {
  display: block;
}

.popup-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  line-height: 1;
  padding: 0;
}

.popup-close:hover {
  background: #ff4444;
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.popup-close:active {
  transform: rotate(90deg) scale(0.95);
}


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

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes popupSlideOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}



@media (max-width: 768px) {
  .popup-box {
    max-width: 95%;
    max-height: 80vh;
  }

  .popup-close {
    width: 35px;
    height: 35px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }

  .popup-image {
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .popup-box {
    max-width: 98%;
  }

  .popup-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}


body.popup-active {
  overflow: hidden;
}
