/*
 * Studios map — palette aligned with legacy #mapa-punktów:
 * borders #c7cad1, search icons #8e95a4, address #505050, CTA #c3cc21,
 * active mobile tab #c3cd35, tab background #fbfbfb, scrollbar #888 / hover #555.
 */
.bb-studios-map {
	--bb-studios-map-border: #c7cad1;
	--bb-studios-map-muted: #505050;
	--bb-studios-map-icon-muted: #8e95a4;
	--bb-studios-map-bg-tabs: #fbfbfb;
	--bb-studios-map-accent: #c3cc21;
	--bb-studios-map-accent-tab: #c3cd35;
	--bb-studios-map-accent-hover: #b8c11e;
	--bb-studios-map-map-bg: #eceef2;
	--bb-studios-map-list-width: 380px;
	/* Extra vertical space for list + map row (~10% viewport height) */
	--bb-studios-map-extra-vh: 10vh;
	box-sizing: border-box;
	margin: 1.5rem auto;
	max-width: 1180px;
	width: 100%;
	font-size: 0.9375rem;
	line-height: 1.45;
	/* Leaflet uses z-index up to 1000 on controls; without a local stacking context
	   those values compete with header / FiboSearch (often 1000). Keep the whole
	   block under site chrome. Pseudo-fullscreen overrides with z-index: 500000. */
	position: relative;
	z-index: 0;
}

.bb-studios-map *,
.bb-studios-map *::before,
.bb-studios-map *::after {
	box-sizing: inherit;
}

.bb-studios-map__tabs {
	display: none;
	overflow: hidden;
	margin-bottom: 10px;
}

.bb-studios-map__tab {
	float: left;
	width: 50%;
	text-align: center;
	background: var(--bb-studios-map-bg-tabs);
	height: 40px;
	line-height: 40px;
	cursor: pointer;
	border: 0;
	font: inherit;
	color: var(--bb-studios-map-muted);
}

.bb-studios-map__tab.is-active {
	border-bottom: solid 3px var(--bb-studios-map-accent-tab);
	color: var(--bb-studios-map-accent-tab);
	font-weight: 600;
}

@media (max-width: 980px) {
	.bb-studios-map .bb-studios-map__tab {
		background: #f2f4f7 !important;
		color: #2f3542 !important;
	}

	.bb-studios-map .bb-studios-map__tab.is-active,
	.bb-studios-map .js-bb-studios-map-tab-map.is-active,
	.bb-studios-map .js-bb-studios-map-tab-list.is-active {
		background: #ffffff !important;
		color: #1f2937 !important;
		border-bottom-color: var(--bb-studios-map-accent-tab);
	}
}

.bb-studios-map__toolbar {
	margin-bottom: 15px;
}

.bb-studios-map__search-form {
	margin: 0;
}

.bb-studios-map__search-wrap {
	display: flex;
	align-items: center;
	position: relative;
	padding: 0 12px 0 42px;
	min-height: 44px;
	border: 1px solid rgba(199, 202, 209, 0.85);
	border-radius: 12px;

}

.bb-studios-map__search-wrap:focus-within {
	border-color: #b5bbc6;
	box-shadow: 0 0 0 2px rgba(195, 205, 53, 0.2);
}

.bb-studios-map__search-btn {
	all: unset;
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bb-studios-map-icon-muted);
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
}

.bb-studios-map__search-btn svg {
	width: 18px;
	height: 18px;
}

.bb-studios-map__search-btn:disabled {
	opacity: 0.45;
	cursor: default;
}

.bb-studios-map__search {
	flex: 1;
	width: 100%;
	margin-left: 0;
	border: 0;
	padding: 0.5rem 0;
	font: inherit;
	background: transparent;
	color: var(--bb-studios-map-muted);
}

.bb-studios-map__search::placeholder {
	color: #747b88;
	opacity: 1;
}

.bb-studios-map__search:focus {
	outline: none;
}

.bb-studios-map__country {
	height: 34px;
	margin-left: 8px;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: var(--bb-studios-map-muted);
	padding: 0 10px;
	font: inherit;
	max-width: 180px;
}

.bb-studios-map__country:focus {
	outline: 2px solid var(--bb-studios-map-accent-tab);
	outline-offset: 1px;
}

.bb-studios-map__layout {
	display: flex;
	gap: 0.4rem;
	min-height: calc(360px + var(--bb-studios-map-extra-vh, 10vh));
	align-items: stretch;
}

.bb-studios-map__list {
	width: var(--bb-studios-map-list-width, 380px);
	flex-shrink: 0;
	max-height: calc(var(--bb-studios-map-list-max, 560px) + var(--bb-studios-map-extra-vh, 10vh));
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

.bb-studios-map__list::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 10px;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.74));
	z-index: 2;
}

