.apex-card-show-popup[hidden] {
  display: none;
}

.apex-card-show-popup {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.apex-card-show-popup__dialog {
  position: relative;
  width: min(680px, calc(100vw - 48px), calc(100vh - 48px));
}

.apex-card-show-popup__link {
  display: block;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid rgba(255, 203, 45, 0.8);
  border-radius: 12px;
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.apex-card-show-popup__link:focus-visible {
  outline: 3px solid #ffcb2d;
  outline-offset: 3px;
}

.apex-card-show-popup__link img {
  display: block;
  width: 100%;
  height: auto;
}

.apex-card-show-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #111;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.apex-card-show-popup__close::before,
.apex-card-show-popup__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.apex-card-show-popup__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.apex-card-show-popup__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.apex-card-show-popup__close:focus,
.apex-card-show-popup__close:focus-visible {
  outline: none;
}

.apex-card-show-popup__close:hover {
  background: #8d171e;
}

body.apex-card-show-popup-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .apex-card-show-popup {
    padding: 16px;
  }

  .apex-card-show-popup__dialog {
    width: min(calc(100vw - 32px), calc(100vh - 32px));
  }

  .apex-card-show-popup__close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }
}
