/*
 * Cookie box in the Provitalia 3.0 look (KANON B122, direction A, task 165).
 * Facit: staging/research/cookiebot-banner-v3-2026-11-09/v2/prototyp.html (direction A).
 *
 * Sheet from the bottom on mobile (3.0 .product-sheet: 14px top radius, 20px padding, reading shadow),
 * centred dialog on desktop, both over a dark blurred page (as .product-sheet::backdrop).
 * "Tillåt alla" first and primary, "Inställningar" in the middle, "Avvisa" last as a text link.
 *
 * Cookiebot has no CSS field in the Manager: this file is the only place for it (support article 360003922714).
 * Selectors are Cookiebot's own ids, measured on its real DOM (Swift template). The fixed 3.0 grafit values
 * are used on purpose: the box looks the same on every page scene.
 *
 * Section 1 works with the banner type that runs today (Accept / Decline).
 * The account has run Multi Level (button "Reject all / Selection / Allow all") since 2026-11-22, so sections 2
 * and 3 are live. Section 2b controls the two steps: first Tillåt alla, Inställningar and Avvisa, then the
 * category rows and "Spara mina val" after a tap on Inställningar (class p3-cb-settings, set by js/cookiebot.js).
 */

#CybotCookiebotDialog {
	--cb-ink: #30302e;
	--cb-lede: #514d47;
	--cb-line: #d8d2c9;
	--cb-edge: #b9ab9d;
	--cb-toggle-off: #857868; /* off toggle: 4.3:1 on white and 3.9:1 on the warm row (WCAG 1.4.11 needs 3:1) */
	--cb-page: #fffdf9;
	--cb-warm: #f8f3ec;
	--cb-line-soft: #ebe5dc;
	--cb-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
	--cb-duration: 280ms;
	font-family: 'Albert Sans', Arial, sans-serif !important;
	color: var(--cb-ink) !important;
}

/* ===== 1. First level, today's banner type ===== */

/* The sheet: mobile first */
#CybotCookiebotDialog {
	position: fixed !important;
	top: auto !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	transform: none !important;
	width: auto !important;
	max-width: none !important;
	max-height: 92dvh !important;
	margin: 0 !important;
	padding: 20px !important;
	overflow-y: auto !important;
	border: 0 !important;
	border-radius: 22px 22px 0 0 !important;
	background: var(--cb-page) !important;
	box-shadow: 0 -8px 40px -12px rgba(48, 40, 30, 0.35), inset 0 1px 0 #fff !important;
	box-sizing: border-box !important;
}

@media (min-width: 651px) {
	#CybotCookiebotDialog {
		top: 50% !important;
		right: auto !important;
		bottom: auto !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important;
		width: min(560px, calc(100% - 32px)) !important;
		padding: 36px !important;
		border-radius: 24px !important;
		box-shadow: 0 32px 80px -24px rgba(48, 40, 30, 0.55), 0 2px 8px rgba(48, 40, 30, 0.08), inset 0 1px 0 #fff !important;
	}
}

/* Dark blurred page behind (3.0 .product-sheet::backdrop). Only while the box is open, and not on the legal pages
   (Cookiepolicy, Integritet): there the visitor must be able to read the page before choosing. The box itself still shows. */
html:not(:has(body.p3-cookiepolicy, body.p3-integritet)):has(#CybotCookiebotDialog.CybotCookiebotDialogActive)::after {
	content: '';
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: color-mix(in srgb, #30302e 55%, transparent);
	backdrop-filter: blur(5px);
}

/* Open animation: only `translate` and `opacity`, because the box's own `transform` is fixed with !important above.
   Switched off for visitors who ask for less motion (end of section 3). */
#CybotCookiebotDialog.CybotCookiebotDialogActive {
	animation: p3-cb-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes p3-cb-in {
	from {
		opacity: 0;
		translate: 0 28px;
	}
}

@keyframes p3-cb-fade {
	from {
		opacity: 0;
	}
}

html:has(#CybotCookiebotDialog.CybotCookiebotDialogActive)::after {
	animation: p3-cb-fade 300ms ease-out both;
}

/* The Provitalia wordmark on top of both steps, set in the same type as the header logo (.pvt-logo) so it has no
   image box around it on the warm surface. Decorative: the box is named by Cookiebot's own dialog label. */
#CybotCookiebotDialog .CybotCookiebotDialogContentWrapper::before {
	content: 'provitalia';
	content: 'provitalia' / '';
	display: block;
	margin: 0 0 14px;
	font: bold 26px/1 Georgia, serif;
	letter-spacing: -1.5px;
	color: #30302e;
}

@media (min-width: 651px) {
	#CybotCookiebotDialog .CybotCookiebotDialogContentWrapper::before {
		font-size: 30px;
		margin-bottom: 18px;
	}
}

