/* Shared by the customer gallery, cards, Featured Inventory and staff previews. */
.featured-unit-media { position: relative; }
.unit-photo:has(.image-overlay),
.featured-unit-media:has(.image-overlay),
.overlay-preview--card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.unit-photo:has(.image-overlay) > img,
.featured-unit-media:has(.image-overlay) > img { min-width: 0; min-height: 0; }
.image-overlay {
  position: absolute;
  z-index: 3;
  top: 0;
  /* Transparent canvas reserves legible type size. The shared SVG geometry
     limits visible artwork to the outer 42% of the photo width (at most 180px).
     Do not independently resize/offset bows or admin previews here. */
  width: min(58%, 250px);
  max-height: 100%;
  aspect-ratio: 1;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / 23%));
}
.image-overlay--right { right: 0; }
.image-overlay--left { left: 0; }
.image-overlay svg { display: block; width: 100%; height: 100%; overflow: visible; }
.image-overlay[hidden] { display: none !important; }
.unit-photo:has(.image-overlay--left) .condition-badge { left: auto; right: 12px; }
.unit-photo:has(.image-overlay) .title-brand-badge { top: auto; bottom: 12px; }
.dialog-photo:has(.image-overlay) .detail-title-brand { top: auto; bottom: 12px; }
.unit-photo:has(.image-overlay) .sold-banner,
.dialog-photo:has(.image-overlay) .sold-banner { top: auto; bottom: 12px; z-index: 4; }
.unit-photo:has(.image-overlay):has(.sold-banner:not([hidden])) .title-brand-badge,
.dialog-photo:has(.image-overlay):has(.sold-banner) .detail-title-brand { bottom: 85px; }
.dialog-photo:has(.image-overlay):has(.sold-banner) .gallery-position { right: auto; left: 12px; }
.dialog-photo:has(.image-overlay):has(.sold-banner) .gallery-swipe-hint { left: 12px; bottom: 48px; transform: none; }
@media (max-width: 760px) {
  /* Keep the modal close action clear of right-corner bows on stacked layouts. */
  #unitDialog:has(.dialog-photo > .image-overlay--right) .dialog-gallery { padding-top: 64px; }
}
