/* Local Resources Finder
   Scope with .lr-* to avoid collisions with existing theme
   Uses Inter via your global base; we re-assert as fallback. */

.lr-wrap {
    --cch-blue: #0011e3;
    --cch-blue-2: #0056b3;
    --cch-accent: #01eefc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #ffffff;
    --pill: #f1f5f9;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    padding: 24px;
}

.lr-header {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 20px 14px 20px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
    margin-bottom: 16px;
}

.lr-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.lr-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    justify-content: center;
    align-items: center;
}


.lr-search-row--center {
    justify-content: center;
}

.lr-input-group--wide {
    width: 100%;
}

.lr-input--xl {
    height: 52px;
    font-size: 16px;
    border-radius: 14px;
}

.lr-search-btn--xl {
    height: 52px;
    border-radius: 14px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 800;
}


.lr-input-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.lr-input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.lr-input:focus {
    border-color: var(--cch-blue-2);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, .12);
}

.lr-btn {
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lr-btn.primary {
    background: var(--cch-blue);
    color: #fff;
}

.lr-btn.primary:hover {
    background: var(--cch-blue-2);
}

.lr-btn.secondary {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.lr-btn.secondary:hover {
    border-color: var(--cch-blue-2);
}

.lr-btn.ghost {
    background: #fff;
    border-color: var(--border);
    color: var(--cch-blue-2);
}

.lr-btn.small {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.lr-btn.outline {
    background: #fff;
    border-color: var(--border);
}

.lr-btn.disabled {
    opacity: .5;
    pointer-events: none;
}

.lr-panels {
    display: grid;
    grid-template-columns: 280px 1fr 420px;
    gap: 16px;
}

.lr-left,
.lr-mid,
.lr-right {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.06);
    min-height: 520px;
}

.lr-left {
    padding: 16px;
}

.lr-panel-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.lr-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 6px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.lr-services {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.lr-services li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lr-services label {
    color: var(--text);
    font-size: 14px;
}

.lr-mid {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    /* keep existing presence */
}

/* Results list should scroll inside the middle panel */
.lr-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    overflow: auto;
}

.lr-status {
    margin: 4px 8px 10px;
    font-size: 13px;
    color: var(--muted);
}

.lr-status--error {
    color: #b91c1c;
}

.lr-status--hide {
    display: none;
}

.lr-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.lr-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.lr-card-col--left {
    min-width: 0;
}

.lr-card-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.lr-card-sub {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.lr-pill {
    display: inline-block;
    background: var(--pill);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lr-card-col--right {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 6px;
    align-items: start;
    justify-items: end;
}

.lr-distance {
    font-weight: 700;
    color: var(--cch-blue-2);
    font-size: 13px;
}

.lr-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lr-star {
    width: 16px;
    height: 16px;
}

.lr-star.full path {
    fill: #f59e0b;
}

.lr-star.half path {
    fill: url(#gradHalf);
}

.lr-star.empty path {
    fill: #e2e8f0;
}

.lr-rcount {
    color: var(--muted);
    font-size: 12px;
}

.lr-actions {
    display: inline-flex;
    gap: 8px;
}

.lr-loadmore {
    align-self: center;
    margin: 12px 0 4px;
}

.lr-right {
    overflow: hidden;
    padding: 12px;
}

.lr-map {
    width: 100%;
    height: 100%;
    min-height: 520px;
    border-radius: 16px;
}

@media (max-width: 1200px) {
    .lr-panels {
        grid-template-columns: 250px 1fr;
    }

    .lr-right {
        grid-column: 1/-1;
        height: 420px;
    }

    .lr-map {
        min-height: 420px;
    }
}



.lr-pager {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    padding: 10px 0 6px;
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

.lr-pagebtn {
    background: #fff;
    border: 1px solid var(--border);
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 13px;
    cursor: pointer;
}

.lr-pagebtn[aria-current="page"] {
    background: var(--cch-blue);
    color: #fff;
    border-color: var(--cch-blue);
}

.lr-pagebtn:disabled {
    opacity: .5;
    cursor: default;
}

/* --- Local Resources: “Searching…” spinner (matches HCE look) --- */
.lr-spinner {
    display: grid;
    place-items: center;
    min-height: 220px;
}

.lr-spinner::after {
    content: "";
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid #dbe7ff;
    border-top-color: #0056b3;
    animation: lrSpin .9s linear infinite;
}

@keyframes lrSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Visually-hidden text for screen readers (same approach as HCE .hce-sr) */
.lr-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Google Places dropdown: keep above UI and slightly offset below input */
.pac-container {
    z-index: 2147483643 !important;
    margin-top: 6px;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 860px) {

    /* Search row stacks neatly */
    .lr-search-row {
        grid-template-columns: 1fr;
    }

    /* Single column layout for panels */
    .lr-panels {
        grid-template-columns: 1fr;
        grid-auto-rows: min-content;
        gap: 12px;
    }

    /* Remove tall desktop minimums for tighter mobile fit */
    .lr-left,
    .lr-mid,
    .lr-right {
        min-height: unset;
    }

    /* Results list should scroll without making the page absurdly tall */
    .lr-mid {
        padding: 10px;
    }

    .lr-results {
        /* Cap height to a portion of the viewport and enable momentum scroll */
        max-height: min(56vh, 560px);
        -webkit-overflow-scrolling: touch;
    }

    /* Map: use a responsive, comfortable height */
    .lr-right {
        height: auto;
        padding: 10px;
    }

    .lr-map {
        width: 100%;
        /* keeps it tall enough to be useful but not overwhelming */
        min-height: clamp(260px, 44vh, 380px);
        border-radius: 12px;
    }

    /* Keep the autocomplete dropdown perfectly aligned on mobile */
    .pac-container {
        width: 96vw !important;
        left: 2vw !important;
        right: 2vw !important;
    }

    /* Input + "Use my location" should wrap gracefully */
    .lr-input-group {
        flex-wrap: wrap;
        gap: 8px;
    }

    .lr-btn.ghost {
        flex: 0 0 auto;
        height: 44px;
    }
}

/* --- Ultra-narrow stacking & tap targets --- */
@media (max-width: 520px) {

    /* Cards become single-column to avoid cramped side-by-side layout */
    .lr-card {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .lr-card-col--right {
        justify-items: start;
        /* align right column content to the left when stacked */
        grid-template-rows: auto auto auto;
        width: 100%;
    }

    /* Make action buttons wrap into rows and stretch nicely for thumbs */
    .lr-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .lr-actions .lr-btn.small {
        height: 40px;
        font-size: 13px;
        width: 100%;
    }

    /* Slightly larger distance text and friendlier spacing */
    .lr-distance {
        font-size: 14px;
    }

    /* Pager buttons: easier to tap */
    .lr-pagebtn {
        min-width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 14px;
    }
}

/* Prevent accidental horizontal scroll on tiny devices */
.lr-wrap {
    overflow-x: hidden;
}