/* Kasa.hr — popup galerija slika proizvoda (assets/js/product-lightbox.js) */

.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery__image a,
.woocommerce-product-gallery__image img { cursor: zoom-in; }

.kpl-trigger {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 9;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #00265E;
    cursor: pointer;
    box-shadow: 0 6px 16px -8px rgba(0, 38, 94, .35);
    transition: background-color .15s, color .15s;
}
.kpl-trigger:hover { background: #00265E; color: #fff; }

.kpl-trigger svg,
.kpl__btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

html.kpl-open,
html.kpl-open body { overflow: hidden !important; }

.kpl {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: rgba(0, 16, 40, .95);
    color: #fff;
    opacity: 0;
    transition: opacity .2s ease;
}
.kpl[hidden] { display: none; }
.kpl.is-visible { opacity: 1; }

.kpl__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(.75rem, env(safe-area-inset-top)) 1rem .5rem;
}
.kpl__count { font-size: .9rem; font-weight: 700; letter-spacing: .02em; opacity: .85; }

.kpl__btn {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s, color .15s, opacity .15s;
}
.kpl__btn:hover:not(:disabled) { background: #D4E157; border-color: #D4E157; color: #00265E; }
.kpl__btn:disabled { opacity: .3; cursor: default; }
.kpl__btn[hidden] { display: none; }
.kpl__btn:focus-visible,
.kpl__thumb:focus-visible { outline: 3px solid #D4E157; outline-offset: 2px; }

.kpl__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: stretch; }
.kpl__nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 3.25rem; height: 3.25rem; }
.kpl__nav--prev { left: 1rem; }
.kpl__nav--next { right: 1rem; }

.kpl__track {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
    outline: none;
}
.kpl__track::-webkit-scrollbar { display: none; }

.kpl__slide {
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    padding: .5rem 5rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.kpl__slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
}

.kpl__thumbs {
    display: flex;
    gap: .5rem;
    justify-content: center;
    overflow-x: auto;
    padding: .75rem 1rem max(1rem, env(safe-area-inset-bottom));
    scrollbar-width: none;
}
.kpl__thumbs[hidden] { display: none; }
.kpl__thumbs::-webkit-scrollbar { display: none; }
.kpl__thumb {
    flex: none;
    width: 3.75rem;
    height: 3.75rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    opacity: .5;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
.kpl__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kpl__thumb:hover { opacity: .85; }
.kpl__thumb.is-active { opacity: 1; border-color: #D4E157; }

/* Mobitel: slika do rubova, strelice skrivene (swipe), sličice manje */
@media (max-width: 767px) {
    .kpl__slide { padding: .25rem .75rem; }
    .kpl__nav { display: none; }
    .kpl__thumb { width: 3rem; height: 3rem; }
    .kpl__thumbs { justify-content: flex-start; }
}

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