/**
 * Baglien Spark Sync — Single Listing (PDP) redesign.
 *
 * Mosaic gallery + two-column layout with a sticky contact card.
 * Class prefix: .bss-pdp-*  (scoped so it will not collide with theme styles).
 */

.bss-pdp {
	--bss-radius: 12px;
	--bss-gap: 8px;
	--bss-border: #e0e0e0;
	--bss-muted: #6f6f6f;
	--bss-ink: #282828;
	--bss-accent: #282828;
	--bss-red: #de080a;
	--bss-light: #f2f5f7;
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 16px 64px;
	color: var(--bss-ink);
}

/* ── Mosaic gallery ───────────────────────────────────────────────────────── */
.bss-pdp-gallery {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--bss-gap);
	margin: 24px 0 32px;
	/* One capped height drives the whole component; both columns fill it. */
	height: clamp( 340px, 42vw, 520px );
}

.bss-pdp-hero,
.bss-pdp-thumb {
	margin: 0;
	padding: 0;
	border: 0;
	cursor: pointer;
	overflow: hidden;
	border-radius: var(--bss-radius);
	background: #f1f5f9;
	display: block;
	height: 100%;
	min-height: 0; /* allow the image to shrink inside the grid track */
}

.bss-pdp-hero img,
.bss-pdp-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}

.bss-pdp-hero:hover img,
.bss-pdp-thumb:hover img {
	transform: scale( 1.03 );
}

.bss-pdp-thumbs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: var(--bss-gap);
	height: 100%;
	min-height: 0;
}

.bss-pdp-allphotos {
	position: absolute;
	right: 16px;
	bottom: 16px;
	background: #fff;
	color: var(--bss-ink);
	border: 1px solid var(--bss-border);
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, .12 );
}

.bss-pdp-allphotos:hover {
	background: #f8fafc;
}

/* ── Two-column body ──────────────────────────────────────────────────────── */
.bss-pdp-body {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 360px;
	gap: 48px;
	align-items: start;
}

.bss-pdp-main {
	min-width: 0;
}

.bss-pdp-stats {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
}

.bss-pdp-stats li {
	font-size: 15px;
	color: var(--bss-muted);
}

.bss-pdp-stat-v {
	font-weight: 700;
	color: var(--bss-ink);
}

.bss-pdp-price {
	font-size: 32px;
	font-weight: 800;
	line-height: 1.1;
	margin: 4px 0 6px;
}

.bss-pdp-title {
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 16px;
}

.bss-pdp-chip {
	display: inline-flex;
	flex-direction: column;
	border: 1px solid var(--bss-border);
	border-radius: 10px;
	padding: 10px 16px;
	margin-bottom: 24px;
}

.bss-pdp-chip-label {
	font-size: 12px;
	color: var(--bss-muted);
}

.bss-pdp-chip-value {
	font-size: 15px;
	font-weight: 600;
}

.bss-pdp-section {
	border-top: 1px solid var(--bss-border);
	padding-top: 28px;
	margin-top: 28px;
}

.bss-pdp-section h2 {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 14px;
}

.bss-pdp-overview {
	line-height: 1.7;
	color: #334155;
}

.bss-pdp-address {
	color: var(--bss-muted);
	margin: 0 0 14px;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */
.bss-pdp-map {
	width: 100%;
	height: 320px;
	border-radius: var(--bss-radius);
	overflow: hidden;
	border: 1px solid var(--bss-border);
	z-index: 0; /* keep Leaflet panes under sticky header */
}

.bss-pdp-map-fallback a {
	font-weight: 600;
}

/* ── Details table ────────────────────────────────────────────────────────── */
.bss-pdp-details {
	margin: 0;
}

.bss-pdp-detail-row {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--bss-border);
}

.bss-pdp-detail-row dt {
	color: var(--bss-muted);
	margin: 0;
}

.bss-pdp-detail-row dd {
	margin: 0;
	font-weight: 600;
}

/* ── Sticky contact card ──────────────────────────────────────────────────── */
.bss-pdp-aside {
	position: sticky;
	top: 100px; /* 84px header + 16px gap */
}

.bss-pdp-card {
	border: 1px solid var(--bss-border);
	border-radius: var(--bss-radius);
	padding: 20px;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, .06 );
	background: #fff;
}

