.ls-imagepopup[hidden] {
  display: none !important;
}

.ls-imagepopup {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ls-imagepopup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.ls-imagepopup__dialog {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(92vw, 980px);
  max-height: 92vh;
  line-height: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.ls-imagepopup__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(92vw, 980px);
  max-height: 92vh;
  object-fit: contain;
}

.ls-imagepopup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.ls-imagepopup__close:focus-visible {
  outline: 3px solid #b24642;
  outline-offset: 2px;
}

body.ls-imagepopup-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .ls-imagepopup {
    padding: 12px;
  }

  .ls-imagepopup__dialog,
  .ls-imagepopup__image {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .ls-imagepopup__close {
    top: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }
}
