/* Listings Page Styles - Modern */

/* =========================================
   FULL WIDTH & PAGE TITLE HIDING
   ========================================= */

/* Hide page titles when listings wrapper is present */
body:has(.wpl-listings-wrapper) .entry-title,
body:has(.wpl-listings-wrapper) .page-title,
body:has(.wpl-listings-wrapper) .wp-block-post-title,
body:has(.wpl-listings-wrapper) h1.has-text-align-center,
body:has(.wpl-listings-wrapper) article>header,
body:has(.wpl-listings-wrapper) .ast-archive-description {
    display: none !important;
}

/* Override WordPress block editor constrained layout */
body:has(.wpl-listings-wrapper) .is-layout-constrained> :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: none !important;
}

/* Remove container padding for full-width */
body:has(.wpl-listings-wrapper) .entry-content,
body:has(.wpl-listings-wrapper) .page-content,
body:has(.wpl-listings-wrapper) .wp-block-post-content,
body:has(.wpl-listings-wrapper) .wp-site-blocks,
body:has(.wpl-listings-wrapper) .has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* JS fallback class for browsers without :has() */
body.wpl-has-listings-page .entry-title,
body.wpl-has-listings-page .page-title,
body.wpl-has-listings-page .wp-block-post-title,
body.wpl-has-listings-page article>header {
    display: none !important;
}

body.wpl-has-listings-page .is-layout-constrained> :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: none !important;
}

body.wpl-has-listings-page .entry-content,
body.wpl-has-listings-page .wp-block-post-content,
body.wpl-has-listings-page .has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* =========================================
   MAIN WRAPPER STYLES
   ========================================= */

.wpl-listings-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
    width: 100%;
    box-sizing: border-box;
}

.wpl-listings-modern {
    display: flex;
    gap: 24px;
}

/* Filters Sidebar */
.wpl-filters-sidebar {
    flex: 0 0 300px;
}

.wpl-filters-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    position: sticky;
    top: 100px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wpl-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.wpl-filters-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wpl-filters-header .dashicons {
    color: #6b7280;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.wpl-filters-header h2 {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
}

/* Close button - hidden on desktop */
.wpl-filter-close-btn {
    display: none;
}

.wpl-filter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpl-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wpl-filter-group label {
    font-size: 0.7em;
    font-weight: 600;
    color: #374151;
}

.wpl-filter-group select,
.wpl-filter-group input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75em;
    color: #1f2937;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Ensure select has dropdown arrow */
.wpl-filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.wpl-filter-group select:focus,
.wpl-filter-group input:focus {
    outline: none;
    border-color: var(--wpl-primary);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
    background-color: #fff;
}

.wpl-input-icon {
    position: relative;
    display: block;
}

.wpl-input-icon .dashicons {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wpl-primary);
    font-size: 14px;
    width: 14px;
    height: 14px;
    z-index: 1;
    pointer-events: none;
}

.wpl-input-icon input,
.wpl-input-icon select {
    padding-left: 28px !important;
}

.wpl-price-inputs {
    display: flex;
    gap: 8px;
}

.wpl-price-inputs input {
    flex: 1;
    min-width: 0;
}

.wpl-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 6px;
}

.wpl-filter-actions-top {
    padding-top: 0;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.wpl-filter-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.7em;
    color: #9ca3af;
    font-style: italic;
}

