/* ===== Gdzie kupisz ===== */
.where-buy-section {
	--wb-brand-900: #004731;
	--wb-brand-700: #0b6347;
	--wb-text: #18231d;
	--wb-text-muted: #5c6d63;
	--wb-border: #e4ebe7;
	--wb-bg: #f6faf7;
	--wb-radius: 12px;
	--wb-shadow: 0 12px 30px rgba(0, 71, 49, 0.12);
	--wb-transition: 0.25s ease;
	padding: 86px 0 80px;
	background: radial-gradient(circle at 20% 0%, #f9fffc 0%, var(--wb-bg) 45%, #f4f8f5 100%);
}

.where-buy-section .where-buy-header h1 {
	color: var(--wb-brand-900);
}

.where-buy-header {
	text-align: center;
	margin-bottom: 40px;
}

.where-buy-eyebrow {
	display: block;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wb-brand-900);
	margin-bottom: 10px;
}

.where-buy-section h1 {
	margin: 0 0 12px;
	font-size: clamp(28px, 4vw, 44px);
	line-height: 1.15;
	color: var(--wb-text);
}

.where-buy-header p {
	margin: 0 auto;
	max-width: 620px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--wb-text-muted);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===== Layout: lista (lewo) + mapa (prawo) ===== */
.where-buy-layout {
	display: grid;
	grid-template-columns: minmax(340px, 420px) 1fr;
	grid-template-areas: "list map";
	gap: 28px;
	align-items: stretch;
	min-height: 640px;
}

.where-buy-panel {
	grid-area: list;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
}

.where-buy-map-wrap {
	grid-area: map;
	position: relative;
	min-height: 640px;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--wb-shadow);
}

/* ===== Loader mapy ===== */
.where-buy-map-loader {
	position: absolute;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, #f4faf7 0%, #e8f2ec 100%);
}

.where-buy-map-loader[hidden] {
	display: none !important;
}

.where-buy-map-loader-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 24px 28px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--wb-border);
	box-shadow: 0 12px 32px rgba(0, 71, 49, 0.1);
}

.where-buy-map-loader-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #d5e2db;
	border-top-color: var(--wb-brand-900);
	border-radius: 50%;
	animation: wb-map-spin 0.75s linear infinite;
}

.where-buy-map-loader-text {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--wb-brand-900);
}

@keyframes wb-map-spin {
	to {
		transform: rotate(360deg);
	}
}

.where-buy-toolbar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex-shrink: 0;
}

.where-buy-filter-label {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wb-brand-900);
}

.where-buy-filter-select,
.where-buy-search-input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #d5e2db;
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	color: var(--wb-text);
	transition: border-color var(--wb-transition), box-shadow var(--wb-transition);
}

.where-buy-filter-select:focus,
.where-buy-search-input:focus {
	outline: none;
	border-color: var(--wb-brand-700);
	box-shadow: 0 0 0 3px rgba(0, 71, 49, 0.12);
}

.where-buy-search {
	position: relative;
}

.where-buy-search-input {
	padding-left: 40px;
}

.where-buy-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #8da49a;
	pointer-events: none;
}

.where-buy-results-count {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--wb-text-muted);
}

.where-buy-locations {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
	min-height: 0;
	max-height: 480px;
	padding-right: 4px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.where-buy-locations::-webkit-scrollbar {
	width: 6px;
}

.where-buy-locations::-webkit-scrollbar-thumb {
	background: #b8c7c0;
	border-radius: 6px;
}

/* ===== Karty ===== */
.where-buy-card {
	display: flex;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--wb-border);
	border-radius: var(--wb-radius);
	background: #fff;
	box-shadow: 0 2px 8px rgba(8, 56, 36, 0.04);
	cursor: pointer;
	transition: transform var(--wb-transition), border-color var(--wb-transition), box-shadow var(--wb-transition);
}

.where-buy-card:hover,
.where-buy-card:focus-visible {
	transform: translateY(-1px);
	border-color: #b8d0c4;
	box-shadow: 0 6px 18px rgba(0, 71, 49, 0.08);
	outline: none;
}

