/* =========================================================
   TownConnect Category Map
   ========================================================= */

#townconnect-category-map,
.townconnect-category-map {
    width: 99.2vw;
    position: relative;
    left: 50.5%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    text-align: center;
    min-height: 500px;
    overflow: hidden;
    background: #f3f7f7;
}

/* =========================================================
   Shared Leaflet Control Basics
   ========================================================= */

.townconnect-map-location-control,
.townconnect-map-filter-control,
.townconnect-map-collapsible-control {
    width: auto;
    min-width: 0;
    max-width: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-family: inherit;
}

.townconnect-map-collapsible-control {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* =========================================================
   Small Icon Toggle Buttons
   ========================================================= */

.townconnect-map-control-toggle {
    appearance: none;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    padding: 0;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px!important;
    background: #ffffff;
    color: #2b3135;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.townconnect-map-control-toggle:hover,
.townconnect-map-control-toggle:focus {
    outline: none;
    transform: translateY(-1px);
    background: #ffffff;
    color: #0f6b73;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.townconnect-map-control-toggle:active {
    transform: translateY(0);
}

.townconnect-map-control-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.townconnect-map-control-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.townconnect-map-control-icon svg circle,
.townconnect-map-control-icon svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================================================
   Location Control

   Step 1: icon only
   Step 2: hover/click shows "SHOW MY LOCATION"
   Step 3: after location is active, show settings panel
   ========================================================= */

.townconnect-map-location-control {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: none!important;
}

.townconnect-map-location-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.townconnect-map-location-content button {
    border-radius: 5px!important;
    outline: none!important;
    box-shadow: none!important;
}

/* Step 2 preview button - hidden by default so it takes no space */

.townconnect-map-location-preview {
    appearance: none;
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 5px;
    background: #ffffff;
    color: #2f3133;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.townconnect-map-location-preview:hover,
.townconnect-map-location-preview:focus {
    outline: none;
    background: #ffffff;
    color: #0f6b73;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

/* Show preview on hover/focus or when JS pins it open.
   Only before location is active. */

.townconnect-map-location-control:not(.is-location-active):hover .townconnect-map-location-preview,
.townconnect-map-location-control:not(.is-location-active):focus-within .townconnect-map-location-preview,
.townconnect-map-location-control.is-peek-pinned:not(.is-location-active) .townconnect-map-location-preview {
    display: inline-flex;
    animation: townconnectFadeInRight 0.18s ease;
}

/* Hide preview once location is active */

.townconnect-map-location-control.is-location-active .townconnect-map-location-preview {
    display: none;
}

/* Full location settings panel - hidden by default so it takes no space */

.townconnect-map-location-control .townconnect-map-control-panel {
    display: none;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 36px));
    background: #ffffff;
    border: 1px solid rgba(15, 107, 115, 0.14);
    border-radius: 5px;
    padding: 14px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.16);
}

/* Show full location panel only when location is active and open */

.townconnect-map-location-control.is-location-active.is-open .townconnect-map-control-panel {
    display: block;
    animation: townconnectFadeInDown 0.18s ease;
}

/* Location panel buttons */

.townconnect-map-control-panel .townconnect-map-location-button {
    appearance: none;
    width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px;
    border: 0;
    border-radius: 0;
    padding: 12px 14px;
    background: #0f6b73;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease;
}

.townconnect-map-control-panel .townconnect-map-location-button:hover,
.townconnect-map-control-panel .townconnect-map-location-button:focus {
    background: #0b555b;
    outline: none;
}

.townconnect-map-control-panel .townconnect-map-location-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.townconnect-map-control-panel .townconnect-map-location-button--reset {
    background: #d8dddf;
    color: #243338;
}

.townconnect-map-control-panel .townconnect-map-location-button--reset:hover,
.townconnect-map-control-panel .townconnect-map-location-button--reset:focus {
    background: #c9d1d4;
    color: #1c2a2e;
}

.townconnect-map-control-panel .townconnect-map-location-button--load-more {
    margin-bottom: 0;
    background: #123d4b;
}

.townconnect-map-control-panel .townconnect-map-location-button--load-more:hover,
.townconnect-map-control-panel .townconnect-map-location-button--load-more:focus {
    background: #0e303a;
}

/* Radius only visible when location is active */

.townconnect-map-location-control .townconnect-map-radius-wrap {
    display: none;
    gap: 6px;
    margin: 2px 0 12px;
}

.townconnect-map-location-control.is-location-active .townconnect-map-radius-wrap {
    display: grid;
}

.townconnect-map-radius-label {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: #506167;
}

select:focus:not(.is-invalid),
.townconnect-map-radius-select {
    width: 100%;
    border: 1px solid rgba(15, 107, 115, 0.22)!important;
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff;
    color: #243338;
    font-size: 15px;
    text-align: center;
    outline: none!important;
    box-shadow: none!important;
    border-color: rgba(15, 107, 115, 0.22)!important;
}

/* If location control is on the right, open inward */

.leaflet-right .townconnect-map-location-control {
    flex-direction: row-reverse;
}

.leaflet-right .townconnect-map-location-control:not(.is-location-active):hover .townconnect-map-location-preview,
.leaflet-right .townconnect-map-location-control:not(.is-location-active):focus-within .townconnect-map-location-preview,
.leaflet-right .townconnect-map-location-control.is-peek-pinned:not(.is-location-active) .townconnect-map-location-preview {
    animation: townconnectFadeInLeft 0.18s ease;
}

/* =========================================================
   Filter Control
   ========================================================= */

.townconnect-map-filter-control {
    display: flex;
    align-items: flex-start;
    background: none!important;
}

.townconnect-map-filter-control .townconnect-map-control-toggle {
    order: 2;
}

/* Filter panel hidden by default so it takes no space */

.townconnect-map-filter-control .townconnect-map-control-panel {
    display: none;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 36px));
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 107, 115, 0.14);
    border-radius: 5px;
    padding: 12px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.16);
}

