/* ==========================================================================
   LEAFLET MAP BLOCK STYLES - ORGANIZED
   ========================================================================== */

/* ==========================================================================
   1. BASE LAYOUT & CONTAINER STYLES
   ========================================================================== */

.leaflet-map-block {
    margin: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
    min-height: 60vh; /* Start with static value, JS will override */
}

/* Body flexbox layout when map is present */
body.has-map-block {
    display: flex;
    flex-direction: column;
    height: 100svh;
    margin: 0;
    overflow: hidden;
}

body.has-map-block #masthead {
    flex-shrink: 0;
}

/* Make all content containers flex to pass through the flex: 1 */
body.has-map-block #page,
body.has-map-block .site,
body.has-map-block #content,
body.has-map-block .site-content,
body.has-map-block #primary,
body.has-map-block .site-main,
body.has-map-block .entry-content,
body.has-map-block article,
body.has-map-block .entry {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
}

/* Additional Astra theme containers */
body.has-map-block .ast-container {
    height: 100%;
}

body.has-map-block #primary {
    height: 100%;
}

/* Full space usage for property grid layouts */
.leaflet-map-block.has-property-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.leaflet-map-block.has-property-grid .map-with-grid-container {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* Alignment classes */
.leaflet-map-block.alignwide {
    width: 100vw;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.leaflet-map-block.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* ==========================================================================
   2. MAP CONTAINER & LEAFLET OVERRIDES
   ========================================================================== */

.leaflet-map-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: var(--min-height, 60vh);
    min-height: 40vh;
}

/* Fix for Leaflet zoom control styling - override Astra theme */
#page .leaflet-control-zoom-in,
#page .leaflet-control-zoom-out {
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}

#page .leaflet-control-zoom-in:hover,
#page .leaflet-control-zoom-out:hover {
    text-decoration: none !important;
}

/* Position zoom controls at top right edge */
.leaflet-top.leaflet-right {
    top: 15px !important;
    right: 15px !important;
}

.leaflet-control-zoom {
    margin: 0 !important;
}

/* Grayscale filter for map tiles */
.leaflet-tile-pane {
    filter: grayscale(90%);
    -webkit-filter: grayscale(90%);
    -moz-filter: grayscale(90%);
    -ms-filter: grayscale(90%);
    -o-filter: grayscale(90%);
}

/* Override Leaflet's fixed width */
.leaflet-popup-content {
    width: auto !important;
    margin: 0 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 3px;
    padding: 0;
}

.leaflet-popup-close-button {
    color: white !important;
    width: 30px !important;
    height: 30px !important;
    font: 18px/21px Tahoma, Verdana, sans-serif !important;
    font-weight: bold !important;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3) !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
}

/* ==========================================================================
   3. MAP MARKERS & ICONS
   ========================================================================== */