.where-buy-card.active {
	border-color: var(--wb-brand-700);
	box-shadow: 0 0 0 2px rgba(11, 99, 71, 0.2), 0 8px 20px rgba(0, 71, 49, 0.1);
}

.where-buy-card[data-type="headquarters"] {
	border-color: rgba(245, 159, 39, 0.45);
	background: linear-gradient(145deg, rgba(245, 159, 39, 0.07), #fff);
}

.where-buy-card-icon {
	font-size: 22px;
	flex: 0 0 28px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 2px;
}

.where-buy-card-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.where-buy-card-label {
	display: inline-flex;
	width: fit-content;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wb-brand-900);
	background: rgba(0, 71, 49, 0.1);
}

.where-buy-card[data-type="headquarters"] .where-buy-card-label {
	color: #fff;
	background: linear-gradient(135deg, #f59f27, #e88511);
}

.where-buy-card-name {
	margin: 0;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 800;
	color: var(--wb-text);
}

.where-buy-card-address {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--wb-text-muted);
}

.where-buy-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

.where-buy-card-btn {
	padding: 7px 10px;
	border-radius: 8px;
	border: 1px solid #d6e2db;
	background: #f3f7f4;
	color: var(--wb-text);
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	transition: background var(--wb-transition), color var(--wb-transition), border-color var(--wb-transition);
}

.where-buy-card-btn:hover {
	background: var(--wb-brand-900);
	border-color: var(--wb-brand-900);
	color: #fff;
}

.where-buy-empty {
	padding: 24px 16px;
	border-radius: var(--wb-radius);
	border: 1px dashed #c8d6cf;
	background: #fbfdfb;
	text-align: center;
	color: #8a9b91;
	font-size: 14px;
}

.where-buy-empty[hidden] {
	display: none !important;
}

/* ===== Przełącznik Lista / Mapa (mobile) ===== */
.where-buy-view-switch {
	display: none;
}

/* ===== Mapa ===== */
.where-buy-map {
	width: 100%;
	height: 100%;
	min-height: 480px;
}

.where-buy-map .leaflet-container {
	width: 100%;
	height: 100%;
	font-family: inherit;
}

.where-buy-map-wrap .leaflet-pane,
.where-buy-map-wrap .leaflet-control {
	z-index: 1;
}

.custom-marker-icon {
	background: none !important;
	border: none !important;
}

.custom-marker-icon svg {
	filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
	transition: transform 0.2s ease;
}

.custom-marker-icon.is-active svg {
	transform: scale(1.12);
}

.where-buy-custom-popup .leaflet-popup-content-wrapper {
	border-radius: 12px;
	padding: 0;
	border: 1px solid var(--wb-border);
	box-shadow: var(--wb-shadow);
}

.where-buy-custom-popup .leaflet-popup-content {
	margin: 0;
	width: min(420px, calc(100vw - 40px)) !important;
	max-width: min(420px, calc(100vw - 40px)) !important;
}

.where-buy-popup {
	padding: 14px 16px;
}

.where-buy-popup .popup-header h4 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.35;
	color: var(--wb-text);
}

.where-buy-popup .popup-type {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, var(--wb-brand-900), var(--wb-brand-700));
}

.where-buy-popup .popup-address {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--wb-text-muted);
}

.where-buy-popup .popup-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.where-buy-popup .popup-btn {
	display: block;
	padding: 9px 10px;
	border-radius: 8px;
	border: 1px solid #d7e4dc;
	background: #f4f9f6;
	color: var(--wb-brand-900);
	text-decoration: none;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.where-buy-popup .popup-btn:hover {
	background: var(--wb-brand-900);
	color: #fff;
}

/* ===== CTA pomocy ===== */
.where-buy-help-cta {
	margin-top: 8px;
	padding: 16px;
	border-radius: 16px;
	border: 1px solid #dce8e1;
	background: linear-gradient(145deg, #fff, #f4faf7);
	box-shadow: 0 8px 24px rgba(0, 71, 49, 0.08);
	flex-shrink: 0;
}

.where-buy-help-icon {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wb-brand-900);
	background: rgba(0, 71, 49, 0.1);
	margin-bottom: 10px;
}

.where-buy-help-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 800;
	color: var(--wb-text);
}

