/* Disable page scrolling while lightbox is open */
body.ub-lightbox-open {
  overflow: hidden;
}

/* Workaround for an iOS issue where lightbox iframe doesn't scroll */
.ub-lightbox-open #ubpoverlay-content {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Use fixed positioning to ensure the lightbox is always centered */
.ub-lightbox-open #ubpoverlay-wrap {
  position: fixed;
  top: 30px !important;
  right: 0 !important;
  bottom: 30px !important;
  left: 0 !important;
  height: auto !important;
  min-width: 320px;
  max-width: 92%; /* older browsers */
  max-width: calc(100% - 40px);
  margin: auto !important;
  padding: 0;
}

/* Workaround for IE8 issue where lightbox iframe is taller than its container */
.ub-lightbox-open #ubpoverlay-outer,
.ub-lightbox-open #ubpoverlay-content,
.ub-lightbox-open #ubpoverlay-frame {
  height: 100% !important;
  width: 100% !important;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
}

/* Close button */
.ub-lightbox-open #ubpoverlay-close {
  background-image: url('images/lightbox-close%403x.png');
  background-size: 30px 30px;
  background-position: 0 0;

  /* Scale the close icon on IE<9 (background-size isn't supported) */
  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='//builder-assets.unbounce.com/published/images/lightbox-close@3x.png', sizingMethod='scale');
}

/* On narrower displays, move the close (X) button so it remains visible on-screen */
@media only screen and (max-width: 360px) {
  .ub-lightbox-open #ubpoverlay-close {
    right: 10px !important;
  }
}

/* Prevent the lightbox position from jumping when lightbox form fields are focused on iOS */
.ub-lightbox-open.ub-ios #lp-pom-root {
  display: none;
}

/* Ensure overlay height doesn't exceed viewport on iOS and cause lightbox positioning issues */
.ub-lightbox-open.ub-ios #ubpoverlay-overlay {
  height: 100% !important;
}
