/* ===== SEARCH BAR ===== */
.map-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.map-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.2s;
}

.map-search-box:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.map-search-icon {
    width: 16px;
    height: 16px;
    color: #aaa;
    flex-shrink: 0;
}

#map-search-input.map-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 0;
    font-size: 14px;
    background: transparent;
    color: #333;
    border: 0;
}

.map-search-input::placeholder {
    color: #aaa;
}

#map-search-reset.map-search-reset {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: #eee;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s;
    padding: 1.2rem;
}

.map-search-reset:hover {
    background: #ddd;
    color: #333;
}

.map-search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 260px;
    overflow-y: auto;
}

.map-search-suggestion {
    padding: 9px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    line-height: 1.4;
    transition: background 0.15s;
}

.map-search-suggestion:last-child {
    border-bottom: none;
}

.map-search-suggestion:hover,
.map-search-suggestion.focused {
    background: #f0f7ff;
    color: #2980b9;
}

/* ===== DISTANCE BADGE ===== */
.map-distance {
    display: inline-block;
    margin-top: 4px;
    margin-left: 18px;
    padding: 2px 7px;
    background: #e8f4fd;
    color: #2980b9;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* ===== SEARCH MARKER ===== */
.search-marker-pin {
    width: 20px;
    height: 20px;
    background: #f39c12;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== MAP ===== */
#atelier-map {
  width: 100%;
}

.map-layout {
    display: flex;
    gap: 0;
}

.map-sidebar {
    width: 320px;
    max-height: 600px;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
}

.map-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
}

.map-item:hover,
.map-item.active {
    background: #f3f3f3;
}

#atelier-map .leaflet-popup-content-wrapper a{
  color: var(--e-global-color-accent);
}

.map-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-item-header > strong{
    width: 90%;
}

.map-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.map-legend {
    background: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

@media screen and (max-width:768px){
  .map-layout{
    flex-direction: column-reverse; 
  }

  .map-sidebar {
    width: 100%;
  }
}