/* The listings page: additions to the off-plan finder's styles (../offplan/assets/styles.css). */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buy / Rent switch */
.purpose-switch { display: inline-flex; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px; margin: 4px 0 22px; }
.purpose-switch button {
  min-width: 120px; min-height: 46px; border: 0; border-radius: 999px; background: none; color: #fff;
  font-weight: 700; font-size: 1.02rem; cursor: pointer; transition: background .15s, color .15s;
}
.purpose-switch button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.purpose-switch button:not([aria-pressed="true"]):hover { background: rgba(255,255,255,.1); }
.budget-card select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.input-affix .affix-code { min-width: 54px; }

/* Cards */
.badge-dark { background: var(--ink); }
.photo-count svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.photo-count { display: inline-flex; align-items: center; gap: 5px; position: absolute; inset-inline-end: 12px; bottom: 12px; background: rgba(17,24,39,.7); color: #fff; font-size: .74rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.l-title { font-size: 1.12rem; line-height: 1.25; }
.l-title button { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-align: start; }
.card-specs span { white-space: nowrap; }

/* The listing's broker */
.card-actions .btn:only-child { grid-column: 1 / -1; }
.broker-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.broker-pic { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: #e5e7eb; }
.broker-initial { display: grid; place-items: center; font-weight: 700; color: var(--ink-2); }
.broker-name { flex: 1; min-width: 0; font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broker-wa { width: 36px; height: 36px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; flex: none; }
.broker-wa:hover { background: #178a45; }
.broker-wa svg { width: 20px; height: 20px; fill: #fff; }
.broker-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #f9fafb; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.broker-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: #e5e7eb; font-size: 1.4rem; }
.broker-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.broker-info small { color: var(--muted); }
.broker-card .btn-wa svg { width: 18px; height: 18px; fill: currentColor; }

/* Details window */
.listing-modal { width: min(900px, calc(100% - 24px)); }
.l-media { aspect-ratio: auto; background: #111827; }
.gallery { position: relative; aspect-ratio: 16 / 10; background: #111827; }
.gallery-main { width: 100%; height: 100%; object-fit: contain; }
.gal-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); font-size: 1.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px;
}
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-count { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(17,24,39,.75); color: #fff; font-size: .78rem; padding: 3px 10px; border-radius: 999px; }
.gal-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: #111827; scrollbar-width: thin; }
.gal-thumbs button { flex: none; width: 76px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; opacity: .7; }
.gal-thumbs button.on { border-color: var(--gold); opacity: 1; }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.l-media .modal-lang { z-index: 2; }
.l-media .modal-close { z-index: 2; }
.price.big { font-size: 1.6rem; margin: 10px 0 0; }
.modal-actions.top { margin-top: 16px; }
.btn-wa-outline { background: #fff; color: #178a45; border-color: var(--wa); }
.btn-wa-outline:hover { background: #ecfdf3; }
.btn-wa-outline svg { width: 18px; height: 18px; fill: currentColor; }
.modal-actions .btn-outline svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.modal-actions .btn-outline.on svg { fill: #e11d48; stroke: #e11d48; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: .74rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.cost-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.cost-head h3 { margin: 0; }
.pay-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.pay-toggle button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
.pay-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cost-table td, .cost-table td:nth-child(2) { width: auto; text-align: end; white-space: nowrap; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-table th { padding-inline-end: 12px; }
.cost-table .total th, .cost-table .total td { font-size: 1.05rem; }
.cheque-select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; }
.note-box { background: var(--amber-soft); color: #78350f; border-radius: 10px; padding: 10px 12px; }
.desc { color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.amenity-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.amenity-list li { background: var(--gold-soft); border-radius: 999px; padding: 4px 12px; font-size: .84rem; }
.permit-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); margin-top: 18px; }
.permit-qr { border: 1px solid var(--line); border-radius: 6px; }

/* Rent: no status filter */
body[data-purpose="rent"] [data-only="sale"] { display: none; }

@media (max-width: 640px) {
  .purpose-switch { display: flex; }
  .purpose-switch button { flex: 1; min-width: 0; }
  .gallery { aspect-ratio: 4 / 3; }
  .price.big { font-size: 1.35rem; }
  .gal-btn { width: 38px; height: 38px; }
}
