/**
 * Desktop Header — Stilar
 *
 * Sektioner:
 *  1.  Dölj gammal header + body spacing
 *  2.  Base header (fixed positioning) + admin-bar
 *  3.  Inner layout (flexbox 3-kolumner)
 *  4.  Logo (centrerad, hängande)
 *  5.  Nav-grupper (vänster/höger)
 *  6.  Länkstilar (typografi, animerad underline, active)
 *  7.  Chevron-indikator
 *  8.  CTA-knapp (Bli medlem)
 *  9.  Ikon-knappar (sök, hjärta)
 * 10.  Dropdown — gemensam bas
 * 11.  Dropdown — rich (Recept: ikon + label + beskrivning)
 * 12.  Dropdown — program (progress bar)
 * 13.  Dropdown — konto
 * 14.  Sök-overlay
 * 15.  Sök scope-pills
 * 16.  Sticky/scroll
 * 17.  Skip-link
 * 18.  Mobil-gömning (≤960px)
 * 19.  Reduced motion
 * 20.  Focus-visible
 */


/* === 1. DÖLJ GAMMAL HEADER + BODY SPACING === */

@media (min-width: 960px) {
	body.sp-new-desktop-header .header {
		display: none !important;
	}

	body.sp-new-desktop-header {
		padding-top: 0 !important;
	}

	.sp-dh {
		margin-bottom: 60px;
	}
}


/* === 2. BASE HEADER === */