.wpl-price-formatted {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.wpl-price-formatted span {
    flex: 1;
    font-size: 0.7em;
    color: var(--wpl-primary, #4f46e5);
    font-weight: 600;
    text-align: center;
    min-height: 1em;
}

.wpl-option-disabled {
    color: #9ca3af !important;
    background: #f3f4f6 !important;
}

.wpl-btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    background: var(--wpl-primary);
    color: var(--wpl-btn-text, #fff);
    border: none;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.wpl-btn-search:hover {
    opacity: 0.9;
}

.wpl-btn-search .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.wpl-btn-reset {
    display: block;
    padding: 6px 12px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.wpl-btn-reset:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Main Listings Section */
.wpl-listings-main {
    flex: 1;
    min-width: 0;
}

.wpl-listings-header {
    margin-bottom: 16px;
}

.wpl-listings-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.wpl-listings-header h1 {
    margin: 0;
    font-size: 1.25em;
    font-weight: 700;
    color: #1f2937;
}

.wpl-results-count {
    font-size: 0.75em;
    color: #6b7280;
}

.wpl-listings-search-bar {
    max-width: 400px;
}

.wpl-listings-search-bar .wpl-search-input {
    height: 38px;
    padding: 8px 36px 8px 38px;
    font-size: 0.85em;
}

/* Property Grid */
/*
 * minmax(0, 1fr), not 1fr. A bare 1fr is minmax(auto, 1fr), and a grid item's
 * automatic minimum stops it shrinking below its own min-content width — so one
 * long title or an unbreakable spec value ("Fully_furnished") widens its whole
 * column and pushes the last one off screen.
 *
 * This did not show until P6.4. Until then the grid item was the card itself,
 * which sets overflow:hidden, and that resolves the automatic minimum to zero.
 * Wrapping each card in .wpl-card-shell so the Save and Compare buttons could
 * sit outside the anchor made the shell the grid item, and the shell has no
 * overflow of its own — so the suppression that had been doing the work quietly
 * for two years went away with it. Stated explicitly here rather than restored
 * by accident.
 */
.wpl-listings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Property Card Modern */
.wpl-property-card-modern {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

/* Clickable Card Link */
a.wpl-property-card-modern.wpl-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.wpl-property-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.wpl-card-image-modern {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: #f3f4f6;
}

.wpl-card-image-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.wpl-property-card-modern:hover .wpl-card-image-modern img {
    transform: scale(1.05);
}

.wpl-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
}

.wpl-no-image .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #9ca3af;
}

.wpl-badge-transaction {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: var(--wpl-secondary);
    backdrop-filter: blur(4px);
    color: var(--wpl-btn-text, #fff);
    font-size: 0.6em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 2;
}

.wpl-badge-type {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    background: var(--wpl-primary);
    color: var(--wpl-btn-text, #fff);
    font-size: 0.6em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 2;
}

.wpl-badge-sold {
    padding: 3px 10px;
    background: #1f2937;
    color: #fff;
    font-size: 0.65em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
}

.wpl-card-image-modern .wpl-badge-sold {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 3;
}

/* Caller-supplied card chips (Seen / New on a shared link).

   In the card body, above the title — not over the image. Every corner of the
   photo is already taken: property type top-left, the Save and Compare buttons
   top-right, the transaction chip bottom-right, SOLD bottom-left. A fifth
   overlay landed on top of the Compare button.

   It belongs here regardless: the image badges are all facts about the
   listing, and this is a fact about the person looking at it. */
.wpl-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

.wpl-card-chip {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.62em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    line-height: 1.6;
    color: #fff;
}

/* Muted: "you have already looked at this" is information, not a call to
   action, and a bright chip on every card the client has read would shout. */
.wpl-card-chip-seen { background: #6b7280; }

.wpl-card-chip-new { background: #059669; }

.wpl-image-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
    pointer-events: none;
}

.wpl-card-body-modern {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wpl-card-title-modern {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.wpl-card-title-modern:hover {
    color: var(--wpl-primary);
}

.wpl-card-location-modern {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7em;
    color: #6b7280;
    margin-bottom: 10px;
}

.wpl-card-location-modern .dashicons {
    color: var(--wpl-primary);
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/*
 * The three-up spec strip inside a card, and the likeliest thing to have been
 * forcing a card wide: its values are uncontrolled text from the listing, and
 * "Fully_furnished", "30,000 sq ft" and "0.00T Crane" have no break opportunity.
 * Same minmax(0, …) reasoning as the grid above.
 */
.wpl-card-specs-modern {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 10px;
}

.wpl-spec-item-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
}

.wpl-spec-item-modern .dashicons {
    color: #9ca3af;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/*
 * Direct children only. Without the child combinator this rule matched twice on
 * the area figure: WPL_Area::render() wraps its value in a nested
 * <span class="wpl-area">, which is itself a :last-child, so 0.65em compounded
 * to roughly 0.42em and "233 sq ft" rendered visibly smaller than the "22 Rooms"
 * and "22 Seats" beside it. The unit is also nudged up from 0.65em, which was
 * around 9px on a typical card.
 */
.wpl-spec-item-modern > span:last-child {
    font-size: 0.74em;
    font-weight: 500;
    color: #374151;
}

/* Any nested span (the area converter) inherits the size rather than shrinking again. */
.wpl-spec-item-modern > span:last-child span {
    font-size: inherit;
}

.wpl-spec-middle {
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

.wpl-card-footer-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.wpl-card-price-modern {
    font-size: 1em;
    font-weight: 700;
    color: var(--wpl-primary);
}

.wpl-btn-view-modern {
    padding: 5px 12px;
    border: 1px solid var(--wpl-primary);
    color: var(--wpl-primary);
    background: transparent;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.wpl-btn-view-modern:hover {
    background: var(--wpl-primary);
    color: var(--wpl-btn-text, #fff);
}

/* No Results */
.wpl-no-results-modern {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
}

.wpl-no-results-modern .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #9ca3af;
    margin-bottom: 12px;
}

.wpl-no-results-modern h3 {
    margin: 0 0 6px 0;
    font-size: 1em;
    color: #1f2937;
}

.wpl-no-results-modern p {
    color: #6b7280;
    margin: 0 0 14px 0;
    font-size: 0.85em;
}

.wpl-btn-clear {
    display: inline-block;
    padding: 8px 16px;
    background: var(--wpl-primary);
    color: var(--wpl-btn-text, #fff);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8em;
    transition: opacity 0.2s;
}

.wpl-btn-clear:hover {
    opacity: 0.9;
    color: var(--wpl-btn-text, #fff);
}

/* Pagination */
.wpl-pagination-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
}

.wpl-page-btn {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #374151;
    font-size: 0.8em;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.wpl-page-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

.wpl-page-btn.active {
    background: var(--wpl-primary);
    border-color: var(--wpl-primary);
    color: var(--wpl-btn-text, #fff);
}

/* Responsive */
@media (max-width: 1100px) {
    .wpl-listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .wpl-listings-wrapper {
        padding: 16px 20px;
    }

    .wpl-listings-modern {
        flex-direction: column;
        gap: 16px;
    }

    .wpl-filters-sidebar {
        flex: none;
        width: 100%;
    }

    .wpl-filters-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .wpl-listings-wrapper {
        padding: 12px 16px;
    }

    .wpl-listings-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .wpl-listings-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .wpl-listings-search-bar {
        max-width: 100%;
        width: 100%;
    }
}

/* =========================================
   MOBILE FILTER TOGGLE
   ========================================= */

/* Spacer after pagination */
.wpl-listings-spacer {
    height: 40px;
}

/* Mobile filter button - hidden on desktop */
.wpl-mobile-filter-btn {
    display: none;
}

/* Filter overlay */
.wpl-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.wpl-filter-overlay.active {
    display: block;
}

/* Mobile/Tablet responsive filter */
@media (max-width: 900px) {

    /* Hide filters by default on mobile/tablet */
    .wpl-filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 60px;
        width: 100%;
        max-width: 100%;
        z-index: 1000;
        background: #fff;
        overflow-y: auto;
        padding: 16px;
        box-sizing: border-box;
        animation: slideUp 0.3s ease;
    }

    .wpl-filters-sidebar.active {
        display: block;
    }

    .wpl-filters-card {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Close button inside filter for mobile */
    .wpl-filters-sidebar.active .wpl-filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .wpl-filters-sidebar .wpl-filter-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: #f3f4f6;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        font-size: 18px;
        color: #374151;
    }

    .wpl-filters-sidebar .wpl-filter-close-btn:hover {
        background: #e5e7eb;
    }

    /* Show mobile filter button */
    .wpl-mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        left: 16px;
        right: 16px;
        padding: 14px 20px;
        background: var(--wpl-primary, #4f46e5);
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 1em;
        font-weight: 600;
        cursor: pointer;
        z-index: 998;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transition: transform 0.2s, opacity 0.3s;
    }

    .wpl-mobile-filter-btn:hover {
        transform: translateY(-2px);
    }

    .wpl-mobile-filter-btn .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }

    .wpl-mobile-filter-btn.hidden {
        opacity: 0;
        pointer-events: none;
    }

    /* Larger spacer on mobile for fixed button */
    .wpl-listings-spacer {
        height: 80px;
    }
}

/* Animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Legacy support - keep old styles for backward compatibility */
.wpl-listings-container:not(.wpl-listings-modern) {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.wpl-listings-container:not(.wpl-listings-modern) .wpl-filters-sidebar {
    flex: 0 0 280px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

/* ==================== */
/* Property Search Widget */
/* ==================== */
.wpl-search-widget {
    position: relative;
    max-width: 100%;
}

.wpl-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.wpl-search-icon {
    position: absolute;
    left: 14px;
    color: #6b7280;
    font-size: 18px;
    width: 18px;
    height: 18px;
    z-index: 1;
}

.wpl-search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9em;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wpl-search-input:focus {
    outline: none;
    border-color: var(--wpl-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wpl-search-input::placeholder {
    color: #9ca3af;
}

.wpl-search-loader {
    position: absolute;
    right: 14px;
    color: var(--wpl-primary);
}

.wpl-spin {
    animation: wpl-spin 1s linear infinite;
}

@keyframes wpl-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.wpl-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
}

.wpl-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.wpl-search-result-item:last-child {
    border-bottom: none;
}

.wpl-search-result-item:hover {
    background: #f9fafb;
}

.wpl-search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.wpl-search-result-no-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpl-search-result-no-image .dashicons {
    color: #9ca3af;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wpl-search-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.wpl-search-result-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpl-search-result-location {
    font-size: 0.75em;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 2px;
}

.wpl-search-result-location .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    color: var(--wpl-primary);
}

.wpl-search-result-price {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--wpl-primary);
}

.wpl-search-no-results {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85em;
}

.wpl-search-no-results .dashicons {
    display: block;
    margin: 0 auto 8px;
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #d1d5db;
}

.wpl-listings-container:not(.wpl-listings-modern) .wpl-listings-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
/*
 * The Saved and Compare pages.
 *
 * These render as a bare shortcode into whatever the theme gives them, which on
 * a full-width template is the browser edge — no gutter, and the table running
 * off the side. The shortcode's own <h2> was also printing under the page title,
 * so both now default to no heading.
 *
 * The outer column and card come from .wpl-dashboard-wrapper / .wpl-dashboard-card,
 * which the markup opts into, so these two screens sit in the same container as
 * the rest of somebody's account rather than in a third layout of their own.
 * All that is left here is the padding inside the card.
 */
.wpl-saved-page,
.wpl-cmp-page {
    padding: 24px;
}

.wpl-saved-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.wpl-saved-empty,
.wpl-cmp-empty {
    color: #6b7280;
    padding: 28px 0;
}

.wpl-saved-note {
    margin-top: 22px;
    font-size: 13px;
    color: #6b7280;
}

/* The table is the one thing here that must be allowed to scroll sideways. */
.wpl-cmp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wpl-cmp-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
}

@media (max-width: 640px) {
    .wpl-saved-page,
    .wpl-cmp-page { padding: 16px; }
}


/* ── Card shell and the actions over the image (P6.4 / P6.5) ────────────────

   These lived in a <style> block inside the listings view's filter sidebar. The
   shared-with-a-client page short-circuits before that sidebar is rendered, so
   it got the card's markup and none of this: the Save and Compare buttons fell
   out of the card and sat above it, because without a positioned shell their
   containing block was the page.

   Here instead, so every page that renders partials/wpl-property-card.php gets
   the positioning the card assumes. */

/* min-width: 0 because this wrapper is the grid item. Without it the item
   cannot shrink below its content's min-content width and one long title
   widens the whole column — see the note on .wpl-listings-grid above. */
.wpl-card-shell { position: relative; display: block; min-width: 0; }

/* The badges and these buttons are measured from different boxes.

   Every .wpl-badge-* is positioned against .wpl-card-image-modern, so "bottom"
   for a badge means the bottom of the photo. These buttons sit outside the
   anchor — a <button> inside an <a> is invalid — so their containing block is
   .wpl-card-shell, the whole card. "bottom" here therefore meant the bottom of
   the *card*, and moving them off the SELL chip landed them on the price row.

   So: buttons take the image's top-right, and the transaction chip moves to the
   image's bottom-right, which nothing else uses. Both are then measured against
   the thing they appear to sit on. */
.wpl-card-actions {
    position: absolute; top: 10px; right: 10px; z-index: 4;
    display: flex; gap: 6px; align-items: center;
    max-width: calc(100% - 20px);
    flex-wrap: wrap; justify-content: flex-end;
}
.wpl-card-shell .wpl-badge-transaction { top: auto; bottom: 8px; }
.wpl-card-actions .wpl-save-btn,
.wpl-card-actions .wpl-cmp-btn {
    background: rgba(255,255,255,.94);
    box-shadow: 0 1px 3px rgba(16,24,40,.12);
    border-color: transparent;
}
.wpl-card-actions .wpl-cmp-btn { font-size: 12px; padding: 5px 10px; }
