/* ============================================================
   Mapa Zasięgu Światłowodu — style do functions.php (WordPress)
   Port stylów z map_test.html. Wszystko poza .leaflet-* /
   .marker-cluster-* jest celowo zagnieżdżone pod .mapa-zasiegu-wrapper,
   żeby nie kolidować z motywem WordPress ani innymi wtyczkami
   (oryginalna reguła "body { margin/background }" z map_test.html
   została USUNIĘTA — nie wolno globalnie nadpisywać <body> w motywie).
   ============================================================ */

.mapa-zasiegu-wrapper {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.mapa-zasiegu-wrapper #mapa-kontener {
  position: relative;
  width: 100%;
}
.mapa-zasiegu-wrapper #mapa-powiaty {
  width: 100%;
  height: 600px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
}

/* ===== Formularz wyszukiwania (sprawdzania zasięgu) ===== */
.mapa-zasiegu-wrapper #formularz-wyszukiwania {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 1500px;
  margin: 0 auto 20px auto;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  box-sizing: border-box;
}
.mapa-zasiegu-wrapper #formularz-wyszukiwania h3 {
  margin: 0 0 24px 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}
.mapa-zasiegu-wrapper .pola-formularza {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.mapa-zasiegu-wrapper .pole {
  display: flex;
  flex-direction: column;
}
.mapa-zasiegu-wrapper .pole label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}
.mapa-zasiegu-wrapper .pole label .wymagane {
  color: #C90000;
}
.mapa-zasiegu-wrapper .pole input,
.mapa-zasiegu-wrapper .pole select {
  font-family: inherit;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
  height: 42px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mapa-zasiegu-wrapper .pole input::placeholder {
  color: #9a9a9a;
}
.mapa-zasiegu-wrapper .pole input:focus,
.mapa-zasiegu-wrapper .pole select:focus {
  outline: none;
  border-color: #C90000;
  background: #fff;
}
.mapa-zasiegu-wrapper .pole select:disabled {
  color: #9a9a9a;
  cursor: not-allowed;
}
.mapa-zasiegu-wrapper .przyciski {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.mapa-zasiegu-wrapper .przyciski button {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 13px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: white;
  transition: background-color 0.15s ease;
}
.mapa-zasiegu-wrapper .przyciski button .ikona-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.mapa-zasiegu-wrapper .przyciski button .ikona-btn svg {
  width: 12px;
  height: 12px;
}
.mapa-zasiegu-wrapper #szukaj-btn {
  background: #C90000;
}
.mapa-zasiegu-wrapper #szukaj-btn:hover {
  background: #7E0000;
}
.mapa-zasiegu-wrapper #wyczysc-btn {
  background: #373737;
}
.mapa-zasiegu-wrapper #wyczysc-btn:hover {
  background: #262626;
}
@media (max-width: 900px) {
  .mapa-zasiegu-wrapper .pola-formularza {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .mapa-zasiegu-wrapper #formularz-wyszukiwania {
    padding: 20px;
  }
  .mapa-zasiegu-wrapper .pola-formularza {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.mapa-zasiegu-wrapper .info {
  padding: 8px 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 5px;
  font-size: 13px;
}

/* ===== Wynik wyszukiwania (tytuł + podtytuł + siatka operatorów) ===== */
.mapa-zasiegu-wrapper #wynik-zasięgu {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  max-width: 1500px;
  margin: 20px auto 0 auto;
  padding: 32px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  box-sizing: border-box;
  display: none;
}
.mapa-zasiegu-wrapper .wynik-header {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}
.mapa-zasiegu-wrapper .wynik-ikona {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mapa-zasiegu-wrapper .wynik-ikona svg {
  width: 18px;
  height: 18px;
}
.mapa-zasiegu-wrapper #wynik-zasięgu.jest .wynik-ikona {
  color: #1e8e3e;
}
.mapa-zasiegu-wrapper #wynik-zasięgu.brak .wynik-ikona {
  color: #C90000;
}
.mapa-zasiegu-wrapper .wynik-tytul {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}
.mapa-zasiegu-wrapper .wynik-podtytul {
  margin: 0 0 32px 0;
  font-size: 15px;
  color: #5a5a5a;
}
.mapa-zasiegu-wrapper #wynik-zasięgu.brak .wynik-podtytul {
  margin-bottom: 0;
  font-weight: 700;
  color: #1a1a1a;
}
.mapa-zasiegu-wrapper .wynik-kontakt {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
}
.mapa-zasiegu-wrapper .kontakt-tytul {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: #C90000;
}
.mapa-zasiegu-wrapper .kontakt-tekst {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #5a5a5a;
}
.mapa-zasiegu-wrapper .kontakt-btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 13px 18px 13px 24px;
  border-radius: 8px;
  background: #C90000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.mapa-zasiegu-wrapper .kontakt-btn:hover {
  background: #7E0000;
  color: #fff;
}
.mapa-zasiegu-wrapper .kontakt-btn .ikona-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.mapa-zasiegu-wrapper .kontakt-btn .ikona-btn svg {
  width: 12px;
  height: 12px;
}
.mapa-zasiegu-wrapper .kontakt-btn .ikona-btn svg path {
  stroke: #fff;
}

