/* ==========================================================================
   Homepage map: justjoin.it-style category row on top, then list (left) +
   map (right) like posao.eu, with a limited height so the page scrolls on.
   Phone (posao.eu): map on top, then title + count, categories, list.
   ========================================================================== */
.adz-maphome {
	max-width: var(--adz-shell, 1384px);
	margin: 0 auto;
	padding: 0.75rem var(--adz-gutter, 24px) 0;
	box-sizing: border-box;
}

/* ---------- Category row: even grid across the content width ---------- */
.adz-catbar { margin-bottom: 0.9rem; }
.adz-catbar__list {
	list-style: none;
	margin: 0;
	padding: 0.35rem 0 0.2rem;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
	gap: 0.25rem;
}
.adz-catbar__list > li { display: flex; justify-content: center; }
.adz-catbar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	width: 100%;
	max-width: 112px;
	padding: 0.35rem 0.25rem 0.45rem;
	border: 0;
	border-radius: 16px;
	background: none;
	cursor: pointer;
	font: 800 0.78rem/1.2 var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--body);
	text-align: center;
	transition: background var(--wp--custom--transition);
}
.adz-catbar__item:hover { background: var(--wp--preset--color--surface); }
.adz-catbar__icon {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	flex: 0 0 56px;
	border-radius: 50%;
	color: #FFFFFF;
	background: linear-gradient(145deg, color-mix(in srgb, var(--cat) 70%, #FFFFFF) 0%, var(--cat) 70%);
	box-shadow: 0 6px 14px color-mix(in srgb, var(--cat) 35%, transparent);
	transition: transform var(--wp--custom--transition), box-shadow var(--wp--custom--transition);
}
.adz-catbar__icon svg { width: 26px; height: 26px; }
.adz-catbar__count {
	position: absolute;
	top: -6px;
	right: -10px;
	min-width: 24px;
	padding: 0.1rem 0.35rem;
	border-radius: 999px;
	background: #FFFFFF;
	color: var(--wp--preset--color--ink);
	box-shadow: 0 1px 4px rgba(31, 27, 45, 0.2);
	font-size: 0.7rem;
	font-weight: 800;
	line-height: 1.35;
}
.adz-catbar__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.4em; }
.adz-catbar__item:hover .adz-catbar__icon { transform: translateY(-2px); }
.adz-catbar__item.is-active { color: var(--wp--preset--color--ink); background: var(--wp--preset--color--surface); }
.adz-catbar__item.is-active .adz-catbar__icon { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--cat); }
.adz-catbar__item:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- List + map: a framed card inside the content width ---------- */
.adz-maphome__split {
	display: grid;
	grid-template-columns: 420px minmax(0, 1fr);
	height: clamp(440px, calc(100vh - 330px), 600px);
	height: clamp(440px, calc(100dvh - 330px), 600px);
	border: 1px solid #E7E9E3;
	border-radius: 24px;
	overflow: hidden;
	background: #FFFFFF;
	box-shadow: 0 10px 30px rgba(31, 27, 45, 0.07);
}
.adz-maphome__panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-right: 1px solid var(--wp--preset--color--border); }
.adz-maphome__head { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.1rem 0.9rem; border-bottom: 1px solid var(--wp--preset--color--border); }
.adz-maphome__titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.adz-maphome__title { margin: 0; font: 800 1.6rem/1.05 var(--wp--preset--font-family--heading); color: var(--wp--preset--color--ink); }
.adz-maphome__title span { color: var(--wp--preset--color--primary); }
.adz-maphome__count { font-size: 0.9rem; color: var(--wp--preset--color--body); white-space: nowrap; }
.adz-maphome__count strong { color: var(--wp--preset--color--ink); }
.adz-maphome__search { display: flex; gap: 0.35rem; padding: 0.3rem; border: 1px solid #E7E9E3; border-radius: 999px; background: #FFFFFF; box-shadow: 0 4px 14px rgba(31, 27, 45, 0.07); }
.adz-maphome__field { flex: 1; display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem; color: var(--wp--preset--color--muted); }
.adz-maphome__field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 1rem var(--wp--preset--font-family--body); color: var(--wp--preset--color--ink); }

