/* ── Full-viewport layout (map left, cards right) ────────────────────── */
body:has(#ffd-sold-wrap) {
    overflow: hidden;
}

.ffd-sold-wrap {
    display: flex;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: #f9f9f8;
    position: relative;
}

/* Map column — fixed height, never scrolls */
.ffd-sold-map-col {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#ffd-sold-map {
    width: 100%;
    height: 100%;
}

/* Cards column — full height, scrolls internally */
.ffd-sold-cards-col {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px 60px;
    box-sizing: border-box;
    background: #f9f9f8;
}

/* ── Loader / spinner ────────────────────────────────────────────────── */
.ffd-sold-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #777;
    font-size: 14px;
}

.ffd-sold-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0e0e0;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: ffd-spin 0.8s linear infinite;
    margin-bottom: 14px;
}

@keyframes ffd-spin {
    to { transform: rotate(360deg); }
}

/* ── Showing count ───────────────────────────────────────────────────── */
.ffd-sold-showing {
    padding: 14px 4px 8px;
    font-size: 14px;
    color: #555;
}

/* ── Cards grid — 2 columns ──────────────────────────────────────────── */
.ffd-sold-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 10px;
}

.ffd-sold-card {
    flex: 0 0 calc(50% - 5px);
    max-width: calc(50% - 5px);
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.ffd-sold-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ffd-sold-card--active {
    border-color: #1565c0 !important;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.35) !important;
}

/* ── Card image ──────────────────────────────────────────────────────── */
.ffd-sold-card-img {
    width: 100%;
    height: 175px;
    overflow: hidden;
    background: #f1f1f1;
}

.ffd-sold-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ffd-sold-card:hover .ffd-sold-card-img img {
    transform: scale(1.03);
}

.ffd-sold-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
}

/* ── Card body ───────────────────────────────────────────────────────── */
.ffd-sold-card-body {
    padding: 10px 12px 8px;
}

.ffd-sold-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.ffd-sold-addr-wrap {
    flex: 1;
    min-width: 0;
}

.ffd-sold-address {
    font-size: 13px;
    font-weight: 400;
    color: #222;
    margin: 0 0 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ffd-sold-city-line {
    font-size: 12px;
    color: #888;
}

.ffd-sold-price-wrap {
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.ffd-sold-list-price {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}

.ffd-sold-status {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ffd-sold-status.closed {
    background: #e53935;
    color: #fff;
}

/* ── Meta details row (Type / Size / Rooms) ──────────────────────────── */
.ffd-sold-meta-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.ffd-sold-meta-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.ffd-sold-meta-label {
    color: #999;
    font-weight: 500;
    min-width: 40px;
    flex-shrink: 0;
}

.ffd-sold-meta-val {
    color: #222;
    font-weight: 600;
}

/* ── Card footer ─────────────────────────────────────────────────────── */
.ffd-sold-card-footer {
    padding: 8px 12px 12px;
}

.ffd-sold-card-footer h4 {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 5px;
}

.ffd-sold-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0px;
    font-size: 13px;
    border-bottom: 1px solid #e5e5e5;
}

.ffd-sold-detail-row .ffd-sold-label {
    color: #888;
}

.ffd-sold-detail-row .ffd-sold-value {
    font-weight: 900;
    color: #333;
}

.ffd-sold-detail-row strong {
    color: #555;
    font-size: 13px;
}

.ffd-sold-detail-view {
    margin-top: 10px;
    text-align: center;
}

.ffd-sold-detail-view a {
    display: inline-block;
    padding: 6px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #1565c0;
    border: 1px solid #1565c0;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.ffd-sold-detail-view a:hover {
    background: #1565c0;
    color: #fff;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.ffd-sold-pagination {
    padding: 16px 0 8px;
    text-align: center;
}

.ffd-sold-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.ffd-sold-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}

.ffd-sold-page-btn:hover {
    background: #e8f0fe;
    border-color: #1565c0;
}

.ffd-sold-page-btn.ffd-sold-page--active {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
    cursor: default;
}

.ffd-sold-page-prev,
.ffd-sold-page-next {
    font-weight: 500;
    padding: 0 14px;
}

/* ── Map legend ──────────────────────────────────────────────────────── */
.ffd-sold-legend {
    background: rgba(255, 255, 255, 0.93);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ffd-sold-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ffd-sold-legend-item:last-child {
    margin-bottom: 0;
}

.ffd-sold-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    body:has(#ffd-sold-wrap) {
        overflow: auto;
    }

    .ffd-sold-wrap {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .ffd-sold-map-col {
        flex: 0 0 100%;
        width: 100%;
        height: 55vw;
        min-height: 300px;
    }

    .ffd-sold-cards-col {
        flex: 0 0 100%;
        width: 100%;
        height: auto;
        overflow-y: visible;
        padding-bottom: 40px;
    }

    .ffd-sold-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
}
