/* ==========================================================================
   Nordic Crumb Forhandlere – list + map
   Colours and type from the Nordic Crumb design system. Scoped to .ncf so an Elementor theme can't break it.
   ========================================================================== */

.ncf {
	--ncf-navy: #1d3a57;
	--ncf-ink: #24232a;
	--ncf-text: #3d3b43;
	--ncf-mauve: #9a6d74;
	--ncf-line: #DED8DB;
	--ncf-input-border: #d9d6d8;
	--ncf-active-bg: #F0EFF0;
	--ncf-font: 'Montserrat', sans-serif;
	font-family: var(--ncf-font);
	color: var(--ncf-text);
	font-size: 15px;
	line-height: 1.45;
	/* Own stacking context: Leaflet uses z-index 400–1000 internally, which would otherwise
	   compete with (and beat) the site's sticky header. Everything here stays on one page level. */
	position: relative;
	isolation: isolate;
}
.ncf *, .ncf *::before, .ncf *::after { box-sizing: border-box; }
/* Block themes cap post content at a narrow "content size"; list + map need the full width. */
.is-layout-constrained > .ncf { max-width: 1200px; }
.ncf [hidden] { display: none !important; }
.ncf button { font-family: var(--ncf-font); margin: 0; text-shadow: none; box-shadow: none; -webkit-appearance: none; appearance: none; }
.ncf a { box-shadow: none; }
.ncf .ncf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ncf button:focus-visible, .ncf a:focus-visible, .ncf input:focus-visible { outline: 2px solid var(--ncf-navy); outline-offset: 2px; }