/* Anything Cookiebot hides stays hidden (the rules below set display on some of these elements) */
#CybotCookiebotDialog div.CybotCookiebotDialogHide,
#CybotCookiebotDialog button.CybotCookiebotDialogHide,
#CybotCookiebotDialog li.CybotCookiebotDialogHide {
	display: none !important;
}

/* Cookiebot's own logo, tabs, heading and shading are not part of this design */
#CybotCookiebotDialogHeader,
#CybotCookiebotDialogNav,
#CybotCookiebotDialogBodyContentTitle,
#CybotCookiebotDialog .CybotCookiebotFader {
	display: none !important;
}

/* Reset Cookiebot's inner spacing, borders and fixed heights */
#CybotCookiebotDialog .CybotCookiebotDialogContentWrapper,
#CybotCookiebotDialogTabContent,
#CybotCookiebotDialogBody,
#CybotCookiebotDialogFooter {
	width: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

#CybotCookiebotDialog .CybotCookiebotScrollContainer,
#CybotCookiebotDialog .CybotCookiebotScrollArea,
#CybotCookiebotDialogBodyContent {
	max-height: none !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	border: 0 !important;
}

#CybotCookiebotDialogBodyContentText,
#CybotCookiebotDialogBodyContentText * {
	font-family: inherit !important;
	font-size: 15px !important;
	line-height: 1.55 !important;
	letter-spacing: normal !important;
	color: var(--cb-lede) !important;
}

#CybotCookiebotDialogBodyContentText {
	margin: 0 0 20px !important;
	padding: 0 !important;
}

#CybotCookiebotDialogBodyContentText a {
	color: var(--cb-ink) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
	text-decoration-color: var(--cb-edge) !important;
	text-decoration-skip-ink: none !important;
}

/* Buttons: Allow all first, Settings in the middle, Decline last */
#CybotCookiebotDialogBodyButtons {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

#CybotCookiebotDialogBodyButtonsWrapper {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	gap: 8px 12px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyButton {
	width: auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	font: 500 15px 'Albert Sans', Arial, sans-serif !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	cursor: pointer;
	transition: transform var(--cb-duration) var(--cb-spring) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyButton:hover {
	transform: translateY(-2px) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyButton:active {
	transform: scale(0.98) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyButton:focus-visible,
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButton:focus-visible + .CybotCookiebotDialogBodyLevelButtonSlider {
	outline: 3px solid currentColor !important;
	outline-offset: 4px !important;
}

/* Tillåt alla: 3.0 primary button, full width, round arrow icon on the right
   (BodyButtonAccept in Accept/Decline, BodyLevelButtonLevelOptinAllowAll in Multi Level) */
#CybotCookiebotDialogBodyButtonAccept,
#CybotCookiebotDialog #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
	order: 1 !important;
	flex: 1 1 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	min-height: 56px !important;
	padding: 8px 9px 8px 24px !important;
	border: 1px solid transparent !important;
	border-radius: 999px !important;
	background: var(--cb-ink) !important;
	color: #fff !important;
	text-align: left !important;
	box-shadow: 0 10px 22px -12px rgba(48, 48, 46, 0.7) !important;
}

/* Cookiebot's own hover opacity would fade the button (and stays on after a touch): keep the ink */
#CybotCookiebotDialogBodyButtonAccept:hover,
#CybotCookiebotDialog #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll:hover {
	background: var(--cb-ink) !important;
	opacity: 1 !important;
	color: #fff !important;
}

#CybotCookiebotDialogBodyButtonAccept::after,
#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll::after {
	content: '';
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.125) url('cookiebot-arrow.svg') center / 18px 18px no-repeat;
}

/* Inställningar / Anpassa: 3.0 chip, white with a line and a round ink arrow */
#CybotCookiebotDialogBodyLevelButtonCustomize {
	order: 2 !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 12px !important;
	min-height: 44px !important;
	padding: 5px 5px 5px 16px !important;
	border: 1px solid var(--cb-line) !important;
	border-radius: 999px !important;
	background: var(--cb-page) !important;
	color: var(--cb-ink) !important;
	font-weight: 400 !important;
	font-size: 14px !important;
}

#CybotCookiebotDialogBodyLevelButtonCustomize.CybotCookiebotDialogHide {
	display: none !important;
}

#CybotCookiebotDialogBodyLevelButtonCustomize .CybotCookiebotDialogArrow {
	display: none !important;
}

#CybotCookiebotDialogBodyLevelButtonCustomize::after {
	content: '';
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--cb-ink) url('cookiebot-arrow.svg') center / 18px 18px no-repeat;
}

/* Avvisa: 3.0 text link (.subnav style), last, to the right */
#CybotCookiebotDialog #CybotCookiebotDialogBodyButtonDecline {
	order: 4 !important;
	margin-left: auto !important;
	min-height: 44px !important;
	padding: 0 4px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: var(--cb-ink) !important;
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 6px !important;
	text-decoration-color: var(--cb-edge) !important;
}