/* Only show filter panel when opened */

.townconnect-map-filter-control.is-open .townconnect-map-control-panel {
    display: block;
    animation: townconnectFadeInDown 0.18s ease;
}

.townconnect-map-filter-title {
    text-align: left;
    margin: 0 0 10px 0;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    color: #12343b;
}

.townconnect-map-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 4px;
    color: #12343b;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.townconnect-map-filter-option input {
    width: 16px !important;
    height: 16px;
    margin: 0 10px 0 0 !important;
    accent-color: #0f6b73;
}

.townconnect-map-filter-option span {
    flex: 1;
}

/* =========================================================
   User Location Marker
   ========================================================= */

.townconnect-user-location-icon span {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f6b73;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   Temporary Map Messages
   ========================================================= */

.townconnect-map-location-message {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 100px;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: calc(100% - 32px);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(23, 63, 70, 0.92);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   Popup Details
   ========================================================= */

.leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    margin-right: -1px;
}

.leaflet-popup-content {
    margin: 0;
}
.leaflet-popup-content:has(.townconnect-popup-help) {
    padding: 15px;
}

.leaflet-popup-content:has(.townconnect-popup-help) strong {
    font-weight: bold;
    text-transform: uppercase;
    margin: 0 0 5px 0 !important;
    display: inline-block;
    width: 100%;
}

.leaflet-popup-close-button {
    text-decoration: none!important;
}

.townconnect-popup-card {
    width: 210px;
    overflow: hidden;
}

.townconnect-popup-image-link {
    display: block;
    margin: 0;
    line-height: 0;
}

.townconnect-popup-image {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: contain;
}

.townconnect-popup-body {
    display: grid;
    gap: 4px;
    padding: 10px;
    text-align: center;
}

.townconnect-popup-title {
    display: block;
    color: #173f46;
    font-size: 14px;
    line-height: 1.25;
}

.townconnect-popup-title-link {
    font-weight: 700;
    text-decoration: none;
}

.townconnect-popup-title-link:hover,
.townconnect-popup-title-link:focus {
    color: #0f6b73;
    text-decoration: underline;
    outline: none;
}

.townconnect-popup-card--no-image .townconnect-popup-body {
    padding: 14px 12px;
}

.townconnect-popup-distance {
    display: inline-block;
    margin: 3px 0 1px;
    color: #0f6b73;
    font-weight: 700;
}

.townconnect-popup-help {
    display: inline-block;
    max-width: 210px;
    color: #4f6670;
    font-size: 12px;
    line-height: 1.35;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes townconnectFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes townconnectFadeInRight {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes townconnectFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {
    .townconnect-map-control-toggle {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .townconnect-map-control-icon,
    .townconnect-map-control-icon svg {
        width: 22px;
        height: 22px;
    }

    .townconnect-map-location-preview {
        min-height: 42px;
        padding: 0 14px;
        font-size: 11px;
    }

    .townconnect-map-location-control .townconnect-map-control-panel,
    .townconnect-map-filter-control .townconnect-map-control-panel {
        min-width: 200px;
        max-width: calc(100vw - 28px);
        padding: 12px;
        border-radius: 5px;
    }

    .townconnect-map-filter-control .townconnect-map-control-panel {
        max-height: 280px;
    }

    .townconnect-map-control-panel .townconnect-map-location-button {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* =========================================================
   Leaflet Zoom Control - TownConnect Style
   ========================================================= */

#townconnect-category-map .leaflet-control-zoom,
.townconnect-category-map .leaflet-control-zoom {
    border: 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
    background: #ffffff;
}

#townconnect-category-map .leaflet-control-zoom a,
.townconnect-category-map .leaflet-control-zoom a {
    width: 46px;
    height: 46px;
    line-height: 46px;
    border: 0;
    background: #ffffff;
    color: #2b3135;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    transition:
        background 0.18s ease,
        color 0.18s ease;
}

#townconnect-category-map .leaflet-control-zoom a:hover,
#townconnect-category-map .leaflet-control-zoom a:focus,
.townconnect-category-map .leaflet-control-zoom a:hover,
.townconnect-category-map .leaflet-control-zoom a:focus {
    background: #ffffff;
    color: #0f6b73;
    outline: none;
}

#townconnect-category-map .leaflet-control-zoom-in,
.townconnect-category-map .leaflet-control-zoom-in {
    border-bottom: 1px solid rgba(15, 107, 115, 0.12);
}

#townconnect-category-map .leaflet-control-zoom-out,
.townconnect-category-map .leaflet-control-zoom-out {
    border-top: 1px solid rgba(15, 107, 115, 0.12);
}

#townconnect-category-map .leaflet-control-zoom a.leaflet-disabled,
.townconnect-category-map .leaflet-control-zoom a.leaflet-disabled {
    background: #f3f7f7;
    color: #a6b2b5;
    cursor: not-allowed;
}
@media (max-width: 640px) {
    #townconnect-category-map .leaflet-control-zoom a,
    .townconnect-category-map .leaflet-control-zoom a {
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 20px;
    }
}

#townconnect-category-map .leaflet-control-attribution,
.townconnect-category-map .leaflet-control-attribution {
    font-size: 10px;
    line-height: 1.2;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.78);
    color: #4f6670;
    border-radius: 4px;
}

#townconnect-category-map .leaflet-control-attribution a,
.townconnect-category-map .leaflet-control-attribution a {
    color: #0f6b73;
    text-decoration: none;
}
/* =========================================================
   TownConnect reusable map app + list layouts
   ========================================================= */

.townconnect-map-app {
    width: 100%;
}

.townconnect-map-app--list_right,
.townconnect-map-app--list_left {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 18px;
    align-items: stretch;
}

.townconnect-map-app--list_left {
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.townconnect-map-app--list_left .townconnect-map-main {
    order: 2;
}

.townconnect-map-app--list_left .townconnect-map-list-panel {
    order: 1;
}

.townconnect-map-app--list_below .townconnect-map-list-panel {
    margin-top: 18px;
}

.townconnect-map-app--list_right #townconnect-category-map,
.townconnect-map-app--list_right .townconnect-category-map,
.townconnect-map-app--list_left #townconnect-category-map,
.townconnect-map-app--list_left .townconnect-category-map,
.townconnect-map-app--list_below #townconnect-category-map,
.townconnect-map-app--list_below .townconnect-category-map {
    width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    border-radius: 18px;
}

.townconnect-map-list-panel {
    background: #ffffff;
    border: 1px solid rgba(15, 107, 115, 0.14);
    border-radius: 18px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.townconnect-map-list-heading {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(15, 107, 115, 0.10);
}

.townconnect-map-list-heading h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    color: #12343b;
}

.townconnect-map-list {
    max-height: 620px;
    overflow: auto;
    padding: 12px;
}

.townconnect-map-list-card {
    padding: 14px;
    margin: 0 0 10px;
    border: 1px solid rgba(15, 107, 115, 0.12);
    border-radius: 14px;
    background: #f8fbfb;
    text-align: left;
}

.townconnect-map-list-card h3 {
    margin: 4px 0 8px;
    font-size: 16px;
    line-height: 1.25;
}

.townconnect-map-list-card h3 a {
    color: #12343b;
    text-decoration: none;
}

.townconnect-map-list-card h3 a:hover,
.townconnect-map-list-card h3 a:focus {
    color: #0f6b73;
    text-decoration: underline;
}

.townconnect-map-list-source,
.townconnect-map-list-distance {
    display: inline-block;
    font-size: 12px;
    line-height: 1.3;
    color: #60757a;
}

.townconnect-map-list-source {
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef7f8;
    color: #0f6b73;
    font-weight: 700;
}

.townconnect-map-list-distance {
    margin-bottom: 8px;
    font-weight: 700;
}

.townconnect-map-list-focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: #0f6b73;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.townconnect-map-list-focus:hover,
.townconnect-map-list-focus:focus {
    background: #0b555b;
    outline: none;
}

.townconnect-map-list-empty {
    padding: 18px;
    color: #60757a;
    text-align: left;
}

@media (max-width: 900px) {
    .townconnect-map-app--list_right,
    .townconnect-map-app--list_left {
        display: block;
    }

    .townconnect-map-app--list_right .townconnect-map-list-panel,
    .townconnect-map-app--list_left .townconnect-map-list-panel {
        margin-top: 18px;
    }

    .townconnect-map-list {
        max-height: none;
    }
}

/* v0.4.8 marker cluster fallback styling, used if the default MarkerCluster CSS is cached/missing. */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}
.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px/30px Arial, Helvetica, sans-serif;
    font-weight: 700;
}


/* v0.4.8 hover-to-front helper */
.townconnect-marker-is-hovered {
    z-index: 10000 !important;
}


/* v5.1.0 bottom controls + fixed-header safe spacing */
.leaflet-bottom .townconnect-map-collapsible-control {
    align-items: flex-end;
}

.leaflet-bottom .townconnect-map-location-control,
.leaflet-bottom .townconnect-map-filter-control {
    margin-bottom: 16px;
}

.leaflet-bottom.leaflet-left .townconnect-map-location-control {
    margin-left: 10px;
}

.leaflet-bottom.leaflet-right .townconnect-map-filter-control {
    margin-right: 10px;
}

.leaflet-bottom .townconnect-map-location-control.is-location-active.is-open .townconnect-map-control-panel,
.leaflet-bottom .townconnect-map-filter-control.is-open .townconnect-map-control-panel {
    animation: townconnectFadeInUp 0.18s ease;
}

@keyframes townconnectFadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* v5.1.0 header-safe fit + bottom-left stacked category/location controls */
.townconnect-map-filter-control--above-location {
    margin-top: 10px;
    margin-left: 0;
}

.townconnect-map-filter-control--above-location .townconnect-map-control-toggle {
    order: 2;
}

.townconnect-map-filter-control--above-location .townconnect-map-control-panel,
.townconnect-map-filter-panel {
    max-height: 300px;
    overflow-y: auto;
}

.leaflet-bottom .townconnect-map-filter-control--above-location {
    align-items: flex-end;
}

.leaflet-bottom.leaflet-left .townconnect-map-filter-control--above-location {
    margin-left: 10px;
}

.leaflet-bottom .townconnect-map-filter-control--above-location.is-open .townconnect-map-control-panel {
    animation: townconnectFadeInUp 0.18s ease;
}


/* v5.1.0 category filter above location, bottom-left stack */
.leaflet-bottom.leaflet-left .townconnect-map-filter-control--above-location {
    margin-left: 10px;
    margin-bottom: 8px;
}

.leaflet-bottom.leaflet-left .townconnect-map-filter-control--above-location .townconnect-map-control-toggle {
    order: 0;
}

.leaflet-bottom.leaflet-left .townconnect-map-filter-control--above-location .townconnect-map-control-panel {
    max-height: 300px;
    overflow-y: auto;
}

.leaflet-bottom.leaflet-left .townconnect-map-filter-control--above-location.is-open .townconnect-map-control-panel {
    animation: townconnectFadeInUp 0.18s ease;
}

/* v5.1.0 location panel absolute positioning so it opens upward without pushing bottom-left controls */
.leaflet-bottom .townconnect-map-location-control {
    position: relative;
}

.leaflet-bottom .townconnect-map-location-control .townconnect-map-location-content {
    position: relative;
}

.leaflet-bottom .townconnect-map-location-control .townconnect-map-control-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 250px;
    min-width: 250px;
    max-width: min(250px, calc(100vw - 90px));
    z-index: 1002;
}

.leaflet-bottom .townconnect-map-location-control.is-location-active.is-open .townconnect-map-control-panel {
    animation: townconnectFadeInUp 0.18s ease;
}

@media (max-width: 640px) {
    .leaflet-bottom .townconnect-map-location-control .townconnect-map-control-panel {
        width: 240px;
        min-width: 240px;
        max-width: min(240px, calc(100vw - 82px));
    }
}


/* v5.1.0 category filter bottom-right with panel opening left */
.leaflet-bottom.leaflet-right .townconnect-map-filter-control--bottom-right {
    margin-right: 10px;
    margin-bottom: 16px;
    position: relative;
    align-items: flex-end;
}

.leaflet-bottom.leaflet-right .townconnect-map-filter-control--bottom-right .townconnect-map-control-toggle {
    order: 2;
}

.townconnect-map-control-panel.townconnect-map-filter-panel {
    position: absolute;
    right: 60px;
    bottom: 0;
    min-width: 270px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1002;
}

.leaflet-bottom.leaflet-right .townconnect-map-filter-control--bottom-right.is-open .townconnect-map-control-panel {
    animation: townconnectFadeInUp 0.18s ease;
}

/* Revert the previous location absolute-panel experiment. */
.leaflet-bottom .townconnect-map-location-control .townconnect-map-control-panel {
    position: static;
    bottom: auto;
    left: auto;
    width: auto;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 36px));
}

@media (max-width: 640px) {
    .townconnect-map-control-panel.townconnect-map-filter-panel {
        right: 52px;
        min-width: 240px;
        max-width: calc(100vw - 90px);
        max-height: 300px;
    }

    .leaflet-bottom .townconnect-map-location-control .townconnect-map-control-panel {
        width: auto;
        min-width: 200px;
        max-width: calc(100vw - 28px);
    }
}


/* v5.1.0 bottom wave safe space: keeps Leaflet bottom controls above decorative bottom overlays. */
#townconnect-category-map .leaflet-bottom.leaflet-left,
#townconnect-category-map .leaflet-bottom.leaflet-right,
.townconnect-category-map .leaflet-bottom.leaflet-left,
.townconnect-category-map .leaflet-bottom.leaflet-right {
    bottom: 35px;
}

@media (max-width: 640px) {
    #townconnect-category-map .leaflet-bottom.leaflet-left,
    #townconnect-category-map .leaflet-bottom.leaflet-right,
    .townconnect-category-map .leaflet-bottom.leaflet-left,
    .townconnect-category-map .leaflet-bottom.leaflet-right {
        bottom: 27px;
    }
}


/* v5.1.22 per-listing custom marker.
   Any field_logo_marker image is masked into the exact TownConnect pin silhouette.
   Existing category SVG pins are unchanged. Featured marker size is 40x57 and the image is contained inside. */
.townconnect-logo-marker-icon {
    box-sizing: border-box;
    overflow: hidden;
    padding: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    line-height: 0;
    -webkit-mask-image: url("../markers/custom-logo-pin-mask.svg");
    mask-image: url("../markers/custom-logo-pin-mask.svg");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
}

.townconnect-logo-marker-image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
    object-position: center;
}

