/* ==========================================================================
   REAL PROPERTY GURU — PROPERTIES V66
   Readability + Floating Filter Precision
   Depends on V64 + V65.
   Desktop >=1025px: untouched.
   Approved Home/Search/Saved/Account bar: preserved.
   ========================================================================== */

@media (max-width:1024px) {
    body.rpg-properties-v66-active {
        --rpgp66-surface: #ffffff;
        --rpgp66-page: #f5f8f6;
        --rpgp66-text: #173126;
        --rpgp66-muted: #52685d;
        --rpgp66-green: #078a4c;
        --rpgp66-border: #dfe8e3;
    }

    /* ------------------------------------------------------------------
       TYPOGRAPHY — visibly larger than V65.
       ------------------------------------------------------------------ */
    body.rpg-properties-v66-active .rpgp2-category {
        font-size: 9.7px !important;
        line-height: 1.2 !important;
        font-weight: 650 !important;
        color: #566b60 !important;
    }

    body.rpg-properties-v66-active .rpgp2-card-title {
        min-height: 38px !important;
        font-size: 13.6px !important;
        line-height: 1.38 !important;
        font-weight: 750 !important;
        letter-spacing: -.012em !important;
        color: var(--rpgp66-text) !important;
    }

    body.rpg-properties-v66-active .rpgp2-location {
        font-size: 10.4px !important;
        line-height: 1.35 !important;
        font-weight: 520 !important;
        color: var(--rpgp66-muted) !important;
    }

    body.rpg-properties-v66-active .rpgp2-location svg {
        width: 13px !important;
        height: 13px !important;
        min-width: 13px !important;
    }

    body.rpg-properties-v66-active .rpgp2-features {
        gap: 6px !important;
        font-size: 10.2px !important;
        line-height: 1.3 !important;
        font-weight: 520 !important;
        color: var(--rpgp66-muted) !important;
    }

    body.rpg-properties-v66-active .rpgp2-features svg {
        width: 13px !important;
        height: 13px !important;
        min-width: 13px !important;
    }

    body.rpg-properties-v66-active .rpgp2-price {
        padding-top: 10px !important;
        font-size: 14.3px !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        letter-spacing: -.01em !important;
        color: #087f48 !important;
    }

    body.rpg-properties-v66-active .rpgp2-agent-row {
        grid-template-columns: 31px minmax(0,1fr) 16px !important;
        gap: 7px !important;
        margin-top: 9px !important;
        padding-top: 8px !important;
    }

    body.rpg-properties-v66-active .rpgp2-agent-avatar {
        width: 31px !important;
        height: 31px !important;
        min-width: 31px !important;
    }

    body.rpg-properties-v66-active .rpgp2-agent-copy span {
        font-size: 9.2px !important;
        line-height: 1.15 !important;
        font-weight: 550 !important;
        color: #74867d !important;
    }

    body.rpg-properties-v66-active .rpgp2-agent-copy strong {
        font-size: 10.4px !important;
        line-height: 1.22 !important;
        font-weight: 750 !important;
        color: #344b40 !important;
    }

    body.rpg-properties-v66-active .rpgp2-badge {
        min-height: 22px !important;
        padding-inline: 6px !important;
        font-size: 9px !important;
        font-weight: 750 !important;
    }

    body.rpg-properties-v66-active .rpgp2-photo-count {
        min-height: 22px !important;
        padding-inline: 6px !important;
        font-size: 8.4px !important;
        font-weight: 700 !important;
    }

    body.rpg-properties-v66-active .rpgp2-card .property-contact-actions {
        gap: 6px !important;
        padding: 8px 10px 10px !important;
    }

    body.rpg-properties-v66-active .rpgp2-card .property-contact-action {
        min-height: 38px !important;
        height: 38px !important;
        font-size: 11px !important;
        line-height: 1 !important;
        font-weight: 750 !important;
        border-radius: 8px !important;
    }

    body.rpg-properties-v66-active .rpgp2-card .property-contact-action svg {
        width: 13px !important;
        height: 13px !important;
        min-width: 13px !important;
    }

    /* ------------------------------------------------------------------
       FLOATING FILTER / SORT TOOLBAR
       Normal: clean premium row.
       Stuck: flush to top, no artificial margin or blank gap.
       ------------------------------------------------------------------ */
    body.rpg-properties-v66-active .rpgp2-toolbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 120 !important;
        width: 100% !important;
        margin: 0 0 11px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        transition:
            background .18s ease,
            box-shadow .18s ease,
            border-radius .18s ease,
            padding .18s ease !important;
    }

    body.rpg-properties-v66-active .rpgp2-toolbar.rpgp66-toolbar-stuck {
        width: calc(100% + 16px) !important;
        margin-left: -8px !important;
        margin-right: -8px !important;
        margin-bottom: 11px !important;
        padding: 7px 8px !important;
        border-bottom: 1px solid rgba(6,85,57,.10) !important;
        border-radius: 0 0 13px 13px !important;
        background: rgba(255,255,255,.975) !important;
        box-shadow: 0 8px 22px rgba(4,56,41,.10) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
    }

    body.rpg-properties-v66-active .rpgp2-toolbar-right {
        grid-template-columns: 91px minmax(0,1fr) 88px !important;
        gap: 7px !important;
    }

    body.rpg-properties-v66-active .rpgp2-filter-button {
        width: 91px !important;
        height: 45px !important;
        min-height: 45px !important;
        padding-inline: 10px !important;
        border-radius: 10px !important;
        font-size: 11.6px !important;
        font-weight: 750 !important;
        background: #fff !important;
    }

    body.rpg-properties-v66-active .rpgp2-filter-button svg {
        width: 16px !important;
        height: 16px !important;
    }

    body.rpg-properties-v66-active .rpgp2-sort + .nice-select {
        height: 45px !important;
        min-height: 45px !important;
        border-radius: 10px !important;
        padding-left: 12px !important;
        background: #fff !important;
    }

    body.rpg-properties-v66-active .rpgp2-sort + .nice-select .current {
        font-size: 11.5px !important;
        font-weight: 650 !important;
        color: #2e463b !important;
    }

    body.rpg-properties-v66-active .rpgp2-view-switch {
        grid-template-columns: repeat(2,41px) !important;
        gap: 6px !important;
    }

    body.rpg-properties-v66-active .rpgp2-view-btn {
        width: 41px !important;
        min-width: 41px !important;
        height: 45px !important;
        min-height: 45px !important;
        border-radius: 10px !important;
    }

    /* Sentinel consumes zero space — fixes sticky margin/placeholder feel. */
    body.rpg-properties-v66-active .rpgp66-toolbar-sentinel {
        display: block !important;
        width: 100% !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        pointer-events: none !important;
    }

    /* ------------------------------------------------------------------
       FILTER DRAWER — remove floating gap and tighten hierarchy.
       ------------------------------------------------------------------ */
    body.rpg-properties-v66-active .search-box-offcanvas {
        margin: 0 !important;
        padding: 0 !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-header {
        min-height: 66px !important;
        padding: 13px 16px !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-header h3 {
        font-size: 20px !important;
        line-height: 1.1 !important;
        font-weight: 750 !important;
    }

    body.rpg-properties-v66-active .rpgp64-drawer-reset {
        font-size: 11px !important;
        font-weight: 750 !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-content .widget-sidebar {
        padding-top: 13px !important;
        padding-bottom: 112px !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-content label,
    body.rpg-properties-v66-active .search-box-offcanvas-content .title-select,
    body.rpg-properties-v66-active .search-box-offcanvas-content .title-price,
    body.rpg-properties-v66-active .search-box-offcanvas-content .text-1 {
        margin-bottom: 7px !important;
        font-size: 12.2px !important;
        font-weight: 750 !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-content input.form-control,
    body.rpg-properties-v66-active .search-box-offcanvas-content select,
    body.rpg-properties-v66-active .search-box-offcanvas-content .nice-select,
    body.rpg-properties-v66-active .search-box-offcanvas-content .multi-select-trigger {
        min-height: 49px !important;
        height: 49px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
    }

    body.rpg-properties-v66-active .search-box-offcanvas-content .nice-select .current,
    body.rpg-properties-v66-active .search-box-offcanvas-content .multi-select-label {
        font-size: 12px !important;
    }

    body.rpg-properties-v66-active .rpgp64-amenities-launch {
        min-height: 50px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    body.rpg-properties-v66-active .rpgp64-amenities-launch span {
        font-size: 10.8px !important;
    }

    body.rpg-properties-v66-active .rpgp64-drawer-actions {
        padding: 11px 16px calc(11px + env(safe-area-inset-bottom)) !important;
    }

    body.rpg-properties-v66-active .rpgp64-apply {
        min-height: 49px !important;
        font-size: 12.4px !important;
        font-weight: 750 !important;
        border-radius: 10px !important;
    }

    body.rpg-properties-v66-active .rpgp64-drawer-clear {
        font-size: 10.8px !important;
    }
}

@media (max-width:576px) {
    /* Logged-in admin bar is the black strip visible in the test screenshot.
       Hide it ONLY on this mobile Properties page so it cannot create a false
       floating margin while testing the public customer UI. */
    body.rpg-properties-v66-active.show-admin-bar #admin_bar {
        display: none !important;
    }

    body.rpg-properties-v66-active.show-admin-bar {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Hero-summary to toolbar rhythm: no unexplained empty spacer. */
    body.rpg-properties-v66-active .rpgp2-results-section {
        padding-top: 10px !important;
    }

    body.rpg-properties-v66-active .rpgp2-results-main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    body.rpg-properties-v66-active .rpgp2-card-media,
    body.rpg-properties-v66-active .rpgp2-card-media > img {
        height: 145px !important;
        min-height: 145px !important;
        max-height: 145px !important;
        object-fit: cover !important;
    }

    body.rpg-properties-v66-active .rpgp2-card-body {
        padding: 11px !important;
    }

    body.rpg-properties-v66-active .rpgp2-summary-item strong {
        font-size: 11.2px !important;
        line-height: 1.15 !important;
        font-weight: 750 !important;
    }

    body.rpg-properties-v66-active .rpgp2-summary-item span {
        font-size: 9.2px !important;
        line-height: 1.2 !important;
        font-weight: 520 !important;
    }

    body.rpg-properties-v66-active .rpgp2-save-search a {
        font-size: 11.3px !important;
        font-weight: 750 !important;
    }

    /* Ensure the sticky row is exactly flush with viewport top once stuck. */
    body.rpg-properties-v66-active .rpgp2-toolbar {
        top: 0 !important;
    }

    /* Footer */
    body.rpg-properties-v66-active .rpgx-footer-grid > div:first-child p,
    body.rpg-properties-v66-active .rpgx-footer-grid > div:last-child p,
    body.rpg-properties-v66-active .rpgx-footer-grid > div.rpgp64-footer-open > a {
        font-size: 11.2px !important;
        line-height: 1.5 !important;
    }

    body.rpg-properties-v66-active .rpgx-footer-grid > div:nth-child(2) h4,
    body.rpg-properties-v66-active .rpgx-footer-grid > div:nth-child(3) h4,
    body.rpg-properties-v66-active .rpgx-footer-grid > div:nth-child(4) h4,
    body.rpg-properties-v66-active .rpgx-footer-grid > div:nth-child(5) h4,
    body.rpg-properties-v66-active .rpgx-footer-grid > div:last-child h4 {
        font-size: 12px !important;
    }
}

@media (min-width:577px) and (max-width:1024px) {
    body.rpg-properties-v66-active .rpgp2-card-media,
    body.rpg-properties-v66-active .rpgp2-card-media > img {
        min-height: 218px !important;
        object-fit: cover !important;
    }

    body.rpg-properties-v66-active .rpgp2-card-title {
        font-size: 14px !important;
        min-height: 39px !important;
    }

    body.rpg-properties-v66-active .rpgp2-location,
    body.rpg-properties-v66-active .rpgp2-features {
        font-size: 10.6px !important;
    }

    body.rpg-properties-v66-active .rpgp2-price {
        font-size: 14.8px !important;
    }
}

/* DESKTOP >=1025px: no V66 overrides. */