.sp-dh {
	display: none; /* Dold som default, visas via min-width: 960px */
	position: relative;
	z-index: 99999;
	overflow: visible;
	padding-top: 5px;
	background: linear-gradient(180deg, #f5f3ef 0%, #faf9f7 100%);
}

@media (min-width: 960px) {
	.sp-dh {
		display: block;
	}
}





/* === 2b. TOP BAR — Utility (mörkt grönt) === */

.sp-dh-topbar {
	background: transparent;
	height: 34px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


.sp-dh-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 40px;
	height: 100%;
}

.sp-dh-topbar-left {
	display: flex;
	align-items: center;
}

.sp-dh-topbar-social {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sp-dh-topbar-social a {
	display: flex;
	align-items: center;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.sp-dh-topbar-social a:hover {
	opacity: 0.85;
}

.sp-dh-topbar-social img {
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 4px;
}

.sp-dh-topbar-links {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: 14px;
	padding-left: 14px;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.sp-dh-topbar-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: 'Proxima Nova', 'proxima_nova_regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #777;
	text-decoration: none;
	padding: 4px 10px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.03);
	border: 1px solid rgba(0, 0, 0, 0.06);
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sp-dh-topbar-link:hover {
	color: #3D5F42;
	background: rgba(61, 95, 66, 0.08);
	border-color: rgba(61, 95, 66, 0.15);
}

.sp-dh-topbar-link:visited {
	color: #777;
}

.sp-dh-topbar-link svg {
	display: block;
	flex-shrink: 0;
	opacity: 0.5;
}

.sp-dh-topbar-link:hover svg {
	opacity: 0.8;
}

.sp-dh-topbar-link-active {
	color: #3D5F42;
	background: #e3e4de;
}

.sp-dh-topbar-dot {
	color: #ccc;
	font-size: 10px;
	line-height: 1;
}

.sp-dh-topbar-brand {
	font-family: 'proxima_nova_semibold', 'Proxima Nova', -apple-system, sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #999;
}

.sp-dh-topbar-right {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* Top bar-stil på sök, hjärta, konto — matchar vänster sida */
.sp-dh-topbar-right .sp-dh-link,
.sp-dh-topbar-right .sp-dh-icon-link,
.sp-dh-topbar-right .sp-dh-search-toggle,
.sp-dh-topbar-right .sp-dh-account-toggle {
	font-family: 'Proxima Nova', 'proxima_nova_regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-weight: 600;
	color: #666;
	font-size: 14px;
	padding: 4px 10px;
}

.sp-dh-topbar-right .sp-dh-link:hover,
.sp-dh-topbar-right .sp-dh-icon-link:hover,
.sp-dh-topbar-right .sp-dh-search-toggle:hover,
.sp-dh-topbar-right .sp-dh-account-toggle:hover {
	color: #3D5F42;
}

.sp-dh-topbar-right .sp-dh-link:visited {
	color: #666;
}

.sp-dh-topbar-right .sp-dh-account-name {
	font-size: 14px;
	color: #666;
}

.sp-dh-topbar-right .sp-dh-chevron {
	opacity: 0.5;
	color: #666;
}

.sp-dh-topbar-right .sp-dh-dropdown-open > button .sp-dh-chevron {
	opacity: 0.8;
}

/* Sök-toggle active state i top bar */
.sp-dh-topbar-right .sp-dh-search-toggle[aria-expanded="true"] {
	color: #3D5F42;
}

/* CTA i top bar — kompakt variant (slår igenom över sektion 8:s !important) */
.sp-dh-topbar-right .sp-dh-cta {
	font-size: 12px !important;
	padding: 5px 14px !important;
	border-radius: 50px !important;
	margin-left: 4px;
}

/* Separator mellan sök och konto-items */
.sp-dh-topbar-right .sp-dh-icon-link:first-of-type {
	margin-left: 4px;
	padding-left: 12px;
	border-left: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0;
}


/* === 2c. MAIN NAV — Innehållsnavigering (varm bakgrund) === */

.sp-dh-main {
	height: 72px;
	position: relative;
}

.sp-dh-main-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 40px;
	height: 100%;
	position: relative;
}


/* === 4. LOGO === */

.sp-dh-logo {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	top: -18px; /* 2/3 i main-nav, 1/3 ovanför */
	z-index: 10;
	text-decoration: none;
	display: flex;
	align-items: flex-start;
	transition: top 0.25s ease;
}

.sp-dh-logo:hover {
	text-decoration: none;
}

.sp-dh-logo img {
	width: 140px;
	height: auto;
	transition: width 0.25s ease;
	filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.12));
}




/* === 5. NAV-GRUPPER === */

.sp-dh-nav {
	display: flex;
	align-items: center;
	gap: 2px;
}

.sp-dh-nav--left {
	flex: 1;
	justify-content: flex-end;
	padding-right: 88px;
}

.sp-dh-nav--right {
	flex: 1;
	justify-content: flex-start;
	padding-left: 88px;
}


/* === 6. LÄNKSTILAR — ANIMERAD UNDERLINE === */

.sp-dh-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 12px 18px;
	font-family: 'proxima_nova_semibold', 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #3a3a3a;
	text-decoration: none;
	border: none;
	background: none;
	cursor: pointer;
	white-space: nowrap;
	line-height: 1.3;
	border-radius: 6px;
	transition: color 0.25s ease;
}

/* Animerad underline — glider in från mitten */
.sp-dh-link::after {
	content: '';
	position: absolute;
	bottom: 2px;
	left: 50%;
	width: 0;
	height: 2px;
	background: #3D5F42;
	border-radius: 1px;
	transition: width 0.3s ease, left 0.3s ease;
}

.sp-dh-link:hover {
	color: #3D5F42;
	text-decoration: none;
}

.sp-dh-link:hover::after {
	width: calc(100% - 36px);
	left: 18px;
}

.sp-dh-link:visited {
	color: #3a3a3a;
}

.sp-dh-link:visited:hover {
	color: #3D5F42;
}

/* Active state — tydlig pill-bakgrund, ingen underline */
.sp-dh-link.sp-dh-active {
	color: #3D5F42;
	font-weight: 600;
	background: #e3e4de;
	border-radius: 6px;
}

.sp-dh-link.sp-dh-active::after {
	display: none;
}


/* === 7. CHEVRON-INDIKATOR === */

