.property-gallery {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 10px;
    width: 100%;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-main-image {
    grid-column: 1 / 2;
    position: relative;
    height: 0;
    padding-bottom: 66.66%;
    overflow: hidden;
    border-radius: 8px;
}

.gallery-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnails {
    grid-column: 2 / 3;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-item {
    position: relative;
    height: 0;
    padding-bottom: 100%; /* 1:1 Aspect Ratio (perfect square) */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-size: cover; /* Make background image cover the div */
    background-position: center; /* Center the background image */
    background-repeat: no-repeat; /* Prevent repeating */
}

/* Ensure no img tag styling for thumbnail items, as they are now background images */
.thumbnail-item > img {
    display: none;
}

.empty-thumbnail-slot {
    display: none;
}

.gallery-more-photos-overlay {
    position: relative;
}

.gallery-more-photos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    border-radius: 8px;
}

/* Responsive Adjustments (Simplified for consistent 2x2 square thumbnails) */
@media (max-width: 992px) {
    .property-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-main-image {
        grid-column: auto;
        padding-bottom: 56.25%;
    }

    .gallery-thumbnails {
        grid-column: auto;
        grid-template-columns: repeat(4, 1fr);
    }

    .thumbnail-item {
        padding-bottom: 56.25%;
    }

    .gallery-more-photos {
        grid-column: auto;
    }
}

@media (max-width: 576px) {
    .gallery-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumbnail-item {
        padding-bottom: 100%;
    }
}

/* Lightbox Styles */
.lightbox-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
    z-index: 9999; /* High z-index to be on top */
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000; /* Higher than other lightbox elements */
}

.elementor-kit-10 .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0px;
    line-height: 44px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 100%;
    z-index: 9999;
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-caption {
    color: #fff;
    margin-top: 10px;
    font-size: 1rem;
}

.lightbox-counter {
    color: #fff;
    margin-top: 5px;
    font-size: 0.8rem;
}

/* Prevent scrolling when lightbox is open */
body.lightbox-open {
    overflow: hidden;
} 