/* ================================================================
   Miami MLS Bridge — Frontend Styles
   ================================================================ */

:root {
  --mmb-primary:    #1a6fc4;
  --mmb-primary-dk: #145fa8;
  --mmb-accent:     #e35d1e;
  --mmb-bg:         #f7f8fa;
  --mmb-card-bg:    #ffffff;
  --mmb-border:     #e0e3e8;
  --mmb-text:       #1d2327;
  --mmb-muted:      #6b7280;
  --mmb-radius:     10px;
  --mmb-shadow:     0 2px 12px rgba(0,0,0,.09);
}

/* ---- Search Form ---- */
.mmb-search-wrapper { font-family: inherit; }

.mmb-search-form {
  background: var(--mmb-card-bg);
  border: 1px solid var(--mmb-border);
  border-radius: var(--mmb-radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--mmb-shadow);
}

.mmb-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.mmb-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
}

.mmb-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--mmb-muted);
  margin-bottom: 4px;
  letter-spacing: .04em;
}

.mmb-field--city   { flex: 1 1 200px; }
.mmb-field--keywords { flex: 2 1 260px; }
.mmb-field--submit { justify-content: flex-end; }

.mmb-select,
.mmb-input {
  height: 42px;
  border: 1.5px solid var(--mmb-border);
  border-radius: 7px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--mmb-text);
  background: #fff;
  transition: border-color .2s;
  width: 100%;
  box-sizing: border-box;
}

.mmb-select:focus,
.mmb-input:focus {
  outline: none;
  border-color: var(--mmb-primary);
  box-shadow: 0 0 0 3px rgba(26,111,196,.12);
}

/* ---- Buttons ---- */
.mmb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .2s, transform .1s;
}
.mmb-btn:active { transform: scale(.98); }

.mmb-btn--search, .mmb-btn--primary {
  background: var(--mmb-primary);
  color: #fff;
  width: 100%;
  justify-content: center;
}
.mmb-btn--search:hover, .mmb-btn--primary:hover { background: var(--mmb-primary-dk); color: #fff; }

.mmb-btn--outline {
  background: transparent;
  color: var(--mmb-primary);
  border: 1.5px solid var(--mmb-primary);
  padding: 8px 16px;
  font-size: 13px;
}
.mmb-btn--outline:hover { background: var(--mmb-primary); color: #fff; }

.mmb-btn--phone {
  background: #22863a;
  color: #fff;
  width: 100%;
  justify-content: center;
  margin: 8px 0;
}

/* ---- Listing Grid ---- */
.mmb-listings-grid {
  display: grid;
  gap: 22px;
}
.mmb-grid--3-col { grid-template-columns: repeat(3, 1fr); }
.mmb-grid--2-col { grid-template-columns: repeat(2, 1fr); }
.mmb-grid--4-col { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .mmb-grid--3-col, .mmb-grid--4-col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .mmb-grid--3-col, .mmb-grid--4-col, .mmb-grid--2-col { grid-template-columns: 1fr; }
  .mmb-form-row { flex-direction: column; }
}

/* ---- Listing Card ---- */
.mmb-listing-card {
  background: var(--mmb-card-bg);
  border-radius: var(--mmb-radius);
  overflow: hidden;
  box-shadow: var(--mmb-shadow);
  border: 1px solid var(--mmb-border);
  transition: transform .2s, box-shadow .2s;
}
.mmb-listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
}

.mmb-card-image {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: #e5e7eb;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
}

.mmb-card-image-link { display: block; }

.mmb-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* Badges */
.mmb-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .03em;
}
.mmb-badge--active   { background: #16a34a; color: #fff; }
.mmb-badge--pending  { background: #d97706; color: #fff; }
.mmb-badge--closed   { background: #6b7280; color: #fff; }
.mmb-badge--feature  { background: rgba(0,0,0,.55); color: #fff; }
.mmb-badge--new      { background: var(--mmb-accent); color: #fff; position: absolute; top: 10px; right: 10px; }

.mmb-card-body { padding: 16px; }

.mmb-card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--mmb-primary);
  margin-bottom: 6px;
}

.mmb-card-specs {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--mmb-muted);
  margin-bottom: 8px;
}

.mmb-card-address {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.4;
}
.mmb-card-address a { color: var(--mmb-text); text-decoration: none; }
.mmb-card-address a:hover { color: var(--mmb-primary); }

.mmb-card-location, .mmb-card-type { font-size: 13px; color: var(--mmb-muted); margin: 2px 0; }

.mmb-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid var(--mmb-border);
  padding-top: 8px;
}

/* ---- Results header ---- */
.mmb-results-count { color: var(--mmb-muted); font-size: 14px; margin: 0 0 16px; }

/* ---- Pagination ---- */
.mmb-pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 28px;
  justify-content: center;
}
.mmb-page-btn {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--mmb-border);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  color: var(--mmb-text);
  background: #fff;
  transition: all .15s;
}
.mmb-page-btn:hover          { border-color: var(--mmb-primary); color: var(--mmb-primary); }
.mmb-page-btn--active        { background: var(--mmb-primary); color: #fff; border-color: var(--mmb-primary); }

/* ---- Loader ---- */
.mmb-loader { display: flex; justify-content: center; padding: 40px; }
.mmb-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--mmb-border);
  border-top-color: var(--mmb-primary);
  border-radius: 50%;
  animation: mmb-spin .7s linear infinite;
}
@keyframes mmb-spin { to { transform: rotate(360deg); } }