/* =========================================================
   Lazy activation + automatic viewport loading (v5.1.37)
   ========================================================= */

.townconnect-category-map {
    position: relative;
}

.townconnect-map-activation {
    position: absolute;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: inherit;
    padding: 48px 24px;
    overflow: hidden;
    background: rgba(7, 27, 31, 0.78);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.townconnect-map-activation::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06), transparent 34%),
        linear-gradient(135deg, rgba(18,86,95,0.18), transparent 55%);
}

.townconnect-map-activation.is-finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.townconnect-map-activation__inner {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.townconnect-map-activation__copy {
    display: grid;
    gap: 12px;
    max-width: 650px;
    text-align: center;
}

.townconnect-map-activation__copy strong {
    color: #ffffff;
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.12;
    font-weight: 750;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

.townconnect-map-activation__copy span {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(14px, 1.6vw, 17px);
    line-height: 1.6;
    text-wrap: balance;
}

.townconnect-map-activation__target {
    position: relative;
    appearance: none;
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 50%;
    padding: 0;
    background: rgba(18, 86, 95, 0.96);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.30), 0 0 0 8px rgba(255,255,255,0.06);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.townconnect-map-activation__target:hover,
.townconnect-map-activation__target:focus-visible {
    outline: none;
    transform: scale(1.06);
    background: #176a74;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 0 0 10px rgba(255,255,255,0.08);
}

.townconnect-map-activation__target:disabled {
    cursor: wait;
}

.townconnect-map-activation__pulse {
    position: absolute;
    inset: -2px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: inherit;
    animation: townconnectMapBreathe 2s ease-out infinite;
}

.townconnect-map-activation__icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.townconnect-map-activation__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.townconnect-map-activation__hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 650;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.townconnect-map-activation.is-loading .townconnect-map-activation__pulse {
    animation-duration: 0.95s;
}

.townconnect-map-activation.is-loading .townconnect-map-activation__target {
    animation: townconnectMapLoadingPulse 1.15s ease-in-out infinite;
}

@keyframes townconnectMapBreathe {
    0% { transform: scale(0.96); opacity: 0.80; }
    70%, 100% { transform: scale(1.55); opacity: 0; }
}

@keyframes townconnectMapLoadingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.94); }
}

