/* Leaflet requires the container to have an explicit height. This is just
   the static fallback (kept in sync with the same 80/70 desktop/mobile
   defaults) -- wherever the map actually renders, includes/shortcodes.php
   appends inline CSS built from the Kartstorlek desktop/mobile settings on
   BDK Inställningar (see bdk_get_map_height_css()), which wins by source
   order without needing !important here. */
.bdk-map {
	position: relative;
	width: 100%;
	height: 80vh;
}

@media (max-width: 600px) {
	/* The single-station mini map (Phase 4) keeps its own fixed height --
	   only the full [bdk_karta] map shrinks on narrow screens. */
	.bdk-map:not(.bdk-map-single) {
		height: 70vh;
	}
}

/* Divi's global stylesheet sets `img { max-width: 100% }`, which squashes
   Leaflet's tile and marker images into distorted rectangles. This override
   is mandatory wherever the map sits inside a Divi Code/Text module. */
.bdk-map img {
	max-width: none;
}

.bdk-map-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.55);
	z-index: 1000;
	pointer-events: none;
}

.bdk-map-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid #e6a817;
	border-top-color: transparent;
	border-radius: 50%;
	animation: bdk-map-spin 0.8s linear infinite;
}

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

.bdk-map-geolocate {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1000;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}

.bdk-map-geolocate:hover {
	background: #333333;
}

/* "Sök ort..." search box (top-center, unobtrusive -- deliberately smaller
   and plainer than the geolocate button, which sits top-right). Submit-only:
   no suggestions dropdown, so there's nothing here that implies
   per-keystroke requests. */
.bdk-map-search {
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	display: flex;
	gap: 4px;
}

