amp-lightbox {
  display: none;
  position: fixed !important;
  z-index: 1000;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
}

amp-lightbox[scrollable] {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Ad lightbox styles */

amp-lightbox i-amphtml-ad-close-header {
  height: 60px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 0;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important; /* same as amp-lightbox */
  display: flex !important;
  align-items: center !important;
  justify-content: right !important;

  /* same as <amp-lightbox [animate-in="fade-in"]> */
  transition: 0.1s opacity ease-in;
}

[animate-in='fly-in-bottom'] > i-amphtml-ad-close-header,
[animate-in='fly-in-top'] > i-amphtml-ad-close-header {
  /* show after transition has finished */
  transition-delay: 0.2s;
}

amp-lightbox .amp-ad-close-header {
  opacity: 1 !important;
  box-sizing: border-box;
  padding: 5px;
  line-height: 40px; /* 60px - 5px * 2 */
  background-color: rgba(0, 0, 0, 1);
  color: white;
  font-family: Helvetica, sans-serif;
  font-size: 12px;
  cursor: pointer;
}

amp-lightbox .amp-ad-close-header > *:first-child {
  margin-left: auto !important; /* aligns right */
  pointer-events: none !important; /* pass-thru */
}

amp-lightbox .amp-ad-close-button {
  display: block !important;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E")
    no-repeat;
  background-position: center center;
  width: 40px;
  height: 40px;
  pointer-events: none !important; /* pass-thru */
  border-radius: 40px;
  margin-left: 5px;
}

amp-lightbox .amp-ad-close-header:active > .amp-ad-close-button {
  background-color: rgba(255, 255, 255, 0.3);
}
