/*
 * Property search results.
 *
 * Loaded through the layout's `styles` stack on the results page only, and
 * every class is prefixed `psr-` — `styles.css` is 391KB of generic names, and
 * the detail page's sheet already owns the `psx-` prefix. The two never load
 * together, but keeping the prefixes apart means they never can collide.
 *
 * The tokens repeat the detail page's values so the two screens read as one
 * site; they are redeclared rather than shared because neither sheet loads the
 * other.
 */

:root {
    --psr-accent: #05af78;
    --psr-accent-soft: rgba(5, 175, 120, .1);
    --psr-ink: #1d2a3b;
    --psr-muted: #6b7490;
    --psr-line: #e7ebf1;
    --psr-surface: #fff;
    --psr-radius: 14px;
    --psr-shadow: 0 2px 14px rgba(29, 42, 59, .07);
    --psr-shadow-lift: 0 10px 28px rgba(29, 42, 59, .13);
}

/* ------------------------------------------------------------------- header */

.psr-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-bottom: 1.1rem;
}

.psr-head__title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--psr-ink);
    line-height: 1.25;
}

.psr-head__count {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
    color: var(--psr-muted);
    font-size: .9rem;
}

.psr-head__count b {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--psr-accent);
}

.psr-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .9rem;
    font-size: .82rem;
    color: var(--psr-muted);
}

.psr-crumbs a {
    color: var(--psr-muted);
    text-decoration: none;
}

.psr-crumbs a:hover {
    color: var(--psr-accent);
}

.psr-crumbs__sep {
    opacity: .5;
}

.psr-crumbs__current {
    color: var(--psr-ink);
    font-weight: 500;
}

/* ------------------------------------------------------------- active chips */

.psr-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.1rem;
}

.psr-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border: 1px solid var(--psr-line);
    border-radius: 999px;
    background: var(--psr-surface);
    color: var(--psr-ink);
    font-size: .8rem;
    line-height: 1.4;
    text-decoration: none;
}

.psr-filters__chip span {
    color: var(--psr-muted);
}

.psr-filters__chip i {
    font-size: .7rem;
    color: var(--psr-muted);
    transition: color .15s ease;
}

.psr-filters__chip:hover {
    border-color: #f2b8b8;
    color: var(--psr-ink);
}

.psr-filters__chip:hover i {
    color: #d9534f;
}

.psr-filters__clear {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    color: #d9534f;
    font-size: .8rem;
    text-decoration: none;
}

.psr-filters__clear:hover {
    background: rgba(217, 83, 79, .08);
    color: #d9534f;
}

/* --------------------------------------------------------------------- card */

.psr-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--psr-line);
    border-radius: var(--psr-radius);
    background: var(--psr-surface);
    box-shadow: var(--psr-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.psr-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--psr-shadow-lift);
}

/*
 * A fixed ratio rather than the image's own height: the thumbnails are not all
 * the same shape, and without this every row of the grid stepped up and down.
 */
.psr-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef1f5;
}

.psr-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.psr-card:hover .psr-card__media img {
    transform: scale(1.05);
}

.psr-card__badges {
    position: absolute;
    top: .6rem;
    left: .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    max-width: calc(100% - 1.2rem);
}

.psr-badge {
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(29, 42, 59, .78);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    backdrop-filter: blur(3px);
}

.psr-badge--deal {
    background: var(--psr-accent);
}

.psr-badge--exclusive {
    background: #f0a30a;
}

.psr-badge--sold {
    background: #d9534f;
}

.psr-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: .55rem;
    padding: .85rem .9rem .9rem;
}

.psr-card__price {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.psr-card__price-main {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--psr-accent);
    line-height: 1.2;
}

.psr-card__price-unit {
    margin-top: .1rem;
    color: var(--psr-muted);
    font-size: .76rem;
}

.psr-card__title {
    margin: 0;
    font-size: .97rem;
    font-weight: 600;
    line-height: 1.35;
}

