﻿/* Prevent background scroll when modal open */
.rl-noscroll {
    overflow: hidden;
}

/* Gallery wrapper */
.rl-gallery {
    border-radius: 18px;
    overflow: hidden;
}

/* Main */
.rl-gallery-main {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
}

.rl-gallery-mainimg {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    background: #f2f2f2;
}

/* Zoom button */
.rl-gallery-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 16px;
}

/* Thumbs row */
.rl-gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 12px;
    overflow-x: auto;
    background: rgba(0,0,0,0.06);
}

.rl-thumb {
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 auto;
}

    .rl-thumb.is-active {
        border-color: rgba(0,0,0,0.55);
    }

    .rl-thumb img {
        width: 88px;
        height: 62px;
        object-fit: cover;
        display: block;
        border-radius: 10px;
    }

/* Lightbox */
.rl-lightbox {
    display: none;
}

    .rl-lightbox.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9999;
    }

.rl-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}

.rl-lightbox-dialog {
    position: relative;
    margin: 4vh auto;
    width: min(1100px, 92vw);
    height: min(86vh, 860px);
    background: rgba(20,20,20,0.95);
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
}

.rl-lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    grid-column: 2;
}

.rl-lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.rl-lightbox-nav {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 44px;
    cursor: pointer;
    height: 100%;
    opacity: 0.85;
}

    .rl-lightbox-nav:hover {
        opacity: 1;
    }

.rl-gallery-empty {
    padding: 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.04);
}


/* ✅ Fallback CSS por si listing-gallery.css no tiene grid */
.rl-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rl-gallery-item {
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

    .rl-gallery-item img {
        width: 100%;
        height: 180px;
        object-fit: cover;
        display: block;
    }

@@media (max-width: 900px) {
    .rl-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rl-gallery-item img {
        height: 160px;
    }
}

@@media (max-width: 520px) {
    .rl-gallery-grid {
        grid-template-columns: 1fr;
    }

    .rl-gallery-item img {
        height: 220px;
    }
}

/* Simple lightbox */
.rl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

    .rl-lightbox.open {
        display: flex;
    }

    .rl-lightbox img {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 14px;
    }

.rl-lightbox-close {
    position: fixed;
    top: 14px;
    right: 18px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
}

    .rl-lightbox-close:hover {
        background: rgba(255,255,255,.25);
    }