/* =========================================================================
   SEARCH ON MAP
   public/assets/css/search-map.css

   Page-scoped under .sm-* so nothing here can reach the rest of the site.
   ========================================================================= */

:root {
    --sm-ink: #0F141B;
    --sm-body: #3B4452;
    --sm-muted: #8B94A3;
    --sm-line: #E6EAEF;
    --sm-soft: #F7F9FD;
    --sm-blue: #1E63E9;
    --sm-blue-dark: #0B3B94;
    --sm-green: #2FA36B;
    --sm-gold: #E3A83C;
    --sm-radius: 16px;

    /* One number controls the height of both columns */
    --sm-h: calc(100dvh - 210px);
}

.sm-page {
    max-width: 1560px;
    padding: 0 20px;
}

/* =========================================================
   PANEL (left)
   ========================================================= */
.sm-panel {
    display: flex;
    flex-direction: column;
    height: var(--sm-h);
    min-height: 520px;
    background: #fff;
    border: 1px solid var(--sm-line);
    border-radius: var(--sm-radius);
    overflow: hidden;
}

.sm-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--sm-line);
    background: var(--sm-soft);
}

.sm-panel-head strong {
    font-size: 17px;
    color: var(--sm-ink);
}

.sm-panel-head span {
    font-size: 13.5px;
    color: var(--sm-muted);
    margin-left: 4px;
}

.sm-reset {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--sm-line);
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-body);
    cursor: pointer;
    max-width: 60%;
}

.sm-reset:hover {
    background: var(--sm-ink);
    color: #fff;
    border-color: var(--sm-ink);
}

.sm-reset span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sm-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
}

.sm-list::-webkit-scrollbar {
    width: 8px;
}

.sm-list::-webkit-scrollbar-thumb {
    background: #DDE3EC;
    border-radius: 999px;
}

/* ---------- card ---------- */
.sm-card {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 13px;
    border: 1px solid transparent;
    border-radius: 13px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.sm-card:hover {
    background: var(--sm-soft);
    border-color: var(--sm-line);
    transform: translateX(2px);
}

.sm-card.is-active {
    background: #EEF3FE;
    border-color: var(--sm-blue);
}

.sm-card:focus-visible {
    outline: 3px solid var(--sm-blue);
    outline-offset: 2px;
}

.sm-card-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
    background: var(--sm-soft);
}

.sm-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.sm-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.sm-card-top h3 {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--sm-ink);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sm-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .4px;
    padding: 2px 7px;
    border-radius: 999px;
}

.sm-tag-pro {
    background: rgba(227, 168, 60, .18);
    color: #A9770F;
}

.sm-tag-live {
    background: rgba(47, 163, 107, .14);
    color: var(--sm-green);
}

.sm-card-meta {
    font-size: 12.5px;
    color: var(--sm-muted);
    margin: 3px 0 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.sm-stars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--sm-gold);
}

.sm-stars em {
    font-style: normal;
    font-size: 12px;
    color: var(--sm-muted);
    margin-left: 4px;
}

.sm-price {
    font-size: 12.5px;
    color: var(--sm-muted);
}

.sm-price strong {
    color: var(--sm-ink);
    font-size: 14px;
}

.sm-empty {
    text-align: center;
    padding: 54px 24px;
}

.sm-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: #EEF3FE;
    color: var(--sm-blue);
    font-size: 22px;
    margin-bottom: 16px;
}

.sm-empty h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--sm-ink);
    margin: 0 0 8px;
}

.sm-empty p {
    font-size: 14px;
    color: var(--sm-body);
    margin: 0 0 18px;
}

/* =========================================================
   MAP (right)
   ========================================================= */
.sm-map-wrap {
    position: relative;
    height: var(--sm-h);
    min-height: 520px;
    border: 1px solid var(--sm-line);
    border-radius: var(--sm-radius);
    overflow: hidden;
}

.sm-map {
    width: 100%;
    height: 100%;
    background: #E8EEF6;
}