.ncf-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 32px; height: var(--ncf-height, 650px); }
.ncf-side { display: flex; flex-direction: column; min-height: 0; }
.ncf-map-wrap { position: relative; z-index: 0; isolation: isolate; min-height: 0; border-radius: 14px; overflow: hidden; background: #e8e6e7; }
.ncf-map { position: absolute; inset: 0; }
.ncf-tabs { display: none; }

/* ---------- Search ---------- */
.ncf-search { position: relative; z-index: 2; }
.ncf-field { display: flex; align-items: stretch; border: 1px solid var(--ncf-input-border); border-radius: 4px; background: #fff; }
.ncf-field:focus-within { border-color: var(--ncf-navy); }
.ncf .ncf-input {
	flex: 1; min-width: 0; border: 0; margin: 0; padding: 13px 16px; background: transparent; box-shadow: none;
	font: 16px/1.4 var(--ncf-font); color: var(--ncf-ink); height: auto; border-radius: 4px 0 0 4px;
}
.ncf .ncf-input:focus { outline: none; }
.ncf .ncf-input::-webkit-search-cancel-button { cursor: pointer; }
.ncf .ncf-submit {
	flex: none; width: 52px; border: 0; border-radius: 0 4px 4px 0; background: transparent; color: var(--ncf-ink);
	cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.ncf .ncf-submit:hover, .ncf .ncf-submit:focus { background: var(--ncf-active-bg); color: var(--ncf-ink); }
.ncf .ncf-submit .ncf-icon { width: 20px; height: 20px; }

.ncf-suggest {
	position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px 0; list-style: none;
	background: #fff; border: 1px solid var(--ncf-input-border); border-radius: 4px; box-shadow: 0 10px 30px rgba(36, 35, 42, 0.12);
}
.ncf-suggest li { margin: 0; padding: 9px 16px; cursor: pointer; font-size: 15px; color: var(--ncf-ink); }
.ncf-suggest li b { color: var(--ncf-navy); font-weight: 700; margin-right: 6px; }
.ncf-suggest li.is-active, .ncf-suggest li:hover { background: var(--ncf-active-bg); }

.ncf-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 12px 12px; border-bottom: 1px solid var(--ncf-line); }
.ncf .ncf-locate {
	display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer;
	font-size: 11px; font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ncf-navy);
}
.ncf .ncf-locate:hover, .ncf .ncf-locate:focus { background: none; color: var(--ncf-ink); }
.ncf .ncf-locate[disabled] { opacity: 0.5; cursor: wait; }
.ncf-count { font-size: 13px; color: var(--ncf-mauve); }

.ncf-status { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px; border-bottom: 1px solid var(--ncf-line); font-size: 14px; color: var(--ncf-text); }
.ncf-status b { color: var(--ncf-ink); }
.ncf-status.is-error { color: #8a2424; }
.ncf .ncf-reset { flex: none; padding: 0; border: 0; background: none; cursor: pointer; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ncf-navy); }
.ncf .ncf-reset:hover, .ncf .ncf-reset:focus { background: none; color: var(--ncf-ink); }

/* ---------- List ---------- */
.ncf-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; overscroll-behavior: contain; }
.ncf-item { margin: 0; padding: 16px 12px; border-bottom: 1px solid var(--ncf-line); transition: background-color .15s ease; }
.ncf-item.is-active { background: var(--ncf-active-bg); box-shadow: inset 3px 0 0 var(--ncf-navy); }
.ncf .ncf-item-main {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; width: 100%;
	padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit;
}
.ncf .ncf-item-main:hover, .ncf .ncf-item-main:focus { background: none; color: inherit; }
.ncf .ncf-item-main:focus:not(:focus-visible) { outline: none; }
.ncf .ncf-item-main[disabled] { cursor: default; }
.ncf-name { font-weight: 700; font-size: 18px; line-height: 1.25; color: var(--ncf-navy); }
.ncf .ncf-item-main:hover .ncf-name { color: var(--ncf-ink); }
.ncf-dist { align-self: start; font-size: 13px; font-weight: 600; color: var(--ncf-mauve); white-space: nowrap; padding-top: 2px; }
.ncf-addr { grid-column: 1 / -1; font-size: 14px; line-height: 1.45; color: #6f6a70; }
.ncf-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.ncf .ncf-link {
	display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
	color: var(--ncf-navy); text-decoration: none;
}
.ncf .ncf-link:hover { color: var(--ncf-ink); text-decoration: underline; text-underline-offset: 3px; }
.ncf .ncf-link .ncf-icon { width: 14px; height: 14px; flex: none; }
.ncf-empty { padding: 32px 0; color: var(--ncf-text); }

/* ---------- Map ---------- */
.ncf--muted .leaflet-tile-pane { filter: grayscale(0.6) contrast(0.95) brightness(1.04); }
.ncf .leaflet-container { font-family: var(--ncf-font); background: #e8e6e7; }
.ncf .leaflet-control-attribution { font-size: 10px; }
.ncf-pin { position: relative; }
.ncf-pin svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25)); transition: transform .15s ease; transform-origin: 50% 100%; }
.ncf-pin.is-active svg { transform: scale(1.25); }
.ncf-pin.is-active .ncf-pin-body { fill: var(--ncf-mauve); }
.ncf-cluster {
	display: flex; align-items: center; justify-content: center; border-radius: 50%;
	background: var(--ncf-navy); color: #fff; font-weight: 700; font-size: 14px;
	box-shadow: 0 0 0 5px rgba(29, 58, 87, 0.25), 0 2px 6px rgba(0, 0, 0, 0.25);
}
.ncf-origin { width: 16px; height: 16px; border-radius: 50%; background: var(--ncf-ink); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ncf-ink); }

.ncf .leaflet-popup-content-wrapper { border-radius: 8px; box-shadow: 0 10px 30px rgba(36, 35, 42, 0.18); }
.ncf .leaflet-popup-content { margin: 16px 18px; font-size: 14px; line-height: 1.45; color: var(--ncf-text); }
.ncf-pop-name { font-weight: 700; font-size: 16px; color: var(--ncf-navy); margin-bottom: 4px; }
.ncf-pop-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.ncf .ncf-pop-links a { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ncf-navy); }
.ncf .ncf-pop-route { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--ncf-navy); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Narrow screens: Liste / Kort tabs ---------- */
@media (max-width: 760px) {
	.ncf-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
	.ncf .ncf-tab {
		flex: 1; padding: 10px 14px; border: 1px solid rgba(36, 35, 42, 0.35); border-radius: 999px; background: transparent; cursor: pointer;
		font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ncf-ink);
	}
	.ncf .ncf-tab.is-active { background: var(--ncf-ink); border-color: var(--ncf-ink); color: #fff; }
	.ncf-layout { display: block; height: auto; }
	.ncf-list { max-height: none; overflow: visible; }
	.ncf-map-wrap { height: 70vh; min-height: 360px; }
	.ncf[data-view="list"] .ncf-map-wrap { position: absolute; left: -10000px; width: 100%; } /* kept rendered so Leaflet keeps its size */
	.ncf[data-view="map"] .ncf-list, .ncf[data-view="map"] .ncf-bar .ncf-count { display: none; }
}