.bb-studios-map__list-inner {
	overflow-y: auto;
	flex: 1;
	padding: 0 6px 0 0;
	scrollbar-gutter: stable;
}

.bb-studios-map__list-inner::-webkit-scrollbar {
	width: 5px;
}

.bb-studios-map__list-inner::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.bb-studios-map__list-inner::-webkit-scrollbar-thumb:hover {
	background: #555;
}

.bb-studios-map__item {
	border: 1px solid var(--bb-studios-map-border);
	border-radius: 12px;
	margin-bottom: 12px;
	padding: 0;
	background: #fff;

	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bb-studios-map__item:last-child {
	margin-bottom: 0;
}

.bb-studios-map__item:hover {
	border-color: #b8bec9;
	box-shadow: 0 2px 4px rgba(40, 48, 64, 0.293), 0 8px 20px rgba(40, 48, 64, 0.03);
}

.bb-studios-map__item-top {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 1rem 1rem 0.65rem;
}

.bb-studios-map__item-pin {
	flex-shrink: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

/* Balanced / map asset (studio-pin.png) — same graphic as Leaflet markers */
.bb-studios-map__item-pin--asset {
	padding-top: 2px;
}

.bb-studios-map__item-pin-img {
	display: block;
	width: 36px;
	height: auto;
	max-height: 46px;
	object-fit: contain;
}

/* No custom marker URL: simple inline SVG */
.bb-studios-map__item-pin--fallback {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	align-items: center;
	color: var(--bb-studios-map-icon-muted);
	background: #f3f4f6;
	border: 1px solid var(--bb-studios-map-border);
}

.bb-studios-map__item-meta {
	flex: 1;
	min-width: 0;
}

.bb-studios-map__item-adres {
	color: var(--bb-studios-map-muted);
	font-size: 0.8125rem;
	margin-bottom: 0.25rem;
	line-height: 1.35;
}

.bb-studios-map__item-name {
	font-size: 1.125rem;
	font-weight: 600;
	margin-bottom: 0;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.bb-studios-map__item-region {
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	color: var(--bb-studios-map-icon-muted);
	line-height: 1.35;
}

.bb-studios-map .bb-studios-map__dk {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background: transparent !important;
	background-color: transparent !important;
	border: 0;
	box-shadow: none !important;
	padding: 0.4rem 1rem 0.35rem;
	margin: 0;
	font: inherit;
	line-height: 1.35;
	color: var(--bb-studios-map-muted);
	width: 100%;
	box-sizing: border-box;
	text-align: left;
	transition: color 0.15s ease;
}

.bb-studios-map .bb-studios-map__dk:hover,
.bb-studios-map .bb-studios-map__dk:focus,
.bb-studios-map .bb-studios-map__dk:focus-visible,
.bb-studios-map .bb-studios-map__dk:active,
.bb-studios-map .bb-studios-map__dk.is-open {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
}

.bb-studios-map .bb-studios-map__dk:hover,
.bb-studios-map .bb-studios-map__dk:focus {
	color: #111;
}

.bb-studios-map .bb-studios-map__dk:focus-visible {
	outline: 2px solid var(--bb-studios-map-accent-tab);
	outline-offset: 2px;
}

.bb-studios-map__dk-ic {
	display: flex;
	color: var(--bb-studios-map-icon-muted);
	flex-shrink: 0;
}

.bb-studios-map__dk-txt {
	flex: 1;
	font-weight: 500;
	font-size: 0.875rem;
}

.bb-studios-map__dk-chev {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	color: var(--bb-studios-map-icon-muted);
	transition: transform 0.2s ease;
}

.bb-studios-map__dk.is-open .bb-studios-map__dk-chev {
	transform: rotate(180deg);
}

.bb-studios-map__dane {
	display: grid;
	grid-template-rows: 0fr;
	margin: 0;
	padding: 0;
	font-size: 14px;
	background: transparent;
	border: 0;
	border-top: 1px solid transparent;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition:
		grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.3s ease,
		border-top-color 0.25s ease;
}

.bb-studios-map__dane.is-open {
	grid-template-rows: 1fr;
	opacity: 1;
	border-top-color: rgba(199, 202, 209, 0.45);
	pointer-events: auto;
}

.bb-studios-map__dane-inner {
	min-height: 0;
	overflow: hidden;
	padding: 0 1rem;
}

.bb-studios-map__dane.is-open .bb-studios-map__dane-inner {
	padding-top: 0.45rem;

}

@media (prefers-reduced-motion: reduce) {
	.bb-studios-map__dane {
		transition-duration: 0.01ms;
	}
}

.bb-studios-map__contact-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 0.55rem;
}

.bb-studios-map__contact-row:last-child {
	margin-bottom: 0;
}

.bb-studios-map__contact-ic {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bb-studios-map-icon-muted);
	margin-top: 0;
}

.bb-studios-map__contact-body {
	flex: 1;
	min-width: 0;
	line-height: 1.45;
}

.bb-studios-map__svg-ic {
	display: block;
	vertical-align: middle;
}

.bb-studios-map__svg-ic--fly {
	color: var(--bb-studios-map-muted);
}

.bb-studios-map__svg-ic--directions {
	flex-shrink: 0;
	opacity: 0.92;
}

.bb-studios-map__directions-ic {
	display: inline-flex;
	line-height: 0;
}

.bb-studios-map__directions-txt {
	min-width: 0;
}

/* Text links (tel, mail, website) + Directions — shared underline language */
.bb-studios-map .bb-studios-map__directions-link,
.leaflet-popup-content .bb-studios-map__directions-link,
.bb-studios-map .bb-studios-map__contact-link,
.leaflet-popup-content .bb-studios-map__contact-link {

	text-decoration-color: #c3cc21!important;
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 400;
	cursor: pointer;
	word-break: break-word;
}

.bb-studios-map .bb-studios-map__contact-link,
.leaflet-popup-content .bb-studios-map__contact-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.bb-studios-map .bb-studios-map__directions-link,
.leaflet-popup-content .bb-studios-map__directions-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-underline-offset: 3px;
}

