/* Mapa placówek — stylizacja wg projektu (paleta S7HEALTH) */

.facility-map-wrapper {
    --fm-primary: #009b8f;
    --fm-primary-dark: #00857a;
    --fm-primary-soft: #e4f4f2;
    --fm-ink: #1e2b2a;
    --fm-muted: #64748b;
    --fm-border: #e6ecea;
    --fm-radius: 14px;
    --fm-shadow: 0 2px 14px rgba(13, 60, 56, 0.07);
    /* Moduł wychodzi poza standardowy kontener treści Porto tylko na dużych ekranach. */
    width: min(1600px, calc(100vw - 48px));
    max-width: none;
    margin: 0 0 40px 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    color: var(--fm-ink);
}

.facility-map-notice {
    padding: 14px 18px;
    border: 1px solid var(--fm-border);
    border-left: 4px solid var(--fm-primary);
    background: #f8fafa;
    border-radius: 8px;
    margin: 0 0 16px;
}

/* ---------- pasek filtrów ---------- */

.facility-map-filterbar {
    display: grid;
    /* minmax(0, …): pole nie może rozpychać siatki swoją najdłuższą opcją (1.5.0: Select2 na wszystkich selectach
       wychodził poza ekran telefonu; natywne selecty robiły to samo o kilkanaście px). */
    grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr)) auto;
    gap: 18px;
    align-items: end;
    background: #fff;
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow);
    padding: 22px 24px;
    margin: 0 0 18px;
}

.facility-map-field {
    min-width: 0;
}

.facility-map-field label {
    display: block;
    font-weight: 700;
    font-size: 0.9em;
    margin: 0 0 8px;
}

.facility-map-field select,
.facility-map-field input[type="text"] {
    width: 100%;
    box-sizing: border-box; /* 1.5.0: pole szukania wychodziło o padding poza siatkę na telefonie */
    padding: 10px 14px;
    border: 1px solid #d8e0de;
    border-radius: 10px;
    font-size: 0.92em;
    color: var(--fm-ink);
    background-color: #fff;
}

/* Selecty: kursor + własna strzałka, żeby Porto jej nie ukrywało. */
.facility-map-field select,
.facility-map-sort select {
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    padding-right: 38px;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2364748b' d='M5.4 7.5 10 12.1l4.6-4.6 1.4 1.4-6 6-6-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px 14px !important;
}

.facility-map-sort select {
    padding-right: 30px;
    background-position: right 8px center !important;
}

.facility-map-field select:focus,
.facility-map-field input[type="text"]:focus {
    outline: 2px solid var(--fm-primary-soft);
    border-color: var(--fm-primary);
}

.facility-map-inputwrap {
    position: relative;
}

.facility-map-field .facility-map-inputwrap input[type="text"] {
    padding-right: 38px; /* 1.5.0: selektor wzmocniony, wcześniej przegrywał z regułą ogólną i tekst wchodził pod lupkę */
}

.facility-map-inputicon::before,
.facility-map-btnicon::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.3 1.4-1.4-5.3-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.3 14l5.4 5.3 1.4-1.4-5.3-5.4A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-inputicon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8a6;
    pointer-events: none;
}

.facility-map-btnicon--target::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 8a4 4 0 100 8 4 4 0 000-8zm9 3h-2.06A7 7 0 0013 5.06V3h-2v2.06A7 7 0 005.06 11H3v2h2.06A7 7 0 0011 18.94V21h2v-2.06A7 7 0 0018.94 13H21v-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 8a4 4 0 100 8 4 4 0 000-8zm9 3h-2.06A7 7 0 0013 5.06V3h-2v2.06A7 7 0 005.06 11H3v2h2.06A7 7 0 0011 18.94V21h2v-2.06A7 7 0 0018.94 13H21v-2z'/%3E%3C/svg%3E");
}

/* suwak promienia */

.facility-map-radius {
    position: relative;
    padding-top: 4px;
}

.facility-map-radius output {
    display: block;
    text-align: center;
    font-size: 0.8em;
    font-weight: 700;
    color: var(--fm-ink);
    margin-bottom: 2px;
}

.facility-map-radius input[type="range"] {
    width: 100%;
    accent-color: var(--fm-primary);
    cursor: pointer;
}

.facility-map-radius-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--fm-muted);
}

/* przyciski */