/* Leaflet's own chrome, restyled to match */
.sm-map-wrap .leaflet-control-zoom {
    border: 0 !important;
    box-shadow: 0 4px 16px rgba(15, 20, 27, .16) !important;
}

.sm-map-wrap .leaflet-control-zoom a {
    border-radius: 8px !important;
    color: var(--sm-ink) !important;
}

.sm-map-wrap .leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, .82);
}

.sm-locate {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 500;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: var(--sm-ink);
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 20, 27, .2);
    transition: .2s;
}

.sm-locate:hover {
    background: var(--sm-blue);
    color: #fff;
}

.sm-locate.is-busy {
    opacity: .6;
    pointer-events: none;
}

.sm-locate.is-busy i {
    animation: smSpin 1s linear infinite;
}

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

.sm-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 500;
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, .94);
    border-radius: 10px;
    padding: 8px 13px;
    font-size: 12px;
    color: var(--sm-body);
    box-shadow: 0 4px 16px rgba(15, 20, 27, .14);
}

.sm-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.sm-dot-trainer {
    background: var(--sm-blue);
}

.sm-dot-dietitian {
    background: var(--sm-green);
}

.sm-hint {
    position: absolute;
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
    z-index: 500;
    margin: 0;
    background: rgba(15, 20, 27, .82);
    color: #fff;
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 12.5px;
    white-space: nowrap;
    pointer-events: none;
}

.sm-hint i {
    margin-right: 6px;
    opacity: .8;
}

/* ---------- city bubble ---------- */
.sm-city-icon {
    background: none !important;
    border: 0 !important;
}

.sm-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--sm-blue), var(--sm-blue-dark));
    color: #fff;
    box-shadow: 0 6px 20px rgba(11, 59, 148, .45);
    border: 3px solid rgba(255, 255, 255, .92);
    cursor: pointer;
    transition: transform .2s ease;
}

.sm-bubble:hover {
    transform: scale(1.09);
}

.sm-bubble b {
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
}

.sm-bubble em {
    position: absolute;
    bottom: -21px;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: var(--sm-ink);
    background: rgba(255, 255, 255, .92);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

/* ---------- user pin ---------- */
.sm-user-icon {
    background: none !important;
    border: 0 !important;
}

.sm-pin {
    position: relative;
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 5px 14px rgba(15, 20, 27, .3);
    overflow: hidden;
    transition: transform .2s ease;
}

.sm-pin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(45deg) scale(1.42);
}

.sm-pin-trainer {
    background: var(--sm-blue);
}

.sm-pin-dietitian {
    background: var(--sm-green);
}

.sm-pin.is-pro {
    border-color: var(--sm-gold);
}

.sm-user-icon.is-hover .sm-pin {
    transform: rotate(-45deg) scale(1.18);
}

/* =========================================================
   A. CARD — arrow to the profile
   ========================================================= */
.sm-card {
    align-items: center;
}

.sm-card-go {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #E5EAF3;
    background: #fff;
    color: #8B94A3;
    font-size: 12px;
    text-decoration: none;
    transition: .18s;
}

.sm-card-go:hover {
    background: var(--sm-blue);
    border-color: var(--sm-blue);
    color: #fff;
    transform: translateX(2px);
}

.sm-card:hover .sm-card-go {
    border-color: #C6CDD8;
}

/* Someone with no coordinates cannot be shown on the map — say so quietly
   rather than letting the card look broken when clicking does nothing */
.sm-card.is-unplaced {
    cursor: default;
}

.sm-card.is-unplaced:hover {
    transform: none;
}

.sm-card-meta em {
    font-style: normal;
    color: #C6A05A;
}

/* =========================================================
   C. POPUP
   ========================================================= */
.sm-popup .leaflet-popup-content-wrapper {
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 12px 34px rgba(15, 20, 27, .26);
}

.sm-popup .leaflet-popup-content {
    margin: 0;
    /* width: auto !important; */
}

.sm-popup .leaflet-popup-tip {
    box-shadow: 0 12px 34px rgba(15, 20, 27, .2);
}

