/* ================================================
   Listing Gallery — Image gallery grid
   ================================================ */

.listing-gallery {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: var(--border-radius-medium);
    overflow: hidden;
}

/* ── Row 1 : Main image ── */
.listing-gallery__main {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.listing-gallery__image--main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    cursor: pointer;
}

.listing-gallery__main:hover .listing-gallery__image--main {
    transform: scale(1.03);
}

/* ── Row 2 : 4 small images ── */
.listing-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.listing-gallery__cell {
    height: 100px;
    overflow: hidden;
    position: relative;
    border-radius: 0;
}

.listing-gallery__cell .listing-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    cursor: pointer;
}

.listing-gallery__cell:hover .listing-gallery__image {
    transform: scale(1.05);
}

/* ── More button overlay ── */
.listing-gallery__cell--more::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(55, 36, 28, 0.4);
    pointer-events: none;
    transition: background 0.2s ease;
}

.listing-gallery__cell--more:hover::after {
    background: rgba(55, 36, 28, 0.55);
}

.listing-gallery__more-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.listing-gallery__more-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.listing-gallery__more-btn i {
    font-size: 20px;
    color: var(--dark1);
}

.listing-gallery__more-btn span {
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 24px;
    font-weight: var(--font-weight-semibold);
    line-height: 32px;
}

/* ================================================
   Gallery Lightbox — Fullscreen carousel overlay
   ================================================ */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 13, 10, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery-lightbox__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    max-width: 1100px;
    padding: 56px 16px 16px;
    box-sizing: border-box;
}

/* ── Close button ── */
.gallery-lightbox__close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 20px;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}
.gallery-lightbox__close:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

/* ── Stage + image ── */
.gallery-lightbox__stage {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

.gallery-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius-medium, 12px);
    transition: opacity 0.25s ease;
    display: block;
}
.gallery-lightbox__img--loading {
    opacity: 0.35;
}

/* ── Navigation arrows ── */
.gallery-lightbox__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}
.gallery-lightbox__arrow:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-50%) scale(1.1);
}
.gallery-lightbox__arrow--prev { left: 14px; }
.gallery-lightbox__arrow--next { right: 14px; }

/* ── Counter ── */
.gallery-lightbox__counter {
    margin: 10px 0 8px;
    color: rgba(255,255,255,0.7);
    font-family: var(--font-rubik, sans-serif);
    font-size: 13px;
    letter-spacing: 0.04em;
}

/* ── Thumbnails strip ── */
.gallery-lightbox__thumbnails {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.gallery-lightbox__thumbnails::-webkit-scrollbar { height: 4px; }
.gallery-lightbox__thumbnails::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 2px; }

.gallery-lightbox__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gallery-lightbox__thumb:hover {
    opacity: 0.8;
}
.gallery-lightbox__thumb--active {
    opacity: 1;
    border-color: var(--main-color, #c0773a);
}

/* ── Responsive arrows ── */
@media (max-width: 600px) {
    .gallery-lightbox__arrow {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    .gallery-lightbox__arrow--prev { left: 6px; }
    .gallery-lightbox__arrow--next { right: 6px; }
    .gallery-lightbox__thumb { width: 48px; height: 34px; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .listing-gallery__main {
        height: 280px;
    }

    .listing-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .listing-gallery__cell {
        height: 120px;
    }

    .listing-gallery__more-btn span {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .listing-gallery__main {
        height: 220px;
    }

    .listing-gallery__cell {
        height: 100px;
    }
}