.facility-map-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    grid-column: -2 / -1; /* zawsze ostatnia kolumna, niezaleznie od liczby filtrow (select "Siec" jest warunkowy) */
}

.facility-map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 11px 22px;
    font-size: 0.92em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}

.facility-map-btn--primary {
    background: var(--fm-primary);
    color: #fff;
    white-space: nowrap;
}

.facility-map-btn--primary:hover,
.facility-map-btn--primary:focus {
    background: var(--fm-primary-dark);
    color: #fff;
}

.facility-map-btn--outline {
    background: #fff;
    border-color: var(--fm-primary);
    color: var(--fm-primary);
    width: calc(100% - 32px);
    margin: 4px 16px 16px;
}

.facility-map-btn--outline:hover,
.facility-map-btn--outline:focus {
    background: var(--fm-primary-soft);
}

.facility-map-link {
    background: none;
    border: 0;
    color: var(--fm-primary);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
}

.facility-map-link::before {
    content: "";
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 18a8 8 0 110-16 8 8 0 010 16zm3.5-10.1L13.4 12l2.1 2.1-1.4 1.4L12 13.4l-2.1 2.1-1.4-1.4 2.1-2.1-2.1-2.1 1.4-1.4 2.1 2.1 2.1-2.1z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 18a8 8 0 110-16 8 8 0 010 16zm3.5-10.1L13.4 12l2.1 2.1-1.4 1.4L12 13.4l-2.1 2.1-1.4-1.4 2.1-2.1-2.1-2.1 1.4-1.4 2.1 2.1 2.1-2.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-link:hover {
    text-decoration: underline;
    color: var(--fm-primary-dark);
}

.facility-map-status {
    min-height: 1.2em;
    margin: 0 0 10px;
    font-size: 0.88em;
    font-weight: 600;
    color: #b45309;
}

/* ---------- układ: lista + mapa ---------- */

.facility-map-layout {
    display: grid;
    grid-template-columns: minmax(340px, 500px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.facility-map-panel {
    background: #fff;
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow);
    display: flex;
    flex-direction: column;
    /* 1.5.0: stała wysokość zamiast max-height. Panel rósł i malał z liczbą kart, a razem z nim mapa (grid stretch);
       Leaflet nie wiedział o zmianie rozmiaru: szary pas na dole mapy i złe centrowanie (uwagi Jakuba z 14.10). */
    height: 760px;
}

.facility-map-panelhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--fm-border);
}

.facility-map-count {
    margin: 0;
    font-weight: 700;
    font-size: 0.95em;
}

.facility-map-count::before {
    content: "";
    display: inline-block;
    vertical-align: -3px;
    margin-right: 8px;
    width: 17px;
    height: 17px;
    background: var(--fm-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 100-10 5 5 0 000 10zm0 2c-4.4 0-8 2.2-8 5v3h16v-3c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--fm-muted);
    white-space: nowrap;
}

.facility-map-sort select {
    border: 1px solid #d8e0de;
    border-radius: 8px;
    padding: 6px 30px 6px 8px;
    font-size: 1em;
    color: var(--fm-ink);
    background-color: #fff;
}