.sm-popup .leaflet-popup-close-button {
    width: 26px;
    height: 26px;
    top: 8px !important;
    right: 8px !important;
    color: #fff !important;
    background: rgba(15, 20, 27, .35);
    border-radius: 50%;
    font-size: 17px !important;
    line-height: 24px !important;
}

.sm-popup .leaflet-popup-close-button:hover {
    background: rgba(15, 20, 27, .6);
}

.sm-pop {
    text-align: left;
}

.sm-pop-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px 13px;
    background: linear-gradient(135deg, #F7F9FD, #EEF3FE);
    border-bottom: 1px solid #E9EDF3;
}

.sm-pop-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 20, 27, .16);
}

.sm-pop-id {
    min-width: 0;
}

.sm-pop-id strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--sm-ink);
    line-height: 1.25;
}

.sm-pop-type {
    display: block;
    font-size: 12px;
    color: var(--sm-muted);
    margin-top: 1px;
}

.sm-pop-tags {
    display: flex;
    gap: 5px;
    margin-top: 6px;
}

.sm-pop-tag {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .4px;
    padding: 2px 7px;
    border-radius: 999px;
}

.sm-pop-pro {
    background: rgba(227, 168, 60, .2);
    color: #A9770F;
}

.sm-pop-live {
    background: rgba(47, 163, 107, .16);
    color: var(--sm-green);
}

.sm-pop-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 9px 16px 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--sm-body);
}

.sm-pop-row i {
    color: #C6CDD8;
    font-size: 11px;
    margin-top: 3px;
    flex-shrink: 0;
}

.sm-pop-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 16px 0;
    padding: 10px 12px;
    background: var(--sm-soft);
    border-radius: 10px;
}

.sm-pop-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9.5px;
    color: var(--sm-gold);
}

.sm-pop-rating em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--sm-muted);
    margin-left: 5px;
}

.sm-pop-price {
    text-align: right;
    line-height: 1.2;
}

.sm-pop-price small {
    display: block;
    font-size: 10px;
    color: var(--sm-muted);
}

.sm-pop-price strong {
    display: block;
    font-size: 15px;
    color: var(--sm-ink);
}

.sm-pop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 16px 16px;
    padding: 10px 16px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--sm-blue), var(--sm-blue-dark));
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: filter .18s ease;
}

.sm-pop-btn:hover {
    filter: brightness(1.1);
}

.sm-pop-btn i {
    font-size: 10px;
}

/* =========================================================
   B. SPREAD PINS — a hovered pin must sit above its neighbours
   ========================================================= */
.sm-user-icon.is-hover {
    z-index: 1000 !important;
}

.sm-user-icon.is-hover .sm-pin {
    transform: rotate(-45deg) scale(1.2);
}

@media (max-width: 575.98px) {
    .sm-card-go {
        width: 30px;
        height: 30px;
    }

    .sm-popup .leaflet-popup-content-wrapper {
        max-width: 90vw;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991.98px) {

    /* Map first on a phone — it is the reason people opened this page */
    .sm-split {
        display: flex;
        flex-direction: column-reverse;
    }

    .sm-map-wrap {
        height: 52vh;
        min-height: 340px;
    }

    .sm-panel {
        height: auto;
        min-height: 0;
        max-height: 70vh;
    }

    .sm-filters {
        padding: 10px;
    }

    .sm-field,
    .sm-check,
    .sm-go {
        height: 42px;
        flex: 1 1 140px;
    }

    .sm-go {
        flex-basis: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .sm-page {
        padding: 0 12px;
    }

    .sm-card-img {
        width: 54px;
        height: 54px;
    }

    .sm-hint {
        display: none;
    }

    .sm-legend {
        font-size: 11px;
        padding: 6px 10px;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .sm-card,
    .sm-bubble,
    .sm-pin,
    .sm-go {
        transition: none;
    }

    .sm-locate.is-busy i {
        animation: none;
    }
}