.promotion-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  background: rgb(0 0 0 / 66%);
  opacity: 0;
  transition: opacity 180ms ease-out;
}

.promotion-modal.is-visible {
  opacity: 1;
}

.promotion-modal__dialog {
  position: relative;
  display: grid;
  justify-items: end;
  max-width: 100%;
  max-height: 100%;
  transform: scale(.985);
  transition: transform 180ms ease-out;
}

.promotion-modal.is-visible .promotion-modal__dialog {
  transform: scale(1);
}

.promotion-modal__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  color: #fff;
  background: rgb(17 17 17 / 78%);
  box-shadow: 0 4px 18px rgb(0 0 0 / 24%);
  font: 300 32px/1 sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.promotion-modal__close:hover {
  background: rgb(17 17 17 / 92%);
}

.promotion-modal__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.promotion-modal__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(800px, 90vw);
  max-height: calc(90vh - 52px);
  max-height: calc(90dvh - 52px);
  object-fit: contain;
  filter: drop-shadow(0 20px 42px rgb(0 0 0 / 35%));
}

html.promotion-modal-open,
body.promotion-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (max-width: 699px) {
  .promotion-modal {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .promotion-modal__image {
    max-width: 92vw;
    max-height: calc(88vh - 52px);
    max-height: calc(88dvh - 52px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .promotion-modal,
  .promotion-modal__dialog {
    transition: none;
  }
}