.facility-map-list {
    overflow-y: auto;
    padding: 10px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

/* karta placówki (1.5.0: kompaktowa, etykiety w prawej kolumnie) */

.facility-map-card {
    display: grid;
    /* pinezka | nazwa+adres | etykiety (max 38 % szerokości, reszta dla nazwy) | strzałka */
    grid-template-columns: auto minmax(0, 1fr) fit-content(38%) auto;
    gap: 10px;
    align-items: start;
    border: 1px solid var(--fm-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.facility-map-card:hover,
.facility-map-card:focus {
    border-color: var(--fm-primary);
    box-shadow: 0 2px 10px rgba(0, 155, 143, 0.12);
    outline: none;
}

.facility-map-cardpin {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fm-primary-soft);
    position: relative;
}

.facility-map-cardpin::before {
    content: "";
    position: absolute;
    inset: 6px;
    background: var(--fm-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 00-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 00-7-7zm0 9.5A2.5 2.5 0 1112 6.5a2.5 2.5 0 010 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 00-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 00-7-7zm0 9.5A2.5 2.5 0 1112 6.5a2.5 2.5 0 010 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-cardbody {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.facility-map-cardname {
    font-size: 0.92em;
    line-height: 1.25;
}

/* Prawa kolumna karty: odległość, sieć, rodzaj usług jako chipy zawijane od prawej (ile wejdzie w wierszu). */
.facility-map-cardaside {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.facility-map-cardaside .facility-map-badges,
.facility-map-cardaside .facility-map-tags {
    display: contents;
}

.facility-map-cardaside .facility-map-distance {
    font-size: 0.74em;
}

.facility-map-distance {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--fm-primary-soft);
    color: var(--fm-primary-dark);
    font-size: 0.72em;
    font-weight: 700;
    white-space: nowrap;
}

.facility-map-address {
    font-size: 0.85em;
    color: var(--fm-muted);
    display: block;
}

.facility-map-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.facility-map-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--fm-primary-soft);
    color: var(--fm-primary-dark);
    font-size: 0.72em;
    font-weight: 600;
    white-space: nowrap;
}

.facility-map-cardmeta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 0.78em;
    color: var(--fm-muted);
}

.facility-map-clock::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    background: var(--fm-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 2a8 8 0 110 16 8 8 0 010-16zm-1 3v6l5 3 1-1.7-4-2.3V7h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 2a8 8 0 110 16 8 8 0 010-16zm-1 3v6l5 3 1-1.7-4-2.3V7h-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-chevron {
    align-self: center;
    width: 10px;
    height: 10px;
    border-right: 2px solid #b9c6c4;
    border-top: 2px solid #b9c6c4;
    transform: rotate(45deg);
}

.facility-map-empty {
    padding: 16px;
    background: #f8fafa;
    border-radius: 10px;
    color: var(--fm-muted);
}

/* ---------- mapa ---------- */

.facility-map-mapwrap {
    position: relative;
    min-height: 570px;
}

#facility-map {
    position: absolute;
    inset: 0;
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow);
    z-index: 0;
}

.facility-map-zoom-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 650;
    max-width: calc(100% - 40px);
    transform: translate(-50%, -50%) translateY(6px);
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(30, 43, 42, 0.9);
    color: #fff;
    font-size: 0.84em;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 18px rgba(13, 60, 56, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.facility-map-zoom-hint.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) translateY(0);
}

.facility-map-btn--locate {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 500;
    background: #fff;
    color: var(--fm-ink);
    box-shadow: var(--fm-shadow);
    font-size: 0.85em;
    padding: 9px 16px;
}

.facility-map-btn--locate:hover,
.facility-map-btn--locate:focus {
    color: var(--fm-primary-dark);
}

/* markery i klastry */

.facility-map-pin svg path {
    fill: var(--fm-primary, #009b8f);
}

.facility-map-pin {
    filter: drop-shadow(0 2px 3px rgba(13, 60, 56, 0.35));
}

.facility-map-pin--origin span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d6fd6;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(29, 111, 214, 0.35);
}

.facility-map-cluster {
    background: #009b8f;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(13, 60, 56, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.facility-map-cluster span {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

/* kontrolki Leaflet w stylu makiety */

.facility-map-mapwrap .leaflet-control-zoom a {
    border-radius: 8px !important;
    color: var(--fm-ink);
    box-shadow: var(--fm-shadow);
    border: 0;
    margin-bottom: 6px;
}

.facility-map-mapwrap .leaflet-bar {
    border: 0;
    background: transparent;
}

/* dymek */

.facility-map-mapwrap .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(13, 60, 56, 0.18);
}

.facility-map-popup {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
    font-family: inherit;
}

