/* =====================================================================
   IRDEN CARS — gallery.css
   Vehicle-card photo gallery + full-screen lightbox.
   Uses the existing design tokens from main.css. Scoped to .vc-* classes
   so it does not touch the rest of the site.
   ===================================================================== */

/* ---------- Card gallery ---------- */
.vc-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.vc-gallery__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.vc-gallery.is-zoomable .vc-gallery__viewport { cursor: zoom-in; }

.vc-gallery__track {
  display: flex;
  height: 100%;
  transition: transform 0.45s var(--ease);
  will-change: transform;
  user-select: none;
}
.vc-gallery__slide {
  flex: 0 0 100%;
  height: 100%;
}
.vc-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform 0.6s var(--ease);
}
.vehicle-card:hover .vc-gallery__slide img { transform: scale(1.03); }

/* legibility scrim (only meaningful when controls are present) */
.vc-gallery--multi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  pointer-events: none;
  z-index: 1;
}

/* keep the category badge above the gallery */
.vehicle-card__media .vehicle-card__tag { z-index: 3; }

/* arrows */
.vc-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vc-gallery__nav svg { width: 15px; height: 15px; }
.vc-gallery__nav--prev { left: 10px; }
.vc-gallery__nav--next { right: 10px; }
.vc-gallery__nav--next svg { transform: scaleX(-1); }
.vc-gallery__nav:hover { background: rgba(10, 10, 12, 0.8); border-color: var(--gold); }
.vc-gallery__nav:disabled { opacity: 0 !important; pointer-events: none; }
.vehicle-card:hover .vc-gallery__nav,
.vc-gallery__nav:focus-visible { opacity: 1; }
@media (hover: none) {
  .vc-gallery__nav { opacity: 0.9; width: 34px; height: 34px; }
}

/* dots */
.vc-gallery__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  flex-wrap: wrap;
}
.vc-gallery__dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: background 0.2s var(--ease), width 0.2s var(--ease), border-radius 0.2s var(--ease);
}
.vc-gallery__dot:hover { background: rgba(255, 255, 255, 0.75); }
.vc-gallery__dot.is-active { background: var(--gold); width: 18px; border-radius: 3px; }

/* zoom / expand hint */
.vc-gallery__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vc-gallery__zoom svg { width: 15px; height: 15px; }
.vc-gallery__zoom:hover { background: rgba(10, 10, 12, 0.8); border-color: var(--gold); }
.vehicle-card:hover .vc-gallery__zoom,
.vc-gallery__zoom:focus-visible { opacity: 1; }
@media (hover: none) { .vc-gallery__zoom { opacity: 0.9; } }

/* ---------- Lightbox ---------- */
html.vc-lightbox-open { overflow: hidden; }

.vc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(6, 6, 8, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0.22s var(--ease);
}
.vc-lightbox.is-open { opacity: 1; visibility: visible; }

.vc-lightbox__inner {
  position: relative;
  width: min(1120px, 96vw);
  height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
}
.vc-lightbox__close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 6;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(20, 20, 24, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vc-lightbox__close:hover { background: rgba(40, 40, 46, 0.95); border-color: var(--gold); }
.vc-lightbox__close svg { width: 20px; height: 20px; }

.vc-lightbox__stage { position: relative; flex: 1; min-height: 0; }
.vc-lightbox__caption {
  margin: 0;
  padding-top: 14px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--paper-dim);
}

.vc-lb { position: absolute; inset: 0; }
.vc-lb__viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.vc-lb__track {
  display: flex;
  height: 100%;
  transition: transform 0.35s var(--ease);
  will-change: transform;
}
.vc-lb__slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.vc-lb__slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  -webkit-user-drag: none;
  user-select: none;
  background: var(--ink-800);
}

.vc-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(20, 20, 24, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.vc-lb__nav svg { width: 20px; height: 20px; }
.vc-lb__nav--prev { left: 4px; }
.vc-lb__nav--next { right: 4px; }
.vc-lb__nav--next svg { transform: scaleX(-1); }
.vc-lb__nav:hover { background: rgba(40, 40, 46, 0.9); border-color: var(--gold); }
.vc-lb__nav:disabled { opacity: 0.32; pointer-events: none; }

.vc-lb__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  flex-wrap: wrap;
}
.vc-lb__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background 0.2s var(--ease), width 0.2s var(--ease), border-radius 0.2s var(--ease);
}
.vc-lb__dot:hover { background: rgba(255, 255, 255, 0.7); }
.vc-lb__dot.is-active { background: var(--gold); width: 20px; border-radius: 3px; }

@media (max-width: 600px) {
  .vc-lightbox { padding: 0; }
  .vc-lightbox__inner { width: 100vw; height: 100dvh; }
  .vc-lightbox__close { top: 10px; right: 10px; background: rgba(20,20,24,0.85); }
  .vc-lb__nav { width: 40px; height: 40px; background: rgba(20, 20, 24, 0.6); }
  .vc-lb__nav--prev { left: 2px; }
  .vc-lb__nav--next { right: 2px; }
  .vc-lightbox__caption { padding: 10px 12px 16px; }
}

/* =====================================================================
   FULL GALLERY (vehicle detail page) — .vf*
   ===================================================================== */
.vf-wrap { display: flex; flex-direction: column; gap: 12px; }

.vf {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-800);
}
.vf__viewport { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.vf.is-zoomable .vf__viewport { cursor: zoom-in; }
.vf__track {
  display: flex;
  height: 100%;
  transition: transform 0.4s var(--ease);
  will-change: transform;
  user-select: none;
}
.vf__slide { flex: 0 0 100%; height: 100%; }
.vf__slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}

.vf__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vf__nav svg { width: 17px; height: 17px; }
.vf__nav--prev { left: 12px; }
.vf__nav--next { right: 12px; }
.vf__nav--next svg { transform: scaleX(-1); }
.vf__nav:hover { opacity: 1; background: rgba(10, 10, 12, 0.8); border-color: var(--gold); }
.vf__nav:disabled { opacity: 0; pointer-events: none; }

.vf__counter {
  position: absolute;
  left: 14px; bottom: 14px;
  z-index: 3;
  padding: 5px 11px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: rgba(10, 10, 12, 0.62);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.vf__zoom {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 3;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vf__zoom svg { width: 16px; height: 16px; }
.vf__zoom:hover { background: rgba(10, 10, 12, 0.8); border-color: var(--gold); }

/* thumbnail strip */
.vf-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.vf-thumbs::-webkit-scrollbar { height: 6px; }
.vf-thumbs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.vf-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink-800);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.vf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vf-thumb:hover { opacity: 0.9; }
.vf-thumb.is-active { opacity: 1; border-color: var(--gold); }

@media (max-width: 560px) {
  .vf-thumb { width: 72px; height: 52px; }
  .vf__nav { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .vf__track { transition: none; }
}
