.nearby-page {
    background: #f8fafc;
    color: #111827;
    display: flex;
    flex-direction: column;
    font-family: "Poppins", Arial, sans-serif;
    height: calc(100vh - 96px);
    min-height: 680px;
    overflow: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
}

#leaflet-map {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nearby-page * {
    letter-spacing: 0;
}

.nearby-topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #edf0f3;
    display: grid;
    gap: 14px;
    grid-template-columns: auto 1fr auto;
    padding: 12px 24px;
}

.nearby-back,
.nearby-toggle-categories,
.nearby-pill,
.nearby-card-action,
.nearby-popup-action {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    text-decoration: none;
}

.nearby-back {
    color: #475467;
    font-size: 14px;
}

.nearby-search-wrap {
    position: relative;
}

.nearby-search-wrap input {
    background: #f8fafc;
    border: 1px solid #edf0f3;
    border-radius: 8px;
    color: #111827;
    font-size: 15px;
    height: 46px;
    padding: 0 18px;
    width: 100%;
}

.nearby-search-wrap input::placeholder {
    color: #9aa4b2;
}

.nearby-search-wrap input:disabled,
.nearby-pill:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.nearby-toggle-categories {
    background: #fff;
    border: 1px solid #edf0f3;
    color: #17643a;
    font-size: 14px;
    min-height: 46px;
    padding: 0 16px;
}

.nearby-filterbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    gap: 10px;
    max-height: 72px;
    overflow-x: auto;
    padding: 14px 24px;
    transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease, border-color 180ms ease;
}

.nearby-filterbar.categories-hidden {
    border-bottom-color: transparent;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-bottom: 0;
    padding-top: 0;
    pointer-events: none;
}

.nearby-statusbar {
    align-items: center;
    background: #f4f8fb;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 24px;
}