.sp-dh-chevron {
	flex-shrink: 0;
	opacity: 0.5;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.sp-dh-link:hover .sp-dh-chevron,
.sp-dh-dropdown-open > button .sp-dh-chevron {
	opacity: 0.8;
}

.sp-dh-dropdown-open > button .sp-dh-chevron {
	transform: rotate(180deg);
}

/* Dropdown-triggers ska inte ha hover-underline (chevron räcker) */
.sp-dh-has-dropdown:not(.sp-dh-active)::after,
.sp-dh-account-toggle::after,
.sp-dh-search-toggle::after,
.sp-dh-icon-link::after {
	display: none;
}


/* === 8. CTA-KNAPP === */

.sp-dh-cta {
	background: #23A455 !important;
	color: #fff !important;
	font-weight: 600 !important;
	padding: 9px 22px !important;
	border-radius: 50px !important;
	margin-left: 6px;
	transition: background 0.2s ease, transform 0.15s ease;
}

.sp-dh-cta:hover {
	background: #1e8f49 !important;
	color: #fff !important;
	text-decoration: none;
}

.sp-dh-cta:visited {
	color: #fff !important;
}

.sp-dh-cta:active {
	transform: scale(0.97);
}

.sp-dh-cta-active {
	background: #e3e4de !important;
	color: #3D5F42 !important;
	border-radius: 6px !important;
	padding: 12px 18px !important;
	pointer-events: none;
	cursor: default;
}

.sp-dh-cta::after {
	display: none !important;
}


/* === 9. IKON-KNAPPAR (bas-stilar, overrides i topbar sektion 2b) === */

.sp-dh-icon-link {
	padding: 6px 10px;
}

.sp-dh-icon-link svg,
.sp-dh-search-toggle svg {
	display: block;
}

.sp-dh-search-toggle {
	padding: 6px 10px;
}


/* === 10. DROPDOWN — GEMENSAM BAS === */

.sp-dh-dropdown-wrap {
	position: relative;
}

.sp-dh-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 220px;
	background: #faf9f7;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 100;
}

.sp-dh-dropdown-open > .sp-dh-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Konto-dropdown: högeranpassad */
.sp-dh-dropdown--account {
	left: auto;
	right: 0;
	min-width: 240px;
}

/* Kompakt ikon-stil (GitHub-inspirerad) — konto-dropdown */
.sp-dh-dropdown--compact .sp-dh-dropdown-rich {
	gap: 10px;
	padding: 8px 20px;
}

.sp-dh-dropdown--compact .sp-dh-dropdown-icon {
	width: auto;
	height: auto;
	background: none;
	border-radius: 0;
	color: #888;
}

.sp-dh-dropdown--compact .sp-dh-dropdown-rich:hover .sp-dh-dropdown-icon {
	transform: none;
	background: none;
	color: #3D5F42;
}

.sp-dh-dropdown--compact .sp-dh-dropdown-rich.sp-dh-dropdown-active .sp-dh-dropdown-icon {
	background: none !important;
	color: #3D5F42 !important;
}

.sp-dh-dropdown--compact .sp-dh-dropdown-title {
	font-size: 14px;
	font-weight: 600;
}

.sp-dh-dropdown--compact .sp-dh-dropdown-item {
	padding: 8px 20px;
}

.sp-dh-dropdown-item {
	display: block;
	padding: 10px 20px;
	font-family: 'Proxima Nova', 'proxima_nova_regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 15px;
	font-weight: 400;
	color: #444;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.sp-dh-dropdown-item:hover {
	background: #f0ede8;
	color: #3D5F42;
	text-decoration: none;
}

.sp-dh-dropdown-item:visited {
	color: #444;
}

.sp-dh-dropdown-item:visited:hover {
	color: #3D5F42;
}

.sp-dh-dropdown-active {
	color: #3D5F42;
	font-weight: 600;
}

.sp-dh-dropdown-label {
	padding: 12px 20px 4px;
	font-family: 'Montserrat', 'Proxima Nova', sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #999;
}

