/* ============================================================
   Shared property card (includes/property-card.php).
   Self-contained: own class prefix (.cp-pcard-*) so the template's
   .property-listing / .property-1 rules in styles.css, cp-theme.css
   and header.php's inline <style> don't reach it.
   ============================================================ */
.cp-pcard {
	--pc-brand: #0f766e;
	--pc-brand-soft: #e6f4f2;
	--pc-ink: #14213d;
	--pc-muted: #64748b;
	--pc-line: #e5e9f0;
	--pc-wa: #128c4b;
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	/* Grid/flex items default to min-width:auto, which let the no-wrap
	   location line and button row push the card wider than a phone screen. */
	min-width: 0;
	max-width: 100%;
	background: #fff;
	border: 1px solid var(--pc-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(20, 33, 61, .06);
	transition: box-shadow .2s ease, transform .2s ease;
	font-family: inherit;
	text-align: left;
}
.cp-pcard:hover { box-shadow: 0 10px 28px rgba(20, 33, 61, .12); transform: translateY(-3px); }

/* ── Photo (flags top-left, actions top-right, both over the photo) ── */
.cp-pcard-top { position: relative; }
.cp-pcard-media { display: block; aspect-ratio: 16 / 10; background: #eef2f6; overflow: hidden; border-bottom: 3px solid var(--pc-brand); } /* divider: photo | details */
@supports not (aspect-ratio: 16 / 10) { .cp-pcard-media { height: 180px; } }
.cp-pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; margin: 0; max-width: none; }
.cp-pcard:hover .cp-pcard-media img { transform: scale(1.04); }
.cp-pcard-flags { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.cp-pcard-tag, .cp-pcard-new {
	font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
	padding: 3px 8px; border-radius: 6px; line-height: 1.4; color: #fff;
}
.cp-pcard-tag { background: rgba(15, 118, 110, .92); }
.cp-pcard-new { background: #f59e0b; }
.cp-pcard-featured { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; line-height: 1.4;
	color: #422006; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.cp-pcard.is-sold .cp-pcard-tag { background: #dc2626; }
.cp-pcard.is-sold .cp-pcard-media img { filter: grayscale(.6); }

/* ── Save / share / compare ── */
.cp-pcard-actions { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 5px; }
.cp-pcard-act {
	width: 30px; height: 30px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .95); color: var(--pc-ink);
	border: 0; padding: 0; cursor: pointer; font-size: 13px; line-height: 1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15); text-decoration: none;
	transition: background .15s, color .15s;
}
.cp-pcard-act:hover { background: var(--pc-brand); color: #fff; text-decoration: none; }
.cp-pcard-act.is-on, .cp-pcard-act.is-on:hover { color: #e11d48; background: #fff; }

/* ── Body ── */
.cp-pcard-body { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.cp-pcard-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap;
	padding-bottom: 7px; border-bottom: 1px solid var(--pc-line); } /* divider: price | title */
.cp-pcard-price { font-size: 18px; font-weight: 800; color: var(--pc-ink); line-height: 1.2; }
.cp-pcard-rate { font-size: 11.5px; font-weight: 600; color: var(--pc-brand); background: var(--pc-brand-soft); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.cp-pcard-title { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.cp-pcard-title a {
	color: var(--pc-ink); text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cp-pcard-title a:hover { color: var(--pc-brand); }
.cp-pcard-loc { margin: 0; font-size: 12.5px; color: var(--pc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-pcard-loc i { color: var(--pc-brand); margin-right: 6px; }
.cp-pcard-facts { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--pc-line); display: flex; flex-wrap: wrap; gap: 5px; } /* divider: title & location | facts */
.cp-pcard-facts:not(:has(li)) { display: none; } /* no facts -> no stray divider line */
.cp-pcard-facts li {
	margin: 0; padding: 3px 8px; font-size: 11.5px; font-weight: 600; color: #334155;
	background: #f4f6f9; border-radius: 6px; line-height: 1.4; list-style: none;
}
.cp-pcard-facts li i { color: var(--pc-muted); margin-right: 5px; font-size: 11px; }
.cp-pcard-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-pcard-badges span { font-size: 11px; font-weight: 700; color: #15803d; background: #ecfdf3; padding: 2px 7px; border-radius: 6px; }
.cp-pcard-badges i { margin-right: 4px; }
.cp-pcard-meta {
	margin-top: auto; padding-top: 7px; border-top: 1px solid var(--pc-line); /* divider: facts | owner & ID (was dashed) */
	display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--pc-muted);
}
/* Template styles.css sizes bare <span>s at 15px; pin the card's own. */
.cp-pcard .cp-pcard-meta span { font-size: 12px; line-height: 1.4; color: var(--pc-muted); }
.cp-pcard-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; white-space: nowrap; }

/* ── Call / WhatsApp / View ── */
.cp-pcard-cta { display: flex; gap: 6px; padding: 0 14px 14px; }
.cp-pcard-btn {
	flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
	height: 34px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
	text-decoration: none; border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s;
	white-space: nowrap;
}
.cp-pcard-btn:hover { text-decoration: none; }
.cp-pcard-btn.is-call { color: var(--pc-brand); border-color: var(--pc-brand); background: #fff; }
.cp-pcard-btn.is-call:hover { background: var(--pc-brand); color: #fff; }
.cp-pcard-btn.is-wa { color: #fff; background: var(--pc-wa); }
.cp-pcard-btn.is-wa:hover { background: #0e6e3b; color: #fff; }
.cp-pcard-btn.is-view { color: #fff; background: var(--pc-ink); flex: .8; }
.cp-pcard-btn.is-view:hover { background: var(--pc-brand); color: #fff; }
.cp-pcard-btn.is-view:only-child { flex: 1; } /* sold listings: no Call/WhatsApp */
/* Account pages (My Properties / Saved): Edit, Delete, Remove */
.cp-pcard-btn.is-edit { color: var(--pc-brand); border-color: var(--pc-brand); background: #fff; }
.cp-pcard-btn.is-edit:hover { background: var(--pc-brand); color: #fff; }
.cp-pcard-btn.is-danger { color: #be123c; border-color: #fecdd3; background: #fff1f2; }
.cp-pcard-btn.is-danger:hover { background: #be123c; border-color: #be123c; color: #fff; }
.cp-pcard-status { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; line-height: 1.4; color: #fff; }
.cp-pcard-status.is-warn { background: #d97706; }
.cp-pcard-status.is-ok { background: #15803d; }
.cp-pcard-status.is-bad { background: #b91c1c; }
.cp-pcard-note { font-size: 12.5px; line-height: 1.4; color: #475569; background: #f8fafc; border-left: 3px solid #94a3b8; padding: 6px 9px; border-radius: 4px; }
.cp-pcard-note.is-bad { color: #9a3412; background: #fff7ed; border-left-color: #ea580c; }

/* ── Grid helper for pages that want it (optional) ── */
.cp-pcard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1280px) { .cp-pcard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .cp-pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .cp-pcard-grid { grid-template-columns: 1fr; gap: 16px; } }
/* Account pages sit next to a 230px sidebar: fit as many ≥260px cards as the space allows. */
.cp-pcard-grid.cp-pcard-grid-dash { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
@media (max-width: 600px) { .cp-pcard-grid.cp-pcard-grid-dash { grid-template-columns: 1fr; } }

@media (max-width: 400px) {
	.cp-pcard-btn { font-size: 12px; }
	.cp-pcard-btn i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.cp-pcard, .cp-pcard-media img { transition: none; }
	.cp-pcard:hover, .cp-pcard:hover .cp-pcard-media img { transform: none; }
}
