/* Listing details media – carousel: main 16:10 + thumbnail strip, swipe, tap to open gallery */

.listing-details-media {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(36, 36, 53, 0.2);
}

.listing-media-main-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.listing-media-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.listing-media-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 36, 53, 0.2);
}

/* Show full image in frame, no cropping */
.listing-media-slide .listing-media-item {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  pointer-events: none;
}

.listing-media-slide video.listing-media-item {
  pointer-events: auto;
}

.listing-media-prev,
.listing-media-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  opacity: 0.9;
  transition: opacity 0.2s, background 0.2s;
}

.listing-media-prev:hover,
.listing-media-next:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.65);
}

.listing-media-prev {
  left: 12px;
}

.listing-media-next {
  right: 12px;
}

[dir="rtl"] .listing-media-prev {
  left: auto;
  right: 12px;
}

[dir="rtl"] .listing-media-next {
  right: auto;
  left: 12px;
}

.listing-media-prev i,
.listing-media-next i {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.listing-media-counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  z-index: 2;
}

[dir="rtl"] .listing-media-counter {
  left: auto;
  right: 12px;
}

.listing-media-open-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.listing-media-open-gallery:hover ~ .listing-media-counter,
.listing-media-counter:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Thumbnail strip below main image */
.listing-media-thumbs-wrap {
  padding: 10px 0 0;
  background: transparent;
}

.listing-media-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.listing-media-thumbs::-webkit-scrollbar {
  height: 5px;
}

.listing-media-thumbs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
}

.listing-media-thumbs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.listing-media-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
}

.listing-media-thumb:hover {
  opacity: 0.95;
}

.listing-media-thumb.active {
  border-color: var(--color-primary, #0d8f0d);
  box-shadow: 0 0 0 1px var(--color-primary, #0d8f0d);
}

.listing-media-thumb-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.listing-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-media-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
