/* =============================================
   Kristal DDF Listings — Styles
   ============================================= */

.ddf-listings-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: inherit;
}

/* ── Mode toggle ─────────────────────────── */
.ddf-mode-toggle {
    display: flex;
    margin-bottom: 14px;
}
.ddf-mode-btn {
    flex: 1;
    padding: 11px 20px;
    font-family: 'Raleway', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px solid #c6ac71;
    background: #fff;
    color: #c6ac71;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ddf-mode-btn:first-child { border-radius: 4px 0 0 4px; }
.ddf-mode-btn:last-child  { border-left: none; border-radius: 0 4px 4px 0; }
.ddf-mode-btn.active      { background: #c6ac71; color: #fff; }
.ddf-mode-btn:hover:not(.active) { background: #faf7f0; }

/* ── Search card ─────────────────────────── */
.ddf-search-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 0 14px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* City tabs */
.ddf-city-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    gap: 0;
}

.ddf-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 11px 18px 9px;
    font-size: 14px;
    font-weight: 500;
    color: #777;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.ddf-tab:hover { color: #232b2b; }
.ddf-tab.active {
    color: #232b2b;
    border-bottom-color: #232b2b;
    font-weight: 600;
}

/* Neighbourhood panels */
.ddf-hood-panel {
    display: none;
    padding: 12px 18px 0;
}
.ddf-hood-panel.active { display: block; }

.ddf-hood-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 14px;
}

.ddf-hood-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    line-height: 1.3;
}
.ddf-hood-label:hover { color: #232b2b; }

.ddf-hood-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: #232b2b;
    cursor: pointer;
}

/* Select / Deselect */
.ddf-area-actions {
    padding: 8px 18px 0;
    font-size: 12px;
    color: #888;
}
.ddf-area-actions a {
    color: #232b2b;
    text-decoration: none;
}
.ddf-area-actions a:hover { text-decoration: underline; }

/* Bottom filter row */
.ddf-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 18px 0;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.ddf-filters-row input[type="number"],
.ddf-filters-row input[type="text"],
.ddf-filters-row select {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #333;
    min-width: 120px;
    flex: 1;
}

.ddf-filters-row input[type="number"]:focus,
.ddf-filters-row input[type="text"]:focus,
.ddf-filters-row select:focus {
    outline: none;
    border-color: #232b2b;
}

.ddf-btn {
    padding: 7px 20px;
    background: #232b2b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.ddf-btn:hover { background: #c9a84c; }

.ddf-btn--secondary {
    background: #eee;
    color: #333;
}
.ddf-btn--secondary:hover { background: #ddd; }

/* ── Toolbar ─────────────────────────────── */
.ddf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.ddf-toolbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ddf-toolbar__count {
    font-size: 14px;
    color: #555;
}

.ddf-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.ddf-sort select:focus { outline: none; border-color: #c9a84c; }

.ddf-view-toggle {
    display: flex;
    gap: 4px;
}

.ddf-view-btn {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}
.ddf-view-btn:hover { border-color: #232b2b; color: #232b2b; }
.ddf-view-btn.active {
    background: #232b2b;
    border-color: #232b2b;
    color: #fff;
}

/* ── Map ─────────────────────────────────── */
#ddf-map {
    width: 100%;
    height: 380px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid #ddd;
}

/* ── Loading ─────────────────────────────── */
.ddf-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* ── List view (default) ─────────────────── */
.ddf-grid { display: block; }

.ddf-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}
.ddf-item:first-child { border-top: 1px solid #eee; }
.ddf-item:hover { background: #fafafa; }

.ddf-item__photo {
    flex: 0 0 280px;
    height: 190px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0ee;
    position: relative;
    display: block;
    text-decoration: none;
}

.ddf-item__address a {
    color: inherit;
    text-decoration: none;
}
.ddf-item__address a:hover { color: #c9a84c; }
.ddf-item__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.ddf-item:hover .ddf-item__photo img { transform: scale(1.03); }

.ddf-item__no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bbb;
    font-size: 13px;
}

.ddf-item__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ddf-item__price {
    font-size: 22px;
    font-weight: 700;
    color: #232b2b;
}

.ddf-item__address {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ddf-item__meta {
    font-size: 13px;
    color: #777;
}

.ddf-item__specs {
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

.ddf-item__remarks {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-top: 4px;
}

.ddf-item__remarks .ddf-truncated { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ddf-item__remarks.expanded .ddf-truncated { display: block; -webkit-line-clamp: unset; overflow: visible; }

.ddf-read-more {
    background: none;
    border: none;
    color: #c9a84c;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
}

.ddf-item__brokerage {
    font-size: 12px;
    color: #999;
    margin-top: auto;
    padding-top: 8px;
}

.ddf-listings-wrap.view-grid .ddf-item__brokerage { display: none; }

/* ── Grid view ───────────────────────────── */
.ddf-listings-wrap.view-grid .ddf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.ddf-listings-wrap.view-grid .ddf-item {
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    background: #fff;
}
.ddf-listings-wrap.view-grid .ddf-item:first-child { border-top: none; }
.ddf-listings-wrap.view-grid .ddf-item:hover { background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,0.13); }
.ddf-listings-wrap.view-grid .ddf-item__photo { flex: none; width: 100%; height: 200px; border-radius: 0; }
.ddf-listings-wrap.view-grid .ddf-item__body { padding: 14px 16px 16px; gap: 4px; }
.ddf-listings-wrap.view-grid .ddf-item__price { font-size: 18px; }
.ddf-listings-wrap.view-grid .ddf-item__address { font-size: 14px; }
.ddf-listings-wrap.view-grid .ddf-item__remarks { display: none; }

/* ── Pagination ──────────────────────────── */
.ddf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 0 16px;
    flex-wrap: wrap;
}

.ddf-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ddf-page-btn:hover { border-color: #232b2b; color: #232b2b; }
.ddf-page-btn.active { background: #232b2b; border-color: #232b2b; color: #fff; cursor: default; }
.ddf-page-btn:disabled { opacity: 0.4; cursor: default; }
.ddf-page-btn.ellipsis { border: none; cursor: default; }
.ddf-page-btn.ellipsis:hover { color: #333; border: none; }

/* ── Open House badge ────────────────────── */
.ddf-oh-ribbon {
    position: absolute;
    top: 14px;
    left: -32px;
    width: 130px;
    background: #232b2b;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 0;
    transform: rotate(-45deg);
    transform-origin: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    pointer-events: none;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 700px) {
    .ddf-city-tabs { gap: 0; padding: 0 12px; }
    .ddf-tab { padding: 12px 14px 10px; font-size: 14px; }
    .ddf-hood-panel { padding: 14px 12px 0; }
    .ddf-hood-grid { grid-template-columns: repeat(2, 1fr); }
    .ddf-filters-row { padding: 14px 12px 0; }
    .ddf-filters-row input,
    .ddf-filters-row select,
    .ddf-btn { width: 100%; flex: none; }
    .ddf-item { flex-direction: column; }
    .ddf-item__photo { flex: none; width: 100%; height: 200px; }
    .ddf-toolbar { flex-direction: column; align-items: flex-start; }
}


/* ── REALTOR.ca badge ─────────────────── */
.ddf-realtor-badge {
    text-align: center;
    padding: 24px 0 8px;
}
