.property-gallery.block {
    height: 100dvh !important;
    width: 100vw !important;
    background-color: white;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.7s ease;

    .header {
        z-index: 10;
        padding: 15px 48px;
        display: flex;
        align-items: center;
        position: relative;
        transition: all 0.7s ease;

        @media screen and (max-width: 767px) {
            padding: 0.3rem 1.5rem;
            position: absolute;
            width: 100vw;
            background-color: white;
            box-sizing: border-box;
        }

        &.hide:not(.no-hide) {
            transition: all 0.7s ease;
            display: block !important;
            transform: translateY(-100%);
            /* height: 0; */
        }

        .close-icon {
            height: 2.5rem;
            @media screen and (max-width: 767px) {
                span {
                    display: none;
                }
            }
        }

        .logo {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            justify-content: center;

            @media screen and (max-width: 767px) {
                height: 2.125rem;

                img {
                    height: 100%;
                    width: auto;
                }
            }
        }
    }

    .mobile-category-filter {
        display: none;
        pointer-events: none;

        @media screen and (max-width: 767px) {
            display: block;
            top: auto;
            bottom: 3rem;

            .mobile-filter-hamburger {
                pointer-events: none;
                bottom: 7px;
                top: auto;
            }
        }
    }

    .category-filters {
        position: absolute;
        top: 8rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
        display: flex;
        gap: 1.5rem;

        @media screen and (max-width: 767px) {
            display: none;
        }

        .filter-button {
            transition: opacity 0.4s ease;

            &.active {
                cursor: auto;
            }

            &.inactive {
                opacity: 0.5;

                &:hover {
                    opacity: 1;
                }
            }
        }
    }

    .card-container {
        position: relative;
        display: flex;
        align-items: center;
        height: 100%;

        @media screen and (max-width: 767px) {
            box-sizing: border-box;
            align-items: start;
            overflow-y: auto;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
            &::-webkit-scrollbar {
                display: none;
            }
            padding-top: 3.5rem;
        }

        .cards {
            width: 100%;
            white-space: nowrap;
            will-change: transform;
            display: flex;
            flex-direction: row;
            align-items: center;
            padding: 0 !important;
            gap: 0 !important;

            @media screen and (max-width: 767px) {
                scrollbar-width: none; /* Firefox */
                -ms-overflow-style: none; /* IE and Edge */
                gap: 0 !important;
                box-sizing: border-box;
                flex-direction: column;
                gap: 1.5rem !important;
                padding: 1.5rem !important;
                box-sizing: border-box;
                margin-bottom: 2rem;
                margin-top: 0;
                padding-top: 0 !important;
            }

            /* Landscape */
            .card:nth-child(4n-3) {
                aspect-ratio: 660 / 480;
                min-height: 480px;

                @media screen and (max-width: 767px) {
                    min-height: 240px !important;
                }

                @media screen and (min-width: 769px) and (max-height: 650px) {
                    min-height: 288px !important;
                }
            }

            /* Square */
            .card:nth-child(4n-2),
            .card:nth-child(4n) {
                aspect-ratio: 1 / 1;
                min-width: 314px;
                min-height: 314px;

                @media screen and (min-width: 769px) and (max-height: 650px) {
                    min-height: 208px !important;
                    min-width: 208px !important;
                }
            }

            /* Portrait */
            .card:nth-child(4n-1) {
                aspect-ratio: 314 / 480;
                min-width: 314px;
                min-height: 480px;

                @media screen and (min-width: 769px) and (max-height: 650px) {
                    min-height: 288px !important;
                    min-width: 314px !important;
                }
            }

            .card {
                list-style-type: none;
                font-family: helvetica, sans-serif;
                position: relative;
                cursor: pointer;
                border-radius: 10px;
                margin-left: 1.5rem !important;
                overflow: clip;

                @media screen and (max-width: 767px) {
                    min-width: none;
                    min-height: none;
                    width: 100%;
                    height: 100%;
                    margin-left: 0 !important;
                }

                &:hover {
                    img,
                    picture,
                    picture::after {
                        transform: scale(1.02);
                    }
                }

                picture {
                    border-radius: 10px;
                    transition: transform 0.3s ease;
                    transform-origin: bottom;

                    &::after {
                        content: "";
                        position: absolute;
                        left: 0;
                        bottom: 0;
                        width: 100%;
                        height: 100%;
                        border-radius: 0 0 10px 10px;
                        pointer-events: none;
                        transition: transform 0.3s ease;
                        background: linear-gradient(
                            to top,
                            rgba(0, 0, 0, 0.3) 0%,
                            rgba(0, 0, 0, 0) 15%
                        );
                        transform-origin: center;
                    }

                    img {
                        position: relative;
                        border-radius: 10px;
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                        transition: transform 0.3s ease;
                    }
                }

                picture img:not([src]),
                picture img[src=""],
                picture img[loading="lazy"] {
                    background-color: rgb(var(--brand-sage)) !important;
                    &::after {
                        background-color: rgb(var(--brand-sage)) !important;
                    }
                }

                .label {
                    position: absolute;
                    bottom: 0rem;
                    left: 0rem;
                    line-height: 100%;
                    z-index: 2;
                    font-family: "";
                    font-family: var(--font-cormorant, Cormorant), serif;
                    font-size: clamp(1rem, 2vw, 1.25rem);
                    letter-spacing: -0.03em;
                    width: 80%;
                    padding: 1rem;
                    text-wrap: wrap;
                    box-sizing: border-box;
                }
            }
        }
    }

    .gallery-header__logo {
        width: 50px;
        height: 50px;
    }

    .gallery-header__close {
        font-size: 3.5rem;
        width: 35px;
        height: 35px;
        left: 15px;
    }

    .image-gallery.scroll-hide .gallery-header {
        transform: translateY(-100%);
        opacity: 0;
    }

    /* Mobile: object-fit: contain */
    .property-gallery-lightbox__swiper .swiper-slide img {
        object-fit: cover;
        height: 484px;
    }

    /* Mobile Lightbox Text Color */
    .property-gallery-lightbox__title {
        color: #333333;
    }

    .property-gallery-lightbox__bottom-bar {
        padding: 24px 16px;
    }
}

