/* Listing-only mobile gallery navigation; desktop keeps the site header. */
.hzp-mobile-gallery-header { display: none; }

@media (max-width: 767.98px) {
    body:has(.hzp-mobile-gallery-header) .hz-header,
    .hzp-detail .hzp-crumbs,
    .hzp-detail .hzp-dprice__actions {
        display: none;
    }

    .hzp-detail .hzp-dgallery { position: relative; }

    .hzp-detail .hzp-mobile-gallery-header {
        --hzpg-accent: var(--hagzi-primary, #0745D9);
        position: absolute;
        inset-inline: 16px;
        top: max(16px, env(safe-area-inset-top));
        z-index: 8;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        pointer-events: none;
    }

    .hzp-mobile-gallery-header__actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Reuse the listing's existing 36px controls and their shared icon/state styles. */
    .hzp-mobile-gallery-header__button {
        pointer-events: auto;
        text-decoration: none;
    }

    .hzp-detail .hzp-mobile-gallery-header .hzp-fav {
        width: 36px;
        min-width: 36px;
        height: 36px;
        background: #ffffff;
    }

    .hzp-detail .hzp-mobile-gallery-header .hzp-mobile-gallery-header__back {
        color: var(--hzp-muted);
    }

    .hzp-detail .hzp-mobile-gallery-header__back .hzd-bar__chev {
        width: 18px;
        height: 18px;
        stroke-width: 1.9;
    }

    /* Keep the listing badge below the back button. */
    .hzp-detail .hzp-dgallery .hzpg__badges {
        top: calc(max(16px, env(safe-area-inset-top)) + 48px);
        inset-inline-start: 16px;
    }
}
