/* CSB Print Shop – map picker + photo map */

.csb-map-picker,
.csb-photo-map {
	width: 100%;
	height: 280px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #ddd;
	background: #eef2f6;
}

.csb-photo-map-shell {
	--csb-map-height: 520px;
	position: relative;
}

.csb-photo-map-shell .csb-photo-map-stage {
	position: relative;
	height: var(--csb-map-height);
}

.csb-photo-map-shell:not(.csb-photo-map-shell--fullscreen) .csb-photo-map {
	height: 100%;
}

/* ========== Fullscreen immersive map page ========== */

body.csb-photo-map-page,
body.page-template-page-photo-map {
	--csb-map-header-h: 160px;
	overflow: hidden;
	height: 100dvh;
}

body.admin-bar.csb-photo-map-page,
body.admin-bar.page-template-page-photo-map {
	height: calc(100dvh - 32px);
}

body.csb-photo-map-page #wrapper,
body.page-template-page-photo-map #wrapper,
body.csb-photo-map-page .csb-wrapper,
body.page-template-page-photo-map .csb-wrapper {
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

body.csb-photo-map-page .csb-site-header,
body.page-template-page-photo-map .csb-site-header {
	position: relative;
	top: auto;
}

body.csb-photo-map-page .csb-site-footer,
body.page-template-page-photo-map .csb-site-footer,
body.csb-photo-map-page .csb-footer-newsletter,
body.page-template-page-photo-map .csb-footer-newsletter,
body.csb-photo-map-page .csb-footer-cta-wrap,
body.page-template-page-photo-map .csb-footer-cta-wrap {
	display: none !important;
}

body.csb-photo-map-page .csb-main.csb-page-photo-map,
body.csb-photo-map-page #main.csb-main.csb-page-photo-map,
body.page-template-page-photo-map .csb-main.csb-page-photo-map,
body.page-template-page-photo-map #main.csb-main.csb-page-photo-map {
	padding: 0 !important;
	margin: 0;
	flex: 1 1 auto;
	height: auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.csb-photo-map-shell--fullscreen {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: 0;
	position: relative;
	overflow: hidden;
}

.csb-photo-map-shell--fullscreen .csb-photo-map-stage {
	flex: 1 1 auto;
	position: relative;
	width: 100%;
	min-height: 360px;
	height: 100%;
}

.csb-photo-map-shell--fullscreen .csb-photo-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 0;
}