@media (max-width: 640px) {
    .townconnect-map-activation {
        padding: 36px 20px;
    }

    .townconnect-map-activation__inner {
        gap: 20px;
    }

    .townconnect-map-activation__target {
        width: 78px;
        height: 78px;
        flex-basis: 78px;
    }

    .townconnect-map-activation__icon {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .townconnect-map-activation__pulse,
    .townconnect-map-activation.is-loading .townconnect-map-activation__target {
        animation: none;
    }
}

/* =========================================================
   v5.1.39 translucent activation + AJAX marker entrance
   ========================================================= */

.townconnect-map-activation {
    background: rgba(7, 27, 31, 0.30);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.townconnect-map-activation::before {
    background: linear-gradient(180deg, rgba(6, 38, 43, 0.05), rgba(6, 38, 43, 0.16));
}

.townconnect-map-activation__inner {
    width: min(520px, 100%);
    gap: 16px;
}

.townconnect-map-activation__hint {
    max-width: calc(100% - 28px);
    color: #ffffff;
    font-size: clamp(13px, 1.5vw, 15px);
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

.townconnect-marker-enter {
    animation: townconnectMarkerFadeIn 0.58s ease-out both;
}

.marker-cluster.townconnect-cluster-updated > div {
    animation: townconnectClusterUpdate 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center;
}

@keyframes townconnectMarkerFadeIn {
    0% { opacity: 0; }
    45% { opacity: 0.58; }
    100% { opacity: 1; }
}

@keyframes townconnectClusterUpdate {
    0% { transform: scale(0.78); opacity: 0.56; }
    65% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .townconnect-marker-enter,
    .marker-cluster.townconnect-cluster-updated > div {
        animation: none;
    }
}

/* =========================================================
   v5.1.40 whole-map activation + decorative beacon cursor
   ========================================================= */

.townconnect-map-activation {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='5' fill='%2312565F' stroke='white' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='11' fill='none' stroke='white' stroke-width='1.5' opacity='.9'/%3E%3Cpath d='M16 1v6M16 25v6M1 16h6M25 16h6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, crosshair;
}

.townconnect-map-activation.is-loading {
    cursor: wait;
}

.townconnect-map-activation:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.92);
    outline-offset: -4px;
}

.townconnect-map-activation__inner {
    gap: 12px;
    pointer-events: none;
}

.townconnect-map-activation__hint {
    order: 1;
    font-size: clamp(14px, 1.6vw, 16px);
}

.townconnect-map-activation__beacon {
    position: relative;
    order: 2;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: rgba(18, 86, 95, 0.92);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.05);
}

