/* Livira Portal - listing detail page (phase 3). Shared primitives (.btn*, .bdg*, .chip, .ico, .ph) live in components.css. */
.lp { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.listing-unavailable { background: #fff4d6; border: 1px solid #c9a24a; color: #5a4410; padding: 12px 16px; margin: 12px 0 0; border-radius: 8px; font-weight: 600; }

/* ---------- breadcrumbs + actions ---------- */
.lp-crumbs { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 10px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; min-width: 0; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 6px; opacity: .5; }
.back-to-search { font-weight: 600; color: var(--green); }
.crumb-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- gallery mosaic (1 large + up to 4) ---------- */
.mosaic { position: relative; display: grid; gap: 8px; height: 430px; border-radius: 18px; overflow: hidden; }
.mosaic .m { position: relative; padding: 0; border: 0; background: var(--sand); cursor: zoom-in; overflow: hidden; min-width: 0; min-height: 0; }
.mosaic .m img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mosaic .m:hover img { transform: scale(1.03); }
.mosaic.n1 { grid-template-columns: 1fr; }
.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.mosaic.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n3 .m:first-child { grid-row: 1 / 3; }
.mosaic.n4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n4 .m:first-child { grid-row: 1 / 3; }
.mosaic.n4 .m:nth-child(4) { grid-column: 2 / 4; }
.mosaic.n5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n5 .m:first-child { grid-row: 1 / 3; }
.mosaic .all { position: absolute; right: 14px; bottom: 14px; z-index: 3; background: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.mosaic .vid { position: absolute; left: 14px; bottom: 14px; z-index: 3; background: #fff; }
.mosaic.is-gone .m img { filter: grayscale(.7) brightness(.85); }
/* The Sold/Rented ribbon from the original mockup (spike 004/008). */
.outcome-banner {
  position: absolute; top: 28px; left: -48px; width: 220px; padding: 8px 0; text-align: center;
  background: var(--outcome-red); color: #fff; font-weight: 700; letter-spacing: 1px;
  transform: rotate(-35deg); z-index: 4; box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: none;
}
.mosaic-empty { position: relative; height: 260px; border-radius: 18px; display: grid; place-items: center; color: #fff; font-weight: 600; overflow: hidden; }
.mosaic-empty span { position: relative; z-index: 1; display: inline-flex; gap: 8px; align-items: center; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* ---------- sticky section menu ---------- */
.subnav { position: sticky; top: 62px; z-index: 900; background: var(--paper); border-bottom: 1px solid var(--line); margin-top: 14px; }
.subnav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav-in::-webkit-scrollbar { display: none; }
.subnav a { padding: 12px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--ink-soft); }
.subnav a:hover, .subnav a.on { color: var(--green); border-color: var(--gold); }

/* ---------- two columns ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 36px; padding: 22px 0 80px; align-items: start; }
.main > section { padding: 26px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 120px; }
.main > section:first-child { padding-top: 0; }
.main > section.last { border: 0; }
.main h2 { font-size: 21px; margin: 0 0 14px; }
.main h3.sub { font-family: var(--font-sans); font-size: 14px; margin: 18px 0 10px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .6px; }
.sec-sub { margin: -6px 0 14px; }
.kicker { font-size: 13px; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
h1.title { font-size: 28px; line-height: 1.2; margin: 6px 0 8px; overflow-wrap: anywhere; }
.addr { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-soft); margin-bottom: 16px; }
.addr .ico { margin-top: 2px; }
.addr address { font-style: normal; }
.addr a { color: var(--green); font-weight: 600; text-decoration: underline; }
.approx-note { font-size: 12px; color: var(--ink-soft); font-style: italic; }

/* price box */
.pricebox { display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.pricebox .big { font-size: 36px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pricebox .big small { font-size: 15px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0; }
.pricebox .big.gone-price { color: var(--ink-soft); }
.pricebox .lbl { font-size: 13px; color: var(--ink-soft); }
.pricebox .parts { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 24px; font-size: 14px; justify-content: start; }
.pricebox .parts div span { display: block; font-size: 12px; color: var(--ink-soft); }
.pricebox .parts b { font-variant-numeric: tabular-nums; }
.pricebox .cta-row { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.fact .ico { width: 24px; height: 24px; color: var(--gold-dark); }
.fact b { display: block; font-size: 16px; line-height: 1.1; }
.fact span { font-size: 12px; color: var(--ink-soft); }

/* description */
.desc-text { line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.desc-text.collapsed { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.linkbtn { background: none; border: 0; padding: 0; margin-top: 8px; font-weight: 700; color: var(--green); text-decoration: underline; cursor: pointer; }

/* videos (story 1471) - one 16:9 box, never wider than the page (phone safe) */
.video-frame { position: relative; width: 100%; max-width: 760px; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* map + places */
.detail-map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; z-index: 0; isolation: isolate; }
.places { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.place-cat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.place-cat summary { cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; list-style: none; }
.place-cat summary::-webkit-details-marker { display: none; }
.place-cat summary .n { margin-left: auto; font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.place-cat p { margin: 10px 0 0; font-size: 13px; }
.place-cat ul { margin: 8px 0 0; padding: 0; list-style: none; }
.place-cat li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--line); }
.places-dist { color: var(--ink-soft); white-space: nowrap; }
.places-none, .places-count, .places-loading, .places-source { color: var(--ink-soft); }
.place-cat .places-count { margin-bottom: 0; }
.places-centre { font-weight: 600; margin: 0 0 12px; }
.places-unavailable { color: var(--ink-soft); font-style: italic; }
.places-source { font-size: 12px; margin-top: 12px; }

/* same address table */
.same { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; font-size: 14px; }
.same th { text-align: left; background: var(--sand); padding: 10px 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.same td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.same tbody tr:nth-child(even) td { background: #FBFAF7; }
.same .th-cell { display: flex; gap: 10px; align-items: center; }
.same .th-cell img, .same .th-cell .ph { width: 56px; height: 42px; border-radius: 6px; flex: none; object-fit: cover; }
.same .th-cell a { color: var(--green); font-weight: 600; text-decoration: underline; }
.same tr.cur td { background: var(--gold-wash); }
.same .pc { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* similar listings rail */
.rail { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.mini { flex: none; width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-snap-align: start; display: block; }
.mini:hover { box-shadow: var(--shadow); }
.mini > img, .mini > .ph { display: block; width: 100%; height: 150px; object-fit: cover; }
.mini .mb { padding: 10px 12px; font-size: 13.5px; }
.mini .mb b { font-size: 17px; display: block; font-variant-numeric: tabular-nums; }
.mini .mb span { color: var(--ink-soft); display: block; }

/* costs + financing simulator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calc.one { grid-template-columns: minmax(0, 480px); }
.calc .box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.calc .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.calc .row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc .row.tot { border: 0; font-weight: 700; font-size: 16px; padding-top: 10px; }
.calc .fine { margin-top: 8px; }
.calc .res .btn { margin-top: 10px; }
.sl { display: flex; flex-direction: column; gap: 6px; font-size: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sl input[type=range] { width: 100%; accent-color: var(--green); }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.seg2 button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg2 button.on { border-color: var(--green); background: var(--gold-wash); }
.res .lbl { font-size: 13px; color: var(--ink-soft); }
.res .big { font-size: 34px; font-weight: 700; letter-spacing: -.8px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.care { display: flex; gap: 14px; background: #F1EFE8; border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; color: var(--ink-soft); }
.care .ico { color: var(--gold-dark); width: 22px; height: 22px; margin-top: 2px; }
.care a { text-decoration: underline; color: var(--ink); }

/* ---------- contact column ---------- */
.aside { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 14px; }
.contact { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.adv { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.adv .av { width: 56px; height: 56px; border-radius: 14px; background: var(--green); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; font-family: var(--font-serif); }
.adv .av.owner { background: var(--horizon-wash); color: var(--green); }
.adv .av .ico { width: 28px; height: 28px; }
.adv h3 { font-family: var(--font-sans); font-size: 16px; margin: 2px 0; line-height: 1.25; overflow-wrap: anywhere; }
.adv .meta { font-size: 12.5px; color: var(--ink-soft); }
/* 14/11: advertiser with a profile (mockup 2026-11-14-advertiser-card-logo-photo.html): broker photo 92 px, name 21 px,
   "Corretora · CRECI n", then a thin divider and only the small agency logo. Without a profile the card above stays. */
.adv.adv-profile { flex-direction: column; align-items: stretch; gap: 0; }
.adv-profile .adv-id { display: flex; gap: 14px; align-items: center; }
.adv-profile .av.av-photo { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; font-size: 24px; }
.adv-profile .av-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.adv-profile h3 { font-size: 21px; line-height: 1.2; margin: 1px 0 3px; }
.adv-profile .meta.role { font-size: 14px; font-weight: 600; color: var(--ink); }
.adv-profile .agency { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.adv-profile .logo { flex: none; width: 84px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; padding: 3px; overflow: hidden; }
.adv-profile .logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.adv-profile .tag { display: inline-block; font-size: 11.5px; font-weight: 600; background: var(--sand); color: var(--ink); border-radius: 999px; padding: 2px 9px; }
.adv-profile .tag:hover { background: var(--gold-wash); }
.ctabs { display: flex; border-bottom: 1px solid var(--line); }
.ctabs button { flex: 1; border: 0; background: none; padding: 12px; font-weight: 700; font-size: 14px; color: var(--ink-soft); border-bottom: 3px solid transparent; cursor: pointer; }
.ctabs button.on { color: var(--green); border-color: var(--gold); }
.cbody { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.cbody.cfoot { padding-top: 0; }
.cbody h4 { margin: 0; font-size: 15px; font-family: var(--font-sans); }
.panel { display: none; flex-direction: column; gap: 10px; }
.panel.on { display: flex; }
.fld { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.fld input, .fld textarea { border: 0; outline: 0; font: inherit; font-size: 14px; width: 100%; padding: 11px 0; background: none; resize: none; min-width: 0; }
.fld:focus-within { border-color: var(--green); }
.fld .ico { color: var(--ink-soft); }
.fine { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.fine a { text-decoration: underline; }
.visit-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.visit-days button, .visit-days label span { display: block; text-align: center; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font-size: 13px; cursor: pointer; }
.visit-days button.on, .visit-days input:checked + span { border-color: var(--green); background: var(--gold-wash); font-weight: 700; }
.visit-days input { position: absolute; opacity: 0; pointer-events: none; }
.visit-days label { position: relative; }
.visit-days input:focus-visible + span, .visit-days button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.inquiry-sent { background: #E7F6E9; border: 1px solid #B8E6C0; padding: 16px; margin: 16px 20px; border-radius: 8px; color: #1E5B2C; }
.gone-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-align: center; }
.gone-box h3 { margin: 0 0 6px; font-size: 18px; font-family: var(--font-sans); }
.gone-box p { margin: 0 0 14px; }

/* mobile sticky bar (hidden on desktop) */
.mbar { display: none; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; background: rgba(9,20,19,.97); z-index: 2000; display: flex; flex-direction: column; }
.lb[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; color: #fff; }
.lb-top button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.lb-stage { flex: 1; position: relative; display: grid; place-items: center; padding: 0 64px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav.l { left: 12px; } .lb-nav.r { right: 12px; }
.lb-thumbs { display: flex; gap: 8px; padding: 12px 20px 18px; overflow-x: auto; justify-content: safe center; }
.lb-thumbs button { flex: none; padding: 0; border: 0; background: none; cursor: pointer; opacity: .6; border-radius: 8px; }
.lb-thumbs button img { display: block; width: 74px; height: 52px; object-fit: cover; border-radius: 8px; }
.lb-thumbs button.on { opacity: 1; outline: 3px solid var(--gold); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) { .subnav { top: 56px; } } /* topbar is shorter once its menu collapses (base.css) */
@media (max-width: 1020px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .places { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .lp { padding: 0 14px; }
  .mosaic { grid-template-columns: 1fr !important; grid-template-rows: 1fr !important; height: 300px; border-radius: 14px; }
  .mosaic .m:not(:first-child) { display: none; }
  .mosaic .m:first-child { grid-row: auto !important; }
  h1.title { font-size: 23px; }
  .pricebox { grid-template-columns: 1fr; }
  .pricebox .big { font-size: 32px; }
  .pricebox .parts { grid-template-columns: repeat(2, auto); gap: 6px 14px; }
  .calc { grid-template-columns: 1fr; }
  .detail-map { height: 260px; }
  .breadcrumbs .sep, .breadcrumbs a:not(.back-to-search), .breadcrumbs span:not(.sep) { display: none; }
  .same thead { display: none; }
  .same, .same tbody, .same tr, .same td { display: block; width: 100%; }
  .same tr { padding: 10px 12px; border-top: 1px solid var(--line); }
  .same tbody tr:first-child { border-top: 0; }
  .same td { border: 0 !important; padding: 2px 0; background: none !important; }
  .same tr.cur { background: var(--gold-wash); }
  .same td[data-label] { display: inline-block; width: auto; margin-right: 14px; font-size: 13px; }
  .same td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-soft); }
  .same td.pc { display: block; margin: 4px 0; }
  .same td.pc::before { content: ""; }
  .mbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 800; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.1); }
  .mbar.one { grid-template-columns: 1fr; }
  body:has(.mbar) { padding-bottom: 72px; }
  .lb-stage { padding: 0 8px; }
  .inquiry-sent { margin: 16px; }
}
