/* Mapa wybrzeża (assets/coast-map/coast-map.js).
   Wszystko pod .cmap / .cmap-*, żeby nie mieszać się z CSS strony
   (uwaga: prefiks .cm- ma już modal konsultacji w nagłówku). */

.cmap {
  --cmap-ink: #0b1c36; --cmap-muted: #5f6f80; --cmap-line: #e3ddd0; --cmap-panel: #fffdf8;
  --cmap-accent: #1f6f7a; --cmap-hl: #f7ad0c; --cmap-db: #b8942e;
  --cmap-cb: #7c5cc4; --cmap-cs: #0f8fa6; --cmap-mu: #c2703d;
  font-family: inherit;
  color: var(--cmap-ink);
  box-sizing: border-box;
}
.cmap *, .cmap *::before, .cmap *::after { box-sizing: border-box; }
.cmap button, .cmap input, .cmap textarea, .cmap select { font-family: inherit; }
.cmap svg.cmap-ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- scena ---------- */
.cmap-stage { position: relative; background: #e8eef1; overflow: hidden; }
.cmap-load { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; margin: 0;
  font-size: .8125rem; color: var(--cmap-muted); pointer-events: none; }
.cmap.is-ready .cmap-load { display: none; }

/* ---------- embed: przewodniki i poradniki ---------- */
.cmap--embed { margin: 0; }
.cmap--embed .cmap-stage { height: clamp(260px, 34vw, 420px); border: 1px solid var(--ti-line, rgba(11,28,54,.13)); border-radius: 2px; }
/* mała mapka: podpis podkładu w jednej linii także na telefonie */
.cmap--embed .leaflet-control-attribution { font-size: 10px; line-height: 1.5; padding: 0 5px; }
.cmap-tip { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 12px)); background: #fff; border: 1px solid var(--cmap-line);
  border-radius: 8px; padding: .5rem .7rem; box-shadow: 0 6px 20px rgba(11,28,54,.14); font-size: .8125rem; line-height: 1.35;
  display: flex; flex-direction: column; gap: .1rem; min-width: 8rem; max-width: 15rem; text-align: center; pointer-events: auto; }
.cmap-tip[hidden] { display: none; }
.cmap-tip strong { font-weight: 600; }
.cmap-tip span { color: var(--cmap-muted); }
.cmap-tip em { font-style: normal; font-size: .75rem; color: var(--cmap-muted); }
.cmap .cmap-tip a { border-bottom: 0; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; margin-top: .3rem; color: var(--cmap-ink);
  font-weight: 600; text-decoration: underline; text-decoration-color: var(--cmap-hl); text-underline-offset: 3px; }
