/* Favourites + compare: floating tray, full-page compare modal, guest favourites.
   Follows the public search card language: 14px radii, soft shadows, slate text. */

.pl-tray {
    position: fixed;
    inset-inline-end: 18px;
    bottom: 18px;
    z-index: 1035;
    display: flex;
    flex-direction: column;
    /* stretch so both pills take the width of the wider label */
    align-items: stretch;
    gap: 10px;
}

.pl-tray[hidden] {
    display: none;
}

.pl-tray-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .16);
    color: #0f172a;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.pl-tray-btn:hover,
.pl-tray-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .22);
    color: #0f172a;
    text-decoration: none;
}

.pl-tray-btn-primary {
    background: var(--ps-primary, #2563eb);
    color: #fff;
}

.pl-tray-btn-primary:hover,
.pl-tray-btn-primary:focus {
    color: #fff;
}

.pl-tray-icon-fav {
    color: #dc2626;
}

.pl-tray-btn-primary .pl-tray-icon-fav {
    color: #fff;
}

.pl-tray-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: .72rem;
    line-height: 22px;
    text-align: center;
}

.pl-tray-btn-primary .pl-tray-count {
    background: rgba(255, 255, 255, .25);
}

/* Compare toggle on a property card, sitting beside the existing heart which is
   pinned bottom-end at 12px. */
.pc3-compare-btn {
    position: absolute;
    bottom: 10px;
    inset-inline-end: 50px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .93);
    color: #475569;
    font-size: .82rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.pc3-compare-btn:hover,
.pc3-compare-btn:focus {
    background: #fff;
    color: var(--ps-primary, #2563eb);
}

.pc3-compare-btn.is-on {
    background: var(--ps-primary, #2563eb);
    color: #fff;
}

/* Active states in the property details action row. Same filled shape for both,
   in each list's own colour: red for favourites, as the cards use, primary for
   compare. The icon swap alone is too weak to read at this size. */
.pdp-act-btn[data-pl-compare].is-on,
.pdp-act-btn[data-pl-compare].is-on:hover {
    border-color: var(--ps-primary, #2563eb);
    background: var(--ps-primary, #2563eb);
    color: #fff;
}

.pdp-act-btn[data-pl-fav].is-on,
.pdp-act-btn[data-pl-fav].is-on:hover {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.pdp-act-btn[data-pl-fav].is-on #favorite_icon {
    color: #fff !important;
}

/* ── Full-page compare modal ── */

.pl-modal .modal-dialog {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* The card scrolls, not the modal, so the sticky header row and label column
   stay inside the card's border instead of floating over the page. */
.pl-modal {
    overflow: hidden;
}

/* Bootstrap's adjustDialog() puts an inline padding-right on the modal equal to
   the scrollbar width when the page behind is scrollable. On a full-screen modal
   that leaves a strip of backdrop down the edge, so it has to be overridden, and
   inline styles mean !important. */
.pl-modal.modal {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.pl-modal .modal-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #f8fafc;
}

.pl-modal-head {
    flex: 0 0 auto;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1.5px solid #e2e8f0;
    background: #fff;
}

.pl-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.pl-modal-title span {
    color: #94a3b8;
    font-weight: 700;
}

.pl-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.pl-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.pl-btn:hover,
.pl-btn:focus {
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
}

.pl-btn-danger:hover,
.pl-btn-danger:focus {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.pl-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 20px 22px 40px;
}

/* ── Comparison table ── */

/* Columns share the available width so a wide screen is actually used, but stop
   growing at --pl-col-max so one property cannot stretch across the page. Past
   that the whole card shrink-wraps the table and centres. Below --pl-col-min the
   table stops shrinking and scrolls inside the card instead of cramping.
   --pl-cols is set per render from the column count. */
.pl-compare-scroll {
    --pl-col-max: 430px;
    --pl-col-min: 200px;
    --pl-label-w: 170px;
    width: 100%;
    max-width: calc(var(--pl-label-w) + var(--pl-cols) * var(--pl-col-max));
    max-height: 100%;
    margin-inline: auto;
    overflow: auto;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
}

.pl-compare {
    width: 100%;
    min-width: calc(var(--pl-label-w) + var(--pl-cols) * var(--pl-col-min));
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.pl-compare th,
.pl-compare td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: .85rem;
    color: #0f172a;
    vertical-align: middle;
    text-align: start;
}

.pl-compare tr:last-child th,
.pl-compare tr:last-child td {
    border-bottom: 0;
}

/* the public theme colours several inline elements, so the cell owns its colour */
.pl-compare td,
.pl-compare td span,
.pl-compare td b,
.pl-compare td strong {
    color: #0f172a;
}

/* the attribute column stays put while the property columns scroll */
.pl-compare-label {
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
    width: var(--pl-label-w);
    background: #f8fafc;
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.pl-compare-col {
    width: calc((100% - var(--pl-label-w)) / var(--pl-cols));
}

.pl-compare thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    border-bottom: 1.5px solid #e2e8f0;
    vertical-align: top;
}

.pl-compare thead .pl-compare-label {
    z-index: 3;
    background: #f8fafc;
}

.pl-compare-card {
    position: relative;
}

.pl-compare-img {
    display: block;
    width: 100%;
    height: 140px;
    margin-bottom: 10px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
}

.pl-compare-name {
    display: block;
    margin-bottom: 4px;
    color: #0f172a;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.35;
}

.pl-compare-name:hover {
    color: var(--ps-primary, #2563eb);
}

.pl-compare-price {
    color: var(--ps-primary, #2563eb);
    font-size: .95rem;
    font-weight: 800;
}

.pl-compare-remove {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .62);
    color: #fff;
    font-size: .8rem;
    line-height: 30px;
    cursor: pointer;
}

.pl-compare-remove:hover {
    background: #dc2626;
}

.pl-compare-muted {
    color: #cbd5e1;
}

/* ── Empty states ── */

.pl-empty {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
}

.pl-empty-icon {
    margin-bottom: 14px;
    color: #cbd5e1;
    font-size: 2.6rem;
}

.pl-empty-title {
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
}

.pl-empty-text {
    font-size: .88rem;
}

@media (max-width: 575px) {
    .pl-tray {
        inset-inline-end: 12px;
        bottom: 12px;
    }

    .pl-tray-btn {
        height: 42px;
        padding: 0 14px;
        font-size: .8rem;
    }

    .pl-modal-head {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 14px;
    }

    .pl-modal-title {
        font-size: .95rem;
    }

    /* the two actions get their own row rather than crowding the title */
    .pl-modal-actions {
        width: 100%;
        margin-inline-start: 0;
    }

    .pl-modal-actions .pl-btn {
        flex: 1;
        justify-content: center;
    }

    .pl-modal-body {
        padding: 14px 14px 30px;
    }

    .pl-compare-scroll {
        --pl-col-min: 190px;
        --pl-label-w: 124px;
    }
}