.facility-map-popuphead {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.facility-map-popuphead strong {
    font-size: 1em;
}

.facility-map-checks {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.facility-map-checks li {
    font-size: 0.85em;
    padding-left: 22px;
    position: relative;
}

.facility-map-checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 14px;
    height: 14px;
    background: var(--fm-primary, #009b8f);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2l-3.5-3.5L4 14.1 9 19 20 8l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2l-3.5-3.5L4 14.1 9 19 20 8l-1.4-1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-hours {
    margin-top: 12px;
    margin-bottom: 0;
    font-size: 0.85em;
}

.facility-map-hours summary {
    line-height: 1.2;
}

.facility-map-hours summary {
    cursor: pointer;
    color: #009b8f;
    font-weight: 600;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.facility-map-hours summary::after {
    content: "";
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5l7 7-7 7 1.8 1.8L15.6 12 6.8 3.2 5 5zm6 0 7 7-7 7 1.8 1.8L21.6 12 12.8 3.2 11 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5l7 7-7 7 1.8 1.8L15.6 12 6.8 3.2 5 5zm6 0 7 7-7 7 1.8 1.8L21.6 12 12.8 3.2 11 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.facility-map-hours summary::-webkit-details-marker {
    display: none;
}

.facility-map-hours table {
    margin: 6px 0 0;
    border-collapse: collapse;
    width: 100%;
}

.facility-map-hours td {
    padding: 2px 8px 2px 0;
    border: 0;
    font-size: 0.95em;
}

/* ---------- responsywność ---------- */

/* Laptop: węższe odstępy, żeby "Wszystkie usługi" nie było ucinane w Select2. */
@media (max-width: 1440px) {
    .facility-map-filterbar {
        grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
        gap: 12px;
        padding: 20px 18px;
    }

    .facility-map-field select,
    .facility-map-field input[type="text"] {
        padding-left: 12px;
    }

    .facility-map-field .select2-container--default .select2-selection--single .select2-selection__rendered {
        padding: 10px 30px 10px 12px;
    }

    .facility-map-field .select2-container--default .select2-selection--single .select2-selection__arrow {
        right: 2px;
    }
}

@media (max-width: 1100px) {
    .facility-map-filterbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .facility-map-field--search {
        grid-column: 1 / -1;
    }

    .facility-map-actions {
        grid-column: 1 / -1;
        align-items: flex-end;
    }
}

@media (max-width: 900px) {
    .facility-map-wrapper {
        width: 100%;
        margin-left: 0;
        transform: none;
    }

    .facility-map-filterbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 16px;
    }

    .facility-map-actions {
        grid-column: 1 / -1;
    }

    .facility-map-layout {
        grid-template-columns: 1fr;
    }

    .facility-map-mapwrap {
        min-height: 480px;
        order: -1;
    }

    .facility-map-panel {
        height: auto;
        max-height: none;
    }

    .facility-map-list {
        max-height: 420px;
    }
}

/* Wąski ekran: prawa kolumna karty schodzi pod nazwę i adres, w jednym wierszu. */
@media (max-width: 520px) {
    .facility-map-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .facility-map-cardpin,
    .facility-map-chevron {
        grid-row: 1 / 3;
    }

    .facility-map-cardaside {
        grid-column: 2 / 3;
        grid-row: 2;
        justify-content: flex-start;
        margin-top: 2px;
    }
}

/* 1.2.6: suwak promienia nieaktywny, dopoki nie ma punktu odniesienia; link "Pokaz wszystkie" bez ikony resetu */
.facility-map-field.is-disabled { opacity: 0.45; }
.facility-map-field.is-disabled input[type="range"] { cursor: not-allowed; }
.facility-map-status button.facility-map-link { margin-left: 6px; min-height: 0; padding: 0; }
.facility-map-link--plain::before { display: none; }

/* 1.2.7: jasniejsza, mniej nasycona mapa bez zewnetrznego dostawcy stylu (filtr na kafelkach OSM).
   Regulacja: --fm-tile-filter. Jasniej = wyzsze brightness, spokojniej = nizsze saturate. */
.facility-map-mapwrap {
    --fm-tile-filter: saturate(0.55) brightness(1.06) contrast(0.92);
}
.facility-map-mapwrap .leaflet-tile-pane {
    filter: var(--fm-tile-filter);
}

/* 1.5.0: przy zoomie pośrednim (zoomSnap 0.25) Chrome skaluje kafelki i między nimi prześwitują cienkie linie
   ("paski", pkt 8 Jakuba z 14.10). Przezroczysty outline wymusza rasteryzację każdego kafelka z 1 px marginesem,
   przez co krawędzie nie są antyaliasowane do tła. Sprawdzone na zaślepce (seams.js): 0 szwów przy zoomach
   6.75 / 11.5 / 11.75 / 12.25 / 14.5, bez tej reguły 29. UWAGA: wariant "width: 256.5px" (nachodzące kafelki)
   robił białą siatkę nawet przy pełnym zoomie, nie używać. */
.facility-map-mapwrap .leaflet-tile-container img.leaflet-tile {
    outline: 1px solid transparent;
}

/* ---------- 1.3.0: siec, niedostepnosc, udogodnienia ---------- */

.facility-map-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 6px;
}

.facility-map-net,
.facility-map-unavail {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
    white-space: nowrap;
}

.facility-map-net {
    background: #eef2f7;
    color: #334155;
}

.facility-map-net--alab {
    background: #e8f0fb;
    color: #1d4ed8;
}

.facility-map-net--diagnostyka {
    background: #fdecef;
    color: #be123c;
}

.facility-map-unavail {
    background: #fff4e5;
    color: #b45309;
}

.facility-map-amenities {
    margin-top: 8px;
}

.facility-map-amenities-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fm-muted);
    margin-bottom: 2px;
}

