/* 06-properties.css — Listings: property cards, the selection bar, the gallery, photo manager and upload
   strip, the detail page.
   Part of the CRM stylesheet: the files load in number order (components/app_styles.html) and later
   rules win, exactly as when this was one file. */

/* ---------- Property cards ---------- */
.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); transition: box-shadow .2s, transform .2s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pcard-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); opacity: .6; }
.pcard-media .ph svg { width: 42px; height: 42px; }
.pcard-media .tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 5px; }
.pcard-media .tags .badge { background: rgba(255, 255, 255, .92); color: var(--text); backdrop-filter: blur(4px); }
.pcard-media .count { position: absolute; right: 10px; bottom: 10px; }
.publish-logos { position: absolute; z-index: 2; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.channel-logo { display: block; width: 16px; height: 16px; flex: none; border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%; box-shadow: 0 1px 5px rgba(15, 23, 42, .4); box-sizing: content-box; }
.channel-logo svg { display: block; width: 100%; height: 100%; }
.row > .channel-logo { border-width: 0; box-shadow: none; width: 20px; height: 20px; }
.pcard.sold .pcard-media img, .pcard.sold .pcard-media .ph { filter: grayscale(.9); opacity: .55; }
.sold-ribbon { position: absolute; inset: auto 0 0 0; padding: 7px 10px; background: rgba(15, 23, 42, .86); color: #fff; font-size: 12.5px; font-weight: 700; }
.pcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pcard-price { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.pcard-price small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pcard-title { font-size: 14px; font-weight: 600; }
.pcard-addr { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.specs { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.specs span { display: inline-flex; align-items: center; gap: 4px; }
.specs svg { color: var(--faint); }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.selection-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
/* Floats over the list only while homes are selected. */
.selection-bar { position: fixed; z-index: 40; left: calc(var(--sidebar-w) + (100% - var(--sidebar-w)) / 2); bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--dark); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; }
.selection-bar[hidden] { display: none; }
.selection-bar .btn-ghost { color: rgba(255, 255, 255, .75); }
.selection-bar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
body.has-selection-bar .panel { padding-bottom: 96px; }
.selectable-property { position: relative; display: flex; min-width: 0; }
.selectable-property .pcard { width: 100%; }
.selectable-property.selected .pcard { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.property-picker { position: absolute; z-index: 5; right: 36px; top: 9px; display: grid; width: 20px; height: 20px; cursor: pointer; }
.property-picker input { position: absolute; opacity: 0; pointer-events: none; }
.property-picker span { display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.95); border-radius: 50%; color: transparent; background: rgba(15,23,42,.58); box-shadow: 0 1px 5px rgba(15,23,42,.35); transition: background .15s, transform .15s; }
.property-picker:hover span { transform: scale(1.08); }
.property-picker input:checked + span { color: #fff; background: #2563eb; }
.property-picker .i { width: 12px; height: 12px; stroke-width: 3; }

.gallery { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; border-radius: 12px; overflow: hidden; }
.gallery .main-img { aspect-ratio: 16 / 10; background: var(--surface-3); position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
/* The cover photo is shown whole: an upright phone photo cropped to 16:10 lost the floor and the ceiling. The bars
   beside it are the same photo, blurred. */
.gallery .main-img { overflow: hidden; }
.gallery .main-img::before { content: ""; position: absolute; inset: -24px; background: var(--photo) center / cover no-repeat; filter: blur(22px) brightness(.85); }
.gallery .main-img img.whole { position: relative; object-fit: contain; }
.gallery .thumbs { display: grid; grid-template-rows: repeat(2, 1fr); gap: 8px; }
.gallery .thumbs > div { background: var(--surface-3); position: relative; overflow: hidden; }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 23, 42, .5); color: #fff; font-weight: 700; font-size: 15px; }
.image-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.image-manager .thumb { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); cursor: grab; touch-action: none; user-select: none; }
.image-manager .thumb.is-dragging { opacity: .45; outline: 2px solid var(--accent); cursor: grabbing; }
.image-manager img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.image-manager .thumb-action { position: absolute; top: 5px; right: 5px; pointer-events: auto; touch-action: manipulation; }
.thumb-badge { position: absolute; left: 5px; bottom: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(15, 23, 42, .72); color: #fff; font-size: 11px; font-weight: 700; pointer-events: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 28px; height: 28px; color: var(--accent); }
.dropzone input { display: none; }
.preview-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.preview-strip:empty { display: none; }
.preview-strip .thumb { width: 72px; height: 72px; position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); cursor: grab; touch-action: none; user-select: none; }
.preview-strip .thumb.is-dragging { opacity: .45; outline: 2px solid var(--accent); cursor: grabbing; }
.preview-strip img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Photos uploading one by one from the listing form: a spinner while on the way, red with ↻ when it failed. */
.preview-strip .thumb[data-state="uploading"] img { opacity: .45; }
.preview-strip .thumb[data-state="uploading"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: upload-spin .8s linear infinite; pointer-events: none; }
.preview-strip .thumb[data-state="failed"] { border-color: var(--red); cursor: pointer; }
.preview-strip .thumb[data-state="failed"] img { opacity: .3; }
.preview-strip .thumb[data-state="failed"]::after { content: "↻"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--red); font-size: 24px; font-weight: 700; pointer-events: none; }
.thumb-remove { position: absolute; top: 3px; right: 3px; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .72); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; touch-action: manipulation; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sticky { position: sticky; top: 16px; }
.spec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.spec { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.spec .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.spec .v { font-size: 15px; font-weight: 800; margin-top: 2px; }
.price-box { padding: 16px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--accent-soft-2); }
.price-box .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