.bb-studios-map .bb-studios-map__directions-link:hover,
.leaflet-popup-content .bb-studios-map__directions-link:hover,
.bb-studios-map .bb-studios-map__contact-link:hover,
.leaflet-popup-content .bb-studios-map__contact-link:hover {
	color: var(--bb-studios-map-muted);
    text-decoration: none;
    opacity: 0.7;
}

.bb-studios-map__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.bb-studios-map__social-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0;
	border: 0;
	background: none;

	font-size: 0.8125rem;
	font-weight: 500;
	text-decoration: none;
	line-height: 1.2;
	transition: color 0.15s ease;
	text-decoration-color: #c3cc21!important;
	text-decoration: underline;
}

.bb-studios-map__social-chip:hover {

	text-decoration: none;

	text-underline-offset: 2px;
}

.bb-studios-map__social-chip .bb-studios-map__svg-ic {
	flex-shrink: 0;
	color: inherit;
}

.bb-studios-map__social-chip-label {
	white-space: nowrap;
}

/* Popup: contact rows (no card chrome) */
.leaflet-popup-content .bb-studios-map__contact-row {
	margin-bottom: 0.5rem;
}

.leaflet-popup-content .bb-studios-map__contact-row:last-child {
	margin-bottom: 0;
}

.bb-studios-map .bb-studios-map__dane-foot {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	margin-top: 0.45rem;
	padding-top: 0.4rem;
	border-top: 1px solid rgba(199, 202, 209, 0.35);
}

.bb-studios-map .bb-studios-map__dane-foot .bb-studios-map__directions {
	margin: 0;
	text-align: right;
}

.bb-studios-map__fly {
	color: var(--bb-studios-map-muted);
	background: var(--bb-studios-map-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	border-radius: 0 0 12px 12px;
	min-height: 44px;
	padding: 0.55rem 1rem;
	line-height: 1.3;
	font-size: 0.9375rem;
	margin-top: 0.75rem;
	cursor: pointer;
	border: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	width: 100%;
	font-weight: 600;
	font-family: inherit;
	box-sizing: border-box;
	transition: background 0.2s ease, color 0.2s ease;
}

.bb-studios-map__fly-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.bb-studios-map__fly-txt {
	flex: 0 1 auto;
}

.bb-studios-map__fly:hover,
.bb-studios-map__fly:focus {
	background: var(--bb-studios-map-accent-hover);
	outline: none;
}

.bb-studios-map__fly:focus-visible {
	outline: 2px solid var(--bb-studios-map-muted);
	outline-offset: 2px;
}

.bb-studios-map__canvas {
	flex: 1;
	min-width: 0;
	position: relative;
	border: 1px solid var(--bb-studios-map-border);
	border-radius: 10px;
	height: calc(var(--bb-studios-map-canvas-h, 450px) + var(--bb-studios-map-extra-vh, 10vh));
	min-height: calc(280px + var(--bb-studios-map-extra-vh, 10vh));
	background: var(--bb-studios-map-map-bg);
}

.bb-studios-map__debug {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 420;
	padding: 6px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--bb-studios-map-border);
	color: #222;
	font-size: 12px;
	line-height: 1.25;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	pointer-events: none;
}

