/*
 * Third-party plugins own their scripts, markup and interaction state.
 * Keep this file limited to stable visual exceptions owned by the theme.
 */

:root {
	--ns-corner-widget-size: 48px;
	--ns-corner-widget-gap: 10px;
	--ns-corner-widget-bottom: max(20px, env(safe-area-inset-bottom));
	--ns-corner-widget-left: max(20px, env(safe-area-inset-left));
}

/* Cookiebot branding is replaced by the theme-owned privacy trigger. */
html body #CookiebotWidget,
html body #CookiebotWidgetUnderlay,
html body #CybotCookiebotDialogPoweredbyCybot,
html body #CybotCookiebotDialogPoweredByText,
html body #CookiebotWidget .CookiebotWidget-body .CookiebotWidget-main-logo {
	display: none !important;
}

/* Keep the custom trigger in the same corner stack used by netsons-com. */
html body .netsons-cookie-preferences {
	position: fixed;
	z-index: 2147483000;
	bottom: var(--ns-corner-widget-bottom);
	left: var(--ns-corner-widget-left);
	isolation: isolate;
	pointer-events: none;
}

html body .netsons-cookie-preferences-control {
	position: relative;
	pointer-events: auto;
}

html body .netsons-cookie-preferences .netsons-corner-widget {
	display: grid;
	box-sizing: border-box;
	width: var(--ns-corner-widget-size);
	height: var(--ns-corner-widget-size);
	place-items: center;
	padding: 0;
	border: 1px solid #d4e0eb;
	border-radius: 14px;
	background: #fff;
	color: #1769e0;
	box-shadow:
		0 10px 26px rgb(14 49 82 / 0.18),
		0 2px 7px rgb(14 49 82 / 0.09);
	cursor: pointer;
	transition:
		transform 180ms ease,
		box-shadow 180ms ease,
		background-color 180ms ease,
		color 180ms ease;
}

html body .netsons-cookie-preferences .netsons-corner-widget:hover {
	transform: translateY(-2px);
	box-shadow:
		0 13px 30px rgb(14 49 82 / 0.22),
		0 3px 9px rgb(14 49 82 / 0.1);
}

html body .netsons-cookie-preferences .netsons-corner-widget:focus-visible {
	outline: 3px solid #73b7ff;
	outline-offset: 3px;
}

html body .netsons-cookie-preferences .netsons-corner-widget[aria-busy="true"] {
	cursor: wait;
	opacity: 0.72;
}

html body .netsons-cookie-preferences .netsons-corner-widget[data-open="true"] {
	border-color: #1769e0;
	background: #eaf3ff;
}

html body .netsons-cookie-preferences .netsons-corner-widget svg {
	width: 23px;
	height: 23px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

html body .netsons-cookie-preferences .netsons-corner-widget-status {
	position: absolute;
	bottom: 0;
	left: calc(var(--ns-corner-widget-size) + var(--ns-corner-widget-gap));
	z-index: 1;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: min(280px, calc(100vw - 90px));
	padding: 11px 12px;
	border: 1px solid #d4e0eb;
	border-radius: 12px;
	background: #fff;
	color: #142e47;
	box-shadow:
		0 10px 26px rgb(14 49 82 / 0.18),
		0 2px 7px rgb(14 49 82 / 0.09);
	font-size: 13px;
	line-height: 1.35;
}

html body .netsons-cookie-preferences .netsons-corner-widget-status[hidden] {
	display: none;
}

html body .netsons-cookie-preferences .netsons-corner-widget-status-close {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin: -2px -3px 0 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: currentColor;
	cursor: pointer;
	font-size: 20px;
	line-height: 20px;
}

html body .netsons-cookie-preferences .netsons-corner-widget-status-close:hover {
	background: #eaf3ff;
}

html body .netsons-cookie-preferences .netsons-corner-widget-status-close:focus-visible {
	outline: 2px solid #1769e0;
	outline-offset: 2px;
}

/*
 * UserWay owns the launcher behavior. Replace only its decorative default
 * accessibility image; the official plugin still owns the button and label.
 */
html body .uwy {
	top: auto !important;
	right: auto !important;
	bottom: var(--ns-corner-widget-bottom) !important;
	left: var(--ns-corner-widget-left) !important;
	z-index: 2147483000 !important;
}

html body .uwy .userway_buttons_wrapper {
	top: auto !important;
	right: auto !important;
	bottom: var(--ns-corner-widget-bottom) !important;
	left: var(--ns-corner-widget-left) !important;
	display: flex !important;
	gap: 10px;
	pointer-events: none;
	transform: none !important;
}

html body .uwy .userway_buttons_wrapper :is(.uai, .ulsti) {
	pointer-events: auto;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon {
	position: relative !important;
	display: flex !important;
	box-sizing: border-box !important;
	width: var(--ns-corner-widget-size) !important;
	height: var(--ns-corner-widget-size) !important;
	border: 1px solid #1769e0 !important;
	border-radius: 14px !important;
	background: transparent !important;
	color: #fff !important;
	box-shadow:
		0 10px 26px rgb(14 49 82 / 0.18),
		0 2px 7px rgb(14 49 82 / 0.09) !important;
	transition:
		transform 180ms ease,
		box-shadow 180ms ease !important;
}

/* The custom Cookiebot control occupies the bottom slot; UserWay sits above it. */
html body.netsons-cookiebot-enabled .uwy,
html body.netsons-cookiebot-enabled .uwy .userway_buttons_wrapper {
	bottom: calc(
		var(--ns-corner-widget-bottom) +
		var(--ns-corner-widget-size) +
		var(--ns-corner-widget-gap)
	) !important;
}

/* UserWay sets an inline !important background; this visual layer keeps the
 * launcher on the Netsons blue without taking ownership of its interaction. */
html body .uwy:not(.uac) #userwayAccessibilityIcon::after {
	position: absolute;
	z-index: 0;
	inset: 0;
	border-radius: 13px;
	background: #1769e0;
	content: "";
	pointer-events: none;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon .uiiw {
	position: relative;
	z-index: 1;
	display: grid !important;
	width: 100%;
	height: 100%;
	place-items: center;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon .uiiw > img.ui_w,
html body .uwy:not(.uac) #userwayAccessibilityIcon .uiiw > img.ui_b {
	display: none !important;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon .uiiw::before {
	display: block;
	width: 24px;
	height: 24px;
	content: "";
	background: #fff;
	-webkit-mask: url("../images/accessibility-person.svg") center / contain no-repeat;
	mask: url("../images/accessibility-person.svg") center / contain no-repeat;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon:hover {
	transform: translateY(-2px) !important;
	box-shadow:
		0 13px 30px rgb(14 49 82 / 0.22),
		0 3px 9px rgb(14 49 82 / 0.1) !important;
}

html body .uwy:not(.uac) #userwayAccessibilityIcon:focus-visible {
	outline: 3px solid #73b7ff !important;
	outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
	html body .netsons-cookie-preferences .netsons-corner-widget {
		transition: none;
	}

	html body .netsons-cookie-preferences .netsons-corner-widget:hover {
		transform: none;
	}

	html body .uwy:not(.uac) #userwayAccessibilityIcon {
		transition: none !important;
	}

	html body .uwy:not(.uac) #userwayAccessibilityIcon:hover {
		transform: none !important;
	}
}

@media (max-width: 560px) {
	html body .netsons-cookie-preferences .netsons-corner-widget-status {
		bottom: calc(var(--ns-corner-widget-size) + var(--ns-corner-widget-gap));
		left: 0;
		width: min(280px, calc(100vw - 40px));
	}
}
