.wd-catalog-dialog {
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.wd-catalog-dialog-inner {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.wd-catalog-dialog-copy {
  flex: 0 0 auto;
}

.wd-catalog-dialog figure {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 25px;
  overflow: hidden;
  place-items: center;
}

.wd-catalog-dialog figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.wd-catalog-dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
}

.wd-catalog-dialog-close::before,
.wd-catalog-dialog-close::after {
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.wd-catalog-dialog-close::before {
  transform: rotate(45deg);
}

.wd-catalog-dialog-close::after {
  transform: rotate(-45deg);
}

.wd-catalog-open svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 620px) {
  .wd-catalog-dialog {
    height: fit-content;
    min-height: 0;
    max-height: calc(100dvh - 16px);
  }

  .wd-catalog-dialog-inner {
    height: fit-content;
    min-height: 0;
    padding: 16px;
    grid-template-rows: auto auto;
  }

  .wd-catalog-dialog figure {
    min-height: 0;
    padding: 6px;
    overflow: hidden;
    place-items: center;
  }
}
