.bwg-index-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.bwg-index-popup[hidden] {
  display: none;
}

.bwg-index-popup__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.bwg-index-popup__dialog {
  position: relative;
  width: min(92vw, 720px);
  max-height: 90vh;
  padding: 10px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  animation: bwg-popup-in 0.25s ease-out both;
}

.bwg-index-popup__close {
  position: absolute;
  top: -13px;
  right: -13px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ed1651;
  color: #fff;
  font: 700 24px/1 Arial, sans-serif;
  box-shadow: 0 8px 24px rgba(237, 22, 81, 0.35);
  cursor: pointer;
}

.bwg-index-popup__link {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.bwg-index-popup__image {
  display: block;
  width: 100%;
  max-height: calc(90vh - 20px);
  object-fit: contain;
  border-radius: 14px;
}

.bwg-index-popup__fallback {
  padding: 34px 24px;
  color: #1f2937;
  font-size: clamp(16px, 2.5vw, 22px);
  line-height: 1.75;
  text-align: center;
}

body.bwg-index-popup-open {
  overflow: hidden;
}

@keyframes bwg-popup-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 575.98px) {
  .bwg-index-popup { padding: 12px; }
  .bwg-index-popup__dialog { width: 100%; padding: 7px; border-radius: 16px; }
  .bwg-index-popup__link,
  .bwg-index-popup__image { border-radius: 11px; }
  .bwg-index-popup__close { top: -9px; right: -7px; width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .bwg-index-popup__dialog { animation: none; }
}
