.djv-thumb-gallery {
    --djv-thumb-size: 90px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

.djv-thumb-gallery.djv-pos-left { flex-direction: row; }
.djv-thumb-gallery.djv-pos-right { flex-direction: row-reverse; }
.djv-thumb-gallery.djv-pos-top { flex-direction: column; }
.djv-thumb-gallery.djv-pos-bottom { flex-direction: column-reverse; }

.djv-thumbs-wrap {
    flex: 0 0 auto;
    max-width: 100%;
}

.djv-thumb-gallery.djv-pos-left .djv-thumbs-wrap,
.djv-thumb-gallery.djv-pos-right .djv-thumbs-wrap {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
}

.djv-thumb-gallery.djv-pos-top .djv-thumbs-wrap,
.djv-thumb-gallery.djv-pos-bottom .djv-thumbs-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.djv-thumbs {
    display: flex;
    gap: 10px;
}

.djv-thumb-gallery.djv-pos-left .djv-thumbs,
.djv-thumb-gallery.djv-pos-right .djv-thumbs {
    flex-direction: column;
}

.djv-thumb-gallery.djv-pos-top .djv-thumbs,
.djv-thumb-gallery.djv-pos-bottom .djv-thumbs {
    flex-direction: row;
    flex-wrap: nowrap;
}

.djv-thumb-item {
    width: var(--djv-thumb-size);
    height: var(--djv-thumb-size);
    padding: 0;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    flex: 0 0 auto;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
    border-radius: 4px;
}

.djv-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.djv-thumb-item:focus { outline: none; }
.djv-thumb-item:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }

.djv-main-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.djv-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    cursor: zoom-in;
}

.djv-thumb-gallery[data-lightbox="0"] .djv-main { cursor: default; }

.djv-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.djv-thumb-gallery.djv-fade .djv-main img {
    transition: opacity .25s ease;
}

.djv-thumb-gallery.djv-fade .djv-main.is-loading img {
    opacity: 0;
}

.djv-caption {
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.djv-empty {
    padding: 24px;
    text-align: center;
    background: #fff3cd;
    border: 1px dashed #d4a849;
    color: #856404;
    border-radius: 4px;
    font-size: 14px;
}

/* Lightbox */
.djv-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.djv-lightbox.is-open { opacity: 1; pointer-events: auto; }
.djv-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    display: block;
}
.djv-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

/* --- Tablet responsive overrides (v1.1) --- */
@media (max-width: 1024px) {
    .djv-thumb-gallery.djv-pos-tablet-left { flex-direction: row; }
    .djv-thumb-gallery.djv-pos-tablet-right { flex-direction: row-reverse; }
    .djv-thumb-gallery.djv-pos-tablet-top { flex-direction: column; }
    .djv-thumb-gallery.djv-pos-tablet-bottom { flex-direction: column-reverse; }

    .djv-thumb-gallery.djv-pos-tablet-left .djv-thumbs,
    .djv-thumb-gallery.djv-pos-tablet-right .djv-thumbs { flex-direction: column; flex-wrap: nowrap; }
    .djv-thumb-gallery.djv-pos-tablet-top .djv-thumbs,
    .djv-thumb-gallery.djv-pos-tablet-bottom .djv-thumbs { flex-direction: row; flex-wrap: nowrap; }

    .djv-thumb-gallery.djv-pos-tablet-left .djv-thumbs-wrap,
    .djv-thumb-gallery.djv-pos-tablet-right .djv-thumbs-wrap {
        max-height: 520px; overflow-y: auto; overflow-x: hidden; width: auto;
    }
    .djv-thumb-gallery.djv-pos-tablet-top .djv-thumbs-wrap,
    .djv-thumb-gallery.djv-pos-tablet-bottom .djv-thumbs-wrap {
        max-height: none; width: 100%; overflow-x: auto; overflow-y: hidden;
    }
}

/* --- Mobile: default auto-reorient (geriye uyumlu) + explicit mobile overrides --- */
@media (max-width: 767px) {
    /* Kullanıcı mobil pozisyon belirtmediyse: sol/sağ otomatik alt yapıya çevrilir (eski davranış) */
    .djv-thumb-gallery.djv-pos-left,
    .djv-thumb-gallery.djv-pos-right {
        flex-direction: column;
    }
    .djv-thumb-gallery.djv-pos-left .djv-thumbs-wrap,
    .djv-thumb-gallery.djv-pos-right .djv-thumbs-wrap {
        max-height: none;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .djv-thumb-gallery.djv-pos-left .djv-thumbs,
    .djv-thumb-gallery.djv-pos-right .djv-thumbs {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    /* Kullanıcı mobil pozisyon seçtiyse bu override uygulanır (sonra tanımlandığı için kazanır) */
    .djv-thumb-gallery.djv-pos-mobile-left { flex-direction: row; }
    .djv-thumb-gallery.djv-pos-mobile-right { flex-direction: row-reverse; }
    .djv-thumb-gallery.djv-pos-mobile-top { flex-direction: column; }
    .djv-thumb-gallery.djv-pos-mobile-bottom { flex-direction: column-reverse; }

    .djv-thumb-gallery.djv-pos-mobile-left .djv-thumbs,
    .djv-thumb-gallery.djv-pos-mobile-right .djv-thumbs { flex-direction: column; flex-wrap: nowrap; }
    .djv-thumb-gallery.djv-pos-mobile-top .djv-thumbs,
    .djv-thumb-gallery.djv-pos-mobile-bottom .djv-thumbs { flex-direction: row; flex-wrap: nowrap; }

    .djv-thumb-gallery.djv-pos-mobile-left .djv-thumbs-wrap,
    .djv-thumb-gallery.djv-pos-mobile-right .djv-thumbs-wrap {
        max-height: 360px; overflow-y: auto; overflow-x: hidden; width: auto;
    }
    .djv-thumb-gallery.djv-pos-mobile-top .djv-thumbs-wrap,
    .djv-thumb-gallery.djv-pos-mobile-bottom .djv-thumbs-wrap {
        max-height: none; width: 100%; overflow-x: auto; overflow-y: hidden;
    }
}
