/* Main wrapper for the listing map */
.listing-map-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Branch sidebar */
.branch-sidebar {
    flex: 0 0 350px;
    max-height: 600px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Branch filters */
.branch-filters {
    background: #f5f1e8;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.filter-item {
    margin-bottom: 10px;
}

.filter-item:last-child {
    margin-bottom: 0;
}

.filter-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 5px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:hover {
    border-color: #f9a825;
}

.filter-select:focus {
    outline: none;
    border-color: #f9a825;
    box-shadow: 0 0 0 2px rgba(249, 168, 37, 0.1);
}

/* GPS Status Indicator */
.gps-status {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    font-weight: normal;
}

.gps-status.active {
    color: #4CAF50;
}

.gps-status.error {
    color: #f44336;
}

.gps-status.loading {
    color: #ff9800;
}

/* Distance badge in branch cards */
.branch-distance {
    display: inline-block;
    background: #f9a825;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

.branch-list {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}

.branch-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Branch item */
.branch-item {
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.branch-item:hover {
    background: #f0f0f0;
    border-color: #0073aa;
    transform: translateX(5px);
}

.branch-item.active {
    background: #e8f4f8;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.branch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.branch-icon {
    font-size: 20px;
    color: #0073aa;
}

.branch-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-divider {
    height: 1px;
    background: linear-gradient(90deg, #0073aa 0%, transparent 100%);
    margin: 8px 0;
}

.branch-info {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.branch-info p {
    margin: 4px 0;
}

.branch-address {
    font-weight: 500;
    color: #333;
}

.branch-hours {
    color: #666;
    font-size: 12px;
}

.branch-phone {
    color: #0073aa;
    font-weight: 500;
}

/* Map column */
.map-column {
    flex: 1;
    min-width: 0;
}

#listing-map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Popup styling */
.branch-popup h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.branch-popup img {
    border-radius: 4px;
    margin-bottom: 10px;
}

.branch-popup p {
    margin: 5px 0;
}

.branch-popup .branch-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.branch-popup a {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.branch-popup a:hover {
    background-color: #005a87;
}

/* Admin styling */
#map {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .listing-map-wrapper {
        flex-direction: column;
    }

    .branch-sidebar {
        flex: 1 1 auto;
        max-height: 400px;
        order: 2;
    }

    .map-column {
        order: 1;
    }

    #listing-map {
        height: 400px !important;
    }
}