.townconnect-map-activation__beacon .townconnect-map-activation__pulse {
    inset: -1px;
    border-width: 1.5px;
}

.townconnect-map-activation__beacon .townconnect-map-activation__icon {
    width: 24px;
    height: 24px;
}

.townconnect-map-activation.is-loading .townconnect-map-activation__beacon {
    animation: townconnectMapLoadingPulse 1.15s ease-in-out infinite;
}

@media (max-width: 640px) {
    .townconnect-map-activation__beacon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .townconnect-map-activation__beacon .townconnect-map-activation__icon {
        width: 22px;
        height: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .townconnect-map-activation.is-loading .townconnect-map-activation__beacon {
        animation: none;
    }
}

/* =========================================================
   v5.1.41 pointer-following sonar beacon
   ========================================================= */

/* The whole inactive map remains the activation control, but the browser's
   hand/pointer is replaced by the lightweight sonar beacon on fine pointers. */
.townconnect-map-activation {
    cursor: default;
}

.townconnect-map-activation__inner {
    position: relative;
}

/* Strip the old button-like appearance completely. */
.townconnect-map-activation__beacon {
    position: relative;
    order: 2;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: block;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    box-shadow: none;
    pointer-events: none;
    z-index: 3;
}

.townconnect-map-activation__beacon-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.34);
}