.cmap-cap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .8rem;
  font-size: .8125rem; line-height: 1.5; color: var(--ti-ink-2, #445a74); }
.cmap-cap__t { display: inline-flex; align-items: center; gap: .5rem; }
.cmap-cap__t strong { color: var(--cmap-ink); font-weight: 600; }
.cmap-cap__pin { width: .7rem; height: .7rem; border-radius: 50%; background: var(--cmap-hl); border: 1.5px solid var(--cmap-ink); flex: none; }
.cmap-cap__hint { color: var(--ti-ink-3, #8a9bb0); }
.cmap .cmap-cap__a { display: inline-flex; align-items: center; gap: .35rem; color: var(--cmap-ink); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--cmap-hl); padding-bottom: 1px; }
.cmap .cmap-cap__a:hover { border-bottom-color: var(--cmap-ink); }
.cmap .cmap-cap__a svg { width: .9em; height: .9em; }

/* w treści poradnika (.ti-prose) */
.ti-prose .cmap--embed { margin: 2rem 0 2.5rem; }
.ti-prose .cmap--embed .cmap-stage { height: clamp(240px, 30vw, 340px); }

/* ---------- full: /pl/mapa ---------- */
.cmap--full { display: flex; height: clamp(560px, calc(100vh - 9rem), 900px); border: 1px solid var(--cmap-line); background: var(--cmap-panel); }
.cmap--full .cmap-stage { flex: 1; min-width: 0; }

.cmap-side { width: 340px; flex: none; border-left: 1px solid var(--cmap-line); display: flex; flex-direction: column; background: var(--cmap-panel); min-height: 0; }
.cmap-head { padding: 18px 18px 10px; }
.cmap-h { font-weight: 700; font-size: 20px; margin: 0 0 2px; letter-spacing: -.01em; }
.cmap-sub { font-size: 12px; color: var(--cmap-muted); display: flex; justify-content: space-between; gap: 8px; }
.cmap-status { white-space: nowrap; color: var(--cmap-db); }
.cmap-detail { margin: 0 18px 12px; border: 1px solid var(--cmap-line); border-radius: 14px; background: #fff; padding: 14px; display: none; }
.cmap-detail.show { display: block; }
.cmap-dh { font-weight: 700; font-size: 18px; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.cmap-dh .x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--cmap-muted); padding: 2px; display: flex; }
.cmap-detail .reg { font-size: 12px; color: var(--cmap-muted); margin-bottom: 10px; }
.cmap-links { display: flex; flex-wrap: wrap; gap: 6px; }
.cmap-none { margin: 0; font-size: 12px; color: var(--cmap-muted); }
.cmap-none + .cmap-links { margin-top: 10px; }
.cmap .cmap-go { display: inline-flex; align-items: center; gap: .35rem; background: var(--cmap-ink); color: #fff; border: 1px solid var(--cmap-ink); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
.cmap .cmap-go:hover { background: #1b2f4f; }
.cmap .cmap-go--ghost { background: #fff; color: var(--cmap-ink); border-color: var(--cmap-line); }
.cmap .cmap-go--ghost:hover { background: #f4efe3; }
/* „Nowe inwestycje” obok „Rynek wtórny” w karcie miejscowości: granatowa obwódka zamiast drugiego pełnego przycisku */
.cmap .cmap-go--nb { background: #fff; color: var(--cmap-ink); }
.cmap .cmap-go--nb:hover { background: #f4efe3; }

/* ---------- filtry ofert (/pl/mapa, od 19.11.2026 zamiast listy miejscowości) ---------- */
.cmap-form { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.cmap-fbody { flex: 1; min-height: 0; overflow: auto; padding: 2px 18px 18px; overscroll-behavior: contain; }
.cmap-fhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.cmap-ft { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cmap-muted); }
.cmap-clear { border: 0; background: none; padding: 2px 0; font-size: 12.5px; font-weight: 600; color: var(--cmap-ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--cmap-hl); text-underline-offset: 3px; }
.cmap-clear[hidden] { display: none; }
.cmap-clear:hover { text-decoration-color: var(--cmap-ink); }
.cmap-fs { border: 0; margin: 0; padding: 14px 0 0; min-width: 0; }
.cmap-fs[hidden] { display: none; }
.cmap-fs legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--cmap-ink); }
.cmap-fs legend + * { clear: both; }
/* opcje-pigułki: rodzaj, udogodnienia (pod spodem prawdziwe radio / checkbox) */
.cmap-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.cmap-opt { position: relative; display: inline-flex; cursor: pointer; margin: 0; }
.cmap-opt[hidden] { display: none; }
.cmap-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cmap-opt span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--cmap-line); background: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 500; line-height: 1.2; color: var(--cmap-ink); white-space: nowrap; }
.cmap-opt span i { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--cmap-muted); font-variant-numeric: tabular-nums; }
.cmap-opt:hover span { border-color: var(--cmap-ink); }
.cmap-opt input:checked + span { background: var(--cmap-ink); border-color: var(--cmap-ink); color: #fff; }
.cmap-opt input:checked + span i { color: var(--cmap-hl); }
.cmap-opt input:focus-visible + span { outline: 2px solid var(--cmap-hl); outline-offset: 2px; }
.cmap-opt.is-zero span { color: #98a3ae; }
.cmap-opt.is-zero input:checked + span { color: #fff; }
/* segmenty: sypialnie, łazienki */
.cmap-seg { display: flex; border: 1px solid var(--cmap-line); border-radius: 10px; background: #fff; }
.cmap-seg .cmap-opt { flex: 1 1 0; min-width: 0; }
.cmap-seg .cmap-opt:first-child { flex: 0 0 auto; }
.cmap-seg .cmap-opt:first-child span { padding-left: 12px; padding-right: 12px; }
.cmap-seg .cmap-opt span { width: 100%; justify-content: center; border: 0; border-left: 1px solid var(--cmap-line); border-radius: 0; padding: 9px 2px; }
.cmap-seg .cmap-opt:first-child span { border-left: 0; border-radius: 9px 0 0 9px; }
.cmap-seg .cmap-opt:last-child span { border-radius: 0 9px 9px 0; }
.cmap-seg .cmap-opt:hover span { background: #f4efe3; }
.cmap-seg .cmap-opt input:checked + span { background: var(--cmap-ink); color: #fff; }
.cmap-seg .cmap-opt input:focus-visible + span { outline-offset: -2px; }
/* listy rozwijane: cena od / do, powierzchnia */
.cmap-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmap-sel { position: relative; display: block; margin: 0; }
.cmap-sel > span { position: absolute; left: 12px; top: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cmap-muted); pointer-events: none; }
.cmap-sel select { display: block; width: 100%; -webkit-appearance: none; appearance: none; border: 1px solid var(--cmap-line); border-radius: 10px;
  background: #fff; padding: 22px 30px 7px 11px; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--cmap-ink); cursor: pointer; }
.cmap-sel select:hover { border-color: var(--cmap-ink); }
.cmap-sel select:focus-visible { outline: 2px solid var(--cmap-hl); outline-offset: 1px; }
.cmap-sel select.is-set { border-color: var(--cmap-ink); box-shadow: inset 0 0 0 1px var(--cmap-ink); }
.cmap-sel .cmap-ico { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--cmap-muted); pointer-events: none; }
/* notka pod filtrem (np. „Blisko plaży” nie dotyczy nowych inwestycji) */
.cmap-fnote { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--cmap-muted); }
.cmap-fnote[hidden] { display: none; }
/* przyciski do listingów: rynek wtórny (/pl/nieruchomosci) i nowe inwestycje (/pl/new-builds), jeden pod drugim */
.cmap-ffoot { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--cmap-line); background: var(--cmap-panel); }
.cmap-ffoot .cmap-submit { order: 1; }
.cmap-ffoot .cmap-nbbtn { order: 2; }
.cmap-ffoot .cmap-tomap { order: 3; }
.cmap-submit[hidden], .cmap-nbbtn[hidden] { display: none; }
.cmap .cmap-nbbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--cmap-ink); border-radius: 10px;
  background: #fff; color: var(--cmap-ink); padding: 11px 14px; font-size: 14px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.cmap .cmap-nbbtn:hover { background: #f4efe3; }
.cmap .cmap-nbbtn.is-primary { background: var(--cmap-hl); border-color: var(--cmap-hl); }
.cmap .cmap-nbbtn.is-primary:hover { background: #ffbf2e; border-color: #ffbf2e; }
.cmap .cmap-nbbtn:focus-visible { outline: 2px solid var(--cmap-ink); outline-offset: 2px; }
.cmap-submit { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; background: var(--cmap-hl);
  color: var(--cmap-ink); padding: 12px 14px; font-size: 14px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.cmap-submit:hover { background: #ffbf2e; }
.cmap-submit:focus-visible { outline: 2px solid var(--cmap-ink); outline-offset: 2px; }
.cmap-submit:disabled { background: #efe9dc; color: var(--cmap-muted); cursor: default; }
.cmap-tomap { display: none; }
.cmap-fbtn { display: none; }
/* pigułka wybrzeża bez ofert przy wybranych filtrach */
.cmap-rpill.is-zero { background: #fff; color: var(--cmap-muted); }
.cmap-rpill.is-zero:hover { background: #f4efe3; }

/* ---------- mapa Leaflet + OpenFreeMap: /pl/mapa i mapki w przewodnikach / poradnikach ---------- */
.cmap-leaflet { position: absolute; inset: 0; z-index: 0; font-family: inherit; }
.cmap-leaflet .leaflet-control-zoom a { color: var(--cmap-ink); }
.cmap-chip-hint, .cmap-allbtn { position: absolute; top: 12px; left: 58px; z-index: 500; margin: 0; background: #fff; color: var(--cmap-ink);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 500; line-height: 1.2; box-shadow: 0 2px 10px rgba(11,28,54,.18);
  max-width: calc(100% - 72px); }
.cmap-chip-hint[hidden], .cmap-allbtn[hidden] { display: none; }
.cmap-allbtn { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.cmap-allbtn:hover { background: #f4efe3; }
.cmap-mk { background: none; border: 0; }
.cmap-mk > button { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-family: inherit; cursor: pointer; }
/* pigułka wybrzeża (oddalona mapa) */
.cmap-rpill { border: 0; background: #f7ad0c; color: var(--cmap-ink); border-radius: 999px; padding: 9px 18px 8px; text-align: center;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(11,28,54,.28); }
.cmap-rpill b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; }
.cmap-rpill small { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.3; }
.cmap-rpill:hover { background: #ffbf2e; }
/* Costa Blanca i Costa Cálida leżą blisko: pierwsza pigułka nad swoim punktem, druga pod - nie nachodzą na siebie przy żadnym zoomie */
.cmap-mk > .cmap-rpill--cb { transform: translate(-50%, calc(-100% + 8px)); }
.cmap-mk > .cmap-rpill--mu { transform: translate(-50%, -8px); }
/* pigułka miejscowości z ofertami (przybliżona mapa) */
.cmap-tpill { border: 1px solid rgba(11,28,54,.12); background: #fff; color: var(--cmap-ink); border-radius: 999px; padding: 5px 10px 5px 7px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; box-shadow: 0 2px 8px rgba(11,28,54,.2); font-size: 12px; line-height: 1; }
.cmap-tpill .d { width: 9px; height: 9px; border-radius: 50%; background: #f7ad0c; flex: none; }
.cmap-tpill.is-db .d { border-radius: 1px; transform: rotate(45deg); }
.cmap-tpill b { font-weight: 600; }
.cmap-tpill i { font-style: normal; font-weight: 700; color: #a8800f; font-variant-numeric: tabular-nums; }
.cmap-tpill:hover { border-color: var(--cmap-ink); }
.cmap-tpill.is-sel { background: var(--cmap-ink); color: #fff; border-color: var(--cmap-ink); z-index: 2; }
.cmap-tpill.is-sel i { color: #f7ad0c; }
/* zachodzi na inną pigułkę - sama kropka (nazwa i liczba w podpowiedzi title) */
.cmap-tpill.is-mini { padding: 0; width: 14px; height: 14px; justify-content: center; border: 2px solid #fff; background: #f7ad0c; }
.cmap-tpill.is-mini .d, .cmap-tpill.is-mini b, .cmap-tpill.is-mini i { display: none; }
/* wyróżniona miejscowość, której pigułka się nie zmieściła: granatowa kropka ze złotą obwódką (inne są złote) */
.cmap-tpill.is-sel.is-mini { width: 16px; height: 16px; background: var(--cmap-ink); border-color: #f7ad0c; }
/* miejscowość bez ofert: mała kropka, nazwa po najechaniu */
.cmap-tdot { width: 10px; height: 10px; padding: 0; border-radius: 50%; background: #fff; border: 2px solid var(--cmap-ink); box-shadow: 0 1px 3px rgba(11,28,54,.3); }
.cmap-tdot .lbl { display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: #fff; color: var(--cmap-ink);
  border-radius: 6px; padding: 4px 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 8px rgba(11,28,54,.2); }
.cmap-tdot:hover .lbl, .cmap-tdot:focus-visible .lbl, .cmap-tdot.is-sel .lbl { display: block; }
.cmap-tdot.is-sel { background: #f7ad0c; width: 14px; height: 14px; }

/* pasek najnowszych ofert na mapie (bez gradientów - zastępcze kafelki pulsują płaskim kolorem).
   bottom 26px: podpis OpenFreeMap / OpenStreetMap w prawym dolnym rogu musi zostać widoczny */
.cmap-strip { position: absolute; left: 12px; right: 12px; bottom: 26px; z-index: 600; background: rgba(255,253,248,.97);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(11,28,54,.24); padding: 10px 10px 12px; }
.cmap-strip[hidden] { display: none; }
.cmap-strip__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 4px 8px; }
.cmap-strip__t { font-size: 13px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmap-strip__x { border: 0; background: none; color: var(--cmap-muted); cursor: pointer; display: flex; padding: 4px; font-size: 18px; flex: none; }
.cmap-strip__x:hover { color: var(--cmap-ink); }
.cmap-strip__row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.cmap .cmap-sc { flex: 0 0 196px; scroll-snap-align: start; display: flex; flex-direction: column; text-decoration: none; color: var(--cmap-ink);
  background: #fff; border: 1px solid var(--cmap-line); border-radius: 10px; overflow: hidden; }
.cmap .cmap-sc:hover { border-color: var(--cmap-ink); }
.cmap-sc__img { position: relative; height: 108px; background: #ece6d8; flex: none; }
.cmap-sc__nb { position: absolute; left: 8px; top: 8px; background: var(--cmap-ink); color: #fff; border-radius: 6px; padding: 3px 7px;
  font-size: 10.5px; font-weight: 600; font-style: normal; letter-spacing: .02em; line-height: 1.3; }
.cmap-sc__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmap-sc__b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.3; min-width: 0; }
.cmap-sc__b strong { font-size: 14px; font-weight: 700; }
.cmap-sc__b b { font-weight: 600; }
.cmap-sc__b span { color: var(--cmap-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmap .cmap-sc--all { justify-content: center; align-items: center; text-align: center; gap: 4px; background: #f7ad0c; border-color: #f7ad0c; padding: 12px; }
.cmap .cmap-sc--all:hover { background: #ffbf2e; border-color: #ffbf2e; }
.cmap .cmap-sc--allnb { background: #fff; border-color: var(--cmap-ink); }
.cmap .cmap-sc--allnb:hover { background: #f4efe3; border-color: var(--cmap-ink); }
.cmap-sc--all b { font-size: 14px; }
.cmap-sc--all span { font-size: 12px; }
.cmap-sc--ph { height: 178px; background: #f4efe3; border-color: transparent; animation: cmap-ph 1.1s ease-in-out infinite alternate; }
@keyframes cmap-ph { from { opacity: .5; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cmap-sc--ph { animation: none; } }

@media (max-width: 760px) {
  .cmap-strip { left: 8px; right: 8px; bottom: 24px; padding: 8px 8px 10px; }
  .cmap .cmap-sc { flex-basis: 156px; }
  .cmap-sc__img { height: 84px; }
  .cmap-sc--ph { height: 150px; }
  .cmap--full { flex-direction: column; height: auto; }
  .cmap--full .cmap-stage { height: 62vh; flex: none; }
  .cmap-side { width: auto; border-left: 0; border-top: 1px solid var(--cmap-line); }
  .cmap-fbody { overflow: visible; }
  .cmap-sel select { font-size: 16px; }   /* iOS nie przybliża strony przy listach z czcionką >= 16 px */
  .cmap-tomap { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--cmap-line); border-radius: 10px;
    background: #fff; color: var(--cmap-ink); padding: 11px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
  /* panel filtrów leży pod mapą - przycisk na mapie do niego przewija */
  .cmap-fbtn { display: inline-flex; align-items: center; gap: 6px; position: absolute; top: 12px; right: 12px; z-index: 500; border: 0;
    border-radius: 10px; background: var(--cmap-ink); color: #fff; padding: 9px 12px; font-size: 13px; font-weight: 600; line-height: 1.2;
    box-shadow: 0 2px 10px rgba(11,28,54,.25); cursor: pointer; }
  .cmap-fbtn__n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--cmap-hl); color: var(--cmap-ink); font-size: 11px; font-weight: 700; }
  .cmap-fbtn__n[hidden] { display: none; }
  .cmap-chip-hint, .cmap-allbtn { max-width: calc(100% - 58px - 118px); }
}
