/* NFHotel Apartments — widok mapy (przełącznik Lista / Mapa, „Zobacz na mapie").
   Wzór: apartamenty.nawyspie.eu. Desktop: lista z kadru mapy + mapa.
   Poniżej 1024 px: mapa na cały ekran z wysuwanym panelem (klasa .is-modal,
   kontener przeniesiony do <body> przez nfap-map.js).
   Leaflet i markercluster ładuje nfap-map.js dopiero przy pierwszym otwarciu. */

/* Sekcja Oxygena to flex z align-items:flex-start, więc wrapper elementu bierze
   szerokość z treści — po ukryciu kafelków mapa skurczyłaby się do ~200 px. */
.oxy-nfhotel-apartments { width: 100%; }

/* ---- Przełącznik Lista / Mapa ---- */
.nfap__viewbar {
	display: flex; justify-content: flex-end;
	margin-bottom: 4px;
	font-family: 'Lato', sans-serif;
}
.nfap__viewbtn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 20px;
	border: 1px solid #d7a97d; background: #fff; color: #d7a97d;
	font: 600 14px/1.2 'Lato', sans-serif; letter-spacing: .5px;
	cursor: pointer; transition: background .3s, color .3s;
}
.nfap__viewbtn + .nfap__viewbtn { border-left: 0; }
.nfap__viewbtn svg { width: 16px; height: 16px; display: block; }
.nfap__viewbtn.is-active { background: #d7a97d; color: #fff; }
@media (hover: hover) and (pointer: fine) {
	.nfap__viewbtn:not(.is-active):hover { background: rgba(215, 169, 125, .12); }
}

/* ---- Przełączanie widoków ---- */
.nfap__map { display: none; }
.nfap.is-map-view .nfap__map { display: block; }
.nfap.is-map-view .nfap__results { display: none; }

/* Własny kontekst nakładania: panele Leafleta mają z-index 400–1000 i bez tego
   wchodziłyby na przyklejony nagłówek strony. */
.nfap__map {
	--nfap-map-h: clamp(520px, calc(100vh - 220px), 760px);
	position: relative; z-index: 0; margin-top: 30px;
}
.nfap__map-layout {
	display: grid;
	/* Środkowa kolumna to uchwyt zmiany szerokości (nfap-map.js ustawia --nfap-side-w). */
	grid-template-columns: var(--nfap-side-w, minmax(330px, 38%)) 16px minmax(0, 1fr);
	gap: 6px;
	padding: 10px;
	border: 1px solid #efe7df;
	background: #fdfdfd;
	box-shadow: 0 14px 32px rgba(36, 36, 36, .05);
}

/* Elementy tylko dla trybu pełnoekranowego. */
.nfap__map-bar,
.nfap__map-sheet-head { display: none; }

/* ---- Lista z kadru mapy ---- */
.nfap__map-side {
	display: flex; flex-direction: column;
	min-width: 0; height: var(--nfap-map-h);
}
.nfap__map-count {
	padding: 4px 4px 10px;
	font: 600 14px/1.3 'Lato', sans-serif; color: #404040;
}
.nfap__map-count strong { color: #d7a97d; }
.nfap__map-list {
	position: relative; /* offsetTop kart liczony względem listy */
	flex: 1 1 auto; min-height: 0;
	display: flex; flex-direction: column; gap: 12px;
	padding: 4px 8px 24px 4px;
	overflow-y: auto; overflow-x: hidden;
	overscroll-behavior: contain;
	scrollbar-width: thin; scrollbar-color: #d7a97d transparent;
}
.nfap__map-list::-webkit-scrollbar { width: 6px; height: 6px; }
.nfap__map-list::-webkit-scrollbar-track { background: transparent; }
.nfap__map-list::-webkit-scrollbar-thumb { background: #d7a97d; border-radius: 3px; }

/* ---- Karta przy mapie ---- */
.nfap-mcard {
	display: flex; gap: 12px; flex: 0 0 auto;
	padding: 10px;
	border: 1px solid #ebe4dd; background: #fff;
	cursor: pointer;
	transition: border-color .25s, box-shadow .25s;
	font-family: 'Inter', 'Lato', sans-serif; color: #404040;
	text-align: left; /* motyw justuje akapity */
}
.nfap-mcard:hover { border-color: rgba(215, 169, 125, .6); }
.nfap-mcard.is-active {
	border-color: #d7a97d;
	box-shadow: 0 0 0 2px rgba(215, 169, 125, .22), 0 12px 24px rgba(215, 169, 125, .18);
}
.nfap-mcard.is-glow { animation: nfap-mcard-glow 1.6s ease; }
@keyframes nfap-mcard-glow {
	0%, 100% { box-shadow: 0 0 0 2px rgba(215, 169, 125, .22), 0 12px 24px rgba(215, 169, 125, .18); }
	35% { box-shadow: 0 0 0 6px rgba(215, 169, 125, .35), 0 16px 30px rgba(215, 169, 125, .3); }
}
.nfap-mcard__img {
	flex: 0 0 118px; height: 104px;
	display: block; overflow: hidden; background: #f7f3ee;
}
.nfap-mcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nfap-mcard__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nfap-mcard__title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	color: #242424 !important; font-size: 15px; font-weight: 500; line-height: 1.3; text-decoration: none;
}
.nfap-mcard__title:hover { color: #d7a97d !important; }
.nfap-mcard__addr {
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	color: #d7a97d; font-size: 12px; letter-spacing: .5px;
}
.nfap-mcard__desc {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	margin: 2px 0 0; color: #5a5a5a; font-size: 12.5px; line-height: 1.4;
}
.nfap-mcard__foot {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
	margin-top: auto; padding-top: 6px;
}
.nfap-mcard__price { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; font-size: 12px; }
.nfap-mcard__price-label { color: #8a8a8a; font-size: 11px; white-space: nowrap; }
.nfap-mcard__price s { color: #d87070; font-weight: 600; white-space: nowrap; }
.nfap-mcard__price strong { color: #d7a97d; font-size: 17px; font-weight: 600; white-space: nowrap; }
.nfap-mcard__na { color: #ce0000; font-size: 12px; font-weight: 700; line-height: 1.3; }
.nfap-mcard__book {
	flex: 0 0 auto;
	padding: 8px 14px;
	border: 1px solid #242424; background: #242424; color: #fff !important;
	font: 500 13px/1.2 'Inter', 'Lato', sans-serif; letter-spacing: .5px; text-decoration: none;
	white-space: nowrap; /* nigdy „Re/zer/wuj” jak na nawyspie */
	cursor: pointer; transition: background .3s, border-color .3s;
}
.nfap-mcard__book:hover { background: #d7a97d; border-color: #d7a97d; }
.nfap-mcard__book--ghost { background: #fff; color: #242424 !important; }
.nfap-mcard__book--ghost:hover { color: #fff !important; }

.nfap__map-reset {
	margin-top: 14px; padding: 10px 18px;
	border: 1px solid #d7a97d; background: #fff; color: #242424;
	font: 600 14px/1.2 'Lato', sans-serif; letter-spacing: .3px;
	cursor: pointer; transition: background .3s, color .3s;
}
.nfap__map-reset:hover { background: #d7a97d; color: #fff; }

/* ---- Uchwyt zmiany szerokości listy ---- */
.nfap__map-resizer {
	position: relative;
	display: flex; align-items: stretch; justify-content: center;
	cursor: col-resize; user-select: none; touch-action: none;
	outline: none;
}
.nfap__map-resizer span {
	position: relative; width: 2px;
	border-radius: 999px; background: #efe7df;
	transition: background .2s, box-shadow .2s;
}
/* „Pigułka” na środku — widać, że da się złapać. */
.nfap__map-resizer span::before {
	content: ""; position: absolute; top: 50%; left: 50%;
	width: 10px; height: 44px; border-radius: 999px;
	background: #f4ebe2; border: 1px solid #e6d6c6;
	transform: translate(-50%, -50%);
	transition: background .2s, border-color .2s;
}
.nfap__map-layout.is-resizing .nfap__map-resizer span,
.nfap__map-resizer:hover span,
.nfap__map-resizer:focus-visible span { background: #d7a97d; box-shadow: 0 0 0 4px rgba(215, 169, 125, .15); }
.nfap__map-layout.is-resizing .nfap__map-resizer span::before,
.nfap__map-resizer:hover span::before,
.nfap__map-resizer:focus-visible span::before { background: #d7a97d; border-color: #d7a97d; }
/* W trakcie przeciągania nic poza uchwytem nie łapie kursora (karty, piny). */
.nfap__map-layout.is-resizing .nfap__map-side,
.nfap__map-layout.is-resizing .nfap__map-stage { pointer-events: none; }

/* ---- Mapa ---- */
.nfap__map-stage { position: relative; min-width: 0; height: var(--nfap-map-h); }
.nfap__map-canvas { width: 100%; height: 100%; background: #e5e5e5; }
.nfap__map-canvas .leaflet-control-zoom { border: 1px solid #e6ddd4; box-shadow: 0 10px 22px rgba(36, 36, 36, .12); }
.nfap__map-canvas .leaflet-control-zoom a { color: #242424; font-weight: 700; }
.nfap__map-status {
	position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000;
	padding: 8px 16px; background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	font: 600 14px/1.3 'Lato', sans-serif; color: #404040; text-align: center;
}

/* ---- Pinezki z ceną ---- */
.nfap-pin-wrap { background: none; border: 0; }
.nfap-pin {
	display: flex; align-items: center; justify-content: center;
	box-sizing: border-box; width: 100%; height: 100%;
	padding: 0 10px;
	border: 2px solid #fff; border-radius: 999px;
	background: #242424; color: #fff;
	font: 700 12px/1 'Inter', 'Lato', sans-serif; white-space: nowrap;
	box-shadow: 0 8px 18px rgba(36, 36, 36, .25);
	transition: background .2s;
}
.nfap-pin.is-active, .leaflet-marker-icon:hover .nfap-pin { background: #d7a97d; }
.nfap-pin.is-na { padding: 0; background: #b9b0a7; }

/* ---- Popup (desktop) ---- */
.nfap__map .leaflet-popup-content-wrapper { border-radius: 0; padding: 0; overflow: hidden; }
.nfap__map .leaflet-popup-content { margin: 0; width: 280px !important; }
/* Krzyżyk leży na zdjęciu — białe kółko, żeby było go widać. */
.nfap__map .leaflet-popup-close-button {
	z-index: 2; top: 8px !important; right: 8px !important; width: 28px !important; height: 28px !important;
	border-radius: 50%; background: rgba(255, 255, 255, .92) !important; color: #242424 !important;
	font: 400 20px/28px Arial, sans-serif !important; text-align: center;
}
.nfap__map .leaflet-popup-close-button:hover { color: #d7a97d !important; }
.nfap-map-pop { font-family: 'Inter', 'Lato', sans-serif; color: #404040; text-align: left; }
.nfap-map-pop__img { display: block; height: 150px; background: #f7f3ee; }
.nfap-map-pop__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nfap-map-pop__body { padding: 12px 14px 14px; }
.nfap-map-pop__title { display: block; color: #242424 !important; font-size: 16px; font-weight: 500; line-height: 1.25; text-decoration: none; }
.nfap-map-pop__title:hover { color: #d7a97d !important; }
.nfap-map-pop__addr { margin-top: 4px; color: #d7a97d; font-size: 12px; letter-spacing: 1px; }
.nfap-map-pop__price { margin-top: 8px; font-size: 13px; }
.nfap-map-pop__price s { color: #d87070; font-weight: 600; }
.nfap-map-pop__price strong { color: #d7a97d; font-size: 20px; font-weight: 600; }
.nfap-map-pop__na { margin-top: 8px; color: #ce0000; font-size: 13px; font-weight: 700; }
.nfap-map-pop__btn {
	display: inline-block; margin-top: 10px; padding: 8px 15px;
	background: #d7a97d; color: #fff !important; font-size: 13px; letter-spacing: 1px; text-decoration: none;
	transition: background .3s;
}
.nfap-map-pop__btn:hover { background: #242424; }

/* ---- „Zobacz na mapie" w kafelku ----
   Desktop: jak na produkcji — trzeci złoty przycisk po „Rezerwuj”, bez ikony.
   Gdy cena i trzy przyciski nie mieszczą się w rzędzie (karta węższa niż
   ~680 px stopki), przycisk schodzi pod pozostałe, wyrównany do prawej. */
.nfap-card__actions > .nfap-card__btn--map {
	background: var(--nfap-primary, #d7a97d); border-color: var(--nfap-primary, #d7a97d);
	white-space: nowrap;
}
.nfap-card__actions > .nfap-card__btn--map:hover { background: var(--nfap-dark, #242424); border-color: var(--nfap-dark, #242424); }
.nfap-card__btn--map svg { display: none; width: 16px; height: 16px; flex: 0 0 auto; }
.nfap-card__actions:has(> .nfap-card__btn--map) { justify-content: flex-end; }
/* Przy braku miejsca ściska się rząd przycisków (mapa schodzi pod spód), nigdy
   cena — inaczej „cena za pobyt” i „PLN” łamały się na kilka linii. */
.nfap-card__footer > .nfap-card__price { flex-shrink: 0; }

/* Telefon: „Szczegóły” i „Rezerwuj” po połowie szerokości, pod nimi
   obrysowany „Zobacz na mapie” z ikoną na całą szerokość. */
@media (max-width: 479px) {
	.nfap-card__actions:has(> .nfap-card__btn--map) {
		display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
		width: 100%;
	}
	.nfap-card__actions:has(> .nfap-card__btn--map) > .nfap-card__btn { width: 100%; margin: 0; }
	.nfap-card__actions > .nfap-card__btn--map {
		grid-column: 1 / -1; gap: 8px;
		background: #fff; color: var(--nfap-primary, #d7a97d);
	}
	.nfap-card__actions > .nfap-card__btn--map:hover { background: var(--nfap-primary, #d7a97d); border-color: var(--nfap-primary, #d7a97d); color: #fff; }
	.nfap-card__btn--map svg { display: block; }
	/* Niedostępny: „Dostosuj termin” z ikoną nie mieści się w połowie szerokości. */
	.nfap-card--unavailable .nfap-card__actions:has(> .nfap-card__btn--map) { grid-template-columns: 1fr; }
	/* Bez ceny nie ma „Rezerwuj” — „Szczegóły” na całą szerokość. */
	.nfap-card__actions--no-book:has(> .nfap-card__btn--map) { grid-template-columns: 1fr; }
}

/* =====================================================================
   Pełny ekran + wysuwany panel (< 1024 px, jak na nawyspie)
   z-index poniżej szuflady filtrów (10000) i kalendarza (99999), które
   otwierają się z górnego paska.
   ===================================================================== */
html.nfap-map-open,
html.nfap-map-open body { overflow: hidden !important; overscroll-behavior: none; }

.nfap__map.is-modal {
	display: block;
	position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9990;
	margin: 0;
	background: #e5e5e5;
}
.nfap__map.is-modal .nfap__map-layout { display: block; height: 100%; padding: 0; border: 0; background: none; box-shadow: none; }
.nfap__map.is-modal .nfap__map-stage { position: absolute; top: 0; right: 0; bottom: 0; left: 0; height: auto; }
.nfap__map.is-modal .leaflet-top { top: 72px; }
.nfap__map.is-modal .nfap__map-resizer,
.nfap__map.is-modal .nfap__map-count,
.nfap__map.is-modal .nfap__map-reset,
.nfap__map.is-modal .leaflet-popup-pane { display: none; }
.nfap__map.is-modal .nfap__map-status { top: 84px; }

/* Górny pasek: wróć / termin i osoby / filtry. */
.nfap__map.is-modal .nfap__map-bar {
	display: flex; align-items: center; gap: 8px;
	position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1002;
	padding: 6px;
	border-radius: 999px; background: #fff;
	box-shadow: 0 10px 26px rgba(36, 36, 36, .18);
}
.nfap__map-bar-btn {
	flex: 0 0 44px; width: 44px; height: 44px;
	display: flex; align-items: center; justify-content: center;
	padding: 0; border: 0; border-radius: 50%;
	background: #f4efea; color: #242424; cursor: pointer;
}
.nfap__map-bar-btn svg { width: 20px; height: 20px; display: block; }
.nfap__map-bar-summary {
	flex: 1 1 auto; min-width: 0;
	padding: 0 6px; border: 0; background: none; cursor: pointer;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left;
	font: 500 13px/1.2 'Inter', 'Lato', sans-serif; letter-spacing: .3px; color: #404040;
}

/* Panel z listą. Wysokość ustawia JS (zwinięty 112 px / połowa / cały ekran). */
.nfap__map.is-modal .nfap__map-side {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 1001;
	height: 50vh;
	padding: 6px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	border: 0; border-radius: 20px 20px 0 0;
	background: rgba(255, 255, 255, .98);
	box-shadow: 0 -18px 40px rgba(36, 36, 36, .22);
	overflow: hidden;
	transition: height .42s cubic-bezier(.16, 1, .3, 1);
}
.nfap__map.is-modal .nfap__map-side.is-dragging,
.nfap__map.is-modal .nfap__map-side.is-instant { transition: none; }

.nfap__map.is-modal .nfap__map-sheet-head {
	display: block; flex: 0 0 auto;
	padding-bottom: 10px;
	touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.nfap__map-sheet-handle { display: block; width: 44px; height: 5px; margin: 4px auto 10px; border-radius: 3px; background: #d9cfc5; }
.nfap__map-sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nfap__map-sheet-meta { min-width: 0; font-family: 'Inter', 'Lato', sans-serif; text-align: left; }
.nfap__map-sheet-meta strong { display: block; color: #242424; font-size: 24px; font-weight: 600; line-height: 1.1; }
.nfap__map-sheet-meta span { display: block; color: #8a8a8a; font-size: 13px; }
.nfap__map-sheet-actions { display: flex; gap: 6px; }
.nfap__map-sheet-actions button {
	width: 36px; height: 36px; padding: 0;
	display: flex; align-items: center; justify-content: center;
	border: 1px solid #e6ddd4; border-radius: 50%; background: #fff; color: #242424; cursor: pointer;
}
.nfap__map-sheet-actions button svg { width: 16px; height: 16px; display: block; }
.nfap__map-sheet-actions button:disabled { opacity: .35; cursor: default; }

.nfap__map.is-modal .nfap__map-list { padding: 4px 2px 16px; gap: 10px; transition: opacity .2s, transform .2s; }
.nfap__map.is-modal[data-sheet="collapsed"] .nfap__map-list { opacity: 0; pointer-events: none; transform: translateY(10px); }

/* Karta w panelu: pełna szerokość, miniatura z lewej, cena i „Rezerwuj” w jednym rzędzie. */
.nfap__map.is-modal .nfap-mcard__img { flex-basis: 104px; height: 104px; }
@media (max-width: 767px) {
	.nfap__map.is-modal .nfap-mcard__desc { display: none; }
	.nfap__viewbar { justify-content: stretch; }
	.nfap__viewbtn { flex: 1 1 50%; justify-content: center; }
	.nfap__map { margin-top: 20px; }
}
@media (max-width: 374px) {
	.nfap__map.is-modal .nfap-mcard__img { flex-basis: 84px; height: 96px; }
	.nfap__map.is-modal .nfap-mcard__book { padding: 8px 10px; }
}