.townconnect-map-activation__beacon-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 1.5px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    opacity: 0;
    animation: townconnectSonarRing 2s ease-out infinite;
}

.townconnect-map-activation__beacon-ring--two {
    animation-delay: 1s;
}

.townconnect-map-activation.is-loading .townconnect-map-activation__beacon {
    animation: none;
}

.townconnect-map-activation.is-loading .townconnect-map-activation__beacon-ring {
    animation-duration: 1.15s;
}

@keyframes townconnectSonarRing {
    0% {
        transform: scale(0.35);
        opacity: 0;
    }
    12% {
        opacity: 0.95;
    }
    72%, 100% {
        transform: scale(2.25);
        opacity: 0;
    }
}

@media (hover: hover) and (pointer: fine) {
    .townconnect-map-activation {
        cursor: none;
    }

    .townconnect-map-activation.is-loading {
        cursor: none;
    }

    .townconnect-map-activation__beacon {
        position: absolute;
        left: 50%;
        top: calc(50% + 34px);
        width: 38px;
        height: 38px;
        margin: 0;
        transform: translate(-50%, -50%);
        transition: opacity 0.12s ease;
    }

    .townconnect-map-activation__beacon.is-following {
        transition: none;
    }
}

@media (max-width: 640px), (hover: none), (pointer: coarse) {
    .townconnect-map-activation__beacon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .townconnect-map-activation__beacon-ring {
        animation: none;
        opacity: 0.72;
        transform: scale(1.35);
    }
}

