/* ============================================================
   WPCarSync — wpcs-lightbox.css
   Global lightbox overlay — used by wpcsInitLightbox() in wpcs-core.js.
   Loaded for both modern and legacy themes.
   ============================================================ */

.wpcs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(8, 10, 14, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.wpcs-lightbox.open {
    opacity: 1;
    pointer-events: all;
}

.wpcs-lightbox__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
}

.wpcs-lightbox__close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
}

.wpcs-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Swiper nav buttons */
.wpcs-lightbox__swiper {
    width: 100%;
}

.wpcs-lightbox__swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
 * aspect-ratio wird per Inline-Style von wpcs-core.js gesetzt (dynamischer
 * Admin-Wert general_vehicle_image_ratio, global als wpcs_image_ratio
 * verfügbar, z.B. 4/3 oder 16/9). width/height bleiben BEIDE auto — nur
 * max-width/max-height spannen den Rahmen auf. Das ist bewusst KEINE feste
 * height:80vh mit max-width nur als Sicherheitsnetz: würde max-width dann
 * greifen (schmales Fenster), bliebe die Höhe bei fixer Vorgabe stur bei
 * 80vh stehen, während die Breite schrumpft — der Wrapper würde dadurch
 * höher als das tatsächlich sichtbare (schmalere) Bild und das Badge läge
 * daneben statt darauf. Mit width:auto + height:auto berechnet der Browser
 * dagegen immer die größtmögliche Box, die BEIDE Maxima gleichzeitig
 * einhält und dabei exakt das Seitenverhältnis behält (dieselbe Logik wie
 * bei einem <img> mit nur max-width/max-height) — Wrapper und sichtbares
 * Bild schrumpfen beim Verschmälern des Fensters also immer synchron.
 */
.wpcs-lightbox__slide-img-wrap {
    display: block;
    line-height: 0;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
}

.wpcs-lightbox__swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.wpcs-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
}

.wpcs-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wpcs-lightbox__nav--prev { left: -64px; }
.wpcs-lightbox__nav--next { right: -64px; }

.wpcs-lightbox__pagination {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .wpcs-lightbox__inner {
        max-width: 100vw;
        padding: 0 52px;
        box-sizing: border-box;
    }
    .wpcs-lightbox__nav--prev { left: 8px; }
    .wpcs-lightbox__nav--next { right: 8px; }
}