/* The Cookiebot logo link in the footer area of the details is hidden with the rest of the branding */
a#CybotCookiebotDialogPoweredbyCybot,
div#CybotCookiebotDialogPoweredByText {
	display: none !important;
}

/* ===== 2. Settings, activated when the banner type is changed to Multilevel in the account ===== */
/* Four category rows: Nödvändig (always on), Inställningar, Statistik, Marknadsföring. */

#CybotCookiebotDialogBodyLevelWrapper:not(.CybotCookiebotDialogHide) {
	margin: 0 0 16px !important;
	padding: 0 !important;
	border: 0 !important;
}

#CybotCookiebotDialogBodyLevelWrapper,
#CybotCookiebotDialogBodyLevelButtons,
#CybotCookiebotDialogBodyLevelButtonsTable,
#CybotCookiebotDialogBodyLevelButtonsRow,
#CybotCookiebotDialogBodyLevelButtonsSelectPane,
#CybotCookiebotDialogBodyLevelButtonsSelectPane > div,
#CybotCookiebotDialogBodyFieldsetInnerContainer {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	padding: 0 !important;
	border: 0 !important;
}

#CybotCookiebotDialogBodyLevelWrapper #CybotCookiebotDialogBodyFieldsetInnerContainer {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonWrapper {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 16px !important;
	width: 100% !important;
	min-height: 60px !important;
	margin: 0 0 8px !important;
	padding: 10px 14px 10px 18px !important;
	border: 1px solid var(--cb-line-soft) !important;
	border-radius: 16px !important;
	background: var(--cb-warm) !important;
	box-sizing: border-box !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonLabel,
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonDescription {
	margin: 0 !important;
	padding: 0 !important;
	font: 500 16px/1.3 'Albert Sans', Arial, sans-serif !important;
	color: var(--cb-ink) !important;
	letter-spacing: normal !important;
}

/* The switch: a calm 3.0 toggle, line when off, filled ink when on. The knob is the ::before. */
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapper {
	position: relative;
	flex: none;
	width: 52px !important;
	height: 32px !important;
	margin: 0 !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSlider {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	border: 1px solid var(--cb-toggle-off) !important;
	border-radius: 999px !important;
	background: #fff !important;
	transition: background-color var(--cb-duration) ease, border-color var(--cb-duration) ease !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapper input[type='checkbox'] + .CybotCookiebotDialogBodyLevelButtonSlider::before {
	content: '' !important;
	position: absolute !important;
	top: 3px !important;
	left: 3px !important;
	display: block !important;
	width: 24px !important;
	height: 24px !important;
	border-radius: 50% !important;
	background: var(--cb-toggle-off) !important;
	box-shadow: none !important;
	transform: none !important;
	transition: translate var(--cb-duration) var(--cb-spring), background-color var(--cb-duration) ease !important;
}

#CybotCookiebotDialog input:checked + .CybotCookiebotDialogBodyLevelButtonSlider {
	background: var(--cb-ink) !important;
	border-color: var(--cb-ink) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapper input[type='checkbox']:checked + .CybotCookiebotDialogBodyLevelButtonSlider::before {
	background: #fff !important;
	translate: 20px 0;
}

/* Nödvändig is always on: the 3.0 tag "Alltid på" instead of a switch */
#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapperDisabled {
	width: auto !important;
	height: 28px !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapperDisabled .CybotCookiebotDialogBodyLevelButtonSlider {
	position: static !important;
	display: inline-flex !important;
	align-items: center;
	height: 28px !important;
	padding: 0 12px !important;
	border: 1px solid var(--cb-line) !important;
	background: var(--cb-page) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapper.CybotCookiebotDialogBodyLevelButtonSliderWrapperDisabled input[type='checkbox']:checked + .CybotCookiebotDialogBodyLevelButtonSlider::before {
	content: 'Alltid på' !important;
	position: static !important;
	translate: none;
	background: none !important;
	border-radius: 0 !important;
	display: block !important;
	width: auto !important;
	height: auto !important;
	white-space: nowrap;
	font: 400 12px 'Albert Sans', Arial, sans-serif;
	color: var(--cb-ink);
}

#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSliderWrapperDisabled input:checked + .CybotCookiebotDialogBodyLevelButtonSlider {
	background: var(--cb-page) !important;
	border-color: var(--cb-line) !important;
}

/* Tillåt urval: 3.0 secondary button, between Tillåt alla and Avvisa */
#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection {
	order: 3 !important;
	min-height: 54px !important;
	padding: 8px 24px !important;
	border: 1px solid var(--cb-line) !important;
	border-radius: 999px !important;
	background: var(--cb-page) !important;
	color: var(--cb-ink) !important;
}

#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection.CybotCookiebotDialogHide {
	display: none !important;
}