@media (hover: hover) and (pointer: fine) {
    .townconnect-map-activation__inner {
        position: static;
    }
}


/* =========================================================
   v5.1.42 larger double sonar + zoom helper
   ========================================================= */

.townconnect-map-activation__inner {
    gap: 10px;
}

.townconnect-map-activation__zoom-hint {
    order: 2;
    display: block;
    margin-top: -2px;
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(11px, 1.15vw, 13px);
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: center;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.52);
    pointer-events: none;
}

.townconnect-map-activation__beacon {
    order: 3;
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.townconnect-map-activation__beacon-dot {
    width: 3px;
    height: 3px;
    margin: -1.5px 0 0 -1.5px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
}

/* Each animated wave has a second softer concentric edge via box-shadow. */
.townconnect-map-activation__beacon-ring {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.58);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
    animation-duration: 2.35s;
}

.townconnect-map-activation__beacon-ring--two {
    animation-delay: 1.175s;
}

@keyframes townconnectSonarRing {
    0% {
        transform: scale(0.42);
        opacity: 0;
    }
    14% {
        opacity: 0.62;
    }
    76%, 100% {
        transform: scale(3.05);
        opacity: 0;
    }
}

@media (hover: hover) and (pointer: fine) {
    .townconnect-map-activation__beacon {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 640px), (hover: none), (pointer: coarse) {
    .townconnect-map-activation__zoom-hint {
        display: none;
    }

    .townconnect-map-activation__beacon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        margin-top: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .townconnect-map-activation__beacon-ring {
        animation: none;
        opacity: 0.42;
        transform: scale(1.7);
    }
}

/* =========================================================
   v5.1.43 activation overlay typography / beacon placement
   ========================================================= */
.townconnect-map-activation__hint {
    letter-spacing: 1px;
    color: #ffffff;
    font-size: 19px;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Delight', sans-serif;
}

.townconnect-map-activation__beacon {
    top: calc(50% + 64px);
}

span.townconnect-map-activation__zoom-hint {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
    font-family: 'Delight', sans-serif;
    letter-spacing: 1px;
}
