.kgli-image-widget {
    display: block;
    width: 100%;
    max-width: 100%;
    position: relative;
    line-height: 0;
    text-align: left;
}

.kgli-image-button {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    background-image: none !important;
    color: inherit !important;
    cursor: pointer !important;
    text-align: inherit !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transform: none !important;
}

.kgli-image-button:hover,
.kgli-image-button:focus,
.kgli-image-button:focus-visible,
.kgli-image-button:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: inherit !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

.kgli-image-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    line-height: 0;
}

.kgli-small-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    object-fit: cover;
    object-position: center center;
    margin: 0;
    padding: 0;
    border: 0;
    transition: none !important;
    transform: none !important;
    filter: none !important;
}

.kgli-image-button:hover .kgli-small-image,
.kgli-image-button:focus .kgli-small-image,
.kgli-image-button:active .kgli-small-image {
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
}

.kgli-image-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(0, 0, 0, 0.02) 45%,
        rgba(0, 0, 0, 0.58) 100%
    );
}

.kgli-caption-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    display: block;
    pointer-events: none;
    color: #fff;
    background: transparent;
    line-height: 1.35;
    font-size: 12px;
    text-align: left;
    padding: 10px 14px;
}

body.kgli-lightbox-open {
    overflow: hidden;
}

.kgli-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.kgli-lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.kgli-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 70px 90px 110px;
    box-sizing: border-box;
}

.kgli-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    cursor: default;
    transform-origin: center center;
    transition: transform 0.18s ease;
}

.kgli-lightbox-image.kgli-is-zoomed {
    cursor: grab;
    transition: none;
}

.kgli-lightbox-image.kgli-dragging {
    cursor: grabbing;
}

.kgli-close,
.kgli-prev,
.kgli-next,
.kgli-zoom-out,
.kgli-reset,
.kgli-zoom-in {
    appearance: none;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.42);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kgli-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    z-index: 4;
    font-size: 32px;
    line-height: 1;
    border-radius: 50%;
}

.kgli-prev,
.kgli-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 70px;
    z-index: 4;
    font-size: 52px;
    line-height: 1;
    border-radius: 4px;
}

.kgli-prev { left: 18px; }
.kgli-next { right: 18px; }

.kgli-close:hover,
.kgli-prev:hover,
.kgli-next:hover,
.kgli-zoom-out:hover,
.kgli-reset:hover,
.kgli-zoom-in:hover {
    background: rgba(199, 34, 32, 0.92);
}

.kgli-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 0 80px;
    box-sizing: border-box;
}

.kgli-caption {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    max-width: 60%;
}

.kgli-tools {
    display: flex;
    align-items: center;
    gap: 5px;
}

.kgli-zoom-out,
.kgli-reset,
.kgli-zoom-in {
    min-width: 40px;
    height: 38px;
    padding: 0 12px;
    border-radius: 3px;
    font-size: 16px;
}

.kgli-reset { font-size: 13px; }

@media (max-width: 767px) {
    .kgli-stage {
        padding: 60px 18px 110px;
    }

    .kgli-lightbox-image {
        max-width: 94vw;
        max-height: 72vh;
    }

    .kgli-prev,
    .kgli-next {
        width: 42px;
        height: 56px;
        font-size: 40px;
    }

    .kgli-prev { left: 6px; }
    .kgli-next { right: 6px; }

    .kgli-bottom {
        bottom: 16px;
        flex-direction: column;
        gap: 10px;
        padding: 0 18px;
    }

    .kgli-caption {
        max-width: 92%;
        font-size: 13px;
    }
}