/* ---- Single Listing ---- */
.mmb-gallery { margin-bottom: 24px; }

.mmb-gallery__main-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--mmb-radius);
}

.mmb-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mmb-gallery__thumb {
  width: 90px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color .2s;
}
.mmb-gallery__thumb.active,
.mmb-gallery__thumb:hover { border-color: var(--mmb-primary); }

.mmb-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.mmb-detail-address { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.mmb-detail-location { font-size: 16px; color: var(--mmb-muted); margin: 0; }
.mmb-detail-price { font-size: 30px; font-weight: 800; color: var(--mmb-primary); }

.mmb-detail-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--mmb-bg);
  border-radius: var(--mmb-radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.mmb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 70px;
}
.mmb-stat__icon { font-size: 22px; margin-bottom: 2px; }
.mmb-stat strong { font-size: 15px; font-weight: 700; }
.mmb-stat span   { font-size: 11px; color: var(--mmb-muted); text-transform: uppercase; letter-spacing: .04em; }

.mmb-detail-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 860px) {
  .mmb-detail-body { grid-template-columns: 1fr; }
}

.mmb-detail-section { margin-bottom: 28px; }
.mmb-detail-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mmb-border);
}

.mmb-details-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mmb-details-table th,
.mmb-details-table td { padding: 9px 12px; border-bottom: 1px solid var(--mmb-border); }
.mmb-details-table th { color: var(--mmb-muted); font-weight: 600; width: 25%; background: var(--mmb-bg); }
.mmb-details-table td { font-weight: 500; }

.mmb-remarks { font-size: 15px; line-height: 1.75; color: var(--mmb-text); }

/* Map */
.mmb-map { height: 350px; border-radius: var(--mmb-radius); overflow: hidden; border: 1px solid var(--mmb-border); }

/* Contact sidebar */
.mmb-contact-card,
.mmb-share-card {
  background: var(--mmb-card-bg);
  border: 1px solid var(--mmb-border);
  border-radius: var(--mmb-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--mmb-shadow);
}

.mmb-contact-card h3 { margin: 0 0 14px; font-size: 17px; }

.mmb-contact-form input,
.mmb-contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--mmb-border);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 10px;
  font-family: inherit;
}
.mmb-contact-form input:focus,
.mmb-contact-form textarea:focus { outline: none; border-color: var(--mmb-primary); }
.mmb-contact-form textarea { resize: vertical; }

.mmb-share-buttons { display: flex; gap: 8px; }
.mmb-share-btn {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.mmb-share-btn--fb    { background: #1877f2; color: #fff; }
.mmb-share-btn--tw    { background: #1da1f2; color: #fff; }
.mmb-share-btn--email { background: #6b7280; color: #fff; }

/* Open Houses */
.mmb-open-houses-list { display: flex; flex-direction: column; gap: 20px; }
.mmb-open-house-item {
  display: flex;
  gap: 16px;
  background: var(--mmb-card-bg);
  border: 1px solid var(--mmb-border);
  border-radius: var(--mmb-radius);
  padding: 16px;
  box-shadow: var(--mmb-shadow);
}
.mmb-oh-photo img { width: 140px; height: 100px; object-fit: cover; border-radius: 7px; }
.mmb-oh-date { font-weight: 600; font-size: 13px; color: var(--mmb-primary); margin-bottom: 6px; }
.mmb-oh-price { font-weight: 800; font-size: 18px; color: var(--mmb-text); }
.mmb-oh-details h3 { margin: 0 0 4px; font-size: 16px; }

/* Error / No results */
.mmb-error-notice {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
}
.mmb-no-results { color: var(--mmb-muted); padding: 24px 0; text-align: center; }
