/* FRI MLS Grid — Front-end Search Styles
   Designed to match the dp-fri theme palette:
   Primary Blue: #335592  |  Green: #369970  |  Light Grey: #eee
*/

/* ----------------------------------------------------------------
   Container
---------------------------------------------------------------- */
.fri-mls-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'JAF Facitweb', 'Open Sans', sans-serif;
    color: #333;
}

/* ----------------------------------------------------------------
   Search Form
---------------------------------------------------------------- */
.fri-mls-search-form {
    background: #f5f5f5;
    padding: 24px;
    border-radius: 4px;
    margin-bottom: 32px;
}

.fri-mls-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.fri-mls-field {
    flex: 1 1 200px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fri-mls-field label {
    font-size: 13px;
    font-weight: 600;
    color: #335592;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fri-mls-field input[type="text"],
.fri-mls-field select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.fri-mls-field select[multiple] {
    height: auto;
    min-height: 40px;
    max-height: 120px;
}

/* Small field width modifier */
.fri-mls-field--sm {
    flex: 0 0 160px;
    min-width: 120px;
}

/* Hint text inside label */
.fri-mls-hint {
    font-weight: normal;
    font-size: 11px;
    color: #888;
    text-transform: none;
    letter-spacing: 0;
}

/* Range pair: two selects with "To" between them */
.fri-mls-range-pair {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fri-mls-range-pair select {
    flex: 1;
    min-width: 100px;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
}

.fri-mls-to {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Checkbox group — vertical stack of labelled checkboxes */
.fri-mls-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 10px;
    border-radius: 3px;
    max-height: 160px;
    overflow-y: auto;
}

.fri-mls-cb-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: normal;
    color: #333;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    line-height: 1.4;
}

.fri-mls-cb-label input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    cursor: pointer;
}

.fri-mls-cb-divider {
    border: none;
    border-top: 1px dashed #ccc;
    margin: 4px 0;
}

/* Single checkbox (Waterfront, Pool Available) */
.fri-mls-checkbox-single {
    padding-top: 6px;
}

.fri-mls-checkbox-field {
    justify-content: flex-end;
    padding-bottom: 8px;
}

.fri-mls-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    font-weight: normal;
    color: #333;
}

/* Primary disclaimer (exact old Matrix text) */
.mls-disclaimer--primary {
    font-weight: 600;
    font-style: normal !important;
    margin-bottom: 6px;
}

.fri-mls-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-top: 8px;
}

/* ----------------------------------------------------------------
   Buttons
---------------------------------------------------------------- */
.fri-mls-btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.3s ease;
}

.fri-mls-btn-search {
    background: #335592;
    color: #fff;
}
.fri-mls-btn-search:hover {
    background: #264070;
}

.fri-mls-btn-clear {
    background: #888;
    color: #fff;
}
.fri-mls-btn-clear:hover {
    background: #666;
    color: #fff;
}

.fri-mls-btn-tour {
    background: #369970;
    color: #fff;
}
.fri-mls-btn-tour:hover {
    background: #2a7a58;
}

