.ag-image-gallery {
    margin: 24px 0;
}

.ag-image-gallery-title {
    margin: 0 0 12px;
}

.ag-image-rail {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 10px 0 16px;
    -webkit-overflow-scrolling: touch;
}

.ag-image-item {
    flex: 0 0 auto;
    width: 260px;
    margin: 0;
    scroll-snap-align: start;
}

.ag-image-shot {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.ag-image-shot img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
}

.ag-image-shot:hover img,
.ag-image-shot:focus-visible img {
    opacity: 0.92;
}

.ag-image-item figcaption {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.35;
    color: #4b5563;
}

.ag-image-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
}

.ag-image-modal.ag-is-open {
    display: flex;
}

.ag-image-modal-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(calc(100% - 140px), 1100px);
    max-height: 86vh;
}

.ag-image-modal img {
    display: block;
    max-width: 100%;
    max-height: 86vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
}

.ag-image-modal-close,
.ag-image-modal-prev,
.ag-image-modal-next {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #fff;
    color: #111827;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22);
    -webkit-appearance: none;
    appearance: none;
}

.ag-image-modal-close {
    top: -22px;
    right: -77px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 42px;
}

.ag-image-modal-prev,
.ag-image-modal-next {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 58px;
    border-radius: 12px;
    font-size: 42px;
    line-height: 58px;
}

.ag-image-modal-prev {
    left: -74px;
}

.ag-image-modal-next {
    right: -74px;
}

.ag-image-modal-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -46px;
    padding: 8px 12px;
    border-radius: 10px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.55);
}

.ag-image-modal.ag-single-image .ag-image-modal-prev,
.ag-image-modal.ag-single-image .ag-image-modal-next {
    display: none;
}

@media (max-width: 700px) {
    .ag-image-item {
        width: 220px;
    }

    .ag-image-shot img {
        height: 130px;
    }

    .ag-image-modal {
        padding: 14px;
    }

    .ag-image-modal-frame {
        max-width: calc(100% - 76px);
        max-height: 78vh;
    }

    .ag-image-modal img {
        max-height: 78vh;
    }

    .ag-image-modal-close {
        top: -18px;
        right: -12px;
        width: 38px;
        height: 38px;
        font-size: 26px;
        line-height: 38px;
    }

    .ag-image-modal-prev,
    .ag-image-modal-next {
        width: 38px;
        height: 48px;
        font-size: 34px;
        line-height: 48px;
        background: rgba(255, 255, 255, 0.94);
    }

    .ag-image-modal-prev {
        left: -44px;
    }

    .ag-image-modal-next {
        right: -44px;
    }

    .ag-image-modal-caption {
        left: 0;
        right: 0;
        bottom: -42px;
        font-size: 13px;
    }
}
