/* ==========================================================================
   KolaKlik Card Preview — fullscreen long-press preview overlay
   Slika prati prst (createSwipeTrack) — identican feel kao u oglasu.
   ========================================================================== */

body.kk-preview-lock { overflow: hidden; }

/* Sprijeci iOS Safari / Android Chrome context menu (kopiraj link, dijeli...)
   na long-press kartice oglasa. Tekst se i dalje moze kopirati u detaljnom
   prikazu — ovo se odnosi samo na karticu u feed-u. */
.vehicle-card {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.vehicle-card img {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* === OVERLAY === */
.kk-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
}
.kk-preview-overlay.show {
    opacity: 1;
    pointer-events: auto;
    animation: kkPreviewIn 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes kkPreviewIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1);    }
}

/* === STAGE === */
.kk-preview-stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
}

/* === IMAGE WRAP + TRACK (carousel) === */
.kk-preview-imgwrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;            /* dozvoli vertikalni scroll/swipe */
    background: #000;
    /* Zaobljeni okviri (kao galerija u oglasu) + lagani razmak od ivica */
    margin: 18px 18px 0;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
    /* Visina se dinamicki postavlja JS-om da odgovara trenutnoj slici */
    transition: height 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.kk-preview-track {
    display: flex;
    height: 100%;
    will-change: transform;
}
.kk-preview-slide {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.kk-preview-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform;
}

/* === CLOSE BUTTON === */
.kk-preview-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.kk-preview-close:hover {
    background: rgba(220, 50, 50, 0.85);
    transform: scale(1.05);
}

/* === COUNTER === */
.kk-preview-counter {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.6);
    color: #fff;
    padding: 8px 16px;
    border-radius: 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 3;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    pointer-events: none;
}

/* === DOTS (indikator trenutne slike) === */
.kk-preview-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 14px 16px 4px;
    z-index: 3;
}
.kk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.kk-dot:hover { background: rgba(255, 255, 255, 0.55); }
.kk-dot.active {
    background: #D4A017;
    transform: scale(1.35);
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.8);
}

/* === INFO BAR === */
.kk-preview-info {
    background: #000;
    padding: 24px 24px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    color: #fff;
    z-index: 3;
}
.kk-preview-titlewrap { flex: 1; min-width: 200px; }
.kk-preview-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 6px;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kk-preview-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    flex-wrap: wrap;
}
.kk-preview-price {
    color: #D4A017;
    font-weight: 800;
    font-size: 20px;
    text-shadow: 0 0 14px rgba(212,160,23,0.4);
}
.kk-preview-city::before {
    content: '\f3c5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 5px;
    color: rgba(255,255,255,0.55);
}

.kk-preview-cta {
    background: linear-gradient(135deg, #D4A017 0%, #B8860B 100%);
    color: #0a0a14;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 12px 22px;
    border-radius: 26px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 22px rgba(212,160,23,0.4);
    white-space: nowrap;
}
.kk-preview-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212,160,23,0.55);
}
.kk-preview-cta i { font-size: 11px; }

/* === MOBILE === */
@media (max-width: 700px) {
    .kk-preview-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 15px; }
    .kk-preview-counter { top: 14px; padding: 6px 12px; font-size: 12px; }
    .kk-preview-imgwrap { margin: 12px 10px 0; border-radius: 14px; }

    .kk-preview-info {
        padding: 18px 16px;
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    .kk-preview-titlewrap { min-width: 0; }
    .kk-preview-title { font-size: 16px; }
    .kk-preview-meta { font-size: 13px; gap: 10px; }
    .kk-preview-price { font-size: 17px; }
    .kk-preview-cta { font-size: 12px; padding: 11px 18px; align-self: stretch; justify-content: center; }
}

.kk-preview-overlay { -webkit-tap-highlight-color: transparent; }

[data-theme="light"] .kk-preview-overlay {
    background: #000;
}
