/* HB Location Map – map.css | by De Grote Spekelaar */

/* ── CSS custom properties (defaults — overschreven per instantie via wp_add_inline_style) ── */
.alm-locator {
    --alm-accent: #c0392b;
    --alm-dark:   #1a1a2e;
    --alm-label:  #6b7a99;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ═══════════════════════════════════════
   CONTROLS (zoekbalk + dropdown)
═══════════════════════════════════════ */
.alm-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 600px) {
    .alm-controls { flex-direction: column; }
}

/* Gedeeld control-blok */
.alm-control {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    height: 46px;
    background: #ffffff;
    border: 1.5px solid #dde2ed;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.alm-control:focus-within {
    border-color: var(--alm-accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

.alm-control__icon {
    flex-shrink: 0;
    color: var(--alm-label);
    margin: 0 10px 0 14px;
    pointer-events: none;
}

/* ── Zoekbalk ── */
.alm-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0;
    height: 100%;
    font-size: 14px;
    font-family: inherit;
    color: var(--alm-dark);
    background: transparent;
    min-width: 0;
}

.alm-search-input::placeholder {
    color: var(--alm-label);
    opacity: 1;
}

.alm-search-clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 7px;
    background: #f0f2f7;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--alm-label);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, background .15s, color .15s;
}

.alm-search-clear.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.alm-search-clear:hover {
    background: var(--alm-accent);
    color: #fff;
}

/* ── Dropdown ── */
.alm-control--dropdown {
    position: relative;
}

.alm-dropdown-select {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 40px 0 0;
    font-size: 14px;
    font-family: inherit;
    color: var(--alm-dark);
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.alm-dropdown-select option {
    color: var(--alm-dark);
    background: #fff;
}

.alm-dropdown-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--alm-label);
    pointer-events: none;
    transition: color .15s;
}

.alm-control--dropdown:focus-within .alm-dropdown-arrow {
    color: var(--alm-accent);
}

/* ── Geen resultaten ── */
.alm-no-results {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--alm-label);
    background: #fff;
    border: 1.5px dashed #dde2ed;
    border-radius: 10px;
}

.alm-no-results.is-visible {
    display: flex;
}

/* ═══════════════════════════════════════
   KAART
═══════════════════════════════════════ */
.alm-map-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 32px rgba(0,0,0,.12);
}

.alm-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #e8edf2;
}

/* ═══════════════════════════════════════
   MARKER
═══════════════════════════════════════ */
.alm-marker-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.alm-marker-label {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 9px;
    background: rgba(255,255,255,.96);
    color: var(--alm-dark, #1a1a2e);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.3;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    letter-spacing: .01em;
    transition: background .2s, color .2s, box-shadow .2s;
}

.alm-marker-wrap:hover .alm-marker-label {
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

/* Highlighted staat (bij dropdown/search match) */
.alm-marker-wrap.is-highlighted .alm-marker-label {
    background: var(--alm-accent, #c0392b);
    color: #fff;
    box-shadow: 0 4px 16px rgba(192,57,43,.35);
}

/* ═══════════════════════════════════════
   POPUP
═══════════════════════════════════════ */
.alm-popup {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: 200px;
    max-width: 260px;
}

.alm-popup__logo {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.alm-popup__logo img {
    max-height: 56px;
    max-width: 180px;
    object-fit: contain;
}

.alm-popup__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--alm-dark, #1a1a2e);
    margin: 0 0 5px;
    line-height: 1.3;
}

.alm-popup__address {
    font-size: 12px;
    color: var(--alm-label, #6b7a99);
    margin: 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.alm-popup__address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--alm-accent, #c0392b);
}

.alm-popup__website {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--alm-accent, #c0392b);
    text-decoration: none;
    transition: opacity .15s;
}

.alm-popup__website:hover {
    opacity: .75;
    text-decoration: underline;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.16) !important;
    border: 1px solid rgba(0,0,0,.05) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 16px 18px !important;
}

.leaflet-popup-tip-container {
    margin-top: -1px;
}

.leaflet-container {
    background: #dde3ea;
}

/* ═══════════════════════════════════════
   ERROR
═══════════════════════════════════════ */
.alm-error {
    background: #fff5f5;
    border: 1px solid #ffb3b3;
    color: #c0392b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}