.bss-pdp-agent {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.bss-pdp-agent-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--bss-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex: 0 0 auto;
}

.bss-pdp-agent-avatar--img {
	width: 56px;
	height: 56px;
	background: none;
	overflow: hidden;
}

.bss-pdp-agent-avatar--img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bss-pdp-agent-name {
	font-weight: 700;
}

.bss-pdp-agent-office {
	font-size: 13px;
	color: var(--bss-muted);
}

.bss-pdp-notice {
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	margin-bottom: 14px;
}

.bss-pdp-notice--ok {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.bss-pdp-notice--err {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.bss-pdp-field {
	margin: 0 0 12px;
}

.bss-pdp-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 4px;
}

.bss-req {
	color: #dc2626;
}

.bss-pdp-field input,
.bss-pdp-field textarea {
	width: 100%;
	border: 1px solid var(--bss-border);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
}

.bss-pdp-field input:focus,
.bss-pdp-field textarea:focus {
	outline: 2px solid var(--bss-accent);
	outline-offset: 1px;
	border-color: var(--bss-accent);
}

.bss-pdp-submit {
	width: 100%;
	background: var(--bss-accent);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 13px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.bss-pdp-submit:hover {
	opacity: .9;
}

/* Honeypot — keep in DOM, off screen. */
.bss-pdp-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.bss-pdp-lightbox {
	border: 0;
	padding: 0;
	max-width: 92vw;
	max-height: 92vh;
	width: 1000px;
	border-radius: var(--bss-radius);
	background: #fff;
}

.bss-pdp-lightbox::backdrop {
	background: rgba( 0, 0, 0, .8 );
}

.bss-pdp-lightbox-close {
	position: sticky;
	top: 0;
	float: right;
	margin: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, .2 );
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}

.bss-pdp-lightbox-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 16px;
}

.bss-pdp-lightbox-grid img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 8px;
}

/* ── Top stats (beds · baths · sqft, above price) ─────────────────────────── */
.bss-pdp-topstats {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	margin: 0 0 10px;
}

.bss-pdp-topstat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 15px;
	font-weight: 600;
	color: #282828;
}

.bss-pdp-topstat-icon {
	color: #282828;
	line-height: 0;
}

.bss-pdp-topstat-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* ── Facts grid ───────────────────────────────────────────────────────────── */
.bss-pdp-facts {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 16px;
	margin: 22px 0 8px;
}

.bss-pdp-fact {
	border: 1px solid var(--bss-border);
	border-radius: 12px;
	padding: 18px;
	display: flex;
	flex-direction: column;
}

.bss-pdp-fact-icon {
	color: #282828;
	margin-bottom: 10px;
}

.bss-pdp-fact-icon svg {
	width: 22px;
	height: 22px;
	display: block;
}

.bss-pdp-fact-label {
	font-size: 13px;
	font-weight: 600;
	color: #6f6f6f;
	margin-bottom: 2px;
}

.bss-pdp-fact-value {
	font-size: 18px;
	font-weight: 700;
	color: #282828;
	line-height: 1.2;
}

@media ( max-width: 640px ) {
	.bss-pdp-facts {
		grid-template-columns: 1fr 1fr;
	}
}

@media ( max-width: 400px ) {
	.bss-pdp-facts {
		grid-template-columns: 1fr;
	}
}

/* ── Overview status line ─────────────────────────────────────────────────── */
.bss-pdp-status {
	color: var(--bss-muted);
	font-size: 14px;
	margin: 0 0 14px;
}

.bss-pdp-sep {
	opacity: .45;
	margin: 0 4px;
}

/* ── Copy address ─────────────────────────────────────────────────────────── */
.bss-pdp-copy {
	margin-top: 14px;
	padding: 9px 18px;
	border: 1px solid var(--bss-border);
	border-radius: 8px;
	background: #fff;
	color: var(--bss-ink);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.bss-pdp-copy:hover {
	background: #f8fafc;
}

/* ── Listing courtesy ─────────────────────────────────────────────────────── */
.bss-pdp-courtesy {
	margin-top: 24px;
	font-size: 13px;
	color: var(--bss-muted);
}

/* ── Full-width disclaimer ────────────────────────────────────────────────── */
.bss-pdp-disclaimer {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--bss-border);
	font-size: 12px;
	line-height: 1.6;
	color: var(--bss-muted);
}