.where-buy-help-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
	color: var(--wb-text-muted);
}

.where-buy-help-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.where-buy-help-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	color: #fff;
	background: linear-gradient(135deg, var(--wb-brand-900), var(--wb-brand-700));
	box-shadow: 0 6px 16px rgba(0, 71, 49, 0.2);
}

.where-buy-help-btn:hover {
	transform: translateY(-1px);
}

/* ===== Tablet ===== */
@media (min-width: 769px) and (max-width: 1024px) {
	.where-buy-layout {
		grid-template-columns: minmax(280px, 360px) 1fr;
		min-height: 560px;
	}

	.where-buy-map-wrap,
	.where-buy-map {
		min-height: 560px;
	}

	.where-buy-locations {
		max-height: 420px;
	}
}

@media (min-width: 769px) {
	.where-buy-map-wrap,
	.where-buy-map {
		min-height: 640px;
	}
}

@media (max-width: 768px) {
	.where-buy-section {
		padding-top: calc(var(--mobile-header-height, 60px) + 1.25rem) !important;
	}
}

/* ===== Mobile: przełącznik Lista | Mapa ===== */
@media (max-width: 768px) {
	.where-buy-page .container {
		max-width: 100%;
		padding-left: 16px;
		padding-right: 16px;
	}

	.where-buy-section {
		padding-bottom: 40px;
	}

	.where-buy-header {
		text-align: left;
		margin-bottom: 20px;
	}

	.where-buy-section h1 {
		font-size: 28px;
	}

	.where-buy-header p {
		font-size: 15px;
		max-width: none;
	}

	.where-buy-layout {
		display: flex;
		flex-direction: column;
		gap: 12px;
		min-height: 0;
	}

	.where-buy-panel {
		display: flex;
		flex-direction: column;
		gap: 12px;
		min-height: 0;
	}

	.where-buy-toolbar {
		gap: 10px;
	}

	.where-buy-filter-select {
		font-size: 16px;
		padding: 12px 14px;
	}

	.where-buy-search-input {
		font-size: 16px;
		padding: 12px 14px 12px 46px;
	}

	.where-buy-search-icon {
		left: 14px;
		width: 18px;
		height: 18px;
	}

	.where-buy-view-switch {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 4px;
		padding: 4px;
		border-radius: 14px;
		background: #e6efe9;
		border: 1px solid #d5e2db;
	}

	.where-buy-view-tab {
		margin: 0;
		padding: 12px 16px;
		border: none;
		border-radius: 11px;
		background: transparent;
		color: var(--wb-text-muted);
		font-size: 15px;
		font-weight: 700;
		line-height: 1.2;
		cursor: pointer;
		transition: background var(--wb-transition), color var(--wb-transition), box-shadow var(--wb-transition);
	}

	.where-buy-view-tab[aria-selected='true'] {
		background: #fff;
		color: var(--wb-brand-900);
		box-shadow: 0 4px 14px rgba(0, 71, 49, 0.12);
	}

	.where-buy-view-tab:focus-visible {
		outline: 2px solid var(--wb-brand-700);
		outline-offset: 2px;
	}

	.where-buy-locations {
		flex: none;
		max-height: none;
		overflow: visible;
		gap: 10px;
		padding-right: 0;
	}

	.where-buy-map-wrap {
		display: none;
		min-height: 0;
		border-radius: 14px;
		box-shadow: var(--wb-shadow);
	}

	.where-buy-map {
		min-height: 0;
		height: 100%;
	}

	/* Widok: lista */
	.where-buy-layout[data-mobile-view='list'] .where-buy-map-wrap {
		display: none;
	}

	.where-buy-layout[data-mobile-view='list'] .where-buy-locations {
		display: flex;
	}

	.where-buy-layout[data-mobile-view='list'] .where-buy-empty:not([hidden]) {
		display: block;
	}

	.where-buy-layout[data-mobile-view='list'] .where-buy-help-cta {
		display: block;
	}

	/* Widok: mapa — prawie pełny ekran, bez walki ze scrollem strony */
	.where-buy-layout[data-mobile-view='map'] {
		min-height: calc(100dvh - var(--mobile-header-height, 60px) - 1.25rem);
		gap: 10px;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-panel {
		flex: 0 0 auto;
		gap: 10px;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-toolbar,
	.where-buy-layout[data-mobile-view='map'] .where-buy-locations,
	.where-buy-layout[data-mobile-view='map'] .where-buy-empty,
	.where-buy-layout[data-mobile-view='map'] .where-buy-help-cta,
	.where-buy-layout[data-mobile-view='map'] .where-buy-results-count {
		display: none !important;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-view-switch {
		position: sticky;
		top: calc(var(--mobile-header-height, 60px) + 6px);
		z-index: 5;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-map-wrap {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		width: 100%;
		min-height: calc(100dvh - var(--mobile-header-height, 60px) - 7.5rem);
		height: calc(100dvh - var(--mobile-header-height, 60px) - 7.5rem);
		max-height: none;
		overflow: hidden;
		position: relative;
		z-index: 2;
		border-radius: 14px;
		box-shadow: var(--wb-shadow);
		isolation: isolate;
		overscroll-behavior: contain;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-map {
		flex: 1 1 auto;
		width: 100% !important;
		height: 100% !important;
		min-height: 100% !important;
		animation: none;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-map .leaflet-container {
		width: 100% !important;
		height: 100% !important;
		min-height: 100% !important;
		touch-action: none;
		-webkit-user-select: none;
		user-select: none;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-map .leaflet-control-zoom {
		margin-top: 12px;
		margin-right: 12px;
		border: 0;
		box-shadow: 0 8px 20px rgba(0, 40, 32, 0.18);
	}

	.where-buy-map-hint {
		display: none;
	}

	.where-buy-map-hint[hidden] {
		display: none !important;
	}

	.where-buy-layout[data-mobile-view='map'] .where-buy-map-hint {
		display: block;
		position: absolute;
		left: 12px;
		right: 60px;
		bottom: 12px;
		z-index: 450;
		margin: 0;
		padding: 8px 12px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.92);
		border: 1px solid rgba(0, 71, 49, 0.12);
		box-shadow: 0 6px 16px rgba(0, 40, 32, 0.12);
		color: var(--wb-text-muted);
		font-size: 12px;
		font-weight: 600;
		line-height: 1.3;
		text-align: center;
		pointer-events: none;
	}

	body.wb-map-open {
		overflow: hidden;
		overscroll-behavior: none;
	}

	body.wb-map-open .where-buy-section {
		padding-bottom: 16px;
	}

	.where-buy-card {
		padding: 14px;
	}

	.where-buy-card-icon {
		font-size: 20px;
		flex-basis: 24px;
	}

	.where-buy-card-name {
		font-size: 15px;
	}

	.where-buy-card-address {
		font-size: 13px;
	}

	.where-buy-card-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.where-buy-card-btn {
		padding: 10px 8px;
		font-size: 12px;
		text-align: center;
		justify-content: center;
	}

	.where-buy-help-cta {
		margin-top: 4px;
		padding: 14px;
	}

	.where-buy-help-title {
		font-size: 15px;
	}

	.where-buy-help-actions {
		flex-direction: column;
	}

	.where-buy-help-btn {
		width: 100%;
	}

	.where-buy-map-loader {
		z-index: 600;
	}

	.where-buy-custom-popup .leaflet-popup-content {
		width: min(300px, calc(100vw - 40px)) !important;
		max-width: min(300px, calc(100vw - 40px)) !important;
	}

	.leaflet-control-zoom a {
		width: 36px !important;
		height: 36px !important;
		line-height: 36px !important;
	}
}
