/* Trang Bản đồ công trình — dùng biến màu/chữ của theme (style.css :root) */

/* 01 · Giới thiệu */
.bd-intro { padding-top: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.bd-intro .breadcrumb { margin-bottom: clamp(4.5rem, 2.5rem + 5vw, 7.5rem); }
.bd-intro .mag-head__title { font-size: var(--fs-h1); line-height: 1.2; }
.bd-intro .framed img { aspect-ratio: 4 / 5; object-fit: cover; }
.bd-stats { display: flex; margin: 0 0 2rem; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.bd-stat { padding: 16px 28px 14px 0; margin-right: 28px; border-right: 1px solid var(--c-border); }
.bd-stat:last-child { margin-right: 0; border-right: 0; }
.bd-stat b { display: block; font-family: var(--f-heading); font-weight: 600; font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); line-height: 1; }
.bd-stat small { display: block; margin-top: 6px; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-text-muted); }
.bd-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* 02 · Chọn tỉnh */
.bd-search { position: relative; max-width: 560px; margin: 0 0 2rem; }
.bd-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--c-text-muted); }
.bd-search input { width: 100%; font: inherit; padding: 14px 18px 14px 50px; border: 1px solid var(--c-border); border-radius: var(--radius-pill); background: #fff; color: var(--c-text); outline: none; }
.bd-search input:focus { border-color: var(--c-primary); }
.bd-region { display: flex; align-items: center; gap: 14px; margin: 2rem 0 1rem; font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-text-muted); }
.bd-region::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.bd-card { position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 22px 22px 18px; text-align: left; font: inherit; color: var(--c-text); background: #fff; border: 1px solid var(--c-border); cursor: pointer; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.bd-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.bd-card__cnt { position: absolute; right: 18px; top: 12px; font-family: var(--f-heading); font-size: 2.6rem; font-weight: 600; line-height: 1; color: var(--c-num); }
.bd-card__nm { padding-right: 56px; font-family: var(--f-heading); font-weight: 600; font-size: 1.25rem; line-height: 1.3; }
.bd-card__sub { margin-top: 8px; font-size: 0.88rem; line-height: 1.5; color: var(--c-text-muted); }
.bd-card__go { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 14px; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; }
.bd-card--all { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 18px; min-height: 0; padding: 22px 26px; background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.bd-card--all .bd-card__nm { padding: 0; }
.bd-card--all .bd-card__sub { color: rgba(255, 255, 255, 0.7); margin-top: 4px; }
.bd-card--all .bd-card__cnt { position: static; margin-left: auto; font-size: 3rem; color: rgba(255, 255, 255, 0.25); }
.bd-card--all .bd-card__go { display: none; }
.bd-empty { padding: 32px 0; color: var(--c-text-muted); }

/* 03 · Bản đồ (toàn chiều rộng, cao bằng màn hình trừ header) */
.bd-map { position: relative; height: calc(100svh - var(--header-h)); min-height: 520px; scroll-margin-top: var(--header-h); background: #efebe5; overflow: hidden; }
#bd-leaflet { position: absolute; inset: 0; z-index: 1; background: #efebe5; }
#bd-leaflet.is-soft .leaflet-tile-pane { filter: saturate(0.45) sepia(0.18) brightness(1.04) contrast(0.95); }
.bd-hud { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.bd-hud > * { pointer-events: auto; }
.bd-hud__title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; padding: 9px 22px; background: #fff; border-radius: var(--radius-pill); box-shadow: 0 4px 14px rgba(10, 10, 10, 0.14); }
.bd-hud__title b { font-family: var(--f-heading); font-weight: 600; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-hud__title small { font-size: 0.85rem; color: var(--c-text-muted); white-space: nowrap; }
.bd-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--c-text); cursor: pointer; box-shadow: 0 4px 14px rgba(10, 10, 10, 0.14); }
.bd-icon:hover { background: var(--c-primary); color: #fff; }
.bd-chips { position: absolute; z-index: 500; top: 68px; left: 12px; right: 12px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.bd-chip { flex: none; padding: 0.4em 1.05em; border: 0; border-radius: var(--radius-pill); background: #fff; color: var(--c-text); font: inherit; font-size: 0.85rem; cursor: pointer; box-shadow: 0 3px 10px rgba(10, 10, 10, 0.12); }
.bd-chip.is-on { background: var(--c-primary); color: #fff; }
.bd-dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; vertical-align: 0.02em; box-shadow: 0 0 0 2px #fff; }
.bd-chip.is-on .bd-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }

.bd-panel { position: absolute; z-index: 600; display: flex; flex-direction: column; background: #fff; box-shadow: 0 18px 40px rgba(10, 10, 10, 0.12); }
.bd-panel__h { display: flex; align-items: center; gap: 10px; width: 100%; padding: 16px 20px 12px; border: 0; border-bottom: 1px solid var(--c-border); background: none; font-family: var(--f-heading); font-weight: 600; font-size: 1.05rem; color: var(--c-text); text-align: left; cursor: default; }
.bd-panel__cnt { font-weight: 400; font-size: 0.9rem; color: var(--c-text-muted); }
.bd-panel__arrow { display: none; margin-left: auto; transition: transform 0.3s; }
.bd-list { flex: 1; overflow: auto; padding: 6px 10px 16px; }
.bd-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border-bottom: 1px solid var(--c-border); cursor: pointer; transition: background 0.15s; }
.bd-item:hover, .bd-item.is-on { background: var(--c-bg-alt); }
.bd-item.is-on { box-shadow: inset 3px 0 0 var(--c-primary); }
.bd-item__no { flex: none; width: 30px; text-align: center; font-weight: 600; font-size: 0.85rem; color: var(--c-num); }
.bd-item__tx { flex: 1; min-width: 0; }
.bd-item__tx b { display: block; font-weight: 600; line-height: 1.3; }
.bd-item__tx small { display: block; font-size: 0.85rem; color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-item__lnk { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--c-border); border-radius: 50%; color: var(--c-text); }
.bd-item__lnk:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.bd-none { padding: 24px 12px; text-align: center; color: var(--c-text-muted); }
.bd-none p { margin: 0 0 16px; }

/* Ghim + cụm */
.bd-pin-wrap { background: none; border: 0; }
.bd-pin { position: relative; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: var(--c-primary); transform: rotate(-45deg); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); transition: transform 0.2s; }
.bd-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff; }
.bd-pin.is-wip { background: #b45309; }
.bd-pin.is-on { transform: rotate(-45deg) scale(1.35); }
.bd-pin-label { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); padding: 2px 9px; border-radius: var(--radius-pill); background: #fff; color: var(--c-text); font-family: var(--f-heading); font-size: 0.78rem; font-weight: 600; line-height: 1.3; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
#bd-leaflet.is-far .bd-pin-label:not(.is-on) { display: none; }
.bd-pin-label.is-on { background: var(--c-primary); color: #fff; }
.bd-cl-icon { background: none; }
.bd-cl { display: grid; place-items: center; width: 46px; height: 46px; border: 3px solid #fff; border-radius: 50%; background: var(--c-primary); color: #fff; font-family: var(--f-heading); font-weight: 600; font-size: 1.05rem; box-shadow: 0 0 0 6px rgba(10, 10, 10, 0.12), 0 6px 14px rgba(0, 0, 0, 0.25); }
.bd-sea { background: none; border: 0; color: #5b7083; font-family: var(--f-heading); font-style: italic; font-size: 0.82rem; text-align: center; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

/* Thẻ chi tiết công trình */
.bd-sheet-bg { position: absolute; inset: 0; z-index: 900; background: rgba(10, 10, 10, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.bd-sheet-bg.is-on { opacity: 1; pointer-events: auto; }
.bd-sheet { position: absolute; z-index: 1000; left: 50%; bottom: 0; display: flex; flex-direction: column; width: min(560px, 100%); max-height: 90%; overflow: hidden; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); transform: translate(-50%, 105%); visibility: hidden; transition: transform 0.35s ease, visibility 0s 0.35s; }
.bd-sheet.is-on { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.bd-sheet__x { position: absolute; z-index: 3; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--c-text); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.bd-cover { position: relative; flex: none; height: 210px; overflow: hidden; background: var(--c-bg-alt); }
.bd-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bd-cover__ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; font-size: 0.85rem; color: var(--c-text-muted); }
.bd-cover__ph img { width: auto; height: 64px; object-fit: contain; }
.bd-thumbs { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 6px; }
.bd-thumbs button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.6); cursor: pointer; }
.bd-thumbs button.is-on { background: #fff; }
.bd-sheet__body { overflow: auto; padding: 20px 22px 24px; }
.bd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bd-tag { padding: 0.25em 0.9em; border: 1px solid var(--c-border); border-radius: var(--radius-pill); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-text-muted); }
.bd-tag.is-wip { border-color: #b45309; color: #b45309; }
.bd-sheet h3 { margin: 0; font-size: 1.45rem; line-height: 1.25; }
.bd-addr { margin: 6px 0 14px; font-size: 0.95rem; color: var(--c-text-muted); }
.bd-approx { margin-bottom: 14px; padding: 8px 12px; border-left: 2px solid var(--c-primary); background: var(--c-bg-alt); font-size: 0.88rem; color: var(--c-text-muted); }
.bd-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 14px; border: 1px solid var(--c-border); background: var(--c-border); }
.bd-kpi { padding: 10px 6px; background: #fff; text-align: center; }
.bd-kpi b { display: block; font-size: 1.2rem; line-height: 1.1; }
.bd-kpi small { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-text-muted); }
.bd-desc { margin: 0 0 16px; line-height: 1.7; }
/* 2 nút chính: Xem chi tiết dự án (đen) + Google Maps (viền đậm, biểu tượng ghim) */
.bd-main { display: grid; gap: 10px; margin-bottom: 10px; }
.bd-main__btn { width: 100%; min-height: 54px; font-size: 0.82rem; gap: 10px; }
.bd-main__map { background: #fff; color: var(--c-text); border: 2px solid var(--c-primary); }
.bd-main__map:hover { background: var(--c-primary); color: #fff; }
.bd-cover > a { display: block; height: 100%; }
.bd-cover > a img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.bd-cover > a:hover img { transform: scale(1.04); }
.bd-item__img { flex: none; width: 54px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--c-bg-alt); }
.bd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bd-actions .btn { min-height: 44px; padding: 10px 12px; font-size: 0.74rem; }
.bd-actions .is-wide { grid-column: 1 / -1; }
.bd-nav { display: flex; gap: 10px; margin-top: 14px; }
.bd-nav .btn { flex: 1; min-height: 40px; padding: 8px 12px; font-size: 0.72rem; }

.bd-map .leaflet-control-zoom { border: 0 !important; border-radius: 22px !important; overflow: hidden; box-shadow: 0 4px 14px rgba(10, 10, 10, 0.14) !important; }
.bd-map .leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; font-size: 1.25rem !important; color: var(--c-text) !important; }
.bd-map .leaflet-control-attribution { font-size: 10px; font-family: system-ui, sans-serif; }

@media (min-width: 860px) {
	.bd-panel { top: 116px; left: 12px; bottom: 12px; width: 340px; border-radius: 16px; overflow: hidden; }
	.bd-chips { right: auto; max-width: calc(100% - 24px); }
	.bd-sheet { left: auto; right: 12px; top: 12px; bottom: 12px; width: 400px; max-height: none; border-radius: 16px; transform: translateX(120%); }
	.bd-sheet.is-on { transform: none; }
	.bd-sheet-bg { display: none; }
	.bd-map .leaflet-bottom.leaflet-right { transition: right 0.3s; }
	.bd-map.is-sheet .leaflet-bottom.leaflet-right { right: 420px; }
	/* Chừa chỗ cho 2 nút Gọi/Zalo nổi ở góc phải dưới */
	.bd-map .leaflet-bottom.leaflet-right { bottom: 130px; }
}
@media (max-width: 859px) {
	.bd-intro .framed { order: -1; }
	.bd-intro .framed img { aspect-ratio: 4 / 3; }
	.bd-intro .breadcrumb { margin-bottom: 4.5rem; }
	.bd-stat { padding-right: 16px; margin-right: 16px; }
	.bd-cta .btn { flex: 1 1 100%; }
	/* Thanh Gọi/Zalo cố định đáy màn hình (60px) → bản đồ thấp hơn để ngăn kéo danh sách không bị che */
	.bd-map { height: calc(100svh - var(--header-h) - 60px); }
	.bd-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
	.bd-card { min-height: 130px; padding: 18px 16px 14px; }
	.bd-card__nm { font-size: 1.1rem; }
	.bd-hud__title small { display: none; }
	.bd-panel { left: 0; right: 0; bottom: 0; height: 50%; border-radius: 18px 18px 0 0; transform: translateY(calc(100% - 60px)); transition: transform 0.35s ease; }
	.bd-panel.is-open { transform: none; }
	.bd-panel__h { position: relative; padding-top: 20px; cursor: pointer; }
	.bd-panel__h::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--c-border); }
	.bd-panel__arrow { display: block; }
	.bd-panel.is-open .bd-panel__arrow { transform: rotate(180deg); }
	.bd-cover { height: 180px; }
	.bd-map .leaflet-bottom.leaflet-right { bottom: 60px; }
}