/* When the switches are visible the box is in settings mode: Tillåt alla is a plain button, no arrow, half width row */
#CybotCookiebotDialog:has(#CybotCookiebotDialogBodyLevelWrapper:not(.CybotCookiebotDialogHide)) #CybotCookiebotDialogBodyButtonAccept {
	flex: 0 0 auto !important;
	justify-content: center !important;
	padding: 8px 24px !important;
}

#CybotCookiebotDialog:has(#CybotCookiebotDialogBodyLevelWrapper:not(.CybotCookiebotDialogHide)) #CybotCookiebotDialogBodyButtonAccept::after {
	display: none;
}

/* ===== 2b. Multi Level in two steps (KANON B122, bygge-165) =====
   Cookiebot's Multi Level shows the four rows and "Spara mina val" at once and hides "Inställningar".
   The approved design shows Tillåt alla, Inställningar and Avvisa first; the rows come after a tap on
   Inställningar. js/cookiebot.js sets .p3-cb-settings on the box for that second step. */
#CybotCookiebotDialog.CybotMultilevel:not(.p3-cb-settings) #CybotCookiebotDialogBodyLevelWrapper,
#CybotCookiebotDialog.CybotMultilevel:not(.p3-cb-settings) #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowallSelection {
	display: none !important;
}

#CybotCookiebotDialog.CybotMultilevel:not(.p3-cb-settings) #CybotCookiebotDialogBodyLevelButtonCustomize {
	display: inline-flex !important;
}

#CybotCookiebotDialog.CybotMultilevel.p3-cb-settings #CybotCookiebotDialogBodyLevelButtonCustomize {
	display: none !important;
}

/* Visually hidden live region announcing step 2 to screen readers (created by js/cookiebot.js) */
#CybotCookiebotDialog .p3-cb-live {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Settings step: Tillåt alla is a plain dark button without the arrow, Tillåt urval beside it, Avvisa last */
#CybotCookiebotDialog.CybotMultilevel.p3-cb-settings #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll {
	flex: 0 0 auto !important;
	justify-content: center !important;
	min-height: 54px !important;
	padding: 8px 24px !important;
}

#CybotCookiebotDialog.CybotMultilevel.p3-cb-settings #CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll::after {
	display: none;
}

/* ===== 3. Second level (Information tab) when Inline Multilevel is chosen: category rows only ===== */
#CybotCookiebotDialogDetailBodyContentCookieContainerTypes {
	border-top: 1px solid var(--cb-line) !important;
}

#CybotCookiebotDialog .CybotCookiebotDialogDetailBodyContentCookieContainerButton {
	font: 500 16px 'Albert Sans', Arial, sans-serif !important;
	color: var(--cb-ink) !important;
}

@media (prefers-reduced-motion: reduce) {
	#CybotCookiebotDialog.CybotCookiebotDialogActive,
	html:has(#CybotCookiebotDialog.CybotCookiebotDialogActive)::after {
		animation: none;
	}

	#CybotCookiebotDialog .CybotCookiebotDialogBodyButton,
	#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSlider,
	#CybotCookiebotDialog .CybotCookiebotDialogBodyLevelButtonSlider::before {
		transition: none !important;
	}
}


/* ===== 4. The round Cookiebot button (#CookiebotWidget) and its panel "Cookieinställningar / Ditt val just nu" =====
   Cookiebot adds the round button (bottom left) once the box has been answered. Its panel (own elements, not
   #CybotCookiebotDialog) is Cookiebot's blue standard look and cannot be restyled to the box above without a second design.
   The same choice is reached from the footer link "Cookieinställningar" (js/cookiebot.js -> Cookiebot.renew()), which opens
   the box itself in the 3.0 look, so the button is switched off wherever that link stands (every page with the 3.0 footer,
   cart, checkout and the portal included). Where the link is missing (the plain fallback page) the button stays, as a way to
   change consent must always exist. No change in the Cookiebot account (KANON B122, Ali 2026-11-22). */
body:has(.p3-cookie-settings) #CookiebotWidget {
	display: none !important;
}

/* ===== Footer link "Cookieinställningar": a button that looks like a link. It stands in the footer's legal line since
   2026-11-20 and takes its size, colour and underline from there (in-topp.css .p3-in-legal). ===== */
.pvt-site .p3-cookie-settings {
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 15px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.pvt-site .p3-cookie-settings:hover {
	text-decoration: underline;
}

.pvt-site .p3-cookie-settings:active {
	opacity: 0.7;
}

.pvt-site .p3-cookie-settings:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (max-width: 700px) {
	.pvt-site .p3-cookie-settings::after {
		content: '';
		position: absolute;
		inset: -14px -10px;
	}
}