.sp-dh-dropdown-sep {
	height: 1px;
	background: #f0f0f0;
	margin: 6px 16px;
}

.sp-dh-dropdown-logout .sp-dh-dropdown-title,
.sp-dh-dropdown-logout {
	color: #999;
}

.sp-dh-dropdown-logout .sp-dh-dropdown-icon {
	background: #f5f3ef;
	color: #999;
}

.sp-dh-dropdown-logout:hover .sp-dh-dropdown-title,
.sp-dh-dropdown-logout:hover {
	color: #666;
}

.sp-dh-dropdown-logout:hover {
	background: #f5f3ef;
}

.sp-dh-dropdown-cta {
	color: #3D5F42;
	font-weight: 600;
}

.sp-dh-dropdown-subtle {
	font-style: italic;
	color: #999;
	font-size: 13px;
}


/* === 11. DROPDOWN — RICH (Recept: ikon + label + beskrivning) === */

.sp-dh-dropdown--rich {
	min-width: 280px;
	padding: 10px 0;
}

.sp-dh-dropdown-rich {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 20px;
}

.sp-dh-dropdown-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: #e2ece3;
	color: #3D5F42;
	flex-shrink: 0;
	transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sp-dh-dropdown-icon svg {
	display: block;
}

.sp-dh-dropdown-rich:hover .sp-dh-dropdown-icon {
	transform: scale(1.05);
	background: #d4e2d5;
}

.sp-dh-dropdown-rich.sp-dh-dropdown-active .sp-dh-dropdown-icon {
	background: #3D5F42;
	color: #fff;
}

.sp-dh-dropdown-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.sp-dh-dropdown-title {
	font-size: 15px;
	font-weight: 600;
	color: #444;
	line-height: 1.3;
}

.sp-dh-dropdown-rich:hover .sp-dh-dropdown-title,
.sp-dh-dropdown-rich.sp-dh-dropdown-active .sp-dh-dropdown-title {
	color: #3D5F42;
}

.sp-dh-dropdown-desc {
	font-size: 13px;
	font-weight: 400;
	color: #999;
	line-height: 1.3;
}


/* === 12. DROPDOWN — PROGRAM (progress bar) === */

.sp-dh-dropdown--program {
	min-width: 260px;
}

.sp-dh-program-active {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 20px;
}

.sp-dh-program-active:hover {
	background: #f0ede8;
}

.sp-dh-program-label {
	font-size: 15px;
	font-weight: 600;
	color: #444;
	line-height: 1.3;
}

.sp-dh-program-active:hover .sp-dh-program-label {
	color: #3D5F42;
}

.sp-dh-program-week {
	font-size: 13px;
	font-weight: 400;
	color: #999;
}

.sp-dh-program-bar {
	display: block;
	width: 100%;
	height: 4px;
	background: #eee;
	border-radius: 2px;
	overflow: hidden;
	margin-top: 2px;
}

.sp-dh-program-fill {
	display: block;
	height: 100%;
	background: #3D5F42;
	border-radius: 2px;
	transition: width 0.3s ease;
}


/* === 12b. DROPDOWN — VECKOMENYER (tvåkolumn) === */

.sp-dh-dropdown--menu {
	min-width: 520px;
}

/* Kolumnlayout — återanvändbar för alla dropdowns */
.sp-dh-dropdown-columns {
	display: flex;
}

.sp-dh-dropdown-col {
	flex: 1;
	min-width: 0;
}

/* Vertikal separator mellan kolumner */
.sp-dh-dropdown-col + .sp-dh-dropdown-col {
	border-left: 1px solid rgba(0, 0, 0, 0.06);
}


/* === 13. DROPDOWN — KONTO (account toggle styling) === */

.sp-dh-account-toggle {
	padding: 4px 10px;
	border-radius: 6px;
}

.sp-dh-account-name {
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
}


