.vpopup-hidden {
  display: none !important;
}

.vpopup-overlay {
  --vpopup-overlay: rgba(8, 12, 20, 0.86);
  --vpopup-surface: #0f1725;
  --vpopup-text: #e8edf7;
  --vpopup-muted: #8ea0bd;
  --vpopup-accent: #4ecdc4;
  --vpopup-radius: 26px;
  --vpopup-shadow: 0 26px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  --vpopup-frame: #031338;
  --vpopup-btn-bg: rgba(255, 255, 255, 0.09);
  --vpopup-btn-bg-hover: rgba(255, 255, 255, 0.18);
  --vpopup-nav-bg: rgba(0, 0, 0, 0.4);
  --vpopup-nav-bg-hover: rgba(0, 0, 0, 0.62);
  --vpopup-nav-text: #fff;
  --vpopup-inline-bg: rgba(255, 255, 255, 0.04);
  --vpopup-inline-border: rgba(255, 255, 255, 0.1);
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--vpopup-overlay);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

.vpopup-overlay.vpopup-theme-light {
  --vpopup-overlay: rgba(255, 255, 255, 0.82);
  --vpopup-surface: #ffffff;
  --vpopup-text: #152238;
  --vpopup-muted: #4f5f79;
  --vpopup-shadow: 0 22px 44px rgba(22, 34, 57, 0.22), 0 0 0 1px rgba(13, 30, 61, 0.08) inset;
  --vpopup-frame: #b8d1f2;
  --vpopup-btn-bg: rgba(15, 34, 64, 0.09);
  --vpopup-btn-bg-hover: rgba(15, 34, 64, 0.18);
  --vpopup-nav-bg: rgba(15, 34, 64, 0.24);
  --vpopup-nav-bg-hover: rgba(15, 34, 64, 0.36);
  --vpopup-nav-text: #152238;
  --vpopup-inline-bg: rgba(15, 34, 64, 0.03);
  --vpopup-inline-border: rgba(15, 34, 64, 0.14);
}

.vpopup-overlay.vpopup-open {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.vpopup-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  background: var(--vpopup-surface);
  border: 3px solid var(--vpopup-frame);
  border-radius: 6px;
  box-shadow: var(--vpopup-shadow);
  color: var(--vpopup-text);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  touch-action: pan-y pinch-zoom;
  transform: translateY(12px) scale(0.985);
  transition: transform 220ms ease, width 220ms ease, height 220ms ease, max-width 220ms ease, max-height 220ms ease;
}

.vpopup-overlay.vpopup-view-popup.vpopup-open .vpopup-dialog {
  transform: translateY(0) scale(1);
}

.vpopup-overlay.vpopup-type-image .vpopup-dialog {
  width: auto;
  max-width: calc(100vw - 40px);
}

.vpopup-overlay.vpopup-type-image .vpopup-content {
  padding: 0;
  min-height: 0;
  max-height: calc(100vh - 40px);
}

.vpopup-overlay.vpopup-view-sidebar {
  padding: 0;
  align-items: stretch;
  justify-items: end;
}

.vpopup-overlay.vpopup-view-sidebar .vpopup-dialog {
  width: min(460px, 100vw);
  height: 100vh;
  max-height: 100vh;
  border-width: 0;
  border-radius: 0;
  box-shadow: -5px 0 5px rgba(0, 0, 0, 0.05);
  transform: translateX(24px);
}

.vpopup-overlay.vpopup-view-sidebar.vpopup-open .vpopup-dialog {
  transform: translateX(0);
}

.vpopup-overlay.vpopup-view-sidebar .vpopup-content {
  height: 100%;
  max-height: 100vh;
  padding: 0;
}

.vpopup-overlay.vpopup-view-sidebar .vpopup-iframe {
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.vpopup-btn {
  border: 0;
  color: var(--vpopup-text);
  background: var(--vpopup-btn-bg);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.vpopup-btn:hover {
  background: var(--vpopup-btn-bg-hover);
}

.vpopup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.vpopup-content {
  position: relative;
  padding: 6px;
  min-height: 280px;
  max-height: 72vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.vpopup-media {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  width: auto;
  height: auto;
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform, opacity;
}

.vpopup-media-container {
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.vpopup-iframe {
  width: 100%;
  height: min(72vh, 780px);
  min-height: 320px;
  aspect-ratio: auto;
  border: 0;
  border-radius: 14px;
  background: #000;
}

.vpopup-inline {
  width: min(780px, 100%);
  background: var(--vpopup-inline-bg);
  border: 1px solid var(--vpopup-inline-border);
  border-radius: 12px;
  padding: 20px;
}

.vpopup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  color: var(--vpopup-nav-text);
  background: var(--vpopup-nav-bg);
}

.vpopup-prev {
  left: -60px;
}

.vpopup-next {
  right: -60px;
}

.vpopup-nav:hover {
  background: var(--vpopup-nav-bg-hover);
}

@media (max-width: 720px) {
  .vpopup-overlay {
    padding: 0;
  }

  .vpopup-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border-width: 0;
  }

  .vpopup-content {
    max-height: calc(100vh - 20px);
    padding: 0;
  }

  .vpopup-iframe {
    height: calc(100vh - 20px);
    border-radius: 0;
  }

  .vpopup-close {
    top: -17px;
    right: 12px;
  }

  .vpopup-overlay.vpopup-view-sidebar .vpopup-dialog {
    width: 100%;
    border-left: 0;
  }

  .vpopup-nav {
    width: 40px;
    height: 40px;
    bottom: -72px;
    top: unset;
  }

  .vpopup-overlay.vpopup-type-image .vpopup-dialog { overflow: unset; }
}
