/* ═══════════════════════════════════════════════════════════
   CLR MLS Listings — Frontend Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── Search Form ──────────────────────────────────────── */

.clr-mls-search-form {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 24px;
}

.clr-mls-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.clr-mls-search-row + .clr-mls-search-row {
    margin-top: 12px;
}

.clr-mls-search-vertical {
    flex-direction: column;
    max-width: 320px;
}

.clr-mls-search-vertical .clr-mls-search-row {
    flex-direction: column;
}

.clr-mls-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 140px;
}

.clr-mls-field label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin-bottom: 4px;
}

.clr-mls-field select,
.clr-mls-field input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    appearance: auto;
}

.clr-mls-field select:focus,
.clr-mls-field input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.clr-mls-field-range .clr-mls-range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clr-mls-field-range select {
    flex: 1;
    min-width: 100px;
}

.clr-mls-range-sep {
    color: #888;
    font-weight: 600;
}

.clr-mls-field-submit {
    min-width: auto;
    flex: 0 0 auto;
}

/* Waterfront checkbox field in search form */
.clr-mls-field-waterfront {
    flex: 0 0 auto;
    min-width: auto;
    justify-content: flex-end;
}

.clr-mls-waterfront-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #333 !important;
    cursor: pointer;
    white-space: nowrap;
    padding: 8px 0 2px;
}

.clr-mls-waterfront-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    padding: 0;
    border: 1px solid #ccc;
}

.clr-mls-btn {
    display: inline-block;
    padding: 9px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.clr-mls-btn:hover {
    background: #135e96;
    color: #fff;
}

/* ─── Results Header ───────────────────────────────────── */

.clr-mls-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.clr-mls-results-count {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.clr-mls-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.clr-mls-sort label {
    color: #555;
    white-space: nowrap;
}

.clr-mls-sort-select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

/* ─── Listing Grid ─────────────────────────────────────── */

.clr-mls-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.clr-mls-cols-2 { grid-template-columns: repeat(2, 1fr); }
.clr-mls-cols-3 { grid-template-columns: repeat(3, 1fr); }
.clr-mls-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── Listing Card ─────────────────────────────────────── */

.clr-mls-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}

.clr-mls-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.clr-mls-card-photo {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    background: #eee;
    overflow: hidden;
}

.clr-mls-card-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clr-mls-no-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: #999;
    font-size: 14px;
}

.clr-mls-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.clr-mls-status-active { background: #16a34a; }
.clr-mls-status-pending { background: #d97706; }
.clr-mls-status-closed { background: #6b7280; }
.clr-mls-status-coming-soon { background: #7c3aed; }

.clr-mls-card-info {
    padding: 14px 16px;
}

.clr-mls-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.clr-mls-card-details {
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
}

.clr-mls-card-details strong {
    font-weight: 700;
    color: #1a1a1a;
}

.clr-mls-sep {
    margin: 0 4px;
    color: #bbb;
}

.clr-mls-card-address {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

.clr-mls-card-city {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.clr-mls-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #888;
}

.clr-mls-card-type {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

/* ─── Pagination ───────────────────────────────────────── */

.clr-mls-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}

.clr-mls-pagination a,
.clr-mls-page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: all 0.15s;
}

.clr-mls-pagination a:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.clr-mls-page-current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    font-weight: 600;
}

.clr-mls-page-dots {
    padding: 4px;
    color: #888;
}

/* ─── Single Listing ───────────────────────────────────── */

.clr-mls-single {
    max-width: 1200px;
    margin: 0 auto;
}

.clr-mls-single-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.clr-mls-single-price {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
}

.clr-mls-single-address h1 {
    font-size: 24px;
    margin: 0 0 4px;
}

.clr-mls-single-city {
    font-size: 16px;
    color: #666;
}

.clr-mls-single-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

.clr-mls-single-key-facts {
    display: flex;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.clr-mls-fact {
    text-align: center;
}

.clr-mls-fact-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
}

.clr-mls-fact-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Photo Gallery ────────────────────────────────────── */

.clr-mls-gallery {
    margin-bottom: 32px;
}

.clr-mls-gallery-main {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #eee;
}

.clr-mls-gallery-main img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.clr-mls-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.clr-mls-gallery-thumb {
    flex: 0 0 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.clr-mls-gallery-thumb:hover,
.clr-mls-gallery-thumb.active {
    border-color: #2271b1;
}

.clr-mls-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Agent / Office Info ──────────────────────────────── */

.clr-mls-agent-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 24px;
}

.clr-mls-agent-info {
    flex: 1;
}

.clr-mls-agent-name {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 4px;
}

.clr-mls-office-name {
    font-size: 14px;
    color: #666;
}

/* ─── Contact Section (Single Listing) ─────────────────── */

.clr-mls-contact-section {
    margin-top: 40px;
    padding: 32px;
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ece6 100%);
    border: 1px solid #e0d9cf;
    border-radius: 12px;
    text-align: center;
}

.clr-mls-contact-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.clr-mls-contact-subtitle {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

.clr-mls-contact-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.clr-mls-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: 'Muli', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.clr-mls-contact-btn-email {
    background: #c9a227;
    color: #fff;
}

.clr-mls-contact-btn-email:hover {
    background: #a8871e;
    color: #fff;
}

.clr-mls-contact-btn-phone {
    background: #fff;
    color: #333;
    border: 2px solid #c9a227;
}

.clr-mls-contact-btn-phone:hover {
    background: #c9a227;
    color: #fff;
}

.clr-mls-contact-address {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

/* ─── Responsive ───────────────────────────────────────── */

@media (max-width: 1024px) {
    .clr-mls-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .clr-mls-cols-3,
    .clr-mls-cols-4 { grid-template-columns: repeat(2, 1fr); }

    .clr-mls-search-form { padding: 16px; }
    .clr-mls-search-row { gap: 10px; }
    .clr-mls-field { min-width: 120px; }
    .clr-mls-single-header { flex-direction: column; }
    .clr-mls-single-price { font-size: 26px; }

    .clr-mls-contact-section { padding: 24px 16px; }
    .clr-mls-contact-buttons { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .clr-mls-cols-2,
    .clr-mls-cols-3,
    .clr-mls-cols-4 { grid-template-columns: 1fr; }

    .clr-mls-search-row { gap: 10px; }
    .clr-mls-field { min-width: 100%; }
    .clr-mls-card-price { font-size: 20px; }
    .clr-mls-single-key-facts { gap: 16px; }
}
