.property-template__photos {
    --property-gallery-arrow-size: 3rem;
    --property-gallery-panel: color-mix(in srgb, var(--e-global-color-text, #252525) 82%, transparent);
    --property-gallery-border-strong: color-mix(in srgb, var(--e-global-color-text, #ffffff) 55%, transparent);
    --property-gallery-accent: var(--e-global-color-primary, #893213);
    --property-gallery-shadow: 0 24px 50px rgba(15, 23, 42, 0.14);
    position: relative;
    width: 100%;
}

.property-template__photos-slider {
    position: relative;
    width: 100%;
}

.property-template__photos-strip {
    display: flex;
    gap: 1rem;
    width: 100%;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.property-template__photos-strip::-webkit-scrollbar,
.property-template__photos-viewer-strip::-webkit-scrollbar {
    display: none;
}

.property-template__photo {
    flex: 0 0 auto;
    margin: 0;
}

.property-template__photo-button {
    display: block;
    width: auto;
    padding: 0;
    border: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    cursor: zoom-in;
    appearance: none;
}

.property-template__photo-button:hover,
.property-template__photo-button:focus,
.property-template__photo-button:focus-visible,
.property-template__photo-button:active {
    border: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    outline: none;
}

.property-template__photo-frame {
    display: block;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transition:
        transform 220ms ease,
        opacity 220ms ease;
}

.property-template__photo.is-active .property-template__photo-frame {
    opacity: 1;
}

.property-template__photo-button:hover .property-template__photo-frame,
.property-template__photo-button:focus-visible .property-template__photo-frame {
    transform: translateY(-2px);
    opacity: 0.94;
}

.property-template__photo-image {
    display: block;
    width: auto;
    height: 200px !important;
    max-width: none;
    object-fit: contain;
}

.property-template__photos-arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--property-gallery-arrow-size);
    height: var(--property-gallery-arrow-size);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--property-gallery-panel);
    color: #fff;
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
    transform: translateY(-50%);
    transition:
        background-color 160ms ease,
        transform 160ms ease,
        border-color 160ms ease;
    cursor: pointer;
}

.property-template__photos-arrow:hover,
.property-template__photos-arrow:focus-visible {
    background: rgba(15, 23, 42, 0.94);
    transform: translateY(-50%) scale(1.03);
}

.property-template__photos-arrow span {
    font-size: 1.35rem;
    line-height: 1;
}

.property-template__photos-arrow--prev {
    left: 1rem;
}

.property-template__photos-arrow--next {
    right: 1rem;
}

.property-template__photos-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
}

.property-template__photos-viewer[hidden] {
    display: none;
}

.property-template__photos-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
}

.property-template__photos-viewer-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: min(100%, 110rem);
    height: 100vh;
    padding: 1rem 1.5rem 1.25rem;
}

.property-template__photos-viewer-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 3rem;
    color: #fff;
}

.property-template__photos-viewer-counter {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.property-template__photos-viewer-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    min-height: 0;
}

.property-template__photos-viewer-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.property-template__photos-viewer-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.property-template__photos-viewer-close span {
    font-size: 2rem;
    line-height: 1;
}

.property-template__photos-arrow--viewer {
    top: 50%;
    width: 3.25rem;
    height: 3.25rem;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.property-template__photos-arrow--viewer:hover,
.property-template__photos-arrow--viewer:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.property-template__photos-viewer-strip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.property-template__photos-viewer-thumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 4.5rem;
    padding: 0;
    border: 0 !important;
    border-color: transparent !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    line-height: 0;
    opacity: 0.72;
    transition:
        opacity 160ms ease,
        transform 160ms ease,
        filter 160ms ease;
    cursor: pointer;
    appearance: none;
}

.property-template__photos-viewer-thumb.is-active {
    opacity: 1;
    transform: translateY(-1px);
    filter: saturate(1.05);
}

.property-template__photos-viewer-thumb:hover,
.property-template__photos-viewer-thumb:focus,
.property-template__photos-viewer-thumb:focus-visible,
.property-template__photos-viewer-thumb:active {
    border: 0 !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    outline: none;
}

.property-template__photos-viewer-thumb-image {
    display: block;
    width: auto;
    height: 100% !important;
    max-width: none;
    flex: 0 0 auto;
    border-radius: 0;
    object-fit: contain;
}

body.property-template__viewer-open {
    overflow: hidden;
}

@media (max-width: 782px) {
    .property-template__photos-slider {
        width: 100%;
    }

    .property-template__photo {
        flex-basis: auto;
    }

    .property-template__photo-image {
        height: 200px;
    }

    .property-template__photos-arrow {
        width: 2.5rem;
        height: 2.5rem;
    }

    .property-template__photos-viewer-dialog {
        padding: 0.75rem 0.75rem 1rem;
    }

    .property-template__photos-arrow--viewer {
        width: 2.8rem;
        height: 2.8rem;
    }

    .property-template__photos-viewer-thumb {
        width: fit-content;
        height: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .property-template__photo-frame,
    .property-template__photos-arrow,
    .property-template__photos-viewer-thumb {
        transition: none;
    }

    .property-template__photos-strip,
    .property-template__photos-viewer-strip {
        scroll-behavior: auto;
    }
}
