/* YM Car Gallery Fix v1.0.1 — scoped to the theme's car gallery (.ymcs-gallery). */

.ymcs-gallery__main { position: relative; }
.ymcs-gallery__img { transition: opacity .18s ease; display: block; width: 100%; }

/* Prev / next arrows on the main photo */
.ymgf-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10, 12, 16, .62); color: #fff; font-size: 30px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.ymgf-nav:hover { background: #C1121F; }
.ymgf-prev { left: 12px; }
.ymgf-next { right: 12px; }

/* Photo counter chip */
.ymgf-count {
  position: absolute; right: 12px; bottom: 12px; z-index: 5;
  background: rgba(10, 12, 16, .68); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 6px 11px; border-radius: 999px; letter-spacing: .03em;
}

/* Thumbnails: one scrollable row, active photo ringed in brand red */
.ymcs-gallery__thumbs {
  display: flex !important; flex-wrap: nowrap !important; gap: 8px;
  overflow-x: auto; overflow-y: hidden; padding: 10px 2px 6px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  list-style: none; margin: 0;
}
.ymcs-gallery__thumbs li { flex: 0 0 auto; scroll-snap-align: center; }
.ymcs-gallery__thumbs [data-ymcs-thumb] {
  display: block; padding: 0; border: 2px solid transparent; border-radius: 8px;
  overflow: hidden; background: none; cursor: pointer; width: 92px; height: 70px;
}
.ymcs-gallery__thumbs [data-ymcs-thumb] img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ymcs-gallery__thumbs [data-ymcs-thumb].ymgf-active { border-color: #C1121F; }

/* Full-screen viewer */
.ymgf-lightbox {
  position: fixed; inset: 0; z-index: 99990; background: rgba(5, 6, 8, .96);
  display: none; align-items: center; justify-content: center;
}
.ymgf-lightbox.ymgf-open { display: flex; }
.ymgf-lb-img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.ymgf-lightbox .ymgf-nav { position: fixed; }
.ymgf-lightbox .ymgf-prev { left: 14px; }
.ymgf-lightbox .ymgf-next { right: 14px; }
.ymgf-lb-close {
  position: fixed; top: 16px; right: 16px; z-index: 6; width: 44px; height: 44px;
  border-radius: 50%; border: 0; cursor: pointer; font-size: 17px;
  background: rgba(255, 255, 255, .14); color: #fff;
}
.ymgf-lb-close:hover { background: #C1121F; }
.ymgf-lb-count { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; right: auto; }

@media (max-width: 640px) {
  .ymgf-nav { width: 42px; height: 42px; font-size: 27px; }
  .ymcs-gallery__thumbs [data-ymcs-thumb] { width: 78px; height: 60px; }
}

/* v1.0.1 hardening: the gallery column can never exceed its container,
   so the next arrow always stays on screen. */
.ymcs-gallery { max-width: 100%; min-width: 0; }
.ymcs-car__grid > * { min-width: 0; }
.ymcs-gallery__main { max-width: 100%; overflow: hidden; }