/* flex (nie grid) celowo: przy mniej niż 4 operatorach justify-content:
   center wyśrodkowuje niepełny wiersz zamiast przyklejać bloki do lewej
   krawędzi. flex-basis liczony tak, żeby przy 4 elementach rząd wyglądał
   jak siatka 4-kolumnowa. */
.mapa-zasiegu-wrapper .operatorzy-siatka {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.mapa-zasiegu-wrapper .operator-blok {
  flex: 0 1 calc(25% - 18px);
  min-width: 240px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 64px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}
.mapa-zasiegu-wrapper .operator-logo {
 
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;

}
.mapa-zasiegu-wrapper .operator-nazwa {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}
.mapa-zasiegu-wrapper .operator-cta {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 13px 24px;
  border: none;
  border-radius: 8px;
  background: #C90000;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.mapa-zasiegu-wrapper .operator-cta:hover {
  background: #7E0000;
}
.mapa-zasiegu-wrapper .operator-cta .ikona-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.mapa-zasiegu-wrapper .operator-cta .ikona-btn svg {
  width: 12px;
  height: 12px;
}
@media (max-width: 1100px) {
  .mapa-zasiegu-wrapper .operator-blok {
    flex-basis: calc(50% - 12px);
  }
}
@media (max-width: 600px) {
  .mapa-zasiegu-wrapper #wynik-zasięgu {
    padding: 20px;
  }
  .mapa-zasiegu-wrapper .operatorzy-siatka {
    gap: 16px;
  }
  .mapa-zasiegu-wrapper .operator-blok {
    flex-basis: 100%;
    padding: 32px;
  }
}

/* Popup: motywy/frameworki potrafią globalnie ustawić word-break:break-all,
   overflow-wrap:anywhere albo white-space, co zapada szerokość popupu do
   ~0 px i łamie tekst litera po literze — przywracamy normalne zawijanie. */