.facility-map-checks--amenities li::before {
    background: var(--fm-muted);
}

.facility-map-status:empty {
    display: none;
}

/* ---------- 1.3.2: odstep w dymku odporny na Porto/WPBakery ----------
   Motyw ma regule "#content .wpb_text_column :last-child { margin-bottom: 0 }", ktora zeruje dolny margines
   ostatniego dziecka w kazdym bloku tekstowym, w tym .leaflet-popup-content w dymku mapy. Selektor z ID bije
   nasze klasy, wiec: margines dymku z !important, a wlasciwy odstep paddingiem, ktorego ta regula nie dotyka. */
.facility-map-mapwrap .leaflet-popup-content {
    margin: 14px 24px 14px 20px !important;
}

.facility-map-popup {
    padding-bottom: 4px;
}

#content .wpb_text_column .facility-map-popup :last-child,
.wpb_text_column .facility-map-popup :last-child {
    margin-bottom: inherit;
}

/* ---------- 1.4.0: Select2 na polu miasta (wyglad jak pozostale selecty) ---------- */

.facility-map-field .select2-container {
    width: 100% !important;
    font-size: 0.92em;
}

.facility-map-field .select2-container--default .select2-selection--single {
    height: auto;
    border: 1px solid #d8e0de;
    border-radius: 10px;
    background: #fff;
}

.facility-map-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 10px 38px 10px 14px;
    line-height: normal;
    color: var(--fm-ink);
}

/* Placeholder "Wybierz miasto" w kolorze tekstu, jak pierwsza opcja zwyklego selecta. */
.facility-map-field .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--fm-ink);
}

/* Wlasna strzalka, ta sama co w pozostalych selectach. */
.facility-map-field .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0;
    bottom: 0;
    right: 6px;
    width: 26px;
    height: auto;
}

.facility-map-field .select2-container--default .select2-selection--single .select2-selection__arrow b {
    display: none;
}

.facility-map-field .select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2364748b' d='M5.4 7.5 10 12.1l4.6-4.6 1.4 1.4-6 6-6-6z'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

/* Krzyzyk czyszczenia (allowClear) na lewo od strzalki. */
.facility-map-field .select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 4px;
    padding: 0 4px;
    font-size: 1.25em;
    font-weight: 400;
    line-height: 1;
    color: var(--fm-muted);
}

.facility-map-field .select2-container--default.select2-container--focus .select2-selection--single,
.facility-map-field .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--fm-primary);
    outline: 2px solid var(--fm-primary-soft);
}

/* Lista rozwijana jest doczepiana do <body> (poza .facility-map-wrapper), wiec bez zmiennych --fm-*. */
.select2-container--default .select2-dropdown.facility-map-select2 {
    border: 1px solid #d8e0de;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(13, 60, 56, 0.12);
    overflow: hidden;
    z-index: 10050;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-search--dropdown {
    padding: 8px;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-search--dropdown .select2-search__field {
    padding: 8px 10px;
    border: 1px solid #d8e0de;
    border-radius: 8px;
    font-size: 0.95em;
    outline: none;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-search--dropdown .select2-search__field:focus {
    border-color: #009b8f;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-results__option {
    padding: 7px 14px;
    font-size: 0.95em;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-results__option--highlighted[aria-selected] {
    background: #009b8f;
    color: #fff;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-results__option[aria-selected="true"] {
    background: #e4f4f2;
    color: #1e2b2a;
}

.select2-container--default .select2-dropdown.facility-map-select2 .select2-results__option--highlighted[aria-selected="true"] {
    background: #009b8f;
    color: #fff;
}
