.pi-m2-wrapper {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.pi-m2-layout {
    display: flex;
    flex-wrap: nowrap;
    height: 100%;
    min-height: 600px;
}

.pi-m2-sidebar {
    flex: 0 0 400px;
    width: 400px;
    max-width: 40%;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.pi-m2-map-container {
    flex: 1 1 auto;
    position: relative;
}

.pi-m2-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* CPT Header Styles */
.pi-cpt-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.pi-cpt-title {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.pi-cpt-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

/* Filters & List */
.pi-m2-filters {
    margin-bottom: 1rem;
}

.pi-m2-filters select {
    width: 100%;
    margin-bottom: .5rem;
    padding: 10px;
    /* More padding */
    border: 1px solid #ddd;
    border-radius: 6px;
    /* Rounded */
    text-transform: capitalize;
    /* Capitalize options */
    font-size: 14px;
    background-color: #fff;
}

.pi-cpt-title {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    line-height: 1.2;
    text-transform: capitalize;
    /* Capitalize title */
    color: #2c3e50;
    /* Darker color */
}

.pi-m2-mode-switch {
    display: flex;
    gap: .5rem;
    margin-top: 10px;
}

.pi-m2-mode-btn {
    flex: 1 1 0;
    padding: 8px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.pi-m2-mode-btn.is-active {
    font-weight: bold;
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pi-m2-list {
    flex: 1 1 auto;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.pi-m2-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pi-m2-list-item, .pi-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.pi-item:hover {
    background: #f8f9fa;
}

.pi-item h2, .pi-item h3 {
    margin: 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.pi-item h2 a, .pi-item h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.pi-item h2 a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.pi-price {
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    margin-left: 10px;
}

/* Nearby sections */
.pi-secondary-title {
    margin: 30px 0 15px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.pi-links-list.pi-nearby {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.pi-links-list.pi-nearby li {
    background: #f1f3f5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.pi-links-list.pi-nearby li a {
    color: #495057;
    text-decoration: none;
}

.pi-links-list.pi-nearby li a:hover {
    color: #000;
}

/* Map Markers */
.pi-price-marker {
    transition: transform 0.2s ease;
}
.pi-price-marker:hover {
    transform: scale(1.1);
    z-index: 1000;
}

@media (max-width: 768px) {
    .pi-m2-layout {
        flex-direction: column;
    }

    .pi-m2-sidebar {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        height: auto;
        min-height: 300px;
        max-height: 70vh;
        order: 2;
    }

    .pi-m2-map-container {
        height: 40vh;
        min-height: 250px;
        order: 1;
        flex: none;
    }
}