.wpdm-container { 
    display: flex; 
    height: 600px; 
    border: 1px solid #ccc; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    scroll-behavior: smooth;
}
.wpdm-sidebar { 
    width: 350px; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid #ddd; 
    background: #fff; 
    z-index: 10; 
    flex-shrink: 0;
}
.wpdm-search-box { padding: 15px; border-bottom: 1px solid #eee; background: #f9f9f9; }
.wpdm-search-box input, .wpdm-search-box select { 
    width: 100%; padding: 8px; margin-bottom: 8px; box-sizing: border-box; border: 1px solid #ccc; font-size: 14px;
}
.wpdm-btn-location { width: 100%; padding: 8px; background: #C8102E; color: #fff; border: none; cursor: pointer; font-weight: bold; }
.wpdm-btn-location:hover { background: #B00E26; }
.wpdm-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.wpdm-item { padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: background 0.2s; margin: 0 !important; }
.wpdm-item:hover { background: #f0f7fc; }
.wpdm-item h4 { margin: 0 0 3px 0; color: #333; font-size: 15px; }
.wpdm-badge-cat { display: inline-block; background: #eef2f5; color: #555; font-size: 11px; padding: 2px 6px; border-radius: 3px; margin-bottom: 8px; border: 1px solid #d2d6dc; font-weight: 500; }
.wpdm-item p { margin: 0 0 4px 0 !important; font-size: 13px; color: #666; line-height: 1.4; }
.wpdm-meta-info { font-size: 12px; color: #555; margin-top: 4px; white-space: nowrap; display: block; }
.wpdm-distance { margin-top: 5px; font-weight: bold; color: #C8102E; font-size: 12px; }
.wpdm-actions { margin-top: 4px; }
.wpdm-btn-dir { font-size: 12px; color: #0073aa; text-decoration: underline; background: none; border: none; padding: 0; cursor: pointer; }
#wpdm-map { flex: 1; height: 100%; min-height: 300px; }
.leaflet-routing-container { display: none !important; }
.wpdm-popup-cat { font-size: 11px; font-weight: bold; margin-bottom: 4px; display: block; }
.wpdm-popup-distance { display: inline-block; color: #C8102E; font-size: 11px; font-weight: bold; margin-bottom: 4px; }
/* Cho phép nội dung popup tự co giãn theo độ dài văn bản */
.wpdm-popup-current {white-space: nowrap;}
.leaflet-popup-content {
    width: auto !important;
    margin: 12px 20px 12px 12px;
    white-space: normal;    /* Tự động xuống dòng khi chạm max-width */
    word-break: break-word; /* Bẻ từ nếu địa chỉ quá dài */
}

/* Tùy chọn: Tự động căn chỉnh lại đầu ghim khi kích thước popup thay đổi */
.leaflet-popup-content-wrapper {
    border-radius: 0;
    width: auto !important;
}
.leaflet-popup-content b:first-child { display: block; font-size: 15px; margin-bottom: 6px; color: #333; }
.wpdm-popup-wrap {
    display: grid;
    grid-template-columns: 84px auto;
    gap: 12px;
    align-items: center;
}
.wpdm-popup-logo {
    gap: 6px;
    display: flex;
    flex-direction: column;
}
.wpdm-popup-logo-img,
.wpdm-popup-logo-btn {
    padding: 1px;
    border: 1px solid #ccc;
}
.wpdm-popup-logo-img {
    display: flex;
    aspect-ratio: 1/1;
    align-items: center;
    object-fit: contain;
    justify-content: center;
}
.wpdm-popup-logo a { width: 100%; padding: 4px 8px; background: #C8102E; color: #fff; border: none; cursor: pointer; text-align: center; display: grid;}
.wpdm-popup-logo a:hover { background: #B00E26; }
@media screen and (max-width: 768px) {
    .wpdm-container { flex-direction: column-reverse; height: auto; border: none; }
    #wpdm-map { width: 100%; height: 350px; flex: none; }
    .wpdm-sidebar { width: 100%; height: 450px; border-right: none; border-top: 1px solid #ddd; }
    .wpdm-search-box { position: sticky; top: 0; z-index: 11; }
    .wpdm-popup-wrap {display: flex; flex-direction: column;}
    .wpdm-popup-logo {display: none;}
}