/* ── Virtual tour ─────────────────────────────────────────────────────────── */
.bss-pdp-vtour-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 16px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #0f172a;
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.bss-pdp-vtour-badge::before {
	content: "▶";
	font-size: 0.7rem;
}

.bss-pdp-vtour-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 24px;
	border-radius: 8px;
	background: var(--bss-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
}

.bss-pdp-vtour-btn::before {
	content: "▶";
	font-size: 0.8rem;
}

.bss-pdp-vtour-btn:hover {
	opacity: .9;
	color: #fff;
}

/* ── Contact buttons + popup ──────────────────────────────────────────────── */
.bss-pdp-cta-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bss-pdp-cta {
	width: 100%;
	border-radius: 8px;
	padding: 13px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	border: 1px solid var(--bss-accent);
}

.bss-pdp-cta--primary {
	background: var(--bss-accent);
	border-color: var(--bss-accent);
	color: #fff;
}

.bss-pdp-cta--primary:hover {
	background: var(--bss-red);
	border-color: var(--bss-red);
	color: #fff;
}

.bss-pdp-cta--secondary {
	background: #fff;
	color: var(--bss-accent);
	border-color: var(--bss-border);
}

.bss-pdp-cta--secondary:hover {
	background: var(--bss-light);
}

/* WhatsApp CTA — white, matching the site buttons */
.bss-pdp-whatsapp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #fff;
	border-color: var(--bss-border);
	color: var(--bss-accent);
	text-decoration: none;
}

.bss-pdp-whatsapp:hover {
	background: var(--bss-red);
	border-color: var(--bss-red);
	color: #fff;
}

.bss-pdp-wa-icon {
	line-height: 0;
}

.bss-pdp-wa-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.bss-pdp-form-modal {
	border: 0;
	padding: 24px;
	width: 440px;
	max-width: 92vw;
	border-radius: var(--bss-radius);
	background: #fff;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, .25 );
}

.bss-pdp-form-modal::backdrop {
	background: rgba( 0, 0, 0, .55 );
}

.bss-pdp-form-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--bss-muted);
}

.bss-pdp-form-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px;
	padding-right: 32px;
}

.bss-pdp-listing-ctx {
	font-size: 13px;
	color: var(--bss-muted);
	margin: -8px 0 16px;
}

/* Easy Appointments widget fits the dialog width. */
.bss-pdp-form-modal .ea-bootstrap {
	max-width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media ( max-width: 900px ) {
	.bss-pdp-body {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.bss-pdp-aside {
		position: static;
	}
}

@media ( max-width: 640px ) {
	.bss-pdp-gallery {
		grid-template-columns: 1fr;
		height: auto; /* stacked: let images use intrinsic ratios */
	}

	.bss-pdp-hero {
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.bss-pdp-thumbs {
		grid-template-rows: 1fr;
		grid-template-columns: 1fr 1fr;
		height: auto;
	}

	.bss-pdp-thumb {
		height: auto;
		aspect-ratio: 1 / 1;
	}

	.bss-pdp-thumb:nth-child( n + 3 ) {
		display: none;
	}

	.bss-pdp-detail-row {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.bss-pdp-lightbox-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Social share row ─────────────────────────────────────────────────────── */
.bss-pdp-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 4px;
}
.bss-pdp-share-label {
	font-size: 13px;
	font-weight: 600;
	color: #6f6f6f;
	margin-right: 4px;
}
.bss-pdp-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid #e0e0e0;
	border-radius: 50%;
	background: #fff;
	color: #282828;
	cursor: pointer;
	position: relative;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.bss-pdp-share-btn svg { width: 18px; height: 18px; }
.bss-pdp-share-btn:hover { color: #fff; }
.bss-pdp-share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.bss-pdp-share-x:hover        { background: #000;     border-color: #000; }
.bss-pdp-share-whatsapp:hover { background: #25d366; border-color: #25d366; }
.bss-pdp-share-mail:hover     { background: #6f6f6f; border-color: #6f6f6f; }
.bss-pdp-share-copy:hover     { background: #de080a; border-color: #de080a; }
.bss-pdp-share-copy.is-copied::after {
	content: "Copied!";
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: #282828;
	color: #fff;
	font-size: 11px;
	line-height: 1;
	padding: 5px 8px;
	border-radius: 4px;
	white-space: nowrap;
}
