#facebox {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99999999;
  text-align: left;
  box-sizing: border-box;
}

#facebox .popup {
  position: relative;
  border: 3px solid rgba(0,0,0,0);
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  -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);
  overflow: hidden;
  width: 100% !important;
  max-width: 800px !important;
  margin: 2px auto !important;
  padding: 0 !important;
  box-sizing: border-box;
}

#facebox .content {
  display: table;
  width: 100% !important;
  max-width: 800px !important;
  padding: 2px !important;
  margin: 0 !important;
  background: #fff;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  box-sizing: border-box;
}

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

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

#facebox .close {
  position: absolute;
  top: 5px;
  right: 10px;
  padding: 2px;
  background: #fff;
  z-index: 99999;
}

#facebox .close img {
  opacity: 1.0;
}

#facebox .close:hover img {
  opacity: 1.0;
}

#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;
}

/* Mobile: facebox fills the viewport */
@media (max-width: 768px) {
  #facebox {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  #facebox .popup {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
  }

  #facebox .content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 2px !important;
    border-radius: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
