/**
 * HouzezHub OSM Full Map with Filters - Custom Styles (Realtor.ca Inspired Interface)
 * @version 1.2.20
 * MODIFIED: Ensured --theme-header-height is correctly applied for padding.
 * MODIFIED: Set z-index of .realtor-ca-inspired-interface to 'auto'.
 * MODIFIED: Added full-height layout rules to fix panel height and scrolling.
 */

/* Full-height layout for the map page */
body.osm-map-fullscreen-active {
    overflow: hidden; /* Prevent main page scrolling */
}
.realtor-ca-inspired-interface {
    /*top: var(--theme-header-height, -100px);*/
    height: calc(100vh - var(--theme-header-height, 80px) - var(--rci-admin-bar-height, 0px));
}
body.osm-map-fullscreen-active footer.footer-wrap {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset and Base Styles */
body.osm-map-fullscreen-active.page-template-osm-template,
body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php,
body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template {
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 14px; 
    line-height: 1.5; 
    color: #333; 
    background-color: #f4f4f4;

    /* Theme header height variables - These should be the actual heights of your theme's header */
    --theme-header-height-desktop: 80px;
    --theme-header-height-mobile: 120px;  
    --theme-header-height: var(--theme-header-height-desktop);
    
    --rci-header-min-height: 72px; /* Plugin's own header min height */
    --rci-bottom-nav-height-mobile: 0px; /* Plugin's bottom nav height (desktop default) */
    --rci-admin-bar-height: 0px; /* Default, updated by admin bar specific rule */
}

/* theme’s header */
.header-mobile.header-mobile {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.realtor-ca-inspired-interface { 
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 0 12px var(--rci-bottom-nav-height-mobile) 12px;
    margin-top: var(--theme-header-height, 80px);
    
    box-sizing: border-box; 
    position: relative; 
    z-index: auto; /* MODIFIED: Was 1. Changed to auto to avoid overlaying theme header. */
}

/* Admin Bar Offset & Theme Header Height Adjustment for Mobile */
@media screen and (max-width: 991px) { /* Assuming 991px is your mobile breakpoint */
    body.osm-map-fullscreen-active.page-template-osm-template,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template {
        --theme-header-height: var(--theme-header-height-mobile);
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar.osm-map-fullscreen-active.page-template-osm-template,
    body.admin-bar.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php,
    body.admin-bar.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template { 
        --rci-admin-bar-height: 46px; 
    }
}
@media screen and (min-width: 783px) { 
    body.admin-bar.osm-map-fullscreen-active.page-template-osm-template,
    body.admin-bar.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php,
    body.admin-bar.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template {
        --rci-admin-bar-height: 32px;
    }
}
body.osm-map-fullscreen-active.page-template-osm-template:not(.admin-bar),
body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php:not(.admin-bar),
body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template:not(.admin-bar) {
    --rci-admin-bar-height: 0px;
}

/* Header Area (Plugin's Own Header) */
.rci-header { 
    background-color: #fff; 
    padding: 10px 15px; 
    border-bottom: 1px solid #e0e0e0; 
    display: flex; 
    align-items: center; 
    flex-shrink: 0; 
    z-index: 999; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    min-height: var(--rci-header-min-height); 
    box-sizing: border-box; 
    position: relative; 
    overflow: visible;
}

@media (min-width: 1024px) {
    .rci-header {
        top: var(--theme-header-height, 80px); /* Position below theme header */
    }
}

.rci-header-search-bar { flex-grow: 1; display: flex; }
.rci-header-search-bar #houzezhub-osm-filters-form { width: 100%; }
.rci-header-search-bar #houzezhub-osm-filters-form { position: relative; }
.rci-header-search-bar #houzezhub-osm-filters-form .filters-inner-wrap { display: flex; width: 100%; gap: 10px; flex-wrap: nowrap; align-items: center; }
.rci-header-search-bar #houzezhub-osm-filters-form .filter-group.filter-group-vector-search { flex-grow: 1; margin-bottom: 0; min-width: 0; }
.rci-header-search-bar #houzezhub-osm-filters-form .filter-group label { display: none; }
.rci-header-search-bar #houzezhub-osm-filters-form .form-control { height: 42px; font-size: 0.95em; padding: 8px 12px; text-align: left; }
.rci-header-search-bar #houzezhub-osm-filters-form .form-control::placeholder { text-align: left; color: #999; }
.rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions { padding-bottom: 0; flex-shrink: 0; display: flex; gap: 8px; align-items: center; }
.rci-header-search-bar #houzezhub-osm-filters-form .btn { height: 42px; padding: 0 14px; font-size: 0.9em; min-width: auto; white-space: nowrap; }
.osm-filters-panel-wrapper { position: relative; z-index: 1050; width: 100%; display: block; }
.osm-filters-panel { position: relative; background: transparent; border: none; box-shadow: none; padding: 0; width: 100%; max-width: 100%; overflow: visible; display: block; }
.osm-filters-panel .filters-inner-wrap { display: flex; flex-direction: row; gap: 10px; align-items: center; width: 100%; }
.osm-filters-panel .filter-group.filter-group-vector-search { flex: 1 1 auto; min-width: 0; }
.osm-filters-panel .form-control { width: 100%; }
.osm-filters-panel .filter-group-actions { display: flex; gap: 8px; flex-shrink: 0; }
.osm-filters-panel .filter-group-actions .btn { flex: 0 0 auto; }
.osm-filters-panel.is-collapsed { display: none; }

/* Enhanced Advanced Filters Dropdown - High z-index to show above map */
.osm-advanced-filters-dropdown { 
    background: #f9f9f9; 
    padding: 18px; 
    border-radius: 18px; 
    border: 1px solid #e7e7e7; 
    box-shadow: 0 24px 64px rgba(0,0,0,0.18); 
    margin-top: 10px; 
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -8px) scale(0.98);
    width: 92%;
    max-width: 520px;
    display: none; 
    z-index: 2000;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.osm-advanced-filters-dropdown.is-open { 
    display: block; 
    transform: translate(-50%, 0) scale(1);
}

.osm-advanced-filters-dropdown::-webkit-scrollbar {
    width: 6px;
}
.osm-advanced-filters-dropdown::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 8px;
}
.osm-advanced-filters-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a7a7a7;
}

.osm-filters-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.osm-filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.filter-label {
    font-weight: 700;
    font-size: 13px;
    color: #111;
    text-transform: none;
    letter-spacing: 0;
}

.osm-filter-select {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    background: #fafafa;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.osm-filter-section-price .price-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.osm-price-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fafafa;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.price-separator {
    color: #ccc;
    font-weight: bold;
}

.osm-features-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

@media (max-width: 768px) {
    .osm-features-checkboxes {
        grid-template-columns: 1fr;
        max-height: 250px;
    }
}

@media (max-width: 1023px) {
    .osm-advanced-filters-dropdown {
        top: auto;
        bottom: 0;
        left: 50%;
        right: auto;
        width: calc(100% - 24px);
        max-width: none;
        max-height: 72vh;
        border-radius: 18px 18px 0 0;
        transform: translate(-50%, 0);
        box-shadow: 0 -12px 28px rgba(0,0,0,0.18);
    }
}

.osm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    border: 1px solid #ededed;
    border-radius: 12px;
    padding: 8px 10px;
    background: #fafafa;
}