.bdk-map-search-input {
	width: 150px;
	max-width: 40vw;
	box-sizing: border-box;
	padding: 7px 10px;
	border: none;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.2;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.bdk-map-search-button {
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 7px 10px;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
}

.bdk-map-search-button:hover {
	background: #333333;
}

.bdk-map-search-status {
	position: absolute;
	top: 44px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	margin: 0;
	max-width: 220px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
}

.bdk-map-search-status:empty {
	display: none;
}

@media (max-width: 600px) {
	/* The centered search box and the top-right geolocate button are wide
	   enough, relative to a narrow screen, to overlap in the same row --
	   center the geolocate button too and drop it below the search box
	   (and its status message, when one is shown) instead. */
	.bdk-map-geolocate {
		top: 80px;
		right: auto;
		left: 50%;
		transform: translateX(-50%);
	}
}

.bdk-pin {
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* Popups must never overflow the map's own width on a narrow screen.
   bdk-map.js already computes Leaflet's `maxWidth` popup option from the
   map container's current width (see computePopupMaxWidth()), which sizes
   .leaflet-popup-content's own pixel width accordingly -- but that alone
   doesn't stop a single long unbroken string (a URL, a long station name)
   from overflowing that width, so word-wrap/overflow-wrap always apply.
   The max-width on small screens below is a viewport-relative backstop on
   top of the JS value, not a replacement for it. Applies to both the full
   map's detail popup and anything the single-station mini map shows --
   both share the .bdk-map class. */
.bdk-map .leaflet-popup-content-wrapper,
.bdk-map .leaflet-popup-content {
	box-sizing: border-box;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

@media (max-width: 600px) {
	.bdk-map .leaflet-popup-content-wrapper,
	.bdk-map .leaflet-popup-content {
		max-width: calc(100vw - 60px);
	}
}

.bdk-popup p {
	margin: 4px 0;
}

.bdk-popup-sponsored {
	display: inline-block;
	background: #e6a817;
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	border-radius: 3px;
	padding: 1px 6px;
	margin-left: 6px;
	text-transform: uppercase;
}

.bdk-popup-actions {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
}

.bdk-report-link {
	color: #8a8a8a;
	font-size: 12px;
}

/* Station status lifecycle: 'obekräftad' notice, 'användartips' notice,
   and 'upphörd' banner. Deliberately not gold -- that accent is reserved
   for sponsorship. */
.bdk-notice {
	margin: 6px 0;
	font-size: 13px;
}

.bdk-notice--unconfirmed {
	color: #9a3412;
	background: #fff4e6;
	border-radius: 4px;
	padding: 6px 10px;
}

.bdk-notice--usertip {
	color: #5a5a5a;
	background: #f0f0f0;
	border-radius: 4px;
	padding: 6px 10px;
}

.bdk-banner {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 6px;
	font-weight: 600;
}

.bdk-banner--discontinued {
	background: #1a1a1a;
	color: #fff;
}

/* Single station page (Phase 4). */
.bdk-station-detail {
	margin-bottom: 24px;
}

.bdk-station-facts {
	list-style: none;
	margin: 12px 0;
	padding: 0;
}

.bdk-station-facts li {
	margin: 4px 0;
}

.bdk-directions-button {
	display: inline-block;
	background: #1a1a1a;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	padding: 8px 16px;
	font-size: 14px;
}

.bdk-directions-button:hover {
	background: #333333;
	color: #fff;
}

.bdk-lan-index {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

/* Shared badge/pill (Phase 6). Gold is reserved for sponsorship only --
   everything else stays in the near-black/white palette. */
.bdk-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border-radius: 3px;
	padding: 2px 7px;
	line-height: 1.4;
}

.bdk-badge--sponsored {
	background: #e6a817;
	color: #1a1a1a;
}

.bdk-pill {
	display: inline-block;
	background: #f2f2f2;
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 600;
	border-radius: 999px;
	padding: 3px 10px;
	white-space: nowrap;
}

/* [bdk_stationslista] (Phase 4/6): cards, not bare table rows. Station name
   prominent, brand/ort as secondary text, a pill for tankkort, verified
   date subtle, sponsored rows a quiet gold left border + badge. */
.bdk-stationslista {
	list-style: none;
	margin: 16px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 100%;
}

.bdk-stationslista .bdk-stationslista-item {
	box-sizing: border-box;
	width: 100%;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 14px 16px;
}

.bdk-stationslista .bdk-stationslista-item.bdk-stationslista-item--sponsored {
	border-left: 3px solid #e6a817;
}

.bdk-stationslista .bdk-stationslista-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 10px;
}

.bdk-stationslista a.bdk-stationslista-name {
	font-size: 17px;
	font-weight: 700;
	color: #1a1a1a;
	text-decoration: none;
	word-break: break-word;
}

.bdk-stationslista a.bdk-stationslista-name:hover {
	text-decoration: underline;
}

.bdk-stationslista .bdk-stationslista-meta {
	margin-top: 3px;
	color: #6b6b6b;
	font-size: 14px;
}

.bdk-stationslista .bdk-stationslista-details {
	margin-top: 8px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 14px;
}

.bdk-stationslista .bdk-stationslista-verified {
	color: #8a8a8a;
	font-size: 12px;
}

.bdk-stationslista .bdk-stationslista-fuelnote {
	margin: 8px 0 0;
	font-size: 14px;
	color: #1a1a1a;
}

.bdk-stationslista-empty {
	color: #4a4a4a;
	max-width: 100%;
}

.bdk-stationslista-empty a {
	color: #1a1a1a;
	font-weight: 700;
}

/* [bdk_partner] (Phase 6): the sellable featured-partner card. */
.bdk-partner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	padding: 16px;
	max-width: 100%;
}

.bdk-partner .bdk-partner-logo {
	max-width: 96px;
	max-height: 96px;
	flex-shrink: 0;
}

.bdk-partner .bdk-partner-body {
	min-width: 0;
}

.bdk-partner .bdk-partner-name {
	display: block;
	color: #1a1a1a;
	font-size: 16px;
	margin-bottom: 4px;
}

.bdk-partner .bdk-partner-text {
	margin: 0 0 10px;
	color: #4a4a4a;
	font-size: 14px;
}

.bdk-partner a.bdk-partner-link {
	display: inline-block;
	color: #1a1a1a;
	font-weight: 700;
	text-decoration: none;
	border-bottom: 2px solid #1a1a1a;
	padding-bottom: 1px;
}

.bdk-partner a.bdk-partner-link:hover {
	opacity: 0.7;
}

/* [bdk_partner] with multiple active partners: stacked (default) or a
   responsive grid (layout="grid"). */
.bdk-partner-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bdk-partner-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.bdk-partner-grid .bdk-partner {
	flex-direction: column;
	align-items: flex-start;
}

.bdk-partner-grid .bdk-partner-logo {
	max-width: 100%;
	height: auto;
}

/* [bdk_cta] (Phase 6): affiliate-ready article callout. Deliberately not
   gold -- that accent is reserved for sponsorship, and a CTA box is neither
   a sponsored station nor the partner slot. */
.bdk-cta {
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-left: 4px solid #1a1a1a;
	border-radius: 8px;
	padding: 18px 20px;
	max-width: 100%;
}

.bdk-cta .bdk-cta-title {
	display: block;
	color: #1a1a1a;
	font-size: 17px;
	margin-bottom: 6px;
}

.bdk-cta .bdk-cta-text {
	margin: 0 0 14px;
	color: #4a4a4a;
	font-size: 14px;
}

.bdk-cta a.bdk-cta-button {
	display: inline-block;
	background: #1a1a1a;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
}

.bdk-cta a.bdk-cta-button:hover {
	background: #333333;
	color: #fff;
}

/* [bdk_tipsformular] (Phase 5 + station report mode) and
   [bdk_kontaktformular] (general contact form) share this block -- both
   scoped under their own container class, tag selectors combined with it
   for enough specificity to survive Divi's aggressive global form styling,
   same approach as the station cards above. Field/error/success/submit
   class names are deliberately identical between the two forms so this
   styling applies to both without duplication -- see includes/contact.php. */
.bdk-tipsformular,
.bdk-kontaktform {
	max-width: 480px;
	box-sizing: border-box;
}

.bdk-tipsformular .bdk-field-row,
.bdk-kontaktform .bdk-field-row {
	margin-bottom: 16px;
}

.bdk-tipsformular label,
.bdk-kontaktform label {
	display: block;
	font-weight: 600;
	color: #1a1a1a;
	font-size: 14px;
	margin-bottom: 6px;
}

.bdk-tipsformular .bdk-field-help,
.bdk-kontaktform .bdk-field-help {
	margin: 4px 0 0;
	color: #6b6b6b;
	font-size: 12px;
}

.bdk-tipsformular input[type="text"],
.bdk-tipsformular input[type="email"],
.bdk-tipsformular select,
.bdk-tipsformular textarea,
.bdk-kontaktform input[type="text"],
.bdk-kontaktform input[type="email"],
.bdk-kontaktform select,
.bdk-kontaktform textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 9px 12px;
	border: 1px solid #d5d5d5;
	border-radius: 4px;
	background: #fff;
	color: #1a1a1a;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

.bdk-tipsformular textarea,
.bdk-kontaktform textarea {
	resize: vertical;
}

.bdk-tipsformular input[type="text"]:focus,
.bdk-tipsformular input[type="email"]:focus,
.bdk-tipsformular select:focus,
.bdk-tipsformular textarea:focus,
.bdk-kontaktform input[type="text"]:focus,
.bdk-kontaktform input[type="email"]:focus,
.bdk-kontaktform select:focus,
.bdk-kontaktform textarea:focus {
	outline: none;
	border-color: #1a1a1a;
}

.bdk-tipsformular .bdk-checkbox-row label,
.bdk-kontaktform .bdk-checkbox-row label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.bdk-tipsformular .bdk-checkbox-row input[type="checkbox"],
.bdk-kontaktform .bdk-checkbox-row input[type="checkbox"] {
	margin: 0;
}

.bdk-tipsformular .bdk-tip-honeypot,
.bdk-kontaktform .bdk-tip-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

.bdk-tipsformular .bdk-tip-errors,
.bdk-kontaktform .bdk-tip-errors {
	margin-bottom: 16px;
}

.bdk-tipsformular .bdk-tip-errors p,
.bdk-kontaktform .bdk-tip-errors p {
	margin: 4px 0;
	color: #b32d2e;
	font-size: 14px;
}

.bdk-tipsformular p.bdk-tip-success,
.bdk-kontaktform p.bdk-tip-success {
	color: #1a1a1a;
	font-weight: 600;
	font-size: 15px;
}

.bdk-tipsformular .bdk-tip-report-context {
	background: #f5f5f5;
	border-left: 3px solid #1a1a1a;
	border-radius: 4px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 14px;
	color: #1a1a1a;
}

.bdk-tipsformular button.bdk-tip-submit,
.bdk-kontaktform button.bdk-tip-submit {
	display: inline-block;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.bdk-tipsformular button.bdk-tip-submit:hover,
.bdk-kontaktform button.bdk-tip-submit:hover {
	background: #333333;
}
