/* Resale MLS search — /resale/ */

/* Segmented control (Houses / Condos / All) */
.resale-seg {
  display: inline-flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 980px;
  padding: 4px;
  margin: 0 auto 18px;
  width: fit-content;
}
.resale-seg-btn {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 22px;
  border-radius: 980px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.resale-seg-btn.is-sel {
  background: var(--ink);
  color: #fff;
}
.wrap.resale-seg {
  display: flex;
  justify-content: flex-start;
  max-width: var(--max);
  margin: 0 auto 18px;
}
@media (max-width: 640px) {
  .wrap.resale-seg { margin-left: 22px; margin-right: 22px; }
  .resale-seg-btn { padding: 8px 16px; flex: 1; }
}

/* Listing card grid */
.resale-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .resale-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .resale-grid { grid-template-columns: 1fr; gap: 16px; } }

.rcard {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: none;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.rcard:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.rcard-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #e8e8ed;
  overflow: hidden;
}
.rcard-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rcard-media .rcard-nophoto {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--mute);
  font-size: 13px;
}
.rcard-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 980px;
}
.rcard-type {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 980px;
  backdrop-filter: blur(4px);
}

.rcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.rcard-price { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.rcard-specs { font-size: 13px; color: var(--ink-soft); }
.rcard-specs b { font-weight: 600; }
.rcard-addr { font-size: 14px; font-weight: 500; color: var(--ink); }
.rcard-loc { font-size: 12.5px; color: var(--mute); }
.rcard-office {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--mute);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 8px;
}

/* Skeleton loading */
.rcard--skeleton { pointer-events: none; }
.rcard--skeleton .rcard-media { background: linear-gradient(100deg, #ececf0 40%, #f6f6f8 50%, #ececf0 60%); background-size: 200% 100%; animation: rsk 1.4s infinite; }
.sk { display: block; border-radius: 6px; background: #ececf0; height: 13px; margin-top: 6px; }
.sk--price { width: 45%; height: 20px; }
.sk--line { width: 85%; }
.sk--short { width: 55%; }
@keyframes rsk { to { background-position: -200% 0; } }

.resale-empty { text-align: center; padding: 60px 22px; color: var(--ink-soft); }
.resale-empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--ink); }
.resale-empty a { color: var(--blue); }

.resale-more-row { text-align: center; margin-top: 32px; }

/* Compliance / disclaimer block */
.resale-disclaimer {
  margin-top: 56px;
  padding: 20px 24px;
  background: var(--panel);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--mute);
  line-height: 1.65;
}
.resale-disclaimer strong { color: var(--ink); }
.resale-disclaimer a { color: var(--blue); text-decoration: none; }

/* ---------- Listing modal ---------- */
.rmodal { position: fixed; inset: 0; z-index: 900; }
.rmodal[hidden] { display: none; }
.rmodal-backdrop { position: absolute; inset: 0; background: rgba(20, 20, 24, 0.55); backdrop-filter: blur(3px); }
.rmodal-panel {
  position: relative;
  max-width: 860px;
  margin: 4vh auto;
  max-height: 92vh;
  background: #fff;
  border-radius: var(--radius);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
@media (max-width: 900px) {
  .rmodal-panel { margin: 0; max-height: 100vh; height: 100%; border-radius: 0; }
}
.rmodal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.rmodal-carousel { position: relative; aspect-ratio: 16 / 10; background: #e8e8ed; overflow: hidden; }
.rmodal-track { display: flex; height: 100%; transition: transform 0.3s ease; }
.rmodal-track img { width: 100%; height: 100%; object-fit: cover; flex: 0 0 100%; }
.rmodal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.rmodal-nav--prev { left: 14px; }
.rmodal-nav--next { right: 14px; }
.rmodal-count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 980px;
}

.rmodal-body { padding: 26px 30px 34px; }
@media (max-width: 600px) { .rmodal-body { padding: 20px 20px 30px; } }
.rmodal-price { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.rmodal-addr { font-size: 16px; font-weight: 500; margin-top: 2px; color: var(--ink); }
.rmodal-loc { font-size: 13.5px; color: var(--mute); margin-top: 2px; }
.rmodal-specrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.rmodal-chip { background: var(--panel); border-radius: 980px; padding: 7px 14px; font-size: 13px; color: var(--ink); }
.rmodal-chip b { font-weight: 600; }
.rmodal-remarks { margin-top: 18px; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.rmodal-facts { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
@media (max-width: 520px) { .rmodal-facts { grid-template-columns: 1fr; } }
.rmodal-fact { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.rmodal-fact span:first-child { color: var(--mute); }
.rmodal-fact span:last-child { color: var(--ink); font-weight: 500; text-align: right; }
.rmodal-attr { margin-top: 20px; font-size: 11px; line-height: 1.6; color: var(--mute); background: var(--panel); border-radius: var(--radius-sm); padding: 12px 16px; }
.rmodal-ctas { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.rmodal-ctas .btn { flex: 1; min-width: 180px; text-align: center; }

body.rmodal-open { overflow: hidden; }