.mapa-zasiegu-wrapper .leaflet-popup-content {
  font-size: 14px;
  line-height: 1.45;
  min-width: 240px;
  max-width: 280px;
  margin: 13px 24px 13px 20px;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  word-wrap: normal !important;
  hyphens: none !important;
  text-align: left;
}
.mapa-zasiegu-wrapper .leaflet-popup-content-wrapper {
  min-width: 240px;
  background: #fff;
  color: #1a1a1a;
}
.mapa-zasiegu-wrapper .leaflet-popup-content p,
.mapa-zasiegu-wrapper .leaflet-popup-content strong {
  margin: 0;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Zabezpieczenie: style typografii treści WYSIWYG (motyw/ACF) często
   ustawiają globalnie coś w rodzaju "img { max-width: 100%; height: auto; }"
   na całej zawartości edytora, z !important. leaflet.css ma już podobny
   reset (max-width/max-height: none !important na .leaflet-container img),
   ale gdyby reguła motywu miała wyższą specyficzność, dokładamy własną,
   mocniej "przyklejoną" do naszego kontenera. Celowo NIE nadpisujemy tu
   width/height na "auto" — to zepsułoby wyostrzone ikony @2x na ekranach
   retina (Leaflet ustawia im inline mniejszy rozmiar niż natywny plik
   PNG); wystarczy zablokować tylko max-width/max-height. */
.mapa-zasiegu-wrapper .leaflet-container img {
  max-width: none !important;
  max-height: none !important;
}

/* Kolor klastrów markerów (nadpisuje domyślne zielone/żółte/pomarańczowe
   kolory z leaflet.markercluster — wszystkie rozmiary klastra jednolicie
   na #C90000, niezależnie od liczby zebranych punktów). Zagnieżdżone pod
   .mapa-zasiegu-wrapper, żeby nie zmieniać wyglądu innych map Leaflet,
   które mogą być gdzie indziej na tej samej witrynie WordPress. */
.mapa-zasiegu-wrapper .marker-cluster-small,
.mapa-zasiegu-wrapper .marker-cluster-medium,
.mapa-zasiegu-wrapper .marker-cluster-large {
  background-color: rgba(201, 0, 0, 0.5);
}
.mapa-zasiegu-wrapper .marker-cluster-small div,
.mapa-zasiegu-wrapper .marker-cluster-medium div,
.mapa-zasiegu-wrapper .marker-cluster-large div {
  background-color: rgba(201, 0, 0, 0.9);
  color: #fff;
}

/* Klaster z własną ikoną (iconCreateFunction w JS, styl inline) — tu tylko
   zerujemy tło/obramowanie, które mógłby dorzucić motyw na divIcon. */
.mapa-zasiegu-wrapper .leaflet-marker-icon.mz-klaster {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Stałe, okrągłe wymiary klastra — motyw potrafi ścisnąć szerokość
   .leaflet-marker-icon (klaster wychodzi wtedy jako wąska "pigułka"). */
.mapa-zasiegu-wrapper .leaflet-marker-icon.mz-klaster {
  padding: 0 !important;
  overflow: visible !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 50% !important;
}
.mapa-zasiegu-wrapper .leaflet-marker-icon.mz-klaster-40 { width: 40px !important; height: 40px !important; min-width: 40px !important; }
.mapa-zasiegu-wrapper .leaflet-marker-icon.mz-klaster-46 { width: 46px !important; height: 46px !important; min-width: 46px !important; }
.mapa-zasiegu-wrapper .leaflet-marker-icon.mz-klaster-54 { width: 54px !important; height: 54px !important; min-width: 54px !important; }

/* ===== Popup — pełne, jawne style (odporne na CSS motywu) =====
   Objaw: kontener .leaflet-popup zapadał się, przez co przycisk zamykania
   (position:absolute; right:0) lądował po lewej stronie, a strzałka (tip)
   znikała. Wymuszamy szerokość kontenera wg zawartości i jawnie ustawiamy
   przycisk zamykania oraz strzałkę. */
.mapa-zasiegu-wrapper .leaflet-popup {
  position: absolute !important;
  width: max-content !important;
  max-width: none !important;
  margin-bottom: 20px !important;
  text-align: center !important;
}
.mapa-zasiegu-wrapper .leaflet-popup-content-wrapper {
  position: relative !important;
  padding: 1px !important;
  text-align: left !important;
  background: #fff !important;
  color: #1a1a1a !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3) !important;
}
.mapa-zasiegu-wrapper .leaflet-popup-content {
  width: auto;
}
.mapa-zasiegu-wrapper .leaflet-popup-content p {
  margin: 0 0 8px 0 !important;
}
.mapa-zasiegu-wrapper .leaflet-popup-tip-container {
  position: absolute !important;
  left: 50% !important;
  width: 40px !important;
  height: 20px !important;
  margin-left: -20px !important;
  margin-top: -1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.mapa-zasiegu-wrapper .leaflet-popup-tip {
  width: 17px !important;
  height: 17px !important;
  padding: 1px !important;
  margin: -10px auto 0 !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3) !important;
  transform: rotate(45deg) !important;
  pointer-events: auto !important;
}
.mapa-zasiegu-wrapper .leaflet-container a.leaflet-popup-close-button {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: 26px !important;
  height: 26px !important;
  padding: 6px 6px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center !important;
  font: 18px/20px Tahoma, Verdana, sans-serif !important;
  color: #757575 !important;
  text-decoration: none !important;
}
.mapa-zasiegu-wrapper .leaflet-container a.leaflet-popup-close-button:hover {
  color: #C90000 !important;
}
