#facebox {
  position: fixed; /* Changed from absolute to fixed */
  top: 0;
  left: 0;
  right: 0; /* Added to cover full width */
  z-index: 100;
  text-align: center; /* Changed from left to center */
  display: flex; /* Added for centering */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
  height: 100vh; /* Full viewport height */
  pointer-events: none; /* Allow clicks to pass through to overlay */
}

#facebox .popup{
  position: relative;
  -webkit-border-radius:10px;
  -moz-border-radius:10px;
  border-radius:10px;
  -webkit-box-shadow:0 0 18px rgba(0,0,0,0.4);
  -moz-box-shadow:0 0 18px rgba(0,0,0,0.4);
  box-shadow:0 0 18px rgba(0,0,0,0.4);
  pointer-events: auto; /* Re-enable clicks on popup */
  margin: 20px; /* Add some spacing from edges */
  max-width: 90vw; /* Prevent overflow on mobile */
}

#facebox .content {
  display:table;
  padding: 10px;
  background: #fff;
  -webkit-border-radius:10px;
  -moz-border-radius:10px;
  border-radius:10px;
}

#facebox .content > p:first-child{
  margin-top:0;
}
#facebox .content > p:last-child{
  margin-bottom:0;
}

#facebox .close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  background: transparent;
  text-decoration: none !important;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.2s;
}

#facebox .close:hover {
  opacity: 1.0;
  cursor: pointer;
}

/* Completely hide the broken image element */
#facebox .close img {
  display: none !important;
}

/* Generate a clean modern close icon using CSS */
#facebox .close::before {
  content: "\2715"; /* Clean Unicode 'X' symbol */
  font-size: 16px;
  font-weight: bold;
  color: #333;
  font-family: Arial, sans-serif;
}

#facebox .loading {
  text-align: center;
}

#facebox .image {
  text-align: center;
}

#facebox img {
  border: 0;
  margin: 0;
}

#facebox_overlay {
  position: fixed;
  top: 0px;
  left: 0px;
  height:100%;
  width:100%;
}

.facebox_hide {
  z-index:-100;
}

.facebox_overlayBG {
  background-color: #000;
  z-index: 99;
}