/* ── Locations Finder ─────────────────────────────────── */

:root {
    --lf-primary: #1a56db;
    --lf-primary-light: #e8eefb;
    --lf-text: #1f2937;
    --lf-text-muted: #6b7280;
    --lf-bg: #ffffff;
    --lf-bg-alt: #f8fafc;
    --lf-border: #e5e7eb;
    --lf-radius: 10px;
    --lf-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --lf-shadow-lg: 0 4px 16px rgba(0,0,0,.08);
    --lf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lf-wrapper {
    font-family: var(--lf-font);
    color: var(--lf-text);
    max-width: 1280px;
    margin: 2rem auto;
}

/* ── Search ───────────────────────────────────────────── */

.lf-search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.lf-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--lf-text-muted);
    pointer-events: none;
}

.lf-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius);
    font-size: 15px;
    font-family: var(--lf-font);
    background: var(--lf-bg);
    box-shadow: var(--lf-shadow);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.lf-search-input:focus {
    outline: none;
    border-color: var(--lf-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

/* ── Layout ───────────────────────────────────────────── */

.lf-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1rem;
    align-items: start;
}

#lf-map {
    border-radius: var(--lf-radius);
    overflow: hidden;
    box-shadow: var(--lf-shadow-lg);
    min-height: 400px;
    z-index: 1; /* keep below WP admin bar */
}

.lf-list-col {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

/* Scrollbar */
.lf-list-col::-webkit-scrollbar { width: 5px; }
.lf-list-col::-webkit-scrollbar-track { background: transparent; }
.lf-list-col::-webkit-scrollbar-thumb { background: var(--lf-border); border-radius: 4px; }

/* ── Card ─────────────────────────────────────────────── */

.lf-card {
    background: var(--lf-bg);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

.lf-card:hover {
    border-color: var(--lf-primary);
    box-shadow: var(--lf-shadow);
    transform: translateY(-1px);
}

.lf-card.is-active {
    border-color: var(--lf-primary);
    background: var(--lf-primary-light);
}

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

.lf-card-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--lf-bg-alt);
    flex-shrink: 0;
}

.lf-card-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--lf-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--lf-primary);
    font-weight: 700;
    font-size: 16px;
}

.lf-card-name {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.lf-card-address {
    font-size: 13px;
    color: var(--lf-text-muted);
    line-height: 1.45;
    margin-bottom: 8px;
}

.lf-card-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lf-contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--lf-primary);
    background: var(--lf-primary-light);
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: background .15s;
}

.lf-contact-badge:hover {
    background: #d4def7;
}

.lf-contact-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ── Results Count ────────────────────────────────────── */

.lf-results-count {
    text-align: center;
    font-size: 13px;
    color: var(--lf-text-muted);
    margin-top: 12px;
}

/* ── Error / Empty ────────────────────────────────────── */

.lf-error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    font-size: 14px;
}

.lf-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--lf-text-muted);
    font-size: 14px;
}

/* ── Leaflet Popup Override ───────────────────────────── */

.lf-popup {
    font-family: var(--lf-font);
    min-width: 200px;
}

.lf-popup h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.lf-popup p {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--lf-text-muted);
}

.lf-popup a {
    color: var(--lf-primary);
    text-decoration: none;
    font-size: 13px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: var(--lf-shadow-lg) !important;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 860px) {
    .lf-container {
        grid-template-columns: 1fr;
    }

    .lf-list-col {
        max-height: 350px;
    }
}