.psr-card__title a {
    color: var(--psr-ink);
    text-decoration: none;
    /* Two lines, then an ellipsis: titles run long and used to push the
       address and the spec row out of alignment across the grid. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.psr-card__title a:hover {
    color: var(--psr-accent);
}

.psr-card__address {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    color: var(--psr-muted);
    font-size: .8rem;
    line-height: 1.4;
}

.psr-card__address i {
    margin-top: .15rem;
    color: var(--psr-accent);
    font-size: .75rem;
}

.psr-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    margin-top: auto;
    padding-top: .65rem;
    border-top: 1px dashed var(--psr-line);
    color: var(--psr-ink);
    font-size: .8rem;
}

.psr-card__specs span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.psr-card__specs i {
    color: var(--psr-muted);
    font-size: .82rem;
}

/* The currency switch is a control, not text — it should not look tappable-ish
   next to the price it belongs to. */
.psr-card .toggle-container {
    transform: scale(.85);
    transform-origin: left center;
}

/* -------------------------------------------------------------- empty state */

.psr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--psr-line);
    border-radius: var(--psr-radius);
    background: var(--psr-surface);
    text-align: center;
}

.psr-empty i {
    font-size: 2.2rem;
    color: var(--psr-accent);
    opacity: .55;
}

.psr-empty h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--psr-ink);
}

.psr-empty p {
    max-width: 30rem;
    margin: 0;
    color: var(--psr-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.psr-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
    padding: .55rem 1.1rem;
    border-radius: 999px;
    background: var(--psr-accent);
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}

.psr-empty__btn:hover {
    color: #fff;
    filter: brightness(1.06);
}

/* -------------------------------------------------------------- pagination */

/*
 * The results page reused the dashboard's paginator, whose chevrons are Tabler
 * glyphs the front site never loads — the previous/next controls came out
 * blank. These rules dress the same `.pagination` / `.page-item.next a`
 * markup that `custom.js` drives infinite scroll from.
 */
.psr-pager .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    margin: 2rem 0 .5rem;
    padding: 0;
    list-style: none;
}

.psr-pager .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    height: 2.35rem;
    padding: 0 .6rem;
    border: 1px solid var(--psr-line);
    border-radius: 10px;
    background: var(--psr-surface);
    color: var(--psr-ink);
    font-size: .88rem;
    text-decoration: none;
}

.psr-pager .page-item .page-link:hover {
    border-color: var(--psr-accent);
    color: var(--psr-accent);
}

.psr-pager .page-item.active .page-link {
    border-color: var(--psr-accent);
    background: var(--psr-accent);
    color: #fff;
}

.psr-pager .page-item.disabled .page-link {
    opacity: .45;
    pointer-events: none;
}

/* ------------------------------------------------------------------ status */

.psr-status {
    padding: 1rem 0 2rem;
    text-align: center;
    color: var(--psr-muted);
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 575.98px) {
    .psr-head__title {
        font-size: 1.25rem;
    }

    .psr-card__media {
        aspect-ratio: 16 / 10;
    }
}

/* ------------------------------------------------- header on the hero band */

/*
 * `.page-title` is the theme's green banner. The header sits inside it, so the
 * breadcrumb, heading and count are drawn light — the shared `--psr-ink` and
 * `--psr-muted` are near-invisible against that background.
 */
.page-title .psr-crumbs,
.page-title .psr-crumbs a {
    color: rgba(255, 255, 255, .8);
}

.page-title .psr-crumbs a:hover,
.page-title .psr-crumbs__current {
    color: #fff;
}

.page-title .psr-head__title {
    color: #fff;
}

.page-title .psr-head__count {
    color: rgba(255, 255, 255, .85);
}

.page-title .psr-head__count b {
    color: #fff;
}

/* The spec icons are the same SVGs the detail page uses. */
.psr-card__specs img {
    width: 14px;
    height: 14px;
    opacity: .65;
}