.osm-feature-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0066cc;
}

.toggle-advanced { 
    font-size: 0.9em; 
    padding: 8px 12px; 
    font-weight: 600;
}

.toggle-advanced i { 
    margin-right: 6px; 
}

.toggle-advanced[aria-expanded="true"] {
    background-color: #f0f5ff;
    color: #0066cc;
}

/* Main Content Wrapper (Map + Content Panel) */
.rci-main-content-wrapper { 
    display: flex; 
    flex-grow: 1; 
    overflow: hidden; 
    position: relative;
    min-height: 0;
    align-items: stretch;
    height: 100%;
}

/* Left Panel: Map */
.rci-map-panel { 
    flex: 1 1 55%; 
    position: relative; 
    overflow: hidden; 
    background-color: #e9ecef; 
    transition: flex-basis 0.3s ease-in-out, width 0.3s ease-in-out; 
    height: 100%; 
    min-height: 0;
}
#houzezhub-osm-full-map-container { width: 100%; height: 100%; min-height: 100%; }

/* Right Panel: Filters and Property List */
.rci-content-panel { 
    flex: 1 1 45%; 
    background-color: #fff; 
    border-left: 1px solid #dcdcdc; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    max-width: 55%; 
    min-width: 320px; 
    transition: all 0.3s ease-in-out; 
    height: 100%; 
    min-height: 0;
}
.rci-controls-area { padding: 8px 12px; border-bottom: 1px solid #e0e0e0; background-color: #f9f9f9; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.rci-results-summary { font-size: 0.85em; color: #555; flex-shrink: 0; white-space: nowrap; }
.rci-view-controls { display: flex; align-items: center; gap: 12px; flex-grow: 1; justify-content: flex-end; }
.rci-sort-control select { height: 32px; font-size: 13px; padding: 4px 8px; border-radius: 4px; border: 1px solid #ccc; background-color: #fff; }
.rci-view-mode-toggle { display: flex; align-items: center; }
.rci-view-mode-toggle .btn-view-mode { background-color: #fff; border: 1px solid #ccc; color: #555; padding: 6px 10px; cursor: pointer; transition: all 0.2s ease; }
.rci-view-mode-toggle .btn-view-mode:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.rci-view-mode-toggle .btn-view-mode:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-left: none; }
.rci-view-mode-toggle .btn-view-mode:hover { background-color: #f0f0f0; }
.rci-view-mode-toggle .btn-view-mode.active { background-color: #007bff; border-color: #007bff; color: #fff; z-index: 2; }

@media (max-width: 480px) {
    .rci-controls-area { flex-direction: column; align-items: flex-start; gap: 8px; }
    .rci-view-controls { width: 100%; }
}

.rci-results-summary .rci-results-range { margin-left: 8px; color: #777; font-weight: 600; }
.rci-mobile-list-toggle-btn { display: none; background-color: #007bff; color: white; border: none; padding: 8px 12px; border-radius: 30px; cursor: pointer; font-size: 0.9em; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: background-color 0.2s ease; position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 1000; }
.rci-mobile-list-toggle-btn i { margin-right: 6px; }
.rci-mobile-list-toggle-btn:hover { background-color: #0056b3; }
.rci-property-list-area { flex-grow: 1; overflow-y: auto; padding: 0; }
#rci-property-list-results.layout-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 16px; 
    padding: 12px;
}
#rci-property-list-results.layout-grid .rci-property-card { 
    border: 1px solid #e5e7eb; 
    border-radius: 10px; 
    box-shadow: 0 3px 10px rgba(0,0,0,0.06); 
    overflow: hidden; 
}
#rci-property-list-results.layout-grid .rci-card-main-info { flex-direction: column; padding: 0; }
#rci-property-list-results.layout-grid .rci-card-thumbnail-wrapper { width: 100%; margin: 0; }
#rci-property-list-results.layout-grid .rci-card-thumbnail { height: 170px; border-radius: 0; }
#rci-property-list-results.layout-grid .rci-card-summary { padding: 12px; width: 100%; }
#rci-property-list-results.layout-grid .rci-card-meta-summary { margin-top: 6px; }
#rci-property-list-results.layout-grid .rci-property-card { cursor: pointer; }
#rci-property-list-results .rci-list-placeholder { text-align: center; color: #777; padding: 30px 15px; font-style: italic; }
#rci-property-list-results .rci-list-placeholder.error-message { color: #c00; font-style: normal; font-weight: bold; }
.osm-pagination { margin: 16px 0; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.osm-pagination button { background: #2c5aa0; color: #fff; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.2s ease, transform 0.1s ease; }
.osm-pagination button:hover,
.osm-pagination button:focus { background: #1e3d72; outline: none; }
.osm-pagination button:active { transform: translateY(1px); }
.osm-pagination .osm-page-indicator { font-weight: 600; color: #2c3e50; }

/* Property Card Styles */
.rci-property-card { background-color: #fff; border-bottom: 1px solid #e9ecef; transition: background-color 0.2s ease-in-out; position: relative; cursor: pointer; }
.rci-property-card.active-map-hover, .rci-property-card.active-list-item { background-color: #e6f2ff !important; }
.rci-card-labels-top { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 10px; width: 100%; box-sizing: border-box; }
.rci-label { background-color: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.65em; padding: 3px 6px; border-radius: 3px; line-height: 1.2; text-transform: uppercase; font-weight: bold; }
.rci-label-featured { background-color: #007bff; } .rci-label-custom { background-color: #5cb85c; }
.rci-card-main-info { display: flex; padding: 10px 12px; align-items: flex-start; }
.rci-card-thumbnail-wrapper { flex-shrink: 0; width: 100px; margin-right: 10px; display: flex; flex-direction: column; }
.rci-card-thumbnail { width: 100%; height: 75px; border-radius: 3px; overflow: hidden; display: block; }
.rci-card-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.rci-card-tools-wrapper { margin-top: 5px; width: 100%; }
.rci-card-tools-wrapper .rci-card-tools { list-style: none; padding: 0; margin: 0; display: flex; justify-content: space-around; align-items: center; background-color: #f8f9fa; border-radius: 3px; width: 100%; box-sizing: border-box; }
.rci-card-tools-wrapper .rci-card-tools .item-tool { text-align: center; flex-grow: 1; }
.rci-card-tools-wrapper .rci-card-tools .item-tool span { cursor: pointer; display: inline-block; width: 20px; height: 20px; line-height: 20px; font-size: 14px; text-align: center; color: #000000; border: 1px solid transparent; background-color: transparent; }
.rci-card-tools-wrapper .rci-card-tools .item-tool span:hover { color: #007bff; background-color: #eeeeee; }
.rci-card-tools-wrapper .rci-card-tools .item-tool .houzez-icon { font-size: inherit; vertical-align: top; }
.rci-card-tools-wrapper .rci-card-tools .item-tool span.add-favorite-js.fave-active .houzez-icon.icon-love-it,
.rci-card-tools-wrapper .rci-card-tools .item-tool span.add-favorite-js .houzez-icon.icon-love-it.text-danger { color: #D32F2F !important; }
.rci-card-tools-wrapper .rci-card-tools .item-tool span.add-favorite-js.fave-active,
.rci-card-tools-wrapper .rci-card-tools .item-tool span.add-favorite-js.text-danger { color: #D32F2F !important; }
.rci-card-tools-wrapper .rci-card-tools .item-tool span.houzez_compare.active .houzez-icon.icon-add-circle,
.rci-card-tools-wrapper .rci-card-tools .item-tool span.houzez_compare.active { color: #007bff !important; }
.tooltip-inner { font-size: 0.8em; background-color: #333; color: #fff; border-radius: .2rem; padding: .25rem .5rem; }
.tooltip.bs-tooltip-top .arrow::before, .tooltip.bs-tooltip-auto[x-placement^="top"] .arrow::before { border-top-color: #333; }
.rci-card-summary { flex-grow: 1; }
.rci-card-title { margin: 0 0 2px 0; font-size: 0.95em; font-weight: 600; line-height: 1.3; }
.rci-card-title a { text-decoration: none; color: #2c3e50; } .rci-card-title a:hover { color: #007bff; }
.rci-card-price-html { margin-bottom: 3px; line-height: 1.2; }
.rci-card-price-html .item-price { font-size: 0.9em; font-weight: bold; color: #333; display: block; }
.rci-card-price-html .item-sub-price { font-size: 0.75em; color: #555; margin-left: 0; display: block; line-height: 1.1; }
.rci-card-price-html li { display: block; list-style-type: none; padding: 0; margin: 0; }
.rci-card-price { font-size: 0.9em; font-weight: bold; color: #333; margin-bottom: 3px; }
.rci-card-address { font-size: 0.75em; color: #555; margin-bottom: 4px; line-height: 1.3; }
.rci-card-meta-summary { list-style: none; padding: 0; margin: 0; font-size: 0.75em; color: #777; display: flex; flex-wrap: wrap; gap: 3px 8px; }
.rci-card-meta-summary li { display: flex; align-items: center; }
.rci-card-meta-summary li .houzez-icon { margin-right: 3px; font-size: 1em; }
.rci-card-meta-summary .rci-meta-label { display: inline; margin-left: 0.2em; }

/* Infobox */
#houzezhub-osm-infobox { max-height: 25% !important; padding: 10px 12px !important; border-top-width: 2px !important; box-shadow: 0 -2px 6px rgba(0,0,0,0.07) !important; }
#houzezhub-osm-infobox .infobox-close-button { top: 4px !important; right: 5px !important; font-size: 1.5em !important; }
.infobox-content-wrap .property-infobox-item { gap: 10px !important; }
.infobox-thumbnail { width: 100px !important; height: 70px !important; }
.infobox-details .infobox-title { font-size: 1em !important; margin-bottom: 3px !important; }
.infobox-price { font-size: 0.95em !important; margin-bottom: 4px !important; }
.infobox-address { font-size: 0.75em !important; margin-bottom: 4px !important; }
.infobox-meta { font-size: 0.7em !important; gap: 3px 8px !important; margin-bottom: 6px !important; }
.infobox-meta li .houzez-icon, .infobox-meta li i { font-size: 0.9em !important; margin-right: 3px !important; }
.infobox-details-link.btn { padding: 3px 7px !important; font-size: 0.75em !important; }
.no-results-message, .infobox-loading, .infobox-error, .infobox-placeholder { padding: 15px 8px !important; font-size: 0.95em !important; }

/* Loading Spinner */
.map-loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.95); padding: 25px 30px; border-radius: 8px; z-index: 10000; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); font-size: 1.1em; color: #343a40; }
.map-loading-spinner::before { content: ""; display: inline-block; width: 24px; height: 24px; margin-right: 12px; border: 3px solid rgba(0, 123, 255, 0.2); border-radius: 50%; border-top-color: #007bff; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Styles for Thumbnail Markers on the map */
.property-div-icon {
    overflow: visible !important; 
}
.property-marker-wrapper {
    position: relative;
    text-align: center;
    display: flex; 
    flex-direction: column;
    align-items: center;
}
.property-marker-price {
    background-color: #ffffff; 
    color: #000000; 
    font-weight: bold; 
    padding: 3px 8px; 
    border-radius: 12px; 
    font-size: 11px; 
    white-space: nowrap;
    margin-bottom: 4px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.25); 
    border: 1px solid #cccccc; 
}
.property-thumbnail-marker { 
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; 
    border: 2px solid #ffffff; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.4); 
    transition: border-color 0.2s ease-in-out;
    background-color: #ccc; 
}
.property-thumbnail-marker.featured-marker-border { border-color: #ff385c !important; } 
.property-thumbnail-marker.highlight-marker-border { border-color: #007bff !important; box-shadow: 0 0 0 2px #007bff; } 
.marker-highlighted-fallback { filter: hue-rotate(180deg) brightness(1.2); }
.marker-cluster.cluster-list-hover-highlight { background-color: #BE5103 !important; }
.marker-cluster.cluster-list-hover-highlight div span { color: #FFFFFF !important; }

/* Mobile View Toggler Styles */
.rci-mobile-view-toggler { 
    display: none; 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background-color: #ffffff; 
    border-top: 1px solid #e0e0e0; 
    padding: 8px; 
    z-index: 1030; 
    box-sizing: border-box; 
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1); 
    height: var(--rci-bottom-nav-height-mobile); 
}
.rci-view-toggle-btn { flex-grow: 1; padding: 8px 10px; font-size: 0.9em; font-weight: 500; background-color: #f8f9fa; color: #495057; border: 1px solid #ced4da; border-radius: 20px; cursor: pointer; margin: 0 4px; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; }
.rci-view-toggle-btn i { margin-right: 6px; font-size: 1em; }
.rci-view-toggle-btn.active { background-color: #007bff; color: white; border-color: #007bff; }
.rci-view-toggle-btn:not(.active):hover { background-color: #e9ecef; border-color: #adb5bd; }

/* Responsive adjustments */
@media (max-width: 991px) {
    body.osm-map-fullscreen-active.page-template-osm-template,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template {
        overflow: hidden !important; 
        --rci-bottom-nav-height-mobile: 50px;
        padding-top: 0;
    }

    .rci-main-content-wrapper { 
        flex-direction: column; 
        flex-grow: 1; 
        height: calc(100vh - var(--rci-admin-bar-height)); 
        padding-bottom: 0;
        padding-top: 0;
        align-items: stretch;
    }
    
    .rci-map-panel, .rci-content-panel { 
        width: 100% !important; 
        height: 100% !important; 
        flex-basis: auto !important; 
        max-width: 100% !important; 
        min-width: 100% !important; 
        border-left: none !important; 
        border-top: none !important; 
    }
    .rci-view-hidden-mobile { display: none !important; }
    .rci-map-panel.mobile-map-active { display: block !important; } 
    .rci-content-panel.mobile-list-active { display: flex !important; flex-direction: column; }
    
    .rci-mobile-list-toggle-btn { display: none !important; }
    .rci-mobile-view-toggler { display: flex; justify-content: space-around; }
    .filter-group-advanced { width: 100%; }
    .filter-group-advanced .price-inputs { flex-direction: column; }
    .osm-pagination { gap: 8px; }
    .osm-pagination button { width: 100%; text-align: center; }
    .osm-filters-panel-wrapper { flex-direction: column; align-items: stretch; width: 100%; }
    .osm-filters-panel { position: relative; top: 0; left: 0; right: 0; width: 100%; max-height: none; box-shadow: 0 6px 18px rgba(0,0,0,0.12); border-radius: 12px; }
    .osm-filters-panel-toggle { width: 100%; margin: 6px 0; }
    
    #houzezhub-osm-infobox { max-height: 30% !important; }
    .rci-header-search-bar { max-width: none; width: 100%; }
    .rci-header { 
        align-items: center; 
        padding: 8px 10px; 
        min-height: auto; 
        height: auto;
        background: white;
        position: relative;
        z-index: 999;
    }
    .rci-header-search-bar #houzezhub-osm-filters-form .filters-inner-wrap { flex-direction: row; align-items: center; gap: 6px; }
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group.filter-group-vector-search { width: auto; flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions { width: auto; justify-content: flex-end; gap: 4px; flex-wrap: nowrap; flex-shrink: 0; }
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions .btn { flex: 0 0 auto; padding: 8px 12px; font-size: 12px; }
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions .toggle-advanced { flex-basis: auto; padding: 8px 10px; }
    .filter-group-advanced { position: static; box-shadow: none; margin-top: 8px; }
    .filter-group-advanced.is-open { display: block; }

    body.osm-map-fullscreen-active.page-template-osm-template footer.footer-wrap.footer-wrap-v1,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template-php footer.footer-wrap.footer-wrap-v1,
    body.osm-map-fullscreen-active.page-template-houzezhub-enhanced-osm-template footer.footer-wrap.footer-wrap-v1 {
        display: none !important;
        visibility: hidden !important; 
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important; 
    }
}
@media (max-width: 767px) { 
    .rci-header { padding: 8px 10px; }
    .rci-controls-area { padding: 8px 10px; }
    .rci-property-list-area { padding: 0; }
    .rci-card-labels-top { padding: 3px 8px; gap: 3px; } .rci-label { font-size: 0.6em; padding: 2px 4px; }
    .rci-card-thumbnail-wrapper { width: 80px; } .rci-card-thumbnail { width: 100%; height: 60px; }
    .rci-card-tools-wrapper .rci-card-tools .item-tool span { width: 18px; height: 18px; line-height: 18px; font-size: 12px; }
    .rci-card-title { font-size: 0.9em; }
    .rci-card-price-html .item-price, .rci-card-price { font-size: 0.85em; }
    .rci-card-address { font-size: 0.7em; } .rci-card-meta-summary { font-size: 0.7em; gap: 3px 8px; }
    #houzezhub-osm-infobox { padding: 8px; max-height: 35%;} .infobox-thumbnail { width: 80px !important; height: 60px !important;}
    .rci-view-toggle-btn { padding: 6px 8px; font-size: 0.85em; } .rci-view-toggle-btn i { margin-right: 4px; }
}
@media (max-width: 360px) { 
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions { flex-direction: row; align-items: center; }
    .rci-header-search-bar #houzezhub-osm-filters-form .filter-group-actions .btn { width: auto; margin-bottom: 0; padding: 6px 10px; font-size: 11px; }
    .rci-card-labels-top { padding: 2px 5px; } .rci-label { font-size: 0.55em; }
    .rci-card-thumbnail-wrapper { width: 70px; } .rci-card-thumbnail { width: 100%; height: 50px; }
    .rci-card-main-info { padding: 8px; }
    .rci-card-tools-wrapper .rci-card-tools .item-tool span { width: 16px; height: 16px; line-height: 16px; font-size: 10px; }
    .rci-view-toggle-btn { font-size: 0.8em; padding: 5px 6px; } .rci-view-toggle-btn i { font-size: 0.9em; }
}
@media (max-width: 991.98px) {
    .slideout-panel {
        position: relative;
        z-index: auto;
    }
}

@media (min-width: 992px) {
    .realtor-ca-inspired-interface {
        padding-top: 0;
    }
}

/* ==========================================================================

   New Filter Modal Styles (v1.2.20) - Corrected

   ========================================================================== */



/* Main search bar button - This is the button in the header */

#osm-open-filters-modal {

    /* This button now uses default .btn styles, specific overrides are not needed */

}



/* Modal Container - This is the full-screen overlay */

.osm-filters-modal {

    display: none; /* Hidden by default */

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    background-color: rgba(0, 0, 0, 0.65); /* Darker overlay */

    z-index: 10000;

    justify-content: center;

    align-items: center;

    padding: 20px;

    box-sizing: border-box;

}



.osm-filters-modal.is-open {

    display: flex;

}



/* The white modal box itself */

.osm-filters-modal .houzezhub-osm-filters-form-modal {

    background-color: #fff;

    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.1);

    width: 100%;

    max-width: 700px;

    height: 100%;

    max-height: 95vh; /* Limit height to viewport */

    display: flex;

    flex-direction: column;

    overflow: hidden; /* Prevent the form itself from scrolling */

}



/* Modal Header */

.osm-filters-modal .modal-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 16px 24px;

    border-bottom: 1px solid #eee;

    flex-shrink: 0; /* Prevent header from shrinking */

}

.osm-filters-modal .modal-header .btn-reset {

    background: none;

    border: none;

    font-weight: 600;

    cursor: pointer;

    padding: 0;

}

.osm-filters-modal .modal-header .modal-title {

    font-size: 18px;

    font-weight: 700;

    margin: 0;

}

.osm-filters-modal .modal-header .btn-close {

    background: #eee;

    border: none;

    border-radius: 50%;

    width: 32px;

    height: 32px;

    font-size: 24px;

    line-height: 1;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

}



/* Modal Body - The scrollable part */



.osm-filters-modal .modal-body {



    padding: 16px 24px;



    overflow-y: auto; /* This enables scrolling */



    flex-grow: 1;



    min-height: 0; /* Crucial for flexbox scrolling */



	font-size: 70%;



}

.osm-filters-modal .filter-section {

    padding: 20px 0;

    border-bottom: 1px solid #eee;

}

.osm-filters-modal .filter-section:last-child {

    border-bottom: none;

}

.osm-filters-modal .filter-title {

    font-size: 16px;

    font-weight: 600;

    margin: 0 0 16px 0;

}



/* Modal Footer */

.osm-filters-modal .modal-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 16px 24px;

    border-top: 1px solid #eee;

    background-color: #f9f9f9;

    flex-shrink: 0; /* Prevent footer from shrinking */

}

.osm-filters-modal .modal-footer .btn {

    padding: 12px 24px;

    border-radius: 8px;

    font-weight: 600;

    cursor: pointer;

}

.osm-filters-modal .modal-footer .btn-secondary {

    background-color: #eee;

    border: 1px solid #ddd;

    color: #333;

}

.osm-filters-modal .modal-footer .btn-primary {

    background-color: #000;

    color: #fff;

    border: 1px solid #000;

}



/* Specific Filter Styles */

.osm-filters-modal .search-input-wrapper {

    position: relative;

}

.osm-filters-modal .search-input-wrapper i {

    position: absolute;

    top: 50%;

    left: 16px;

    transform: translateY(-50%);

    color: #888;

}

.osm-filters-modal .search-input-wrapper .form-control {

    padding-left: 40px;

    height: 48px;

    border-radius: 8px;

    border: 1px solid #ccc;

}



.osm-filters-modal .btn-group-toggle {

    display: flex;

    border: 1px solid #ccc;

    border-radius: 8px;

    overflow: hidden;

}

.osm-filters-modal .btn-group-toggle .btn {

    flex: 1;

    padding: 12px;

    background: #fff;

    border: none;

    cursor: pointer;

    font-weight: 500;

}

.osm-filters-modal .btn-group-toggle .btn.active {

    background: #f0f0f0;

    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);

}

.osm-filters-modal .btn-group-toggle .btn:not(:last-child) {

    border-right: 1px solid #ccc;

}



.osm-filters-modal .price-inputs {

    display: flex;

    gap: 16px;

    align-items: center;

}

.osm-filters-modal .price-inputs .form-control {

    height: 48px;

    border-radius: 8px;

    border: 1px solid #ccc;

    text-align: center;

}



.osm-filters-modal .btn-group-pills {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}

.osm-filters-modal .btn-group-pills .btn {

    padding: 8px 16px;

    border: 1px solid #ccc;

    border-radius: 24px;

    background: #fff;

    cursor: pointer;

}

.osm-filters-modal .btn-group-pills .btn.active {

    background: #000;

    color: #fff;

    border-color: #000;

}



.osm-filters-modal .property-types-grid {

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));

    gap: 12px;

}

.osm-filters-modal .property-types-grid .btn-icon {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    padding: 16px;

    border: 1px solid #ccc;

    border-radius: 8px;

    background: #fff;

    cursor: pointer;

    text-align: center;

}

.osm-filters-modal .property-types-grid .btn-icon.active {

    border-color: #000;

    background: #f0f0f0;

}

.osm-filters-modal .property-types-grid .btn-icon i {

    font-size: 24px;

}



.osm-filters-modal .checkbox-list {

    display: flex;

    flex-direction: column;

    gap: 12px;

}

.osm-filters-modal .checkbox-list .checkbox-item {

    display: flex;

    align-items: center;

    gap: 12px;

    cursor: pointer;

}

.osm-filters-modal .checkbox-list .checkbox-item input {

    width: 20px;

    height: 20px;

    accent-color: #000;

}



.osm-filters-modal .accordion-group {

    display: flex;

    flex-direction: column;

}

.osm-filters-modal .accordion-group .accordion-toggle {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 16px 0;

    text-decoration: none;

    color: #000;

    font-weight: 600;

    border-bottom: 1px solid #eee;

}



.osm-filters-modal .accordion-group .accordion-toggle:last-child {

    border-bottom: none;

}



/* Accordion Styles */

.osm-filters-modal .accordion-item {

    border-bottom: 1px solid #eee;

}

.osm-filters-modal .accordion-item:last-child {

    border-bottom: none;

}

.osm-filters-modal .accordion-toggle {

    width: 100%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 20px 0;

    background: none;

    border: none;

    cursor: pointer;

    text-align: left;

}

.osm-filters-modal .accordion-toggle span {

    font-size: 16px;

    font-weight: 600;

}

.osm-filters-modal .accordion-toggle i {

    transition: transform 0.3s ease;

}

.osm-filters-modal .accordion-item.is-open .accordion-toggle i {

    transform: rotate(180deg);

}

.osm-filters-modal .accordion-content {

    display: none;

    padding-bottom: 20px;

}

.osm-filters-modal .accordion-item.is-open .accordion-content {

    display: block;

}

.osm-filters-modal .accordion-content .filter-section-inner {

    padding: 10px 0;

}

.osm-filters-modal .accordion-content .filter-section-inner:first-child {

    padding-top: 0;

}

.osm-filters-modal .accordion-content .filter-title {

    font-size: 14px;

    margin-bottom: 12px;

}
/* ==========================================================================
   New Property Marker Popup Styles (v1.2.21)
   ========================================================================== */

/* Override default Leaflet popup padding and background */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden; /* Ensure content respects the rounded corners */
    border: 1px solid #e1e1e1;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    top: 10px !important;
    right: 10px !important;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff !important;
    border-radius: 50%;
    font-size: 18px;
    line-height: 30px;
    text-align: center;
}

/* Main popup container link */
.osm-property-popup-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.osm-property-popup {
    width: 280px;
    border-radius: 12px;
    overflow: hidden;
}

/* Image section */
.osm-popup-image-wrapper {
    position: relative;
    height: 160px;
    background-color: #f0f0f0;
}

.osm-popup-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Labels on top-left of image */
.osm-popup-labels {
    position: absolute;
    top: 0;
    left: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.osm-popup-label {
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Action buttons (Favorite, Share) */
.osm-popup-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.osm-popup-actions button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s;
}

.osm-popup-actions button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Content section below image */
.osm-popup-content {
    padding: 12px 16px;
}

.osm-popup-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osm-popup-price {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin-bottom: 4px;
}

.osm-popup-meta {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osm-popup-address {
    margin-bottom: 4px;
}

.osm-popup-type {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.osm-popup-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #333;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.osm-popup-meta i {
    margin-right: 5px;
    color: #888;
}

/* ==========================================================================
   Share Modal Styles
   ========================================================================== */

.osm-share-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 19999;
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.osm-share-modal-backdrop.is-open {
    display: block;
    opacity: 1;
}

.osm-share-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    z-index: 20000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-width: 500px;
    margin: 0 auto;
}

.osm-share-modal.is-open {
    transform: translateY(0);
}

.osm-share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.osm-share-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.osm-share-modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.osm-share-modal-body {
    padding: 24px;
    display: flex;
    justify-content: space-around;
    gap: 16px;
}

.osm-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    text-align: center;
}

.osm-share-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    transition: background-color 0.2s;
}

.osm-share-option:hover .osm-share-icon-wrapper {
    background-color: #e0e0e0;
}