.custom-div-icon {
    background: transparent;
    border: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-house {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.marker-tooltip {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
}

.marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.marker-house:hover .marker-tooltip,
.marker-house.hover-from-grid .marker-tooltip {
    opacity: 1;
}

/* Simulate marker hover effect when triggered from grid */
.marker-house.hover-from-grid {
    transform: scale(1.1);
    z-index: 1000;
    transition: transform 0.2s ease;
}

/* Hover effects for non-property markers (landmarks, other post types) */
.fas.hover-from-grid,
.landmark-icon.hover-from-grid,
.custom-div-icon.hover-from-grid {
    transform: scale(1.1);
    z-index: 1000;
    transition: transform 0.2s ease;
}

.fas.hover-from-grid i,
.landmark-icon.hover-from-grid i,
.custom-div-icon.hover-from-grid i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Dimmed marker styling */
.custom-div-icon.dimmed {
    opacity: 0.6 !important;
    filter: grayscale(60%) !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Marker colors - enhanced for dynamic support */
.available-property i,
.available-property-icon i {
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    font-weight: 900;
}

.waitlist-property i,
.waitlist-property-icon i {
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    font-weight: 900;
}

.landmark-icon i,
.landmarks-icon i {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    font-weight: 900;
}

/* Generic post type markers */
.post-icon i,
.page-icon i,
.custom-div-icon i {
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    font-weight: 900;
}

/* Drop shadow effects for all markers */
.custom-div-icon i {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

/* ==========================================================================
   4. MAP POPUPS
   ========================================================================== */

.map-popup {
    max-width: 240px;
    min-width: 240px;
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.popup-image,
.popup-image-placeholder {
    width: 100%;
    height: 135px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-image-placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.no-image-text {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.availability-overlay,
.property-grid-availability {
    position: absolute;
    bottom: 5px;
    right: 3px;
    color: white;
    font-size: .85em;
    line-height: 1em;
    text-align: right;
    border-radius: 3px;
    padding: 0.5em 1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
    z-index: 99;
}

.property-grid-availability {
    font-weight: 700;
}

.price-overlay {
    position: absolute;
    bottom: 0px;
    left: 0px;
    color: white;
    font-size: 1.1em;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.85);
    background: linear-gradient(180deg,rgba(42, 155, 102, 0.42) 0%, rgba(69, 136, 51, 0.9) 100%);
    width: 100%;
    padding: 0.5em 0.5em;
}

.price-overlay.waitlist {
    background: linear-gradient(180deg,rgba(42, 150, 155, 0.42) 0%, rgba(26, 68, 121, 0.9) 100%);
}

.popup-info {
    padding: 0.6em 0.7em .7em 0.7em;
    flex: 1;
}

.popup-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Allow text wrapping for non-property popup titles */
.map-popup:not(:has(.property-details)) .popup-info h3 {
    white-space: normal;
    text-overflow: unset;
    overflow: visible;
}

.map-popup p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.4;
}

.map-popup .button {
    display: inline-block;
    padding: 8px 16px;
    background: #2B3D55;
    color: white;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
    margin-top: 0.3em;
}

.map-popup .button:hover {
    background: #254D75;
    color: white;
}

.bold-number {
    font-weight: 700;
    color: #565751;
}

.separator {
    color: #ccc;
    font-weight: normal;
    margin: 0 4px;
}

.property-details {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #959595;
}

.property-address {
    margin: .3em 0;
    font-size: 13px;
    font-style: italic;
    margin-bottom: 0.4em;
}

.property-address .address-street {
    font-weight: 700;
}

.property-address .address-neighborhood {
    font-weight: 400;
    margin-left: 0.4em;
    color: #959595;
}

/* ==========================================================================
   5. MAP LEGEND
   ========================================================================== */

.leaflet-map-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    padding: .5em 1.2em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    font-size: 14px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.leaflet-map-legend-items {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.leaflet-map-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.leaflet-map-legend-item input[type="checkbox"] {
    display: none;
}

.leaflet-map-legend-item label {
    cursor: pointer;
    margin: 0;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Icon container with stacked icons */
.leaflet-map-legend-item .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.leaflet-map-legend-item .icon i {
    font-size: 14px;
    text-shadow: none !important;
    filter: none !important;
}

/* Legend icon colors - now handled by inline styles from dynamic configuration */
.leaflet-map-legend-item .icon .fa-stack-1x {
    /* Color is now set via inline styles from admin configuration */
}

/* Font Awesome stack for overlaying no symbol */
.leaflet-map-legend-item .fa-stack {
    display: inline-block;
    width: 2em;
    height: 2em;
    line-height: 2em;
    position: relative;
    vertical-align: middle;
}

.leaflet-map-legend-item .fa-stack .fa-stack-1x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
}

.leaflet-map-legend-item .fa-stack .fa-stack-2x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: #ff4444 !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    display: none;
}

/* Show ban symbol on hover and when item is hidden */
.leaflet-map-legend-item:hover .fa-stack .fa-stack-2x {
    display: block;
}

.leaflet-map-legend-item.item-hidden .fa-stack .fa-stack-2x {
    display: block;
}

/* Disable hover effect temporarily when just clicked */
.leaflet-map-legend-item.no-hover:hover .fa-stack .fa-stack-2x {
    display: none;
}

/* Dim the item when hidden */
.leaflet-map-legend-item.item-hidden {
    opacity: 0.6;
}

/* ==========================================================================
   6. MAP CONTROLS (RESET BUTTON)
   ========================================================================== */

.leaflet-show-all-wrapper {
    position: absolute;
    top: 88px;
    right: 15px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    z-index: 1001;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.leaflet-show-all-control {
    background: white;
    border: none;
    border-radius: 2px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaflet-show-all-wrapper:hover {
    transform: translateY(-1px);
}

.leaflet-show-all-wrapper:hover .leaflet-show-all-control {
    background: #f5f5f5;
}

.leaflet-show-all-control.disabled {
    background: #f9f9f9;
    cursor: not-allowed;
    opacity: 0.5;
}

.leaflet-show-all-wrapper:has(.leaflet-show-all-control.disabled) {
    border-color: #e5e5e5;
}

.leaflet-show-all-wrapper:has(.leaflet-show-all-control.disabled):hover {
    transform: none;
}

.leaflet-show-all-control.disabled:hover {
    background: #f9f9f9;
}

.leaflet-show-all-control i {
    font-size: 14px;
    color: #333;
}

.leaflet-show-all-control.disabled i {
    color: #999;
}

/* ==========================================================================
   7. FILTER SYSTEM
   ========================================================================== */

/* Filter modal */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.filter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-modal-content {
    background: white;
    border-radius: 3px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.filter-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.filter-modal-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.filter-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.filter-modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.filter-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 24px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Filter sections and form elements */
.filter-section {
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 16px;
}

.filter-col {
    flex: 1;
}

.filter-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    text-align: left;
}

.filter-col select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    background: white;
}

/* Filter buttons */
.filter-clear-btn {
    padding: 10px 16px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.filter-clear-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.filter-apply-btn {
    padding: 10px 20px;
    background: #2B3D55;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.filter-apply-btn:hover {
    background: #254D75;
}

/* Date picker styling */
.date-picker-container {
    position: relative;
}

.date-input-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.date-input-field:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.date-display {
    flex: 1;
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.calendar-icon {
    color: #666;
    font-size: 16px;
    margin-left: 8px;
}

/* Inline calendar */
.inline-calendar {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 350px;
    width: 350px;
    height: 330px;
    margin: 5px 0 0 0;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.inline-calendar.collapsed {
    max-height: 0;
    height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    flex: 1;
    text-align: center;
}

.calendar-nav {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    transition: background 0.2s ease;
}

.calendar-nav:hover {
    background: #f5f5f5;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 2px;
    flex: 1;
    height: 192px;
}

.calendar-day {
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover:not(.past):not(.empty) {
    background: #e3f2fd;
    color: #254D75;
}

.calendar-day.selected {
    background: #2B3D55;
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    background: #fff3e0;
    color: #f57c00;
    font-weight: 600;
    border: 1px solid #ffb74d;
}

.calendar-day.today.selected {
    background: #2B3D55;
    color: white;
    border-color: #2B3D55;
}

.calendar-day.past {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

/* Filter chips */
.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 24px;
    align-items: center;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4em 0.8em 0.4em 1.1em;
    background:  var(--ast-global-color-0);
    color: #FFFDFB;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: #FFFDFB;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.filter-chip-remove:hover {
    background: rgba(21, 101, 192, 0.1);
}

.filter-chip-remove i {
    font-size: 10px;
}

/* Filter toggles - shared styles for legend and filter modal */
.filter-toggles {
    display: flex;
    flex-direction: row;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.filter-toggle input[type="checkbox"] {
    display: none;
}

.filter-toggle label {
    cursor: pointer;
    margin: 0;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-toggle .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-toggle .icon i {
    text-shadow: none !important;
    filter: none !important;
}

/* Filter toggle icon colors - now handled by inline styles from dynamic configuration */
.filter-toggle .icon .fa-stack-1x {
    /* Color is now set via inline styles from admin configuration */
}

/* Font Awesome stack for filter toggles - same as legend */
.filter-toggle .fa-stack {
    display: inline-block;
    width: 2em;
    height: 2em;
    line-height: 2em;
    position: relative;
    vertical-align: middle;
}

.filter-toggle .fa-stack .fa-stack-1x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
    padding-left: 5px;
}

.filter-toggle .fa-stack .fa-stack-2x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: #ff4444 !important;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    display: none;
}

.filter-toggle:hover .fa-stack .fa-stack-2x {
    display: block;
}

.filter-toggle.no-hover:hover .fa-stack .fa-stack-2x {
    display: none;
}

.filter-toggle.item-hidden .fa-stack .fa-stack-2x {
    display: block !important;
}

.filter-toggle.item-hidden {
    opacity: 0.6;
}

/* ==========================================================================
   8. MAP BLOCK HEADER (UNIFIED RESPONSIVE)
   ========================================================================== */

.map-block-header {
    display: flex;
    background: #565751;
    color: #FFFDFB;
    padding: 12px 17px;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
}

.map-block-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.map-block-header .header-right {
    display: flex;
    align-items: center;
    position: relative;
}

/* Filter button styling */
.map-block-header .filters-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.map-block-header .filters-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.map-block-header .filters-button i {
    font-size: 13px;
    color: #50677b;
}

.map-block-header .filters-button .filter-count {
    font-weight: 700;
}

/* Property count display */
.map-block-header .property-count {
    font-size: 14px;
    font-weight: 500;
    margin-left: 12px;
}

/* Filter chips container */
.map-block-header .filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Mobile view selector */
.map-block-header .mobile-view-selector {
    display: flex;
    align-items: center;
    position: relative;
}

.map-block-header .mobile-view-toggle {
    background: #f8f9fa;
    border-radius: 6px;
    position: relative;
    min-width: 115px;
    width: 115px;
}

.map-block-header .mobile-view-active,
.map-block-header .mobile-view-alternative {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
}

.map-block-header .mobile-view-active {
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.map-block-header .mobile-view-toggle.expanded .mobile-view-active {
    border-radius: 6px 6px 0 0;
}

.map-block-header .mobile-view-active:hover {
    background: #e9ecef;
}

.map-block-header .mobile-view-alternative {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.map-block-header .mobile-view-toggle.expanded .mobile-view-alternative {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.map-block-header .mobile-view-alternative:hover {
    background: #f8f9fa;
}

.map-block-header .mobile-view-active i,
.map-block-header .mobile-view-alternative i {
    font-size: 12px;
}

.map-block-header .mobile-view-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    opacity: 0.6;
    transform: rotate(0deg);
}

.map-block-header .mobile-view-toggle.expanded .mobile-view-chevron {
    transform: rotate(180deg);
}

/* Desktop view selector */
.map-block-header .desktop-view-selector {
    display: none;
}

.map-block-header .desktop-view-buttons {
    display: flex;
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

.map-block-header .desktop-view-button {
    padding: 8px 16px;
    background: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    border-right: 1px solid #ddd;
    font-family: inherit;
}

.map-block-header .desktop-view-button:last-child {
    border-right: none;
}

.map-block-header .desktop-view-button.active {
    background: #2B3D55;
    color: white;
}

.map-block-header .desktop-view-button:hover:not(.active) {
    background: #f5f5f5;
    color: #333;
}

.map-block-header .desktop-view-button i {
    font-size: 11px;
}

/* ==========================================================================
   9. PROPERTY GRID LAYOUT
   ========================================================================== */

.leaflet-map-block.has-property-grid .map-with-grid-container {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.leaflet-map-block.has-property-grid .property-grid-container {
    flex: 0 0 calc(40% - 10px);
    overflow-y: auto;
    border-radius: 0;
    padding: 0 1em;
    min-width: 0;
}

.leaflet-map-block.has-property-grid .map-container-wrapper {
    flex: 0 0 calc(60% - 10px);
    min-width: 0;
}

/* Bottom grid position - stack vertically */
.leaflet-map-block.has-property-grid.grid-position-bottom .map-with-grid-container {
    flex-direction: column !important;
}

.leaflet-map-block.has-property-grid.grid-position-bottom .map-container-wrapper {
    flex: none !important;
    width: 100% !important;
    height: 30vh !important;
}

.leaflet-map-block.has-property-grid.grid-position-bottom .property-grid-container {
    flex: 1 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
}

.leaflet-map-block.has-property-grid.grid-position-bottom .leaflet-map-container {
    height: 30vh !important;
}

/* Property grid responsive columns */
.property-grid {
    display: grid !important;
    gap: 16px;
    padding: 1em 0;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: start;
    max-width: none;
    margin: 0;
    border: none !important;
    border-collapse: initial !important;
    font-size: inherit !important;
}

/* Property grid item */
.property-grid-item {
    background: white !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: all 0.5s ease, opacity 0.3s ease, transform 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
}

.property-grid-item.bounds-hidden {
    display: none !important;
}

.property-grid-image {
    width: 100%;
    height: 240px;
    position: relative;
    overflow: hidden;
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
    display: block !important;
}

.property-grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-grid-image-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 14px;
}

.property-grid-price {
    position: absolute;
    bottom: 0px;
    left: 0px;
    color: white;
    font-size: 1em;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    background: var(--property-available-color, rgba(14, 127, 29, 0.7));
    width: 100%;
    padding: 0.3em 0.5em 0.5em 0.9em;
}

.property-grid-image.waitlist .property-grid-price {
    background: var(--property-waitlist-color, rgba(220, 53, 69, 0.7));
}


.property-grid-content {
    padding: .5em 1em 1em .9em !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}


.property-grid-details {
    margin: 0 0 0.6em;
    font-size: .9em;
    font-weight: 500;
    color: #959595;
    font-variant-numeric: tabular-nums;
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.property-grid-address {
    font-size: 1.05em;
    color: #565751;
    margin-bottom: 0.4em;
    font-style: italic;
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.property-grid-address .address-street {
    font-weight: 700;
}

.property-grid-address .address-neighborhood {
    font-weight: 400;
    margin-left: 0.4em;
    color: #959595;
}

.property-grid-excerpt {
    font-size: .8em;
    line-height: 1.5em;
    margin-bottom: 1.2em;
    overflow: hidden;
}

.property-grid-button {
    display: inline-block;
    text-decoration: none;
    font-size: .6em !important;
    cursor: pointer;
}

.property-grid-button:hover {
    text-decoration: none;
}

.property-grid-content .wp-block-buttons {
    margin-top: auto !important;
    justify-self: flex-end !important;
}

.property-grid-overview {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

/* Loading and empty states */
.property-grid-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #50677b;
    font-size: 14px;
}

.property-grid-empty {
    text-align: center;
    padding: 40px 20px;
    color: #50677b;
    font-size: 14px;
}

/* ==========================================================================
   10. RESPONSIVE BEHAVIOR
   ========================================================================== */

/* Mobile styles (max-width: 1024px) */
@media (max-width: 1024px) {
    /* Allow mobile-view-grid to use responsive columns, only restrict split/map */
    .leaflet-map-block.mobile-view-split .grid-items-container,
    .leaflet-map-block.mobile-view-split .grid-post-type-items {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    /* Filter modal fullscreen */
    .filter-modal-content {
        border-radius: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }
    
    /* Hide "Filters" text on mobile, show only count */
    .map-block-header .filters-button .filter-text {
        display: none;
    }
    
    /* Show mobile view selector */
    .map-block-header .mobile-view-selector {
        display: flex;
    }
    
    /* Hide filter chips on mobile */
    .map-block-header .filter-chips {
        display: none;
    }
    
    /* Hide desktop view selector */
    .map-block-header .desktop-view-selector {
        display: none;
    }
    
    /* Mobile inline calendar adjustments */
    .inline-calendar {
        max-width: 295px;
        width: 295px;
    }
    
    /* Mobile legend adjustments */
    .leaflet-map-legend {
        bottom: 10px;
        right: 10px;
        max-width: calc(100vw-20px);
        width: calc(100vw - 20px);
        transition: transform 0.4s ease-in-out;
    }
    
    .leaflet-map-legend.mobile-hidden {
        transform: translateY(calc(100% + 20px));
    }
    
    .leaflet-map-legend-item label {
        font-size: 11px;
        gap: 0;
    }
    
    .filter-toggle label {
        font-size: 11px;
        gap: 0;
    }
    
    /* Mobile map block layout */
    .leaflet-map-block.has-property-grid {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    
    .leaflet-map-block.has-property-grid .map-with-grid-container {
        flex-direction: column !important;
        flex: 1;
        min-height: 0;
    }
    
    .leaflet-map-block.has-property-grid .property-grid-container {
        flex: 1;
        order: 2;
        display: none;
        overflow-y: auto;
        min-height: 0;
    }
    
    .leaflet-map-block.has-property-grid .map-container-wrapper {
        order: 1;
        flex: 1 !important;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Bottom grid position overrides for mobile */
    .leaflet-map-block.has-property-grid.grid-position-bottom .map-container-wrapper {
        flex: none !important;
        height: 30vh !important;
    }
    
    .leaflet-map-block.has-property-grid.grid-position-bottom .property-grid-container {
        flex: 1 !important;
        display: block !important;
    }
    
    .leaflet-map-block.has-property-grid.grid-position-bottom .leaflet-map-container {
        height: 30vh !important;
    }
    
    .leaflet-map-block.has-property-grid .leaflet-map-container {
        flex: 1;
        width: 100% !important;
        min-height: 0;
    }
    
    /* Mobile view states */
    .leaflet-map-block.mobile-view-grid .property-grid-container {
        display: block;
        flex: 1;
    }
    
    .leaflet-map-block.mobile-view-grid .map-container-wrapper {
        display: none;
    }
    
    .leaflet-map-block.mobile-view-map .property-grid-container {
        display: none;
    }
    
    .leaflet-map-block.mobile-view-map .map-container-wrapper {
        display: block;
        flex: 1;
    }
    
    .leaflet-map-block.mobile-view-map .leaflet-map-container {
        height: 100% !important;
        width: 100% !important;
    }
    
    /* Mobile property grid */
    .property-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
        padding: 12px;
        max-width: 800px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .property-grid {
        grid-template-columns: 1fr;
        padding: 1em 0;
    }
    
    /* All views single column on small mobile */
    .grid-items-container,
    .grid-post-type-items {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
    
    /* Override property-grid when it contains our new containers */
    .property-grid:has(.grid-post-type-section),
    .property-grid:has(.grid-items-container) {
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
    }
    
    /* Grid containers get responsive layout in this range */
    .grid-items-container,
    .grid-post-type-items {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 16px;
    }
    
    /* Only restrict split view to single column */
    .leaflet-map-block.mobile-view-split .grid-items-container,
    .leaflet-map-block.mobile-view-split .grid-post-type-items {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* Desktop styles (min-width: 1025px) */
@media (min-width: 1025px) {
    /* Show desktop view selector */
    .map-block-header .mobile-view-selector {
        display: none;
    }
    
    .map-block-header .desktop-view-selector {
        display: flex;
    }
    
    /* Show filter chips on desktop */
    .map-block-header .filter-chips {
        display: flex;
    }
    
    /* Desktop map block layout */
    .leaflet-map-block.has-property-grid {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    
    .leaflet-map-block.has-property-grid .map-with-grid-container {
        flex: 1;
        min-height: 0;
        display: flex;
    }
    
    .leaflet-map-block.has-property-grid .property-grid-container {
        display: block !important;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .leaflet-map-block.has-property-grid .map-container-wrapper {
        display: flex !important;
        flex: 1 !important;
        min-height: 0;
        flex-direction: column;
    }
    
    .leaflet-map-block.has-property-grid .leaflet-map-container {
        flex: 1;
        width: 100% !important;
        min-height: 0;
    }
    
    /* Bottom grid position overrides for desktop */
    .leaflet-map-block.has-property-grid.grid-position-bottom .map-with-grid-container {
        flex-direction: column !important;
    }
    
    .leaflet-map-block.has-property-grid.grid-position-bottom .map-container-wrapper {
        flex: none !important;
        height: 30vh !important;
    }
    
    .leaflet-map-block.has-property-grid.grid-position-bottom .property-grid-container {
        flex: 1 !important;
        display: block !important;
    }
    
    .leaflet-map-block.has-property-grid.grid-position-bottom .leaflet-map-container {
        height: 30vh !important;
    }
    
    /* Desktop view states */
    .leaflet-map-block.desktop-view-split .property-grid-container {
        display: block !important;
        flex: 0 0 50% !important;
    }
    
    .leaflet-map-block.desktop-view-split .map-container-wrapper {
        display: block !important;
        flex: 0 0 50% !important;
    }
    
    .leaflet-map-block.desktop-view-split .property-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        max-width: none;
        margin: 0;
        padding: 1em 0;
        gap: 16px;
    }
    
    /* Make bottom split exactly like grid view - copy all grid view properties */
    .leaflet-map-block.desktop-view-split.grid-position-bottom .property-grid-container {
        display: block !important;
        flex: 1 !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    .leaflet-map-block.desktop-view-split.grid-position-bottom .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 1em 0 !important;
        gap: 1em !important;
        width: 100% !important;
    }
    
    .leaflet-map-block.desktop-view-split.grid-position-bottom .property-grid:has(.grid-post-type-section) {
        display: block !important;
        grid-template-columns: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 1em 0 !important;
    }
    
    .leaflet-map-block.desktop-view-split.grid-position-bottom .property-grid:has(.grid-items-container) {
        display: block !important;
        grid-template-columns: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 1em 0 !important;
    }
    
    .leaflet-map-block.desktop-view-split.grid-position-bottom .grid-items-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 1em 0 !important;
        gap: 1em !important;
        width: 100% !important;
    }
    
    /* When grid headers are enabled, disable grid on parent container */
    .leaflet-map-block.desktop-view-split .property-grid:has(.grid-post-type-section) {
        display: block;
        grid-template-columns: none;
    }
    
    /* When no headers, use grid on parent container but let child container handle layout */
    .leaflet-map-block.desktop-view-split .property-grid:has(.grid-items-container) {
        display: block;
        grid-template-columns: none;
    }
    
    .leaflet-map-block.desktop-view-map .property-grid-container {
        display: none !important;
    }
    
    .leaflet-map-block.desktop-view-map .map-container-wrapper {
        display: block !important;
        flex: 1 !important;
    }
    
    .leaflet-map-block.desktop-view-grid .property-grid-container {
        display: block !important;
        flex: 1 !important;
    }
    
    .leaflet-map-block.desktop-view-grid .map-container-wrapper {
        display: none !important;
    }
    
    .leaflet-map-block.desktop-view-grid .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: none;
        margin: 0;
        padding: 1em 0;
        gap: 1em;
    }
    
    /* When grid headers are enabled, disable grid on parent container */
    .leaflet-map-block.desktop-view-grid .property-grid:has(.grid-post-type-section) {
        display: block !important;
        grid-template-columns: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 1em 0 !important;
    }
    
    /* When no headers, disable grid on parent container */
    .leaflet-map-block.desktop-view-grid .property-grid:has(.grid-items-container) {
        display: block !important;
        grid-template-columns: none !important;
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 1em 0 !important;
    }
    
    /* Property grid hover effects only in split view */
    .leaflet-map-block.desktop-view-split .property-grid-item {
        cursor: pointer !important;
    }
    
    .leaflet-map-block.desktop-view-split .property-grid-item:hover {
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    }
    
    .leaflet-map-block.desktop-view-split .property-grid-item.highlighted,
    .leaflet-map-block.desktop-view-split .property-grid-item.popup-active {
        box-shadow: 0 4px 16px rgba(17, 38, 66, 0.7) !important;
    }
}

/* Responsive adjustments for smaller desktop screens in split view */
@media (min-width: 1025px) and (max-width: 1400px) {
    .leaflet-map-block.desktop-view-split .property-grid {
        gap: 1em;
        padding: 1em 0;
    }
}

/* Larger screen optimizations */
@media (min-width: 1000px) {
    .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: none;
    }
    
    .leaflet-map-block.desktop-view-grid .grid-items-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: none;
    }
}

@media (min-width: 1025px) {
    .leaflet-map-block.desktop-view-split .property-grid-container.bottom .grid-post-type-items {
        grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    }
}

@media (min-width: 1400px) {
    .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        max-width: none;
    }
    
    .leaflet-map-block.desktop-view-grid .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        max-width: none;
    }
    
    .leaflet-map-block.desktop-view-grid .grid-items-container {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        max-width: none;
    }
}

@media (min-width: 1800px) {
    .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        max-width: none;
    }
    
    .leaflet-map-block.desktop-view-grid .property-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        max-width: none;
    }
    
    .leaflet-map-block.desktop-view-grid .grid-items-container {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
        max-width: none;
    }
}

/* ==========================================================================
   11. UTILITY CLASSES
   ========================================================================== */

/* Hide old headers that are no longer used */
.mobile-header,
.desktop-header {
    display: none !important;
}

/* ==========================================================================
   12. GRID TEMPLATE SYSTEM STYLES
   ========================================================================== */

/* Default grid item template styles */
.grid-item {
    background: white !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    transition: all 0.5s ease, opacity 0.3s ease, transform 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
}

.grid-item.highlighted {
    border-color: #007acc;
    box-shadow: 0 4px 16px rgba(17, 38, 66, 0.7) !important;
}

/* Default template image */
.grid-item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: #f5f5f5;
}

.grid-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}


.grid-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
}

/* Default template content */
.grid-item-content {
    padding: .5em 1em 1em .9em !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.grid-item-title h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
}

.grid-item-excerpt {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-item-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007acc;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: .6em !important;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.grid-item-button:hover {
    background-color: #005a9a;
    color: white !important;
}

.grid-item-content .wp-block-buttons {
    margin-top: auto !important;
    justify-self: flex-end !important;
}

/* Grid empty state */
.grid-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

/* Grid section headers and containers */
.grid-post-type-section {
    margin: 30px 0;
    width: 100%;
    display: block;
    max-width: none;
    flex: none;
}

.grid-post-type-section:first-child {
    margin-top: 0;
}

.grid-section-header {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #e0e0e0;
}

.grid-section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Grid containers - default layout */
.grid-items-container,
.grid-post-type-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    width: 100%;
}

/* Split view layouts - force full width and smart columns */
.leaflet-map-block.desktop-view-split .grid-items-container,
.leaflet-map-block.desktop-view-split .grid-post-type-items {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: 1 !important;
}

/* Constrain the container width to force grid items to be narrower */
.leaflet-map-block.desktop-view-split .grid-items-container {
    max-width: 850px;
}

/* Force consistent sizing for both waitlist and available properties */
.leaflet-map-block.desktop-view-split .property-grid-item[data-config-key="properties_waitlist"],
.leaflet-map-block.desktop-view-split .property-grid-item[data-config-key="properties_available"] {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
}

/* Grid view layouts - flexible percentage-based columns */
.leaflet-map-block.desktop-view-grid .grid-items-container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    max-width: none;
    margin: 0;
    padding: 1em 0;
    gap: 1em;
}

.leaflet-map-block.desktop-view-grid .grid-post-type-items {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1em;
}