.nearby-status-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nearby-status-copy strong {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.nearby-status-copy span {
    color: #667085;
    font-size: 13px;
}

.nearby-locate-btn {
    align-items: center;
    background: #17643a;
    border: 1px solid #17643a;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
}

.nearby-pill {
    background: #fff;
    border: 1px solid #d8dee6;
    color: #667085;
    flex: 0 0 auto;
    font-size: 13px;
    min-height: 36px;
    padding: 0 16px;
}

.nearby-pill.active {
    background: #17643a;
    border-color: #17643a;
    color: #fff;
}

.nearby-shell {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 386px minmax(0, 1fr);
    height: auto;
    min-height: 0;
}

.nearby-list {
    background: #fff;
    border-right: 1px solid #edf0f3;
    overflow: hidden;
    min-height: 0;
}

.nearby-list-head {
    align-items: center;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
}

.nearby-list-head strong {
    color: #1f2937;
    font-size: 15px;
    font-weight: 800;
}

.nearby-list-head span {
    color: #98a2b3;
    font-size: 13px;
}

.nearby-list-scroll {
    height: calc(100% - 57px);
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nearby-state-card {
    align-items: center;
    color: #667085;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 32px 24px;
    text-align: center;
}

.nearby-state-card h2 {
    color: #111827;
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.nearby-state-card p {
    font-size: 14px;
    margin: 0;
    max-width: 320px;
}

.nearby-state-icon {
    align-items: center;
    background: #e8f6e9;
    border-radius: 999px;
    color: #17643a;
    display: inline-flex;
    font-size: 24px;
    height: 60px;
    justify-content: center;
    width: 60px;
}

.nearby-state-icon-denied {
    background: #fef2f2;
    color: #dc2626;
}

.nearby-state-icon-empty {
    background: #eff6ff;
    color: #2563eb;
}

.nearby-state-button {
    min-width: 132px;
}

.nearby-card {
    background: #fff;
    border-bottom: 1px solid #edf0f3;
    display: grid;
    gap: 12px;
    grid-template-columns: 80px 1fr 24px;
    padding: 14px 18px;
    text-align: left;
    transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    width: 100%;
}

.nearby-card-select {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: contents;
    font: inherit;
    padding: 0;
    text-align: inherit;
}

.nearby-card.active {
    background: #f8fbff;
    box-shadow: inset 4px 0 0 var(--nearby-accent, #17643a), 0 10px 28px rgba(17, 24, 39, 0.08);
    position: relative;
    transform: translateX(2px);
    z-index: 2;
}

.nearby-card-selected-flash {
    animation: nearby-card-focus 760ms cubic-bezier(.2, .8, .2, 1);
}

.nearby-card-image {
    position: relative;
}

.nearby-card-image img {
    border-radius: 8px;
    height: 80px;
    object-fit: cover;
    width: 80px;
}

.nearby-status-dot {
    background: #12b981;
    border: 2px solid #fff;
    border-radius: 999px;
    height: 15px;
    position: absolute;
    right: -5px;
    top: -5px;
    width: 15px;
}

.nearby-status-dot.closed {
    background: #98a2b3;
}

.nearby-card h2 {
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 4px;
}

.nearby-meta {
    align-items: center;
    color: #667085;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 6px;
}

.nearby-star {
    color: #f5a91a;
    font-weight: 800;
}

.nearby-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 7px;
}

.nearby-badge {
    align-items: center;
    background: #e8f6e9;
    border-radius: 999px;
    color: #17643a;
    display: inline-flex;
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
    line-height: 1;
    padding: 5px 8px;
}

.nearby-badge-category.category-restaurants {
    background: #e8f6e9;
    color: #17643a;
}

.nearby-badge-category.category-accommodations {
    background: #eaf1ff;
    color: #2563eb;
}

.nearby-badge-category.category-masjids {
    background: #fff7d6;
    color: #b7791f;
}

.nearby-badge-category.category-sellers {
    background: #fee2e2;
    color: #dc2626;
}

.nearby-card-address {
    align-items: center;
    color: #98a2b3;
    display: flex;
    font-size: 11px;
    gap: 4px;
}

.nearby-heart {
    color: #c8d0db;
    font-size: 18px;
    padding-top: 4px;
}

.nearby-card-actions {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 104px;
    margin-top: 2px;
}

.nearby-card-action {
    border: 1px solid #edf0f3;
    color: #475467;
    font-size: 13px;
    min-height: 36px;
}

.nearby-card-action.primary {
    background: #17643a;
    border-color: #17643a;
    color: #fff;
}

.nearby-map {
    height: 100%;
    isolation: isolate;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.nearby-map-canvas {
    inset: 0;
    position: absolute;
    z-index: 1;
}

.nearby-map-overlay {
    align-items: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.95));
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: absolute;
    z-index: 1200;
}

.nearby-map-overlay-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #edf0f3;
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(17, 24, 39, 0.08);
    color: #667085;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
    padding: 24px;
    text-align: center;
}

.nearby-map-overlay-card ion-icon {
    color: #17643a;
    font-size: 28px;
}

.nearby-map-overlay-card strong {
    color: #111827;
    font-size: 18px;
}

.nearby-map-overlay-card span {
    font-size: 14px;
}

.leaflet-tooltip {
    border-radius: 999px;
    font-weight: 700;
    padding: 6px 10px;
}

.nearby-user-marker-wrap {
    background: transparent;
    border: 0;
}

.nearby-user-marker {
    background: #2563eb;
    border: 4px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.22), 0 6px 18px rgba(37, 99, 235, 0.35);
    display: block;
    height: 24px;
    width: 24px;
}

.nearby-user-tooltip {
    background: #2563eb;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    color: #ffffff;
}

.nearby-user-tooltip::before {
    border-top-color: #2563eb !important;
}

.nearby-place-marker-wrap {
    background: transparent;
    border: 0;
}

.nearby-place-marker {
    align-items: center;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    position: relative;
    transform: translateZ(0);
    width: 32px;
}

.nearby-place-marker-dot {
    background: var(--marker-color, #17643a);
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.24);
    display: block;
    height: 18px;
    transition: transform 180ms ease, box-shadow 180ms ease;
    width: 18px;
}