/* === 14. SÖK-DROPDOWN === */

.sp-dh-dropdown--search {
	right: -12px;
	left: auto;
	width: 320px;
	padding: 16px 18px;
	background: #faf9f7;
}

.sp-dh-search-form {
	position: relative;
	display: flex;
	align-items: center;
}

.sp-dh-search-form-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #999;
	pointer-events: none;
}

.sp-dh-search-input {
	flex: 1;
	height: 44px;
	padding: 0 14px 0 42px;
	border: 1px solid #e0dcd6;
	border-radius: 10px;
	background: #f0ede8;
	font-family: 'Proxima Nova', 'proxima_nova_regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 15px;
	color: #2c2c2c;
	outline: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.sp-dh-search-input:focus {
	border-color: #3D5F42;
	background: #fff;
}

.sp-dh-search-input::placeholder {
	color: #999;
}

.sp-dh-search-text {
	font-size: 14px;
}


/* === 15. SÖK SCOPE-PILLS === */

.sp-dh-search-scope {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 10px;
}

.sp-dh-scope-pill {
	background: none;
	border: none;
	padding: 4px 14px;
	font-family: 'Proxima Nova', 'proxima_nova_regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 13px;
	font-weight: 400;
	color: #999;
	cursor: pointer;
	border-radius: 6px;
	transition: color 0.15s ease;
	outline: none;
}

.sp-dh-scope-pill.sp-dh-scope-active {
	color: #2c2c2c;
	font-weight: 600;
}

.sp-dh-scope-pill:hover:not(.sp-dh-scope-active) {
	color: #666;
}

.sp-dh-scope-dot {
	color: #d5d5d5;
	font-size: 14px;
	line-height: 1;
	pointer-events: none;
}


/* === 16. (Borttagen — ingen sticky header) === */


/* === 17. SKIP-LINK === */

.sp-dh-skip {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 100000;
	font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 14px;
}

.sp-dh-skip:focus {
	position: fixed;
	left: 16px;
	top: 16px;
	width: auto;
	height: auto;
	overflow: visible;
	padding: 10px 18px;
	background: #3D5F42;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* === 18. MOBIL-GÖMNING === */

/* Mobil-gömning hanteras av default display: none + min-width: 960px */

/* Underline gäller bara main-nav items, inte topbar */
.sp-dh-topbar-right .sp-dh-link::after,
.sp-dh-topbar-right .sp-dh-icon-link::after,
.sp-dh-topbar-right .sp-dh-search-toggle::after,
.sp-dh-topbar-right .sp-dh-account-toggle::after {
	display: none;
}



/* === 19. REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
	.sp-dh,
	.sp-dh-main,
	.sp-dh-logo,
	.sp-dh-logo img,
	.sp-dh-link,
	.sp-dh-link::after,
	.sp-dh-cta,
	.sp-dh-dropdown,
	.sp-dh-search-overlay,
	.sp-dh-chevron,
	.sp-dh-search-input,
	.sp-dh-search-close,
	.sp-dh-dropdown-icon,
	.sp-dh-program-fill {
		transition-duration: 0.01s !important;
	}
}


/* === 20. FOCUS-VISIBLE === */

.sp-dh-link:focus-visible,
.sp-dh-dropdown-item:focus-visible,
.sp-dh-search-toggle:focus-visible,
.sp-dh-account-toggle:focus-visible,
.sp-dh-search-close:focus-visible,
.sp-dh-scope-pill:focus-visible {
	outline: 2px solid #81BA80;
	outline-offset: 2px;
}

.sp-dh-link:focus:not(:focus-visible),
.sp-dh-dropdown-item:focus:not(:focus-visible),
.sp-dh-search-toggle:focus:not(:focus-visible),
.sp-dh-account-toggle:focus:not(:focus-visible),
.sp-dh-search-close:focus:not(:focus-visible),
.sp-dh-scope-pill:focus:not(:focus-visible) {
	outline: none;
}
