.location-images-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
}

.location-images-row-full {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.location-images-row>.location-image {
  width: auto !important;
  min-width: 0;
  position: relative;
}

.location-image .custom-popover {
  left: 50%;
  right: auto;
}

.location-image.popover-left .custom-popover {
  left: auto;
  right: 50%;
}

.location-image.popover-right .custom-popover {
  left: 50%;
  right: auto;
}

.custom-popover {
  width: 500px !important;
  max-width: calc(100vw - 32px) !important;
}

.location-images.map-open .custom-popover {
  width: min(480px, calc(100vw - 32px)) !important;
}

.location-images.map-open .location-image.popover-right .custom-popover {
  left: 35%;
}

@media (max-width: 1500px) {
  .location-images-row {
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  }

  .location-images.map-open .location-image.popover-right .custom-popover {
    left: 3%;
  }
}

@media (max-width: 1200px) {
  .location-images-row {
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: 12px;
  }

  .location-images.map-open .location-image.popover-right .custom-popover {
    left: 3%;
  }
}

@media (max-width: 900px) {
  .location-images-row {
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  }

  .custom-popover,
  .location-images.map-open .custom-popover {
    width: min(360px, calc(100vw - 32px)) !important;
  }

  .location-images.map-open .location-image.popover-right .custom-popover {
    left: 25%;
  }
}

@media (max-width: 600px) {
  .location-images-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .custom-popover,
  .location-images.map-open .custom-popover {
    width: calc(100vw - 32px) !important;
    max-width: 420px !important;
  }

  .location-image.popover-left .custom-popover {
    left: auto;
    right: 0;
  }

  .location-image.popover-right .custom-popover {
    left: 0;
    right: auto;
  }

  .location-images.map-open .location-image.popover-right .custom-popover {
    left: 0;
  }
}

@media (max-width: 400px) {
  .custom-popover,
  .location-images.map-open .custom-popover {
    width: calc(100vw - 20px) !important;
  }
}

#content-wrapper .location-image,
#content-wrapper .list-image,
#content-wrapper .list-classes {
  position: relative;
}

#content-wrapper .custom-popover:is(.preview-right, .preview-left, .preview-top) {
  position: absolute;
  max-width: calc(100vw - 24px);
  transition:
    opacity 0.3s ease-in-out,
    visibility 0.3s ease-in-out,
    transform 0.3s ease-in-out;
}

#content-wrapper .custom-popover.preview-right {
  left: 50% !important;
  right: auto !important;
  top: 20% !important;
  bottom: auto;
}

#content-wrapper .custom-popover.preview-left {
  left: auto !important;
  right: 50% !important;
  top: 20% !important;
  bottom: auto;
}

#content-wrapper .custom-popover.preview-top {
  left: var(--preview-top-left, 0px) !important;
  right: auto !important;
  top: auto !important;
  bottom: calc(100% + 18px);
}

#content-wrapper .custom-popover.preview-up {
  top: auto !important;
  bottom: 50%;
  transform: translateY(10px) !important;
}

#content-wrapper .location-image:hover .custom-popover.preview-up,
#content-wrapper .list-image:hover .custom-popover.preview-up,
#content-wrapper .custom-popover.preview-up:hover {
  transform: translateY(-10px) !important;
}

.mini-images img {
  background-color: #e1e1e1;
  border-radius: 3px;
}

.img-container {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.listing-style1 .list-content {
  padding: 10px 15px 6px 15px;
}

.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-popover .mini-images {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.custom-popover .mini-images img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  /* object-fit: cover !important; */
}

.custom-popover.list-view {
  width: min(calc(100% - 285px), 1267px) !important;
  max-width: min(calc(100% - 285px), 1267px) !important;
}

.custom-popover.list-view .mini-images {
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.custom-popover.list-view .mini-images img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}