.adz-maplist { list-style: none; margin: 0; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.adz-maplist__item[hidden] { display: none; }
.adz-mapcard { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 0.85rem; padding: 0.55rem; border: 1px solid #E7E9E3; border-radius: 18px; background: #FFFFFF; transition: border-color var(--wp--custom--transition), box-shadow var(--wp--custom--transition); }
.adz-maplist__item.is-active .adz-mapcard,
.adz-mapcard:hover { border-color: var(--cat); box-shadow: 0 8px 22px rgba(31, 27, 45, 0.1); }
.adz-mapcard__media { display: block; aspect-ratio: 1 / 1; border-radius: 13px; overflow: hidden; background: color-mix(in srgb, var(--cat) 12%, #FFFFFF); }
.adz-mapcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adz-mapcard__body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; padding: 0.15rem 0.25rem 0.15rem 0; }
.adz-mapcard__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.adz-mapcard__city { padding: 0.2rem 0.5rem; border-radius: 7px; background: var(--wp--preset--color--tint-sun); color: #6B4E00; font-size: 0.72rem; font-weight: 800; }
.adz-mapcard__dist { font-size: 0.75rem; font-weight: 800; color: var(--wp--preset--color--muted); }
.adz-mapcard__title { margin: 0; font: 700 1.1rem/1.2 var(--wp--preset--font-family--heading); }
.adz-mapcard__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.adz-mapcard__title a::after { content: ""; position: absolute; inset: 0; }
.adz-mapcard__foot { margin: auto 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.adz-mapcard__price { color: var(--wp--preset--color--ink); font-size: 1rem; }
.adz-mapcard__unit { font-size: 0.8rem; color: var(--wp--preset--color--muted); }
.adz-mapcard__foot .adz-status { margin-left: auto; }
.adz-maplist__empty { margin: 1rem 1.25rem; color: var(--wp--preset--color--muted); }
.adz-maplist__all { margin: 0.5rem 1.25rem 1.5rem; text-align: center; }

/* ---------- Map ---------- */
.adz-maphome__map { position: relative; min-height: 0; }
.adz-map { position: absolute; inset: 0; background: #EEF3F0; }
.adz-map .leaflet-tile-pane { filter: saturate(0.8) brightness(1.03); }
.adz-maphome.is-map-error .adz-map::after { content: "Mapa chwilowo niedostępna."; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--wp--preset--color--muted); }

.adz-map__tools { position: absolute; top: 12px; right: 12px; z-index: 600; display: flex; gap: 8px; }
.adz-map__tool {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-width: 44px;
	height: 44px;
	padding: 0 0.7rem;
	border: 0;
	border-radius: 12px;
	background: #FFFFFF;
	color: var(--wp--preset--color--ink);
	box-shadow: 0 2px 8px rgba(31, 27, 45, 0.25);
	cursor: pointer;
	font: 800 0.9rem var(--wp--preset--font-family--body);
}
.adz-map__tool:hover { background: #F6F5FA; }
.adz-map__tool[aria-expanded="true"] { background: var(--wp--preset--color--primary); color: #FFFFFF; }
.adz-map__badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--wp--preset--color--coral-strong); color: #FFFFFF; font-size: 0.72rem; line-height: 20px; }
.adz-map__badge[hidden] { display: none; }
.adz-map__tool .adz-ico-close { display: none; }
.is-fullscreen .adz-map__tool .adz-ico-open { display: none; }
.is-fullscreen .adz-map__tool .adz-ico-close { display: block; }

.adz-map__panel {
	position: absolute;
	top: 66px;
	right: 12px;
	z-index: 650;
	width: 320px;
	max-height: calc(100% - 80px);
	display: flex;
	flex-direction: column;
	border-radius: 18px;
	background: #FFFFFF;
	box-shadow: 0 18px 40px rgba(31, 27, 45, 0.25);
	overflow: hidden;
}
.adz-map__panel[hidden] { display: none; }
.adz-map__panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--wp--preset--color--border); font: 800 1.1rem var(--wp--preset--font-family--heading); }
.adz-map__panel-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--wp--preset--color--ink); }
.adz-map__panel-close:hover { background: #F2F1F6; }
.adz-map__panel-body { padding: 0.75rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; }
.adz-map__panel-body fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.adz-map__panel-body legend { margin-bottom: 0.35rem; font-weight: 800; font-size: 0.85rem; color: var(--wp--preset--color--ink); }
.adz-map__panel-body select { min-height: 42px; padding: 0 0.6rem; border: 1.5px solid #D5D1DF; border-radius: 12px; font: 600 0.95rem var(--wp--preset--font-family--body); }
.adz-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; color: var(--wp--preset--color--body); cursor: pointer; }
.adz-check input { width: 18px; height: 18px; accent-color: var(--wp--preset--color--primary); }
.adz-map__panel-foot { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--wp--preset--color--border); }
.adz-map__panel-foot .adz-btn { flex: 1; min-height: 42px; padding: 0 0.8rem; }

.adz-map__area,
.adz-map__locate {
	position: absolute;
	z-index: 500;
	border: 0;
	background: #FFFFFF;
	color: var(--wp--preset--color--ink);
	box-shadow: 0 2px 8px rgba(31, 27, 45, 0.25);
	cursor: pointer;
	font: 800 0.9rem var(--wp--preset--font-family--body);
}
.adz-map__area { top: 12px; left: 50%; transform: translateX(-50%); min-height: 42px; padding: 0 1.1rem; border-radius: 999px; }
.adz-map__area[hidden] { display: none; }
.adz-map__locate { right: 10px; bottom: 96px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--wp--preset--color--primary-strong); }

/* Full screen (CSS like the posao.eu plugin; works on iOS) */
.adz-maphome__map.is-fullscreen { position: fixed !important; inset: 0 !important; z-index: 99999 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important; background: #FFFFFF; }
html.adz-map-fs, html.adz-map-fs body { overflow: hidden !important; }
.is-fullscreen .adz-map__tools { top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }

/* Pins, clusters, my location */
.adz-pin-wrap { background: none; border: 0; }
.adz-pin { position: relative; display: block; filter: drop-shadow(0 3px 4px rgba(31, 27, 45, 0.28)); }
.adz-pin svg { display: block; }
.adz-pin__icon { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); color: #FFFFFF; line-height: 0; }
.adz-pin.is-active .adz-pin__icon svg { width: 19px; height: 19px; }
.adz-cluster { display: flex !important; align-items: center; justify-content: center; border-radius: 50%; background: #2F2A6B; color: #FFFFFF; font: 800 0.9rem var(--wp--preset--font-family--body); box-shadow: 0 0 0 4px #FFFFFF, 0 4px 12px rgba(31, 27, 45, 0.3); }
.adz-me { border-radius: 50%; background: var(--wp--preset--color--sky); border: 3px solid #FFFFFF; box-shadow: 0 0 0 8px rgba(56, 182, 245, 0.25); }

/* Popup */
.adz-leaflet-popup .leaflet-popup-content-wrapper { border-radius: 18px; padding: 0; overflow: hidden; }
.adz-leaflet-popup .leaflet-popup-content { margin: 0; width: 240px !important; }
/* Close button: a round white button over the photo, big enough to tap. */
.adz-leaflet-popup a.leaflet-popup-close-button {
	top: 8px;
	right: 8px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 2px 8px rgba(31, 27, 45, 0.25);
	color: var(--wp--preset--color--ink, #1F1B2D);
	font: 400 26px/1 var(--wp--preset--font-family--body, sans-serif);
	text-decoration: none;
}
.adz-leaflet-popup a.leaflet-popup-close-button span { display: block; line-height: 1; margin-top: -2px; }
.adz-leaflet-popup a.leaflet-popup-close-button:hover,
.adz-leaflet-popup a.leaflet-popup-close-button:focus-visible { background: #FFFFFF; color: var(--wp--preset--color--primary-strong, #0F7B6F); }
.adz-popup { display: flex; flex-direction: column; gap: 0.25rem; padding-bottom: 0.75rem; text-decoration: none; color: var(--wp--preset--color--ink); font-family: var(--wp--preset--font-family--body); }
.adz-popup img { width: 100%; height: 130px; object-fit: cover; display: block; margin-bottom: 0.35rem; }
.adz-popup > span, .adz-popup > strong { padding: 0 0.85rem; }
.adz-popup > .adz-noimg { padding: 0; }
.adz-popup__cat { font-size: 0.75rem; font-weight: 800; }
.adz-popup__title { font: 700 1.05rem/1.2 var(--wp--preset--font-family--heading); }
.adz-popup__foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.leaflet-container a.adz-popup { color: var(--wp--preset--color--ink); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
	.adz-maphome__split { grid-template-columns: 380px minmax(0, 1fr); }
}

/* ---------- Phone: exactly like posao.eu (map on top, list below) ---------- */
@media (max-width: 47.99em) {
	.adz-maphome { display: flex; flex-direction: column; border-top: 0; max-width: none; padding: 0; }
	.adz-catbar { margin-bottom: 0; }
	.adz-catbar__list { display: flex; overflow-x: auto; scrollbar-width: none; }
	.adz-catbar__list > li { flex: 0 0 auto; }
	.adz-catbar__item { max-width: none; width: auto; }
	.adz-catbar__item .adz-catbar__icon { flex: 0 0 26px; width: 26px; height: 26px; }
	.adz-catbar__name { height: auto; }
	.adz-maphome__split { display: contents; }
	.adz-maphome__map { order: 1; height: 52vh; height: 52svh; min-height: 300px; }
	.adz-maphome__head { order: 2; }
	.adz-catbar { order: 3; }
	.adz-maphome__panel { order: 4; overflow: visible; border-right: 0; display: contents; }
	.adz-maphome__head { padding: 0.9rem 1rem 0.6rem; border-bottom: 0; }
	.adz-maphome__titlerow { align-items: center; }
	.adz-maphome__title { font-size: 1.35rem; }
	.adz-maphome__title span { color: var(--wp--preset--color--ink); }
	.adz-maphome__search,
	.adz-maphome__head .adz-chips { display: none; }
	.adz-catbar { background: #FFFFFF; border-bottom: 0; }
	.adz-catbar__list { padding: 0.2rem 1rem 0.6rem; gap: 0.5rem; justify-content: flex-start; }
	.adz-catbar__item { flex-direction: row; width: auto; gap: 0.4rem; padding: 0.45rem 0.85rem 0.45rem 0.45rem; border-radius: 999px; background: var(--wp--preset--color--surface); white-space: nowrap; font-size: 0.85rem; }
	.adz-catbar__item.is-active { background: #2F2A6B; color: #FFFFFF; }
	.adz-catbar__icon { width: 26px; height: 26px; box-shadow: none; }
	.adz-catbar__icon svg { width: 15px; height: 15px; }
	.adz-catbar__count { display: none; }
	.adz-catbar__item.is-active .adz-catbar__icon { box-shadow: none; }
	.adz-catbar__name { min-height: 0; display: inline; }
	.adz-maplist { order: 5; padding: 0.25rem 1rem 1rem; }
	.adz-maplist__morewrap, .adz-maplist__empty, .adz-maplist__all { order: 6; } /* "Pokaż więcej" right under the list */
	.adz-mapcard { grid-template-columns: 92px minmax(0, 1fr); border-color: #F2C9A0; border-color: color-mix(in srgb, var(--cat) 45%, #FFFFFF); }
	.adz-map__tool-label { display: none; }
	.adz-map__panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; border-radius: 22px 22px 0 0; z-index: 100000; }
	.adz-map__panel-foot { padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 16px rgba(31, 27, 45, 0.08); }
	.adz-map__locate { bottom: 92px; }
}

/* Empty categories: shown (like justjoin.it) but dimmed */
.adz-catbar__item.is-empty .adz-catbar__icon { background: color-mix(in srgb, var(--cat) 18%, #FFFFFF); color: var(--cat); box-shadow: none; }
.adz-catbar__item.is-empty .adz-catbar__name { color: var(--wp--preset--color--muted); }
.adz-catbar__item.is-empty .adz-catbar__count { color: var(--wp--preset--color--muted); }
.adz-catbar__item.is-empty.is-active .adz-catbar__icon { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--cat); }
.adz-maplist__empty--cat { padding: 1rem 1.1rem; border-radius: 16px; background: var(--wp--preset--color--surface); line-height: 1.5; }
.adz-maplist__empty--cat a { font-weight: 800; color: var(--wp--preset--color--primary-strong); }
@media (max-width: 47.99em) {
	.adz-catbar__item.is-empty { opacity: 0.75; }
}

/* ==========================================================================
   List pages (/atrakcje/…): same component, plus breadcrumbs, "Pokaż
   więcej", a short text and related links (inc/list-pages.php).
   ========================================================================== */
a.adz-catbar__item { text-decoration: none; }
span.adz-catbar__item { cursor: default; }
.adz-maplist__morewrap { margin: 0.75rem 1.25rem 0.25rem; text-align: center; }
.adz-maplist__more { width: 100%; justify-content: center; }

.adz-listpage .adz-main--hivepress { padding: 0; background: #fff; }
.adz-crumbs {
	max-width: var(--adz-shell, 1384px);
	margin: 0 auto;
	padding: 0.75rem var(--adz-gutter, 24px) 0;
	box-sizing: border-box;
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}
.adz-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; }
.adz-crumbs li + li::before { content: "›"; margin-right: 0.4rem; color: var(--wp--preset--color--muted); }
.adz-crumbs a { color: var(--wp--preset--color--body); text-decoration: none; }
.adz-crumbs a:hover { text-decoration: underline; }
.adz-listpage .adz-maphome { padding-top: 0.25rem; }

.adz-listseo {
	max-width: var(--adz-shell, 1384px);
	margin: 2rem auto 3rem;
	padding: 0 var(--adz-gutter, 24px);
	box-sizing: border-box;
	display: grid;
	gap: 1.5rem;
}
.adz-listseo__text { max-width: 760px; font-size: 1rem; line-height: 1.65; color: var(--wp--preset--color--body); }
.adz-listseo__text p { margin: 0 0 0.75rem; }
.adz-listseo__title { margin: 0 0 0.6rem; font: 800 1.15rem/1.2 var(--wp--preset--font-family--heading); }
.adz-listseo__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.adz-listseo__links a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.85rem;
	border: 1px solid #E7E9E3;
	border-radius: 999px;
	background: #fff;
	color: var(--wp--preset--color--body);
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none;
}
.adz-listseo__links a:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary-strong); }
.adz-listseo__links span { color: var(--wp--preset--color--muted); font-weight: 600; }

@media (max-width: 47.99em) {
	.adz-listpage .adz-crumbs { display: none; }
	.adz-listseo { margin-top: 1.25rem; padding: 0 1rem; }
}

/* Nothing found: suggestions */
.adz-maplist__sugg-title { display: block; margin: 0.9rem 0 0.5rem; font-weight: 800; color: var(--wp--preset--color--body); }
.adz-maplist__sugg { margin-bottom: 0.9rem; }
.adz-maplist__sugg a { font-size: 0.88rem; padding: 0.35rem 0.75rem; }
.adz-maplist__empty--cat .adz-maplist__sugg-all { display: inline-block; }
