/* Shell for every .detail-modal (description, availability, housing details,
   bundle, share). Lives outside detailview.css so pages without it (compare
   rentals) get the same shell; detail pages load it right after detailview.css
   so source order against .modal/.modal-content is unchanged.

   The overlay and dialog base values restate the generic .modal/.modal-content
   rules so the shell stands alone where detailview.css is not loaded. */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 180;
}

.detail-modal.is-open {
    display: flex;
}

/* A detail modal opened over another (see initDetailModals): paint above it, lighter scrim. */
.detail-modal.is-stacked {
    z-index: 190;
    background-color: rgba(0, 0, 0, 0.25);
}

.detail-modal__dialog {
    position: relative;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: min(680px, calc(100vw - 32px));
    max-width: 680px;
    max-height: min(760px, calc(100vh - 40px));
    overflow-y: auto;
    padding: 0;
    border-radius: 8px;
    color: #111;
}

.detail-modal__header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 24px 64px 16px 26px;
    border-bottom: 1.2px solid #ececec;
    background: #fff;
}

.detail-modal__heading {
    min-width: 0;
    flex: 1;
}

.detail-modal__heading h2 {
    margin: 0;
    color: #111;
    font-size: 28px;
    line-height: 1.15;
}

.detail-modal__heading p {
    margin: 6px 0 0;
    color: #555;
    font-size: 14px;
    line-height: 1.35;
}

.detail-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #444;
    cursor: pointer;
    font-size: 22px;
}

.detail-modal__close:hover,
.detail-modal__close:focus-visible {
    background: #f2f2f2;
    color: #111;
    outline: none;
}

.detail-modal__body {
    padding: 10px 26px 18px;
}

.detail-modal__scroll-zone {
    position: sticky;
    left: 0;
    z-index: 2;
    height: 0;
    pointer-events: none;
    display: none;
}

.detail-modal__dialog.has-overflow-y .detail-modal__scroll-zone {
    display: block;
}

.detail-modal__scroll-zone--up {
    top: var(--detail-modal-header-h, 70px);
}

.detail-modal__scroll-zone--down {
    bottom: 0;
}

.detail-modal__scroll-arrow {
    position: absolute;
    left: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    color: #222;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transition:
        opacity 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.18s ease;
}

.detail-modal__scroll-arrow--up {
    top: 10px;
    transform: translateX(-50%);
}

.detail-modal__scroll-arrow--down {
    bottom: 10px;
    transform: translateX(-50%);
}

.detail-modal__scroll-arrow:hover {
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    opacity: 1;
}

.detail-modal__scroll-arrow--down:hover {
    transform: translateX(-50%) scale(1.07);
}

.detail-modal__scroll-arrow--up:hover {
    transform: translateX(-50%) scale(1.07);
}

.detail-modal__scroll-arrow.is-disabled {
    display: none !important;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 800px) {
    .detail-modal__dialog {
        width: min(500px, calc(100vw - 20px));
        max-height: calc(100vh - 250px);
    }

    .detail-modal__header {
        padding: 20px 58px 14px 20px;
    }

    .detail-modal__body {
        padding: 10px 20px 18px;
    }
}
