.ajlg-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 10, 10, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ajlg-overlay.is-open {
    display: flex;
}

.ajlg-backdrop {
    position: absolute;
    inset: 0;
}

.ajlg-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ajlg-media-wrap {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    cursor: grab;
    will-change: transform;
    transform-origin: center center;
    user-select: none;
}

.ajlg-media-wrap.is-dragging {
    cursor: grabbing;
}

.ajlg-media {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.ajlg-toolbar {
    position: absolute;
    top: 18px;
    right: 18px;
    /* transform: translateX(-50%); */
    z-index: 3;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px;
}

.ajlg-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: #fff;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px 12px;
}

.ajlg-btn,
.ajlg-nav {
    appearance: none;
    border: 0;
    outline: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .18s ease;
}

.ajlg-btn {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.ajlg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 52px;
    height: 52px;
    font-size: 22px;
}

.ajlg-nav.prev {
    left: 18px;
}

.ajlg-nav.next {
    right: 18px;
}

.ajlg-btn:hover,
.ajlg-nav:hover {
    background: rgba(255, 255, 255, 0.16);
}

.ajlg-btn:disabled,
.ajlg-nav:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.ajlg-hidden {
    display: none !important;
}

.ajlg-scale-span {
    display: flex;
    min-width: 50px;
    justify-content: center;
    align-items: center;
    color: white;
}

@media (max-width: 768px) {
    .ajlg-toolbar {
        top: 12px;
        gap: 6px;
        padding: 6px;
    }

    .ajlg-btn {
        width: 38px;
        height: 38px;
    }

    .ajlg-nav {
        width: 44px;
        height: 44px;
    }

    .ajlg-nav.prev {
        left: 10px;
    }

    .ajlg-nav.next {
        right: 10px;
    }
}

.ajlg-thumbs {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 8px;
    max-width: min(90vw, 900px);
    overflow-x: auto;
    padding: 8px 10px;
    scrollbar-width: thin;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

.ajlg-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    padding: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s ease;
}

.ajlg-thumb:hover {
    opacity: 1;
}

.ajlg-thumb.is-active {
    border-color: #fff;
    opacity: 1;
}

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

.ajlg-media-wrap {
    transition: transform 0.2s ease;
    will-change: transform;
}

.ajlg-media-wrap.is-dragging {
    transition: none;
}

@media (max-width: 768px) {
    .ajlg-thumbs {
        bottom: 12px;
        gap: 6px;
        max-width: 94vw;
    }

    .ajlg-thumb {
        width: 48px;
        height: 48px;
    }
}