.image-gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    @media screen and (max-width: 767px) {
        box-sizing: border-box;
        flex-direction: column;
        background-color: white;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
    }

    .swiper.mySwiper2 {
        width: 100vw;
        height: 100vh;
        box-sizing: border-box;
        background-color: white;

        @media screen and (max-width: 767px) {
            height: fit-content;
        }

        .swiper-slide {
            width: 100vw;
            height: 100vh;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;

            @media screen and (max-width: 767px) {
                aspect-ratio: 4/5;
                height: 30.25rem;
                justify-content: center;
                align-items: center;
            }

            &::after {
                content: "";
                position: absolute;
                left: 0;
                bottom: 0;
                width: 100%;
                height: 30%;
                pointer-events: none;
                background: linear-gradient(
                    to top,
                    rgba(0, 0, 0, 0.7),
                    rgba(0, 0, 0, 0)
                );
                z-index: 2;

                @media screen and (max-width: 767px) {
                    display: none;
                }
            }

            picture {
                width: 100%;
                height: 100%;
                display: flex;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }

        .swiper-button-next,
        .swiper-button-prev {
            background-color: rgba(0, 0, 0, 0.5);
            border-radius: 10rem;
            width: 40px;
            height: 40px;
            transition: background-color 0.4s ease;

            @media screen and (max-width: 767px) {
                display: none;
            }

            &:hover {
                background-color: rgba(0, 0, 0, 0.8);
            }

            svg {
                width: 1.5rem;
                height: 1.5rem;
            }
        }

        .swiper-button-prev {
            left: 5rem;
        }

        .swiper-button-next {
            right: 5rem;
            svg {
                transform: rotate(180deg);
            }
        }

        .swiper-button-next:after,
        .swiper-rtl .swiper-button-prev:after,
        .swiper-button-prev:after,
        .swiper-rtl .swiper-button-next:after {
            display: none;
        }
    }

    .swiper-caption {
        position: absolute;
        bottom: 5rem;
        left: 5rem;
        color: white;
        z-index: 3;

        @media screen and (max-width: 767px) {
            position: static;
            color: rgb(var(--brand-black));
            text-align: center;
            padding: 0 1.5rem;
            height: 5rem;
        }

        @media screen and (max-width: 480px) {
            max-width: 16rem;
        }
    }

    .gallery-indicator {
        position: absolute;
        bottom: 8.5rem;
        left: 5rem;
        color: white;
        z-index: 3;

        @media screen and (max-width: 767px) {
            position: static;
            color: rgb(var(--brand-black));
            text-align: right;
            margin-bottom: 0.5rem;
            padding: 0 1.5rem;
            display: flex;
            justify-content: space-between;
            width: 100%;
            box-sizing: border-box;
            align-items: center;
            height: fit-content;
        }

        .close-button {
            display: none;

            @media screen and (max-width: 767px) {
                display: block;
                position: relative;
                color: rgb(var(--brand-black));
                top: auto;
                left: auto;

                span {
                    display: none;
                }
            }
        }
    }

    .thumbs-container {
        position: absolute;
        right: 5rem;
        bottom: 5rem;
        width: 468px;
        height: fit-content;

        @media screen and (max-width: 1024px) {
            width: 256px;
        }

        @media screen and (max-width: 767px) {
            display: none;
        }

        .swiper.mySwiper.thumbs {
            width: 100%;

            .swiper-slide:not(.swiper-slide-thumb-active) {
                &::after {
                    content: "";
                    position: absolute;
                    left: 0;
                    bottom: 0;
                    width: 100%;
                    height: 100%;
                    pointer-events: none;
                    background: rgba(0, 0, 0, 0.6);
                    z-index: 2;
                    border-radius: 10px;
                    transition: background 0.3s ease;
                }

                &:hover {
                    &::after {
                        background: rgba(0, 0, 0, 0);
                    }
                }
            }

            .swiper-slide {
                aspect-ratio: 1/1;
                cursor: pointer;
                border-radius: 10px;

                img {
                    border-radius: 10px;
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
        }
    }

    .close-button {
        position: absolute;
        top: 2rem;
        left: 5rem;
        padding-left: 1rem;
        color: #fff;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10000;
    }

    /* ------------------------ Swiper Mobile Pagination ------------------------ */
    .dot-pagination {
        display: none;

        @media screen and (max-width: 767px) {
            display: block;
            bottom: 1rem !important;

            .swiper-pagination-bullet {
                width: 4px;
                height: 4px;
                border-radius: 50%;
                background: white;
                margin: 0 2px;
                border: none;
                transition: width 0.3s, border-radius 0.3s;
                opacity: 0.8;
            }
            .swiper-pagination-bullet.swiper-pagination-bullet-active {
                width: 25px;
                opacity: 1;
                background: white;
                border-radius: 16px;
            }
        }
    }
}
