/* =============================================================
   MLS LISTINGS PRO v1.1 – Frontend CSS
   ============================================================= */
:root {
    --mls-blue:    #1a56a4;
    --mls-blue-dk: #0f3272;
    --mls-accent:  #e8870a;
    --mls-green:   #1a7a3c;
    --mls-red:     #c0392b;
    --mls-bg:      #f4f7fb;
    --mls-card:    #ffffff;
    --mls-border:  #dde3ec;
    --mls-text:    #1d2433;
    --mls-muted:   #6b7585;
    --mls-r:       8px;
    --mls-sh:      0 2px 12px rgba(0,0,0,.08);
}
.mls-single-listing,
.mls-listings-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
    color: var(--mls-text);
    line-height: 1.55;
}
/* ---- HERO BANNER ---- */
.mls-hero-banner {
    background: linear-gradient(135deg, #0d2a5e 0%, #1a56a4 100%);
    color: #fff;
    border-radius: var(--mls-r);
    padding: 24px 28px;
    margin-bottom: 20px;
}
.mls-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mls-status-badge,
.mls-prop-type-badge,
.mls-mls-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.mls-status-badge { background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.mls-prop-type-badge { background: rgba(255,255,255,.15); color: #ffe; border: 1px solid rgba(255,255,255,.25); }
.mls-mls-badge { background: rgba(0,0,0,.25); color: #cde; font-size: 10px; }
/* status-specific badge colors in grid */
.mls-card-status.mls-status-active,
.mls-widget .mls-w-status.mls-status-active { background: #1a7a3c; color: #fff; }
.mls-card-status.mls-status-pending,
.mls-widget .mls-w-status.mls-status-pending { background: #c06000; color: #fff; }
.mls-card-status.mls-status-under-contract,
.mls-widget .mls-w-status.mls-status-under-contract { background: #8b0060; color: #fff; }
.mls-card-status.mls-status-sold,
.mls-widget .mls-w-status.mls-status-sold { background: #1a3888; color: #fff; }
.mls-card-status.mls-status-withdrawn,
.mls-widget .mls-w-status.mls-status-withdrawn { background: #555; color: #fff; }
.mls-card-status.mls-status-expired,
.mls-widget .mls-w-status.mls-status-expired { background: #888; color: #fff; }
.mls-hero-price {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.mls-hero-dom {
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    background: rgba(0,0,0,.3);
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
}
.mls-hero-address {
    font-size: 17px;
    font-weight: 500;
    opacity: .9;
    margin-bottom: 14px;
}
.mls-county-label { font-size: 13px; opacity: .7; }
.mls-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 14px;
}
.mls-hstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 18px;
    border-right: 1px solid rgba(255,255,255,.18);
    min-width: 70px;
}
.mls-hstat:first-child { padding-left: 0; }
.mls-hstat:last-child  { border-right: none; }
.mls-hstat strong { font-size: 22px; font-weight: 700; line-height: 1.1; }
.mls-hstat span   { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* ---- GALLERY ---- */
.mls-gallery-wrap { margin-bottom: 22px; }
.mls-stage-wrap {
    position: relative;
    background: #000;
    border-radius: var(--mls-r);
    overflow: hidden;
    line-height: 0;
}
.mls-stage-img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity .15s;
}
.mls-stage-img.loading { opacity: .5; }
.mls-stage-ui {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.mls-nav {
    background: rgba(255,255,255,.85);
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #222;
    transition: background .15s;
    flex-shrink: 0;
}
.mls-nav:hover { background: #fff; }
.mls-nav-next { margin-right: 4px; }
.mls-counter {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    flex: 1;
    text-align: center;
}
.mls-expand-btn {
    background: rgba(255,255,255,.85);
    border: none;
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 16px;
    cursor: pointer;
    color: #222;
    transition: background .15s;
}
.mls-expand-btn:hover { background: #fff; }
.mls-thumb-strip {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    padding: 2px 0;
}
.mls-strip-thumb {
    width: 80px; height: 58px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: .75;
    transition: opacity .15s, border-color .15s, transform .12s;
    flex-shrink: 0;
}
.mls-strip-thumb:hover  { opacity: 1; transform: scale(1.05); }
.mls-strip-thumb.active { opacity: 1; border-color: var(--mls-blue); }

/* ---- LIGHTBOX ---- */
.mls-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mls-lb-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: zoom-out;
}
.mls-lb-frame {
    position: relative;
    z-index: 2;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mls-lb-img {
    max-width: 92vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    display: block;
}
.mls-lb-x {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 3;
    background: rgba(255,255,255,.15);
    border: none; border-radius: 50%;
    width: 42px; height: 42px;
    font-size: 26px; line-height: 1;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.mls-lb-x:hover { background: rgba(255,255,255,.3); }
.mls-lb-prev,
.mls-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,.15);
    border: none; border-radius: 50%;
    width: 50px; height: 50px;
    font-size: 32px; line-height: 1;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.mls-lb-prev:hover, .mls-lb-next:hover { background: rgba(255,255,255,.3); }
.mls-lb-prev { left: 16px; }
.mls-lb-next { right: 16px; }
.mls-lb-cap {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255,255,255,.75);
    font-size: 13px;
    background: rgba(0,0,0,.4);
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ---- DETAIL LAYOUT ---- */
.mls-detail-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 22px;
    align-items: start;
}
@media (max-width: 860px) { .mls-detail-layout { grid-template-columns: 1fr; } }

/* ---- SECTIONS ---- */
.mls-section {
    background: var(--mls-card);
    border: 1px solid var(--mls-border);
    border-radius: var(--mls-r);
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: var(--mls-sh);
}
.mls-section-h {
    font-size: 15px;
    font-weight: 700;
    color: var(--mls-blue);
    margin: 0 0 14px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--mls-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mls-section-h span { font-style: normal; }
.mls-description { font-size: 14px; line-height: 1.7; }
.mls-notes-block {
    margin-top: 10px;
    font-size: 13px;
    color: var(--mls-muted);
    background: var(--mls-bg);
    border-left: 3px solid var(--mls-blue);
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
}
.mls-ext-link { font-size: 13px; color: var(--mls-blue); text-decoration: none; }
.mls-ext-link:hover { text-decoration: underline; }

/* ---- FACTS TABLE ---- */
.mls-facts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mls-facts-table th {
    text-align: left;
    padding: 7px 10px 7px 0;
    font-weight: 500;
    color: var(--mls-muted);
    width: 42%;
    vertical-align: top;
    white-space: nowrap;
}
.mls-facts-table td {
    padding: 7px 6px;
    color: var(--mls-text);
    font-weight: 500;
    vertical-align: top;
}
.mls-facts-table tr:nth-child(even) th,
.mls-facts-table tr:nth-child(even) td {
    background: var(--mls-bg);
}
.mls-no-data { font-size: 13px; color: var(--mls-muted); font-style: italic; margin: 0; }

/* ---- DOCUMENTS SECTION ---- */
.mls-docs-section { background: #fff8f0; border-color: #f0d9b5; }
.mls-docs-intro { font-size: 13px; color: var(--mls-muted); margin: 0 0 14px; }
.mls-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.mls-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    background: #fff;
    border: 1px solid var(--mls-border);
    border-left: 4px solid var(--dc, #555);
    border-radius: 6px;
    text-decoration: none;
    color: var(--mls-text);
    transition: box-shadow .15s, transform .12s;
}
.mls-doc-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.mls-dc-icon { font-size: 22px; flex-shrink: 0; }
.mls-dc-body { flex: 1; display: flex; flex-direction: column; }
.mls-dc-label { font-size: 13px; font-weight: 700; color: var(--mls-text); }
.mls-dc-file  { font-size: 11px; color: var(--mls-muted); margin-top: 2px; }
.mls-dc-dl {
    font-size: 10px;
    font-weight: 700;
    background: var(--dc, #555);
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    flex-shrink: 0;
}
.mls-docs-empty {
    background: var(--mls-bg);
    border-radius: 6px;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--mls-muted);
}
.mls-docs-empty p { margin: 0 0 5px; }

/* ---- SIDEBAR WIDGETS ---- */
.mls-widget {
    background: var(--mls-card);
    border: 1px solid var(--mls-border);
    border-radius: var(--mls-r);
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: var(--mls-sh);
}
.mls-widget h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--mls-muted);
    margin: 0 0 12px;
}
.mls-price-widget { background: var(--mls-blue); color: #fff; border-color: var(--mls-blue-dk); }
.mls-price-widget h4 { color: rgba(255,255,255,.7); }
.mls-w-price { font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.mls-w-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.mls-w-orig { font-size: 12px; opacity: .7; text-decoration: line-through; margin-bottom: 12px; }
.mls-w-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.mls-w-table th { text-align: left; font-weight: 400; opacity: .75; padding: 4px 0; width: 55%; }
.mls-w-table td { text-align: right; font-weight: 700; }
.mls-price-widget .mls-w-table th { color: rgba(255,255,255,.75); }
.mls-price-widget .mls-w-table td { color: #fff; }
.mls-price-widget .mls-w-table tr + tr th,
.mls-price-widget .mls-w-table tr + tr td { border-top: 1px solid rgba(255,255,255,.1); padding-top: 6px; }

.mls-offer-widget { background: #fff3e0; border-color: #f0c070; }
.mls-offer-widget h4 { color: #7c4000; }
.mls-offer-widget p { font-size: 12px; color: #7c5000; margin: 0 0 12px; }

.mls-agent-widget { background: #f0f6ff; border-color: #c8d9f5; }
.mls-w-an    { font-size: 15px; font-weight: 700; margin: 0 0 3px; }
.mls-w-sm    { font-size: 11px; color: var(--mls-muted); margin: 0 0 2px; }
.mls-w-office{ font-size: 12px; color: var(--mls-muted); margin: 0 0 8px; }
.mls-w-cta   { font-size: 13px; color: var(--mls-blue); text-decoration: none; display: block; margin-bottom: 4px; }
.mls-w-cta:hover { text-decoration: underline; }
.mls-w-showing { font-size: 12px; color: var(--mls-text); margin: 0; }

.mls-docs-sidebar {}
.mls-w-doc {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0;
    font-size: 12px;
    color: var(--mls-blue);
    text-decoration: none;
    border-bottom: 1px solid var(--mls-border);
}
.mls-w-doc:last-child { border-bottom: none; }
.mls-w-doc:hover { color: var(--mls-blue-dk); }
.mls-w-doc-badge { font-size: 9px; font-weight: 700; background: #c0392b; color: #fff; padding: 1px 4px; border-radius: 2px; margin-left: auto; }

/* ---- BUTTONS ---- */
.mls-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none; transition: background .15s;
    line-height: 1;
}
.mls-btn-primary { background: var(--mls-blue); color: #fff; }
.mls-btn-primary:hover { background: var(--mls-blue-dk); color: #fff; }
.mls-btn-full { width: 100%; box-sizing: border-box; }
.mls-btn-secondary { background: #e4e9f2; color: var(--mls-text); }
.mls-btn-secondary:hover { background: #d2daea; }
.mls-btn-sm { padding: 5px 12px; font-size: 12px; }
.mls-btn-lg { padding: 13px 30px; font-size: 16px; }
.mls-open-contract { cursor: pointer; }

/* ---- CONTRACT MODAL ---- */
.mls-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.mls-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.mls-modal-content {
    position: relative; z-index: 1;
    background: #fff; border-radius: 10px;
    width: 92%; max-width: 680px; max-height: 90vh; overflow-y: auto;
    padding: 28px 30px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.mls-modal-content h2 { font-size: 20px; margin: 0 0 4px; }
.mls-modal-sub { font-size: 13px; color: var(--mls-muted); margin: 0 0 20px; }
.mls-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; font-size: 26px;
    cursor: pointer; color: var(--mls-muted); line-height: 1;
}
.mls-modal-close:hover { color: var(--mls-text); }

/* ---- CONTRACT FORM ---- */
.mls-contract-form-wrap { font-size: 14px; }
.mls-contract-intro p  { font-size: 13px; color: var(--mls-muted); margin-bottom: 16px; }
.mls-req { color: var(--mls-red); }
.mls-fieldset { border: 1px solid var(--mls-border); border-radius: var(--mls-r); padding: 16px 18px; margin-bottom: 14px; }
.mls-fieldset legend { font-weight: 700; font-size: 13px; color: var(--mls-blue); padding: 0 6px; }
.mls-form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.mls-form-group { display: flex; flex-direction: column; }
.mls-col-half { flex: 1 1 180px; }
.mls-col-full { flex: 1 1 100%; }
.mls-form-group label { font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--mls-text); }
.mls-form-group input,
.mls-form-group select,
.mls-form-group textarea {
    padding: 9px 11px; border: 1px solid var(--mls-border);
    border-radius: 5px; font-size: 13px; background: #fff; color: var(--mls-text);
    transition: border-color .15s;
}
.mls-form-group input:focus,
.mls-form-group textarea:focus {
    border-color: var(--mls-blue); outline: none;
    box-shadow: 0 0 0 3px rgba(26,86,164,.1);
}
.mls-field-note { font-size: 11px; color: var(--mls-muted); margin-top: 4px; }
.mls-file-upload-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mls-file-input  { display: none; }
.mls-file-label  { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--mls-bg); border: 1px dashed var(--mls-border); border-radius: 5px; cursor: pointer; font-size: 13px; transition: background .15s; }
.mls-file-label:hover { background: #ddeaff; border-color: var(--mls-blue); }
.mls-file-chosen { font-size: 11px; color: var(--mls-muted); }
.mls-form-disclaimer { background: #fffbe6; border: 1px solid #ffe082; border-radius: 5px; padding: 11px 14px; margin-bottom: 14px; font-size: 11px; color: #5a4500; }
.mls-form-actions { text-align: center; }
.mls-form-response { padding: 13px 16px; border-radius: var(--mls-r); margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.mls-form-response.success { background: #e6f9ee; border: 1px solid #72d99a; color: #1a5c33; }
.mls-form-response.error   { background: #fdecea; border: 1px solid #f2a5a0; color: #8c1c1c; }

/* ---- LISTINGS GRID ---- */
.mls-listings-wrap {}
.mls-filter-bar {
    background: #fff; border: 1px solid var(--mls-border);
    border-radius: var(--mls-r); padding: 14px 16px;
    margin-bottom: 16px; box-shadow: var(--mls-sh);
}
.mls-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mls-filter-row input,
.mls-filter-row select { padding: 8px 11px; border: 1px solid var(--mls-border); border-radius: 5px; font-size: 13px; }
.mls-filter-kw { flex: 1 1 200px; }
.mls-filter-price { width: 110px; }
.mls-results-meta { font-size: 12px; color: var(--mls-muted); margin-bottom: 8px; }
.mls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
    gap: 20px;
    margin-top: 14px;
}
.mls-card { background: var(--mls-card); border-radius: var(--mls-r); border: 1px solid var(--mls-border); box-shadow: var(--mls-sh); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.mls-card:hover { transform: translateY(-3px); box-shadow: 0 6px 22px rgba(0,0,0,.13); }
.mls-card-photo-link { display: block; position: relative; overflow: hidden; height: 185px; background: #d8e0ee; }
.mls-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.mls-card:hover .mls-card-photo { transform: scale(1.05); }
.mls-card-no-photo { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--mls-muted); font-size: 13px; }
.mls-card-status { position: absolute; top: 9px; left: 9px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #fff; letter-spacing: .3px; }
.mls-card-photo-count { position: absolute; bottom: 7px; right: 7px; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; }
.mls-card-body { padding: 13px 15px; }
.mls-card-price { font-size: 21px; font-weight: 800; color: var(--mls-blue); }
.mls-card-address { font-size: 13px; color: var(--mls-text); margin: 4px 0 5px; }
.mls-card-stats { display: flex; gap: 10px; font-size: 12px; color: var(--mls-muted); flex-wrap: wrap; }
.mls-card-stats span { font-weight: 600; }
.mls-card-sub { font-size: 11px; color: var(--mls-muted); margin-top: 4px; }
.mls-card-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; border-top: 1px solid var(--mls-border); padding-top: 10px; }
.mls-dom, .mls-mls-num { font-size: 11px; color: var(--mls-muted); margin-right: auto; }
.mls-no-results { text-align: center; padding: 40px 20px; color: var(--mls-muted); }
.mls-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.mls-pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--mls-border); border-radius: 5px; font-size: 13px; text-decoration: none; color: var(--mls-text); }
.mls-pagination .current { background: var(--mls-blue); color: #fff; border-color: var(--mls-blue); }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .mls-hero-price { font-size: 28px; }
    .mls-hero-banner { padding: 18px; }
    .mls-hstat { padding: 0 10px; }
    .mls-hstat strong { font-size: 18px; }
    .mls-docs-grid { grid-template-columns: 1fr; }
    .mls-thumb-strip .mls-strip-thumb { width: 64px; height: 46px; }
    .mls-stage-img { max-height: 280px; }
    .mls-grid { grid-template-columns: 1fr; }
}
