/* Properties pages — mobile-only layout fixes (listing + detail) */

@media (max-width: 768px) {
    .fa-layout--properties,
    .fa-layout--property-detail {
        overflow-x: clip;
        max-width: 100%;
    }

    .fa-layout--properties .adonis-fa-new-main,
    .fa-layout--property-detail .adonis-fa-new-main {
        overflow-x: clip;
    }

    /* ── Listing (/properties/) ── */
    .fa-layout--properties .fa-proplist-section {
        padding-top: 1.5rem;
        padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
    }

    .fa-layout--properties .adonis-fa-new-container {
        padding-inline: clamp(1rem, 4vw, 1.25rem);
    }

    .fa-layout--properties .fa-proplist-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        gap: 1rem;
    }

    .fa-layout--properties .fa-featprop-card {
        max-width: 100%;
    }

    /* ── Detail hero ── */
    .fa-layout--property-detail .fa-prop-hero {
        height: clamp(240px, 42vh, 360px);
        min-height: 240px;
        max-height: none;
    }

    .fa-layout--property-detail .fa-prop-hero-content {
        padding: 1.15rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .fa-layout--property-detail .fa-prop-title {
        font-size: clamp(1.35rem, 6vw, 1.75rem);
        line-height: 1.35;
    }

    .fa-layout--property-detail .fa-prop-tagline {
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .fa-layout--property-detail .fa-prop-badges {
        gap: 0.45rem;
        margin-top: 0.75rem;
    }

    .fa-layout--property-detail .fa-prop-badge {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }

    /* ── Detail content shell ── */
    .fa-layout--property-detail .fa-prop-content {
        padding: 1.35rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    .fa-layout--property-detail .fa-prop-overview {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .fa-layout--property-detail .fa-prop-overview > * {
        min-width: 0;
        max-width: 100%;
    }

    .fa-layout--property-detail .fa-overview-box {
        padding: 1.15rem 1rem;
        border-radius: 18px;
        box-sizing: border-box;
    }

    .fa-layout--property-detail .fa-overview-features {
        grid-template-columns: 1fr !important;
        gap: 0.55rem;
    }

    .fa-layout--property-detail .fa-overview-feature {
        min-width: 0;
        max-width: 100%;
        padding: 0.65rem 0.7rem;
        box-sizing: border-box;
    }

    .fa-layout--property-detail .fa-overview-feature-text b,
    .fa-layout--property-detail .fa-overview-feature-text span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .fa-layout--property-detail .fa-overview-grid {
        grid-template-columns: 1fr !important;
        gap: 0.55rem;
    }

    .fa-layout--property-detail .fa-overview-stat {
        min-width: 0;
        max-width: 100%;
        padding: 0.7rem 0.75rem;
        box-sizing: border-box;
    }

    .fa-layout--property-detail .fa-overview-stat-text b,
    .fa-layout--property-detail .fa-overview-stat-text span {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .fa-layout--property-detail .fa-overview-price {
        font-size: clamp(1.55rem, 7vw, 2rem);
    }

    .fa-layout--property-detail .fa-overview-actions {
        flex-direction: column;
        gap: 0.65rem;
    }

    .fa-layout--property-detail .fa-overview-actions .fa-prop-cta,
    .fa-layout--property-detail .fa-overview-actions .fa-prop-contact-btn {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    /* ── Bento / specs / features ── */
    .fa-layout--property-detail .fa-prop-bento {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto;
        gap: 0.75rem;
    }

    .fa-layout--property-detail .fa-bento--price,
    .fa-layout--property-detail .fa-bento--cta,
    .fa-layout--property-detail .fa-bento--sq {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .fa-layout--property-detail .fa-prop-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem;
    }

    .fa-layout--property-detail .fa-prop-features {
        grid-template-columns: 1fr !important;
        gap: 0.65rem;
    }

    .fa-layout--property-detail .fa-prop-feature {
        min-width: 0;
    }

    /* ── Gallery ── */
    .fa-layout--property-detail .fa-gallery-thumbs {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .fa-layout--property-detail .fa-prop-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem;
    }

    /* ── Related properties ── */
    .fa-layout--property-detail .fa-prop-related {
        padding: 2.5rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
    }

    .fa-layout--property-detail .fa-prop-related-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        gap: 1rem;
    }

    .fa-layout--property-detail .fa-related-card {
        max-width: 100%;
    }

    /* ── Location / map preview ── */
    .fa-layout--property-detail .fa-prop-location {
        padding-inline: 0;
    }

    .fa-layout--property-detail .fa-prop-distances {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .fa-layout--property-detail .fa-prop-map {
        border-radius: 16px;
        overflow: hidden;
    }
}

@media (max-width: 420px) {
    .fa-layout--property-detail .fa-prop-specs {
        grid-template-columns: 1fr !important;
    }

    .fa-layout--property-detail .fa-unit-card-specs {
        grid-template-columns: 1fr;
    }
}