.nearby-place-marker-ring {
    border: 2px solid var(--marker-color, #17643a);
    border-radius: 999px;
    inset: 4px;
    opacity: 0;
    position: absolute;
    transform: scale(.7);
}

.nearby-place-marker:hover .nearby-place-marker-dot {
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.3);
    transform: scale(1.14);
}

.nearby-place-marker.selected {
    height: 42px;
    width: 42px;
}

.nearby-place-marker.selected .nearby-place-marker-dot {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--marker-color, #17643a) 22%, transparent), 0 14px 30px rgba(17, 24, 39, 0.28);
    height: 24px;
    transform: scale(1.08);
    width: 24px;
}

.nearby-place-marker.selected .nearby-place-marker-ring {
    animation: nearby-marker-pulse 1.55s cubic-bezier(.2, .8, .2, 1) infinite;
    opacity: .55;
}

@supports not (color: color-mix(in srgb, #000 20%, transparent)) {
    .nearby-place-marker.selected .nearby-place-marker-dot {
        box-shadow: 0 0 0 6px rgba(23, 100, 58, 0.2), 0 14px 30px rgba(17, 24, 39, 0.28);
    }
}

@keyframes nearby-marker-pulse {
    0% {
        opacity: .58;
        transform: scale(.72);
    }

    70% {
        opacity: 0;
        transform: scale(1.48);
    }

    100% {
        opacity: 0;
        transform: scale(1.48);
    }
}

@keyframes nearby-card-focus {
    0% {
        background: #ffffff;
        transform: translateX(0) scale(1);
    }

    38% {
        background: color-mix(in srgb, var(--nearby-accent, #17643a) 10%, #ffffff);
        transform: translateX(4px) scale(1.012);
    }

    100% {
        background: #f8fbff;
        transform: translateX(2px) scale(1);
    }
}

.nearby-popup {
    background: #fff;
    border-radius: 8px;
    bottom: 28px;
    box-shadow: 0 18px 46px rgba(17, 24, 39, .22);
    display: grid;
    gap: 12px;
    grid-template-columns: 64px 1fr auto;
    left: 50%;
    max-width: 360px;
    padding: 16px;
    position: absolute;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    z-index: 2000;
}

.nearby-popup img {
    border-radius: 8px;
    height: 64px;
    object-fit: cover;
    width: 64px;
}

.nearby-popup h2 {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 5px;
}

.nearby-popup-close {
    background: transparent;
    border: 0;
    color: #98a2b3;
    font-size: 20px;
    height: 24px;
    line-height: 1;
    padding: 0;
    width: 24px;
}

.nearby-popup-actions {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 112px;
}

.nearby-popup-action {
    border: 1px solid #edf0f3;
    color: #475467;
    font-size: 13px;
    min-height: 44px;
}

.nearby-popup-action.primary {
    background: #17643a;
    border-color: #17643a;
    color: #fff;
}

@media (max-width: 991px) {
    .nearby-page {
        display: block;
        height: auto;
        min-height: calc(100vh - 96px);
        overflow: visible;
    }

    .nearby-topbar {
        grid-template-columns: 1fr;
        padding: 12px 16px;
    }

    .nearby-filterbar {
        padding: 12px 16px;
    }

    .nearby-statusbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 16px;
    }

    .nearby-shell {
        grid-template-columns: 1fr;
        height: auto;
    }

    .nearby-list {
        border-right: 0;
    }

    .nearby-list-scroll {
        height: auto;
        max-height: 420px;
    }

    .nearby-map {
        min-height: 620px;
    }
}

@media (max-width: 575px) {
    .nearby-card {
        grid-template-columns: 72px 1fr 22px;
        padding: 12px 14px;
    }

    .nearby-card-image img {
        height: 72px;
        width: 72px;
    }

    .nearby-card-actions,
    .nearby-popup-actions {
        grid-template-columns: 1fr;
    }

    .nearby-popup {
        left: 12px;
        transform: none;
        width: calc(100% - 24px);
    }
}