.bb-studios-map__canvas .leaflet-container {
	font: inherit;
}

/* Controls: fullscreen + locate (Leaflet top-right) */
.bb-studios-map__leaf-tools {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border: 1px solid var(--bb-studios-map-border);
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(80, 80, 80, 0.12);
}

.bb-studios-map__tool-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	line-height: 1;
	padding: 0;
	margin: 0;
	border: 0;
	background: #fff;
	color: var(--bb-studios-map-muted);
	cursor: pointer;
	border-radius: 2px;
}

.bb-studios-map__leaf-tools .bb-studios-map__tool-btn:first-child {
	border-radius: 4px 4px 2px 2px;
}

.bb-studios-map__leaf-tools .bb-studios-map__tool-btn:last-child {
	border-radius: 2px 2px 4px 4px;
}

.bb-studios-map__tool-btn:hover {
	background: var(--bb-studios-map-bg-tabs);
	color: #000;
}

.bb-studios-map__tool-btn.is-active {
	background: #e3e6ea;
	color: #000;
}

.bb-studios-map__tool-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Pseudo-fullscreen (e.g. some mobile cases): map fills viewport */
.bb-studios-map.bb-studios-map--pseudo-fullscreen {
	position: fixed !important;
	z-index: 500000;
	inset: 0;
	margin: 0 !important;
	max-width: none !important;
	width: 100% !important;
	height: 100% !important;
	overflow: auto;
	background: #fff;
}

.bb-studios-map--pseudo-fullscreen .bb-studios-map__layout {
	min-height: calc(100vh - 140px);
}

.bb-studios-map--pseudo-fullscreen .bb-studios-map__canvas {
	min-height: 55vh;
}

body.bb-studios-map-fs-active {
	overflow: hidden;
}

.bb-studios-map__notice {
	padding: 1rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.05);
	color: #333;
}

.bb-studios-map .bb-studios-map__directions {
	margin: 0.4rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.35;
}

.bb-studios-map .leaflet-popup-content-wrapper {
	border-radius: 12px;
	padding: 0;
	border: 1px solid var(--bb-studios-map-border);
	box-shadow: 0 2px 4px rgba(40, 48, 64, 0.06), 0 8px 20px rgba(40, 48, 64, 0.12);
}

.bb-studios-map .leaflet-popup-content {
	margin: 0;
	min-width: 260px;
}

.leaflet-popup-content .bb-studios-map__popup-stack {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 0;
}

.leaflet-popup-content .bb-studios-map__popup-main {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.9rem 1rem 0.75rem;
}

.leaflet-popup-content .bb-studios-map__popup-main > strong {
	display: block;
	font-size: 1.03rem;
	color: #1a1a1a;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 0.35rem;
}

.leaflet-popup-content .bb-studios-map__popup-dane {
	margin-top: 0.55rem;
	padding-top: 0.6rem;
	border-top: 1px solid rgba(199, 202, 209, 0.45);
}

.leaflet-popup-content .bb-studios-map__popup-foot {
	display: block;
	margin-top: 0;
	padding: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 0 0 12px 12px;
	overflow: hidden;
}

.leaflet-popup-content .bb-studios-map__popup-foot .bb-studios-map__directions {
	margin: 0;
	text-align: left;
}

.leaflet-popup-content .bb-studios-map__popup-foot .bb-studios-map__directions-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 1rem;
	background: var(--bb-studios-map-accent);
	color: var(--bb-studios-map-muted);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	text-decoration-color: transparent;
}

.leaflet-popup-content .bb-studios-map__popup-foot .bb-studios-map__directions-link:hover,
.leaflet-popup-content .bb-studios-map__popup-foot .bb-studios-map__directions-link:focus {
	background: var(--bb-studios-map-accent-hover);
	color: var(--bb-studios-map-muted);
	text-decoration: none;
	opacity: 1;
}

.bb-studios-map__error {
	color: #8a1c1c;
}

@media (max-width: 980px) {
	.bb-studios-map__tabs {
		display: block;
	}

	.bb-studios-map__layout {
		display: block;
	}

	.bb-studios-map__list {
		width: 100%;
		max-height: none;
		border: 0;
		padding: 0;
	}

	.bb-studios-map__list-inner {
		padding-right: 0;
	}

	.bb-studios-map.bb-studios-map--view-map .bb-studios-map__toolbar {
		display: none;
	}

	.bb-studios-map.bb-studios-map--view-map .bb-studios-map__list {
		display: none;
	}

	.bb-studios-map.bb-studios-map--view-map .bb-studios-map__canvas {
		display: block;
		width: 100%;
	}

	.bb-studios-map.bb-studios-map--view-list .bb-studios-map__canvas {
		display: none;
	}
}
