/* Advanced Map Search Styles */
.realplus-map-search-container {
	display: flex;
	height: calc(100vh - 150px);
	min-height: 700px;
	background: #fff;
	overflow: hidden;
	position: relative;
	border: 1px solid #eee;
}

/* Sidebar / List */
.rp-map-list-side {
	flex: 0 0 50%;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #eee;
}

.rp-map-filters {
	padding: 25px;
	border-bottom: 1px solid #eee;
	background: #fff;
}

.rp-map-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.rp-map-filter-grid select,
.rp-map-filter-grid input {
    width: 100%;
    height: 50px; /* Explicit height */
    padding: 0 35px 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    color: #1e293b !important;
    background-color: #ffffff !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    display: block;
    visibility: visible;
    opacity: 1;
}

.rp-map-filter-grid select option {
    color: #1e293b;
    background-color: #ffffff;
    padding: 10px;
}

.rp-map-filter-grid select:focus {
    border-color: #9d7515;
    outline: none;
}

.rp-map-reset-btn {
    height: 50px; /* Match select height */
    padding: 0 20px;
    background: #9d7515;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rp-map-reset-btn:hover {
    background: #7a5a10;
}

.rp-map-results {
	flex: 1;
	overflow-y: auto;
	padding: 25px;
	background: #ffffff;
}

.rp-map-results .realplus-grid {
	grid-template-columns: repeat(2, 1fr) !important; 
    gap: 20px;
}

.rp-map-results .rp-card-img {
    height: 200px !important; /* Smaller height for map results */
}

.rp-map-results .realplus-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 0;
}

.rp-map-results .rp-card-image-wrapper {
    margin-bottom: 10px; /* Reduced from 20px */
}

.rp-map-results .rp-card-title {
    margin-bottom: 2px;
}

.rp-map-results .rp-card-address,
.rp-map-results .rp-card-specs {
    margin-bottom: 2px !important;
}

.rp-map-results .rp-card-price {
    margin-bottom: 5px !important;
}

/* Map Side */
.rp-map-view-side {
	flex: 0 0 50%;
	position: relative;
	background: #e5e7eb;
}

#realplus-advanced-map {
	width: 100%;
	height: 100%;
}

/* Custom Marker Styling */
.rp-price-marker {
	background: #9d7515;
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 700;
	font-size: 13px;
	border: 1px solid #fff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
	white-space: nowrap;
	display: flex;
	align-items: center;
	justify-content: center;
    min-width: 45px;
}

.rp-price-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #9d7515;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
	.realplus-map-search-container {
		flex-direction: column-reverse; /* Map on top for better mobile feel */
		height: auto;
        min-height: 900px;
	}
	.rp-map-list-side {
		flex: none;
		width: 100%;
		height: 600px;
	}
	.rp-map-view-side {
		height: 400px;
        width: 100%;
        flex: none;
	}
}

/* Highlighted result */
.rp-map-results .realplus-card.is-active {
	border-color: #9d7515;
	background: #fffdf5;
}

.rp-map-results .realplus-card {
    overflow: hidden; /* Prevent text overflow */
}

/* Map Popup Styling */
.leaflet-popup-content {
    font-size: 12px !important;
    line-height: 1.5;
    color: #333;
}

.leaflet-popup-content b {
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
    color: #000;
}

.leaflet-popup-content a {
    color: #000 !important;
    text-decoration: underline;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.leaflet-popup-content a:hover {
    color: #9d7515 !important;
}

/* Fix for 'X' close button decoration */
.leaflet-container a.leaflet-popup-close-button {
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}
