html.vp-popup-open,
body.vp-popup-open {
  overflow: hidden !important;
}

body.vp-popup-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.vp-popup {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  box-sizing: border-box;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--vp-popup-overlay, rgba(0, 0, 0, 0.65));
  z-index: 200000;
}

.vp-popup.vp-popup--open {
  display: block !important;
}

.vp-popup__panel {
  position: fixed !important;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
  max-width: min(calc(100dvw - var(--vp-popup-margin-left, 24px) - var(--vp-popup-margin-right, 24px)), 100%);
  max-height: calc(100dvh - var(--vp-popup-margin-top, 24px) - var(--vp-popup-margin-bottom, 24px));
  z-index: 200001;
}

.vp-popup__content,
.vp-popup__content > .uk-section,
.vp-popup__content > div:first-child {
  position: relative;
}

.vp-popup--internal-scroll .vp-popup__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.vp-popup:not(.vp-popup--internal-scroll) .vp-popup__content {
  overflow: visible;
}

.vp-popup__content > .uk-section {
  margin: 0 !important;
  padding-top: var(--vp-popup-content-margin-top, initial) !important;
  padding-right: var(--vp-popup-content-margin-right, initial) !important;
  padding-bottom: var(--vp-popup-content-margin-bottom, initial) !important;
  padding-left: var(--vp-popup-content-margin-left, initial) !important;
}

.vp-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: rgba(0,0,0,.35);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.vp-popup--mobile-fullscreen {
  padding: 0 !important;
}

.vp-popup--mobile-fullscreen .vp-popup__panel {
  border-radius: 0;
}

@media (max-width: 640px) {
  .vp-popup__panel {
    width: calc(100dvw - 24px) !important;
    max-width: calc(100dvw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .vp-popup--mobile-fullscreen .vp-popup__panel {
    width: 100dvw !important;
    max-width: 100dvw;
    height: 100dvh !important;
    max-height: 100dvh;
    margin: 0 !important;
    border-radius: 0;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
  }
}
