/* popupManager.css - basic styling */

/* popup background */
.popup-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

/* popup dialog window */
.popup-dialog {
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  max-height: 95vh;
  max-height: 95dvh;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

:is(.xs, .sm) .popup-dialog {
  max-height: 100vh;
  max-height: 100dvh;
  max-width: 100vw;
  max-width: 100dvw;
  height: 100vh;
  height: 100dvh;
  width: 100vh;
  width: 100dvh;
}

.iframe-loaded .popup-dialog {
  width: 800px;
  height: 95vh;
}

:is(.xs, .sm) .iframe-loaded .popup-dialog {
  height: 100vh;
  height: 100dvh;
  width: 100vh;
  width: 100dvh;
}

/* close button */
.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  background: none;
  border: none;
  padding: 0;
  z-index: 10;
}

.popup-close::after {
  content: "";
  position: absolute;
  inset: -12px;
  background: transparent;
}

/* popup content inside of dialog window */
.popup-content {
  height: 100%;
  width: 100%;
  padding: 36px;
  overscroll-behavior: none;
  overflow-y: auto;
}

:is(.xs, .sm) .popup-content {
  padding-top: 60px;
}

/* iframe styling */
.iframe-loaded .popup-content {
  padding: 0 !important;
}

.popup-iframe {
  width: 100%;
  height: 100%;
  display: block;
  overscroll-behavior: none;
}

:is(.xs, .sm) .popup-iframe {
  max-height: unset;
  height: 100vh;
  height: 100dvh;
}

/* active states */
.popup-overlay.active {
  opacity: 1;
}

.popup-dialog.active {
  opacity: 1;
  transform: translateY(0);
}

/* html + body overflow handling and scroll lock */
html.popup-open {
  overflow: hidden;
  scrollbar-width: none;
}

body.popup-open {
  overflow: hidden;
  scrollbar-width: none;
}

prepare-popup {
  display: none;
}

/* error handling */
.popup-error {
  text-align: center;
  padding: 2rem;
}

.popup-error button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #eee;
  border: 1px solid #ccc;
  cursor: pointer;
}

.popup-content .iframe-via-lightview {
  padding: unset !important;
}

/* popup hidden when multiple instances */
.popup-hidden {
  display: none;
}

/* popup with loading animation */
.popup-loading-animation {
  width: 50px;
  padding: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ff9239;
  --_m: 
    conic-gradient(#0000 10%,#000),
    linear-gradient(#000 0 0) content-box;
  -webkit-mask: var(--_m);
          mask: var(--_m);
  -webkit-mask-composite: source-out;
          mask-composite: subtract;
  animation: l3 1s infinite linear;
}
@keyframes l3 {to{transform: rotate(1turn)}}