/* Listings, listing detail, sign-up gate and terms notice. Builds on styles.css tokens. */

[hidden] { display: none !important; }   /* .btn and .lx-empty set display, which would otherwise override hidden */

.lx-head { padding-block: 40px 8px; }
.lx-head h1 { font-size: clamp(32px, 4.4vw, 52px); }
.lx-head .lede { margin-top: 10px; }

/* ---------- Filter bar ---------- */
.lx-filters { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; }
.lx-filters .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lx-filters .tabs button { border: 1px solid var(--line-strong); background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--wine-deep); transition: background .25s, color .25s; }
.lx-filters .tabs button[aria-pressed="true"] { background: var(--wine); color: #fff; border-color: var(--wine); }
.lx-fields { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr auto auto; gap: 10px; align-items: end; }
.lx-fields label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.lx-fields input, .lx-fields select { height: 46px; border: 1px solid var(--line-strong); background: #fff; padding: 0 12px; border-radius: 2px; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); min-width: 0; width: 100%; }
.lx-fields .btn { height: 46px; }

.lx-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 0 14px; color: var(--muted); font-size: 14px; }
.lx-meta b { color: var(--wine-deep); font-weight: 500; }

/* ---------- Cards ---------- */
.lx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.lx-card { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s; min-width: 0; }
.lx-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lx-card .ph { position: relative; aspect-ratio: 4 / 3; background: var(--blush-pale); overflow: hidden; }
.lx-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.lx-card .ph .count { position: absolute; right: 10px; bottom: 10px; background: rgba(31, 26, 28, .72); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.lx-card .bd { padding: 14px 16px 16px; display: grid; gap: 4px; flex: 1; }
.lx-card .price { font-family: var(--display); font-size: 28px; color: var(--wine-deep); line-height: 1.1; }
.lx-card .addr { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-card .specs { font-size: 13.5px; color: var(--muted); }
.lx-card .brk { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--wine); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }

.lx-more { display: flex; justify-content: center; margin: 34px 0 10px; }
.lx-empty { background: var(--surface); border: 1px solid var(--line); padding: 34px clamp(20px, 4vw, 44px); display: grid; gap: 14px; max-width: 760px; }
.lx-empty h2 { font-size: clamp(26px, 3vw, 36px); }
.lx-skel { background: linear-gradient(90deg, var(--blush-pale), #fff, var(--blush-pale)); background-size: 200% 100%; animation: lx-sh 1.4s infinite linear; aspect-ratio: 4 / 4.2; border: 1px solid var(--line); }
@keyframes lx-sh { to { background-position: -200% 0; } }

/* ---------- Lead forms ---------- */
.lead-form { display: grid; gap: 12px; }
.lead-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lead-form input[type=text], .lead-form input[type=email], .lead-form input[type=tel], .lead-form select, .lead-form textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; padding: 12px 14px; border-radius: 2px; font-size: 15px; color: var(--ink); min-width: 0;
}
.lead-form textarea { min-height: 96px; resize: vertical; font: inherit; }
.lead-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.lead-form .check input { margin-top: 3px; accent-color: var(--wine); width: 16px; height: 16px; flex: none; }
.lead-form .msg { min-height: 1.3em; font-size: 14px; color: var(--wine); }
.lead-form .btn { width: 100%; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alt-contact { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); align-items: center; }
.alt-contact a { color: var(--wine); border-bottom: 1px solid var(--line-strong); }

/* ---------- Gate (sign-up before full listing) ---------- */
.gate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(31, 14, 20, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.gate[hidden] { display: none; }
.gate-card { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-top: 4px solid var(--wine); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); padding: clamp(22px, 4vw, 34px); display: grid; gap: 14px; animation: gate-in .5s var(--ease); }
.gate-card h2 { font-size: clamp(26px, 3.2vw, 34px); }
.gate-card p { margin: 0; color: var(--muted); font-size: 15px; }
.gate-teaser { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 10px; }
.gate-teaser img, .gate-teaser .noimg { width: 96px; height: 72px; object-fit: cover; background: var(--blush-pale); font-size: 10px; }
.gate-teaser b { font-family: var(--display); font-size: 22px; color: var(--wine-deep); font-weight: 500; display: block; line-height: 1.1; }
.gate-teaser span { font-size: 13px; color: var(--muted); }
@keyframes gate-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
body.gated main .ld-body { filter: blur(7px); pointer-events: none; user-select: none; }

/* ---------- Listing detail ---------- */
.ld-back { display: inline-flex; gap: 8px; align-items: center; margin: 28px 0 16px; color: var(--wine); font-size: 14px; }
.ld-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; height: clamp(260px, 46vw, 520px); }
.ld-gallery .main { position: relative; overflow: hidden; background: var(--blush-pale); }
.ld-gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.ld-gallery .side { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; min-height: 0; }
.ld-gallery .side div { overflow: hidden; background: var(--blush-pale); min-height: 0; }
.ld-gallery .side img { width: 100%; height: 100%; object-fit: cover; }
.ld-gallery button.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); cursor: pointer; font-size: 20px; color: var(--wine-deep); }
.ld-gallery button.prev { left: 12px; } .ld-gallery button.next { right: 12px; }
.ld-gallery .count { position: absolute; left: 12px; bottom: 12px; background: rgba(31, 26, 28, .72); color: #fff; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }
.ld-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; margin-top: 30px; align-items: start; }
.ld-price { font-family: var(--display); font-size: clamp(36px, 4.6vw, 52px); color: var(--wine-deep); line-height: 1; }
.ld-addr { font-size: 18px; margin-top: 8px; }
.ld-specs { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin-top: 8px; }
.ld-brk { margin-top: 14px; font-size: 15px; color: var(--ink); }
.ld-brk b { font-weight: 500; }
.ld-sec { margin-top: 34px; }
.ld-sec h2 { font-size: clamp(24px, 2.6vw, 30px); margin-bottom: 12px; }
.ld-remarks { white-space: pre-line; margin: 0; }
.ld-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.ld-facts div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.ld-facts dt { color: var(--muted); } .ld-facts dd { margin: 0; overflow-wrap: anywhere; }
.ld-rooms { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ld-rooms td, .ld-rooms th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ld-rooms th { font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.ld-side { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; }
.ld-side .agent { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.ld-side .agent img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.ld-side .agent b { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--wine-deep); display: block; line-height: 1.1; }
.ld-side .agent span { font-size: 13px; color: var(--muted); }
.ld-fine { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.ld-fine img { width: 125px; height: auto; }

/* ---------- Terms notice (DDF® browse-wrap) ---------- */
.terms-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; max-width: 760px; margin-inline: auto; background: var(--wine-deep); color: rgba(255, 255, 255, .88); padding: 14px 16px; display: flex; gap: 14px; align-items: center; font-size: 13.5px; line-height: 1.45; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .5); }
.terms-bar a { color: #fff; text-decoration: underline; }
.terms-bar button { flex: none; height: 38px; padding: 0 18px; border: 1px solid #fff; background: #fff; color: var(--wine-deep); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.terms-bar[hidden] { display: none; }

.terms { max-width: 820px; padding-block: 48px 72px; }
.terms h1 { font-size: clamp(34px, 4.4vw, 50px); margin-bottom: 18px; }
.terms h2 { font-size: 26px; margin: 30px 0 10px; }
.terms p { margin: 0 0 12px; }

/* ---------- Filters button, chips, sort ---------- */
.lx-fbtn { height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--line-strong); background: #fff; color: var(--wine-deep); font: inherit; font-size: 14px; letter-spacing: .04em; border-radius: 2px; cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s; }
.lx-fbtn:hover { border-color: var(--wine); background: var(--blush-pale); }
.lx-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wine); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.lx-badge[hidden] { display: none; }
.lx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--blush-pale); color: var(--wine-deep); padding: 6px 10px 6px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.lx-chip span { font-size: 16px; line-height: 1; opacity: .7; }
.lx-chip:hover { border-color: var(--wine); } .lx-chip:hover span { opacity: 1; }
.lx-chip-clear { border: 0; background: none; color: var(--wine); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px 4px; }
.lx-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lx-sort[hidden] { display: none; }
.lx-sort select { height: 38px; border: 1px solid var(--line-strong); background: #fff; padding: 0 10px; border-radius: 2px; font: inherit; font-size: 14px; color: var(--ink); }
.lx-meta { align-items: center; }

/* ---------- Filters panel (centred dialog on desktop, bottom sheet on phones) ---------- */
body.lx-locked { overflow: hidden; }
.lx-panel { position: fixed; inset: 0; z-index: 90; background: rgba(31, 14, 20, .5); display: grid; place-items: center; padding: 16px; }
.lx-panel[hidden] { display: none; }
.lx-panel-card { width: min(620px, 100%); max-height: calc(100vh - 32px); background: var(--surface); display: grid; grid-template-rows: auto 1fr auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: gate-in .35s var(--ease); }
.lx-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.lx-panel-head h2 { font-size: 28px; }
.lx-x { width: 40px; height: 40px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--wine-deep); cursor: pointer; border-radius: 50%; }
.lx-x:hover { background: var(--blush-pale); }
.lx-panel-body { overflow: auto; padding: 6px 22px 18px; overscroll-behavior: contain; }
.lx-group { border: 0; padding: 16px 0 0; margin: 0; min-width: 0; }
.lx-group legend { float: left; width: 100%; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; padding: 0; }
.lx-group + .lx-group, .lx-two { border-top: 1px solid var(--line); margin-top: 16px; }
.lx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lx-two .lx-group { border-top: 0; margin-top: 0; }
.lx-group > :not(legend) { clear: both; }
.lx-group select { width: 100%; height: 44px; border: 1px solid var(--line-strong); background: #fff; padding: 0 10px; border-radius: 2px; font: inherit; font-size: 15px; color: var(--ink); min-width: 0; }
.lx-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.lx-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-pills button { border: 1px solid var(--line-strong); background: #fff; color: var(--wine-deep); padding: 9px 16px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; min-width: 56px; transition: background .2s, color .2s; }
.lx-pills button:hover { border-color: var(--wine); }
.lx-pills button[aria-checked="true"] { background: var(--wine); border-color: var(--wine); color: #fff; }
.lx-panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--paper); }
.lx-clear { border: 0; background: none; color: var(--wine); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 8px 0; }
.lx-panel-foot .btn { min-width: 180px; }

/* ---------- List / Map toggle ---------- */
.lx-tools { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lx-view { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: #fff; }
.lx-view[hidden] { display: none; }
.lx-view button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; color: var(--wine-deep); cursor: pointer; }
.lx-view button[aria-pressed="true"] { background: var(--wine); color: #fff; }

/* ---------- Map view: list + map side by side on computers, full map on phones ---------- */
.lx-results.map-on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.lx-results.map-on .lx-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.lx-mapwrap { position: sticky; top: 74px; height: calc(100vh - 90px); min-height: 420px; border: 1px solid var(--line); background: var(--blush-pale); }
.lx-mapwrap[hidden] { display: none; }
.lx-map { position: absolute; inset: 0; z-index: 0; font-family: inherit; }
.lx-area { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; border: 0; background: var(--wine); color: #fff; font: inherit; font-size: 14px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .45); cursor: pointer; white-space: nowrap; }
.lx-area[hidden], .lx-maploading[hidden], .lx-mapnote[hidden] { display: none; }
.lx-maploading { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; background: #fff; color: var(--wine-deep); font-size: 13.5px; padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .35); }
.lx-mapnote { position: absolute; left: 12px; right: 12px; bottom: 26px; z-index: 500; background: rgba(255, 255, 255, .95); color: var(--ink); font-size: 13px; padding: 8px 12px; border-radius: 6px; box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .3); text-align: center; }

/* price pins */
.lx-pin { background: none; border: 0; }
.lx-pin span { position: absolute; transform: translate(-50%, calc(-100% - 7px)); background: var(--wine); color: #fff; font-size: 12.5px; font-weight: 500; padding: 4px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 3px 8px -2px rgba(0, 0, 0, .4); border: 1.5px solid #fff; cursor: pointer; transition: transform .15s, background .15s; }
.lx-pin span::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--wine); border-bottom: 0; }
.lx-pin:hover span, .lx-pin.on span { background: var(--wine-deep); transform: translate(-50%, calc(-100% - 7px)) scale(1.12); }
.lx-pin.on { z-index: 1000 !important; }
.lx-cl { background: none; }
.lx-cl span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--wine); color: #fff; font-size: 13.5px; font-weight: 500; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 5px rgba(91, 26, 44, .25); }

/* pin pop-up */
.lx-map .leaflet-popup-content-wrapper { border-radius: 8px; padding: 0; overflow: hidden; }
.lx-map .leaflet-popup-content { margin: 0; width: 240px !important; font-family: inherit; }
.lx-pop { display: block; color: var(--ink); text-decoration: none; }
.lx-pop img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--blush-pale); }
.lx-pop .pb { display: grid; gap: 2px; padding: 10px 12px 12px; font-size: 13px; }
.lx-pop b { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--wine-deep); line-height: 1.1; }
.lx-pop .sp, .lx-pop .brk { color: var(--muted); font-size: 12.5px; }
.lx-pop .go { color: var(--wine); margin-top: 4px; font-size: 13px; }

@media (max-width: 900px) {
  .lx-results.map-on { display: block; }
  .lx-results.map-on .lx-list { display: none; }
  .lx-mapwrap { position: relative; top: 0; height: 72vh; min-height: 380px; }
  .lx-fields { grid-template-columns: 1fr 1fr; }
  .lx-fields label:first-child, .lx-fields .btn { grid-column: 1 / -1; }
  .ld-grid { grid-template-columns: 1fr; }
  .ld-side { position: static; }
  .ld-gallery { grid-template-columns: 1fr; }
  .ld-gallery .side { display: none; }
}
@media (max-width: 600px) {
  .lx-panel { padding: 0; place-items: end stretch; }
  .lx-panel-card { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .lx-panel-foot .btn { flex: 1; min-width: 0; }
  .lx-fbtn { justify-content: center; }
  .ld-facts { grid-template-columns: 1fr; }
  .lead-form .row { grid-template-columns: 1fr; }
  .terms-bar { flex-direction: column; align-items: stretch; }
}