/* ----------------------------------------------------------------
   Results header
---------------------------------------------------------------- */
.fri-mls-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.fri-mls-result-count {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.fri-mls-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.fri-mls-sort-select,
.fri-mls-sort-dir {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}

/* ----------------------------------------------------------------
   Listing Grid
---------------------------------------------------------------- */
.fri-mls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* ----------------------------------------------------------------
   Listing Card
---------------------------------------------------------------- */
.fri-mls-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.fri-mls-card:hover {
    box-shadow: 0 4px 16px rgba(51, 85, 146, 0.15);
}

.fri-mls-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fri-mls-card-photo {
    position: relative;
    background: #eee;
    overflow: hidden;
    aspect-ratio: 4/3;
}
.fri-mls-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fri-mls-card-status {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.fri-mls-status-active  { background: #369970; color: #fff; }
.fri-mls-status-pending { background: #e8a020; color: #fff; }
.fri-mls-status-closed  { background: #888; color: #fff; }

.fri-mls-card-body {
    padding: 16px;
}

.fri-mls-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #335592;
    margin-bottom: 6px;
}

.fri-mls-card-address {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
}

.fri-mls-address-suppressed {
    font-style: italic;
    color: #777;
}

.fri-mls-card-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.fri-mls-meta-item strong {
    color: #335592;
}

.fri-mls-card-type {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   Initial state (no search submitted yet)
---------------------------------------------------------------- */
.fri-mls-initial-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    margin-top: 8px;
}

/* Back to search link on detail pages */
.fri-mls-back-link {
    margin-bottom: 20px;
}
.fri-mls-back-link a {
    color: #335592;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.fri-mls-back-link a:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------------
   No results
---------------------------------------------------------------- */
.fri-mls-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 15px;
}

/* ----------------------------------------------------------------
   Pagination
---------------------------------------------------------------- */
.fri-mls-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.fri-mls-page-btn {
    padding: 7px 14px;
    border: 1px solid #335592;
    background: #fff;
    color: #335592;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}
.fri-mls-page-btn:hover,
.fri-mls-page-btn.active {
    background: #335592;
    color: #fff;
}

/* ----------------------------------------------------------------
   Compliance footer
---------------------------------------------------------------- */
.mls-compliance-footer {
    margin-top: 32px;
    padding: 20px;
    background: #f8f8f8;
    border-top: 2px solid #335592;
    font-size: 12px;
    color: #555;
    line-height: 1.6;
}

.mls-stellar-logo {
    display: block;
    margin-bottom: 10px;
    max-width: 120px;
    height: auto;
}

.mls-copyright {
    font-weight: 600;
    margin-bottom: 6px;
}

.mls-disclaimer {
    font-style: italic;
    max-width: 900px;
}

/* ----------------------------------------------------------------
   Detail page
---------------------------------------------------------------- */
.fri-mls-gallery {
    margin-bottom: 24px;
}

.fri-mls-gallery-main img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.fri-mls-gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.fri-mls-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0.7;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}
.fri-mls-thumb:hover,
.fri-mls-thumb.active {
    opacity: 1;
    border-color: #335592;
}

.fri-mls-detail-header {
    margin-bottom: 24px;
}

.fri-mls-detail-price-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.fri-mls-detail-price {
    font-size: 32px;
    font-weight: 700;
    color: #335592;
    margin: 0;
}

.fri-mls-detail-address address {
    font-style: normal;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 12px;
}

.fri-mls-detail-meta-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 15px;
    color: #444;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}
.fri-mls-detail-meta-bar strong {
    color: #335592;
}

.fri-mls-detail-section {
    margin-bottom: 28px;
}

.fri-mls-detail-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #335592;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.fri-mls-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.fri-mls-detail-table th,
.fri-mls-detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
.fri-mls-detail-table th {
    color: #666;
    font-weight: 600;
    width: 20%;
}

.fri-mls-remarks {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

.fri-mls-agent-card {
    background: #f8f8f8;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}
.fri-mls-agent-card p {
    margin: 0 0 4px;
}

.fri-mls-open-house {
    background: #fff8e6;
    border-left: 3px solid #e8a020;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* ----------------------------------------------------------------
   Loading state
---------------------------------------------------------------- */
.fri-mls-loading {
    text-align: center;
    padding: 40px;
    color: #335592;
    font-size: 15px;
}

.fri-mls-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #cce;
    border-top-color: #335592;
    border-radius: 50%;
    animation: fri-mls-spin 0.7s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes fri-mls-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------
   Responsive
---------------------------------------------------------------- */
@media (max-width: 768px) {
    .fri-mls-field,
    .fri-mls-field--sm {
        flex: 1 1 100%;
        min-width: unset;
    }

    .fri-mls-range-pair {
        flex-wrap: nowrap;
    }

    .fri-mls-range-pair select {
        min-width: 0;
        font-size: 12px;
    }

    .fri-mls-grid {
        grid-template-columns: 1fr;
    }

    .fri-mls-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fri-mls-detail-price {
        font-size: 24px;
    }

    .fri-mls-detail-meta-bar {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .fri-mls-search-form {
        padding: 16px;
    }

    .fri-mls-pagination {
        gap: 4px;
    }

    .fri-mls-page-btn {
        padding: 6px 10px;
    }
}