.csb-photo-map-loading {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eef2f6;
	color: #555;
	font-size: 0.9375rem;
	font-weight: 600;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.csb-photo-map-loading.is-hidden {
	opacity: 0;
	visibility: hidden;
}

.csb-photo-map-ui {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.csb-photo-map-ui > * {
	pointer-events: auto;
}

/* Top-left filter chips — kept off the popup */
.csb-photo-map-filters {
	align-self: flex-start;
	display: flex;
	align-items: center;
	width: max-content;
	max-width: min(720px, calc(100% - 4.5rem));
	gap: 0.35rem;
	padding: 0.35rem;
	margin: 0.75rem 0 0 0.75rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	cursor: grab;
	scrollbar-width: none;
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 999px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(10px);
}

.csb-photo-map-filters::-webkit-scrollbar {
	display: none;
}

.csb-photo-map-filters.is-empty {
	display: none;
}

.csb-map-filter-card {
	flex: 0 0 auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-width: 0;
	max-width: 14rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: #333;
	font: inherit;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.csb-map-filter-card:hover {
	border-color: var(--csb-primary, #dd2f6e);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.csb-map-filter-card.is-active {
	border-color: var(--csb-primary, #dd2f6e);
	background: var(--csb-primary, #dd2f6e);
	color: #fff;
	box-shadow: 0 4px 16px rgba(221, 47, 110, 0.35);
}

.csb-map-filter-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.375rem;
	height: 1.375rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.05);
	overflow: hidden;
	flex-shrink: 0;
}

.csb-map-filter-card-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.csb-map-filter-card-icon.is-all {
	font-size: 1.125rem;
	line-height: 1;
}

.csb-map-filter-card.is-active .csb-map-filter-card-icon {
	background: rgba(255, 255, 255, 0.2);
}

.csb-map-filter-card-label {
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: left;
	max-width: 9.5rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csb-map-filter-card-count {
	font-size: 0.6875rem;
	font-weight: 600;
	opacity: 0.75;
}

/* Bottom photo strip */
.csb-photo-map-bottom-panel {
	margin: 0 0.75rem 0.75rem;
	margin-top: auto;
	padding: 0.625rem 0.75rem 0.75rem;
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 100%);
	border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
	backdrop-filter: blur(12px);
	pointer-events: auto;
}

.csb-photo-map-bottom-panel.is-empty .csb-photo-map-cards {
	display: none;
}

.csb-photo-map-bottom-panel .csb-photo-map-attribution {
	margin-top: 0.5rem;
	padding-top: 0.35rem;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	font-size: 0.5625rem;
	color: #888;
	line-height: 1.35;
	pointer-events: none;
}

.csb-photo-map-strip-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
	padding: 0 0.125rem;
}

.csb-photo-map-strip-title {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #1a1a1a;
}

.csb-photo-map-strip-count {
	font-size: 0.75rem;
	font-weight: 600;
	color: #666;
	white-space: nowrap;
}

.csb-photo-map-cards {
	display: flex;
	gap: 0.625rem;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 0.125rem;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	cursor: grab;
	scrollbar-width: none;
}

.csb-photo-map-filters.is-dragging,
.csb-photo-map-cards.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.csb-photo-map-cards::-webkit-scrollbar,
.csb-photo-map-filters::-webkit-scrollbar {
	display: none;
}

.csb-map-photo-card {
	flex: 0 0 auto;
	width: 7.5rem;
	text-decoration: none;
	color: inherit;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.csb-map-photo-card:hover,
.csb-map-photo-card.is-highlighted {
	transform: translateY(-2px);
	border-color: var(--csb-primary, #dd2f6e);
	box-shadow: 0 6px 18px rgba(221, 47, 110, 0.2);
}

.csb-map-photo-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #eef2f6;
	overflow: hidden;
}

.csb-map-photo-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.csb-map-photo-card-media.is-placeholder {
	background: linear-gradient(135deg, #eef2f6, #dde4ec);
}

.csb-map-photo-card-body {
	padding: 0.375rem 0.5rem 0.5rem;
}

.csb-map-photo-card-title {
	display: block;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csb-map-photo-card-cat {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	margin-top: 0.15rem;
	font-size: 0.625rem;
	color: #777;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.csb-map-photo-card-cat img {
	width: 12px;
	height: 12px;
	object-fit: contain;
	flex-shrink: 0;
}

.csb-photo-map-shell--fullscreen .maplibregl-ctrl-top-right {
	top: 50%;
	right: 0.625rem;
	bottom: auto;
	transform: translateY(-50%);
}

.csb-photo-map-shell--fullscreen .maplibregl-ctrl-group {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Non-fullscreen embed */
.csb-photo-map-shell:not(.csb-photo-map-shell--fullscreen) .csb-photo-map-ui {
	pointer-events: none;
}

.csb-photo-map-shell:not(.csb-photo-map-shell--fullscreen) .csb-photo-map-filters {
	margin-top: 0.5rem;
}

.csb-photo-map-shell:not(.csb-photo-map-shell--fullscreen) .csb-photo-map-bottom-panel {
	margin-top: auto;
}

.csb-photo-map-shell:not(.csb-photo-map-shell--fullscreen) .csb-photo-map-attribution {
	position: static;
	margin-top: 0.5rem;
	padding: 0;
	background: none;
	font-size: 0.6875rem;
	color: #777;
}

.csb-map-picker-actions {
	margin: 0.5rem 0 0;
}

.csb-photo-map-attribution {
	line-height: 1.4;
}

.csb-map-marker {
	width: 28px;
	height: 28px;
	border-radius: 999px;
	border: 2px solid #fff;
	background: var(--csb-primary, #dd2f6e) center / cover no-repeat;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	padding: 0;
}

.csb-map-cluster {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 3px solid #fff;
	border-radius: 999px;
	background: var(--csb-primary, #dd2f6e);
	color: #fff;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 6px 18px rgba(221, 47, 110, 0.38);
}

.csb-map-cluster:hover {
	box-shadow: 0 8px 22px rgba(221, 47, 110, 0.5);
}

.csb-map-cluster--sm {
	width: 36px;
	height: 36px;
	font-size: 0.8125rem;
}

.csb-map-cluster--md {
	width: 46px;
	height: 46px;
	font-size: 0.875rem;
}

.csb-map-cluster--lg {
	width: 56px;
	height: 56px;
	font-size: 1rem;
}

.csb-map-cluster--xl {
	width: 66px;
	height: 66px;
	font-size: 1.0625rem;
}

.csb-photo-map-shell .csb-map-popup .maplibregl-popup-content {
	padding: 0.75rem;
	border-radius: 12px;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.csb-photo-map-shell .csb-map-popup .maplibregl-popup-close-button {
	font-size: 1.25rem;
	padding: 0 0.35rem;
}

.csb-map-popup-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.csb-map-popup-img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 0.5rem;
}

.csb-map-popup-title {
	display: block;
	font-weight: 700;
	font-size: 0.9375rem;
	margin-bottom: 0.25rem;
	color: #1a1a1a;
}

.csb-map-popup-cat {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.8125rem;
	color: #666;
}

.csb-map-popup-cat-icon {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.csb-cat-icon-preview {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.35rem;
}

.csb-cat-icon-preview img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 4px;
	background: #fff;
}

.csb-kategorii-page .csb-table td:first-child {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.csb-kategorii-page .csb-cat-icon-thumb {
	width: 28px;
	height: 28px;
	object-fit: contain;
	border-radius: 4px;
}

.csb-home-region-icon {
	width: 36px;
	height: 36px;
	object-fit: contain;
	margin-bottom: 0.35rem;
}

.csb-home-map-cta {
	margin-top: 1.25rem;
	text-align: center;
}

/* ========== Mobile ========== */

@media (max-width: 768px) {
	.csb-map-picker {
		height: 220px;
	}

	.csb-photo-map-filters {
		margin: 0.5rem 0 0 0.5rem;
		max-width: calc(100% - 3.75rem);
		padding: 0.3rem;
		gap: 0.25rem;
	}

	.csb-map-filter-card {
		max-width: 11rem;
		padding: 0.35rem 0.55rem;
	}

	.csb-map-filter-card-icon {
		width: 1.25rem;
		height: 1.25rem;
	}

	.csb-map-filter-card-label {
		max-width: 7rem;
		font-size: 0.6875rem;
	}

	.csb-photo-map-bottom-panel {
		margin: 0 0.5rem max(0.5rem, env(safe-area-inset-bottom));
		padding: 0.5rem 0.5rem 0.625rem;
	}

	.csb-map-photo-card {
		width: 6.5rem;
	}

	.csb-photo-map-strip-meta {
		flex-wrap: wrap;
	}

	.csb-photo-map-strip-count {
		font-size: 0.6875rem;
		white-space: normal;
	}
}

@media (min-width: 769px) {
	.csb-photo-map-filters {
		margin-left: 0.75rem;
		margin-right: 0;
		max-width: min(720px, calc(100% - 5rem));
	}

	.csb-photo-map-bottom-panel {
		margin-left: auto;
		margin-right: auto;
		max-width: min(1100px, calc(100% - 1.5rem));
	}

	.csb-map-photo-card {
		width: 8.75rem;
	}
}

@media (min-width: 1200px) {
	.csb-map-photo-card {
		width: 9.5rem;
	}
}
