.elementor-widget-auto_gallery_lightbox_7331d52d {
    --cols: 3;
    --gap: 10px;
}

.agl-wrapper-7331d52d {
    width: 100%;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.agl-grid-7331d52d {
    display: inline-grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    /* Calculate column width based on 3 columns visible at once */
    grid-auto-columns: calc((100% / var(--cols)) - (var(--gap) * (var(--cols) - 1) / var(--cols)));
    gap: var(--gap);
    padding: var(--gap) 0;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .elementor-widget-auto_gallery_lightbox_7331d52d {
        --cols: 2;
    }
}

@media screen and (max-width: 767px) {
    .elementor-widget-auto_gallery_lightbox_7331d52d {
        --cols: 1;
    }
}

.agl-item-7331d52d {
    cursor: pointer;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    transition: opacity 0.3s ease;
    width: 100%;
}

.agl-item-7331d52d:hover {
    opacity: 0.8;
}

.agl-item-7331d52d img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox Styles */
.agl-lightbox-7331d52d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.admin-bar .agl-lightbox-7331d52d {
    top: var(--wp-admin--admin-bar--height, 32px);
    height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

@media screen and (max-width: 782px) {
    body.admin-bar .agl-lightbox-7331d52d {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.agl-lightbox-7331d52d.active {
    opacity: 1;
    pointer-events: auto;
}

.agl-lightbox-img-container-7331d52d {
    width: 90%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.agl-lightbox-7331d52d img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.15s ease;
}

.agl-lightbox-7331d52d.active img {
    transform: scale(1);
}

.agl-lightbox-close-7331d52d {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    font-family: sans-serif;
    font-weight: 300;
    z-index: 9999999;
}

.agl-lightbox-close-7331d52d:hover {
    opacity: 0.7;
}

.agl-lightbox-nav-7331d52d {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    z-index: 9999999;
    transition: opacity 0.2s, transform 0.2s;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.agl-lightbox-nav-7331d52d:hover {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.1);
}

.agl-lightbox-prev-7331d52d {
    left: 20px;
}

.agl-lightbox-next-7331d52d {
    right: 20px;
}