.property-media {
    max-width: var(--container);
    height: 520px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
    gap: 8px;
}

.media-left,
.media-right {
    height: 100%;
}

.media-left {
    overflow: hidden;
    border-radius: 8px 0 0 8px;
}

.media-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
}

.media-right > div,
.gallery-item {
    overflow: hidden;
}

.media-right .gallery-item:nth-child(2) {
    border-radius: 0 8px 0 0;
}

.media-right .gallery-item:nth-child(4) {
    border-radius: 0 0 8px 0;
}

.property-media img,
.property-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-soft);
    color: var(--color-muted);
}

.gallery-item {
    position: relative;
    cursor: pointer;
    background: var(--color-soft);
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(45,28,15,.04);
    opacity: 0;
    transition: opacity .2s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

.show-more {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255,243,233,.72);
    border-radius: 999px;
    background: rgba(45,28,15,.78);
    color: var(--color-white);
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
}

.media-left img,
.gallery-item img {
    transition: transform .45s ease;
    will-change: transform;
}

.gallery-item:hover img {
    transform: scale(1.025);
}

.gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(45,28,15,.94);
}

.gallery-overlay::after {
    content: "Sluiten";
    position: absolute;
    top: 20px;
    right: 24px;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255,243,233,.12);
    color: var(--color-white);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.gallery-large {
    max-width: min(1120px, 92vw);
    max-height: 76vh;
    border-radius: 8px;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    max-width: min(1120px, 92vw);
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gallery-thumbs img {
    width: 86px;
    height: 62px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    opacity: .76;
}

.gallery-thumbs img:hover {
    opacity: 1;
}

@media (max-width: 900px) {
    .property-media {
        height: auto;
        padding: 0 var(--space-md);
        grid-template-columns: 1fr;
    }

    .media-left {
        border-radius: 8px;
    }

    .media-left,
    .media-right {
        height: auto;
    }

    .media-right {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
        grid-template-rows: none;
        overflow-x: auto;
    }

    .media-right .gallery-item {
        border-radius: 8px;
    }

    .media-left img,
    .property-image-placeholder {
        height: 300px;
    }

    .gallery-item img {
        height: 140px;
    }
}
