/* HomeFlow - Virtual tour icon and modal */

.homeflow-virtual-tour-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    color: var(--e-global-color-lcolor5, #fff);
    background: var(--e-global-color-lprimary1, #1e73be);
    border-radius: var(--e-global-lborder-radius, 4px);
    line-height: 1;
    transition: opacity .2s ease, transform .2s ease;
}

.homeflow-virtual-tour-trigger:hover,
.homeflow-virtual-tour-trigger:focus-visible {
    opacity: .85;
    transform: scale(1.05);
}

.homeflow-virtual-tour-trigger:focus-visible {
    outline: 2px solid var(--e-global-color-lprimary2, #000);
    outline-offset: 2px;
}

.homeflow-virtual-tour-trigger svg {
    flex: 0 0 auto;
    display: block;
}

/* Listing card: compact round icon in the bottom bar, just before the price */
.homeflow-virtual-tour-trigger--listing {
    position: relative;
    z-index: 21;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 10px;
    width: 34px;
    height: 34px;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.homeflow-virtual-tour-trigger--listing .homeflow-virtual-tour-trigger__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Property page: icon with text next to the type/action labels */
.homeflow-virtual-tour-trigger--property {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Property gallery: the button covers the last visible image (same layer as the "+N" overlay) */
.homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--gallery {
    position: absolute;
    inset: 0;
    z-index: 3;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: rgba(0, 0, 0, .45);
    border-radius: 0;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background-color .2s ease;
}

.homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--gallery:hover,
.homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--gallery:focus-visible {
    opacity: 1;
    transform: none;
    background: rgba(0, 0, 0, .6);
}

.homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--gallery:focus-visible {
    outline-offset: -4px;
}

/* Each gallery button belongs to one layout, like the "+N" overlay: desktop (1 + 4 images) or mobile (1 + 2 images) */
.homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--mobile {
    display: none;
}

@media (max-width: 767px) {
    .homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--desktop {
        display: none;
    }

    .homeflow-virtual-tour-trigger.homeflow-virtual-tour-trigger--mobile {
        display: flex;
    }
}

/* Property with a single image: small button below the gallery */
.homeflow-gallery-v2__tour {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.homeflow-virtual-tour-trigger--single {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
}

/* Modal */
html.homeflow-virtual-tour-open,
html.homeflow-virtual-tour-open body {
    overflow: hidden;
}

.homeflow-virtual-tour-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.homeflow-virtual-tour-modal[hidden] {
    display: none;
}

.homeflow-virtual-tour-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .8);
}

.homeflow-virtual-tour-modal__dialog {
    position: relative;
    width: min(1200px, 94vw);
    height: min(800px, 88vh);
    background: #000;
    border-radius: var(--e-global-lborder-radius-large, 8px);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.homeflow-virtual-tour-modal__iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.homeflow-virtual-tour-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: rgba(0, 0, 0, .6);
}

.homeflow-virtual-tour-modal__close:hover,
.homeflow-virtual-tour-modal__close:focus-visible {
    background: rgba(0, 0, 0, .85);
}

@media (max-width: 767px) {
    .homeflow-virtual-tour-modal__dialog {
        width: 100vw;
        height: 100%;
        border-radius: 0;
    }
}
