/* Centre the popup vertically and horizontally */
#homepagePopup {
  text-align: center;
  padding: 0 !important;
}

#homepagePopup:before {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

#homepagePopup .modal-dialog {
  display: inline-block;
  text-align: left;
  vertical-align: middle;
  margin: 0;
  width: 90%;
  max-width: 1000px;
}

/* Popup box */
#homepagePopup .modal-content {
  border-radius: 8px;
  overflow: hidden;
  border: none;
  box-shadow: 0 5px 25px rgba(0,0,0,0.35);
}

/* Close button */
.popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  background: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 30px;
  line-height: 42px;
  text-align: center;
  color: #000000;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 1000;
}

.popup-close:hover,
.popup-close:focus {
  background: #ffffff;
  color: #000000;
  opacity: 1;
  outline: none;
}
/* Make popup fit within screen */
#homepagePopup .modal-dialog {
  width: 90%;
  max-width: 1000px;
  margin: 30px auto;
}

/* Limit popup height */
#homepagePopup .modal-content {
  max-height: 90vh;
  overflow: hidden;
}

/* Allow scrolling inside if needed */
#homepagePopup .modal-body {
  max-height: 90vh;
  overflow-y: hidden;
  padding: 0;
}

/* Make image responsive and contained */
#homepagePopup img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 85vh;
  object-fit: contain;
}
/* Force modal above EVERYTHING */
#homepagePopup {
  z-index: 999999 !important;
}

#homepagePopup .modal-dialog {
  z-index: 999999 !important;
}

#homepagePopup .modal-content {
  z-index: 999999 !important;
}

/* Backdrop (dark overlay behind popup) */
.modal-backdrop {
  z-index: 999998 !important;
}