.catalog-view-switch {
 display: inline-flex;
 flex-shrink: 0;
 gap: 4px;
 padding: 3px;
 border: 1px solid #e0e8e2;
 border-radius: 9px;
 background: #eef3ef;
}
.catalog-view-switch button {
 display: inline-flex;
 align-items: center;
 gap: 5px;
 min-height: 38px;
 border-radius: 6px;
 padding: 0 12px;
 font-size: 13px;
 font-weight: 600;
 white-space: nowrap;
 color: #405548;
}
.catalog-view-switch button[aria-pressed=true] {background: #fff; color: #173d2b;}
.catalog-view-switch .icon {width: 16px; height: 16px;}

/* The list stays readable at 320px. The map fills the remaining column. */
.map-view {
 --map-border: #dae5dd;
 --map-ink: #203a2b;
 --map-accent: #087951;
 display: grid;
 grid-template-columns: minmax(320px, 1fr) minmax(0, 2.35fr);
 height: clamp(490px, 68vh, 820px);
 border: 1px solid var(--map-border);
 border-radius: 14px;
 overflow: hidden;
 background: #f7f9f7;
}
.map-view[hidden], .map-view [hidden], #catalog-list-view[hidden] {display: none;}
.map-list-panel {display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--map-border);}
.map-list-heading {display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--map-border);}
.map-list-heading h3 {margin: 0; font-size: 16px; color: var(--map-ink);}
.map-list-heading p {margin: 0; color: #4d6457; font-size: 13px;}
.map-list {overflow: auto; min-height: 0; scrollbar-gutter: stable; overscroll-behavior: contain;}
.map-property {display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 13px; padding: 13px 16px 13px 13px; border-inline-start: 3px solid transparent; border-bottom: 1px solid var(--map-border); background: #fff;}
.map-property-selected {background: #eaf4ed; border-inline-start-color: var(--map-accent);}
.map-property-photo {display: block; width: 100%; aspect-ratio: 8 / 5; border-radius: 7px; overflow: hidden; background: #e4eae5;}
.map-property-photo img {width: 100%; height: 100%; object-fit: cover;}
.map-property h4, .map-popup h4 {margin: 4px 0; font-size: 14px; line-height: 1.35; color: var(--map-ink);}
.map-property a:hover, .map-popup a:hover {text-decoration: underline;}
.map-price {margin: 0; color: var(--map-ink); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;}
.map-price span {color: #546b5c; font-size: 12px; font-weight: 500;}
.map-location, .map-empty-list {margin: 0; color: #4d6457; font-size: 13px; line-height: 1.4;}
.map-empty-list {padding: 18px 16px;}
.map-row-locate {margin-top: 3px; padding: 0; min-height: 28px; color: var(--map-accent); font-size: 13px; font-weight: 650;}
.map-row-locate:hover {text-decoration: underline;}

.map-workspace {position: relative; min-width: 0; min-height: 0; background: #e8eee9;}
.property-map {position: absolute; inset: 0;}
#property-map {transition: opacity 180ms ease-out;}
#property-map:where(.map-awaiting-frame) {opacity: 0;}
@media (prefers-reduced-motion: reduce) {
 #property-map {transition: none;}
}
.map-actions {position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 8px; padding-right: 12px;}
.map-action {min-height: 40px; padding: 0 13px; border: 1px solid var(--map-border); border-radius: 8px; background: #fff; color: var(--map-ink); font-size: 13px; font-weight: 650;}
.map-action:hover {background: #f1f7f2;}
.map-placeholder {position: absolute; top: 50%; left: 50%; width: max-content; max-width: calc(100% - 32px); transform: translate(-50%, -50%); text-align: center; padding: 15px 18px; border: 1px solid var(--map-border); border-radius: 10px; background: #fff; color: var(--map-ink); pointer-events: none;}
.map-placeholder p {margin: 6px 0; font-size: 14px; line-height: 1.4;}
.map-placeholder .map-action {margin-top: 6px; pointer-events: auto;}
.map-pins {position: absolute; inset: 0; pointer-events: none;}
.map-pin {position: absolute; pointer-events: auto; transform: translate(-50%, -92%); min-width: 35px; min-height: 32px; padding: 2px 8px; border: 2px solid white; border-radius: 9px; color: #fff; background: var(--map-accent); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 2px 5px #163d2b39;}
.map-pin::after {content: ''; position: absolute; left: calc(50% - 4px); bottom: -4px; width: 8px; height: 8px; transform: rotate(45deg); background: inherit; border-right: 1px solid #fff; border-bottom: 1px solid #fff;}
.map-pin-group {min-width: 33px; min-height: 33px; border-radius: 50%; transform: translate(-50%, -50%);}
.map-pin-group::after {display: none;}
.map-pin:hover, .map-pin-selected {background: #143a29; z-index: 1;}
.map-pin:focus-visible {z-index: 2; outline-color: #173d2b;}
.map-popup {min-width: 155px; padding: 3px 4px 6px;}
.map-popup p:not(.map-price) {font-size: 13px; line-height: 1.4; margin: 0 0 10px; color: #4d6457;}
.map-popup a, .map-popup-group button {color: var(--map-accent); font-size: 13px; font-weight: 650;}
.map-popup-group {display: grid; gap: 4px; max-height: 185px; overflow: auto;}
.map-popup-group button {min-height: 34px; padding: 6px; text-align: left;}
.map-popup-group button:hover {background: #eaf4ed;}
.map-legal-links {font-size: 13px;}
.map-legal-links a:hover, #listing-map-hint a {text-decoration: underline;}

.listing-map {
 --map-border: #dae5dd;
 --map-accent: #087951;
 --map-ink: #203a2b;
 margin-top: 14px;
}
.listing-map [hidden] {display: none;}
.listing-map-workspace {height: clamp(230px, 34vw, 320px); border: 1px solid var(--map-border); border-radius: 10px; overflow: hidden;}
.listing-map-caption {display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; justify-content: space-between; font-size: 13px; color: #4d6457;}
.listing-map-caption .back-catalog {display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 0 auto;}
.listing-map-pin {display: block; pointer-events: none; min-width: 27px; min-height: 27px; border-radius: 50%; padding: 0;}
.listing-map-pin::before {content: ''; position: absolute; top: 7px; left: 7px; width: 9px; height: 9px; background: #fff; border-radius: 50%;}

@media(max-width: 760px) {
 .catalog-page .section-heading:has(.catalog-view-switch) {flex-wrap: wrap;}
 .catalog-page .results-actions:has(.catalog-view-switch) {flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px;}
 .catalog-view-switch button, .map-action {min-height: 44px;}
 .map-view {grid-template-columns: minmax(0, 1fr); height: auto;}
 .map-workspace {grid-row: 1; height: clamp(330px, 51svh, 530px);}
 .map-list-panel {grid-row: 2; border-right: 0; border-top: 1px solid var(--map-border);}
 .map-list {max-height: min(420px, 55svh);}
 .map-property {grid-template-columns: 96px minmax(0, 1fr);}
 .map-row-locate {min-height: 36px;}
}
