/* Nexta Cookie Consent - front end styles. Colours come from CSS variables set in the settings. */

:root {
	--nxcc-bg: #fff;
	--nxcc-text: #1d2327;
	--nxcc-primary: #1e3a8a;
	--nxcc-primary-text: #fff;
	--nxcc-radius: 6px;
}

.nxcc-root {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

.nxcc-root [hidden],
.nxcc-root[hidden] {
	display: none !important;
}

.nxcc-root *,
.nxcc-root *::before,
.nxcc-root *::after {
	box-sizing: border-box;
}

.nxcc-banner,
.nxcc-modal__dialog {
	background: var(--nxcc-bg);
	color: var(--nxcc-text);
}

.nxcc-banner {
	position: fixed;
	z-index: 2147483000;
	display: flex;
	gap: 16px 24px;
	align-items: flex-end;
	padding: 20px 56px 20px 24px;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

.nxcc-layout-bar {
	left: 0;
	right: 0;
	bottom: 0;
}

.nxcc-layout-box-left,
.nxcc-layout-box-right {
	bottom: 16px;
	max-width: 440px;
	flex-direction: column;
	align-items: stretch;
	border-radius: calc(var(--nxcc-radius) * 1.5);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.nxcc-layout-box-left {
	left: 16px;
}

.nxcc-layout-box-right {
	right: 16px;
}

.nxcc-banner__content {
	flex: 1 1 auto;
	min-width: 0;
}

.nxcc-title {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.nxcc-text p {
	margin: 0 0 8px;
}

.nxcc-text a,
.nxcc-links a,
.nxcc-placeholder a {
	color: inherit;
	text-decoration: underline;
}

.nxcc-links {
	margin: 0;
	font-size: 0.93em;
}

.nxcc-actions,
.nxcc-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 0 0 auto;
}

.nxcc-layout-box-left .nxcc-actions,
.nxcc-layout-box-right .nxcc-actions {
	justify-content: flex-end;
}

/* Accept and reject share the same style: equal prominence as required by the Garante. */
.nxcc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var(--nxcc-primary);
	border-radius: var(--nxcc-radius);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.nxcc-btn--primary {
	background: var(--nxcc-primary);
	color: var(--nxcc-primary-text);
}

.nxcc-btn--secondary {
	background: transparent;
	color: var(--nxcc-text);
}

.nxcc-btn:hover {
	filter: brightness(1.1);
}

.nxcc-btn:focus-visible,
.nxcc-close:focus-visible,
.nxcc-revisit:focus-visible,
.nxcc-switch input:focus-visible + .nxcc-switch__track,
.nxcc-details summary:focus-visible,
.nxcc-modal__dialog:focus-visible {
	outline: 3px solid var(--nxcc-primary);
	outline-offset: 2px;
}

.nxcc-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nxcc-text);
	cursor: pointer;
}

.nxcc-close:hover {
	background: rgba(127, 127, 127, 0.15);
}

.nxcc-close--static {
	position: static;
	flex: 0 0 auto;
}

/* Preferences dialog */
.nxcc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.nxcc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.nxcc-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	border-radius: calc(var(--nxcc-radius) * 1.5);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
	outline: none;
}

.nxcc-modal__header,
.nxcc-modal__footer {
	padding: 16px 24px;
}

.nxcc-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}

.nxcc-modal__header .nxcc-title {
	margin: 0;
}

.nxcc-modal__body {
	padding: 16px 24px;
	overflow-y: auto;
}

.nxcc-modal__footer {
	justify-content: flex-end;
	border-top: 1px solid rgba(127, 127, 127, 0.25);
}

html.nxcc-modal-open {
	overflow: hidden;
}

.nxcc-categories {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.nxcc-category {
	margin: 0 0 12px;
	padding: 14px 16px;
	border: 1px solid rgba(127, 127, 127, 0.3);
	border-radius: var(--nxcc-radius);
}

.nxcc-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.nxcc-category__label {
	font-weight: 700;
}

.nxcc-category__desc {
	margin-top: 6px;
	font-size: 0.93em;
}

.nxcc-badge {
	font-size: 0.85em;
	font-weight: 600;
	white-space: nowrap;
}

.nxcc-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}

.nxcc-switch input {
	position: absolute;
	width: 44px;
	height: 24px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.nxcc-switch input:disabled {
	cursor: not-allowed;
}

.nxcc-switch__track {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: #8c8f94;
	transition: background 0.15s ease;
}

.nxcc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s ease;
}

.nxcc-switch input:checked + .nxcc-switch__track {
	background: var(--nxcc-primary);
}

.nxcc-switch input:checked + .nxcc-switch__track::after {
	transform: translateX(20px);
}

.nxcc-switch input:disabled + .nxcc-switch__track {
	opacity: 0.6;
}

.nxcc-details {
	margin-top: 8px;
	font-size: 0.9em;
}

.nxcc-details summary {
	cursor: pointer;
	font-weight: 600;
}

.nxcc-table-wrap {
	overflow-x: auto;
	margin-top: 8px;
}

.nxcc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.93em;
}

.nxcc-table th,
.nxcc-table td {
	padding: 6px 8px;
	border-bottom: 1px solid rgba(127, 127, 127, 0.25);
	text-align: left;
	vertical-align: top;
}

.nxcc-consent-meta {
	margin: 12px 0 0;
	font-size: 0.85em;
	opacity: 0.85;
	word-break: break-word;
}

/* Floating button to change consent at any time */
.nxcc-revisit {
	position: fixed;
	bottom: 16px;
	z-index: 2147482999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nxcc-primary);
	color: var(--nxcc-primary-text);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.nxcc-revisit--left {
	left: 16px;
}

.nxcc-revisit--right {
	right: 16px;
}

/* Placeholder for blocked embeds (also used outside .nxcc-root) */
.nxcc-placeholder {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	padding: 24px;
	border-radius: var(--nxcc-radius, 6px);
	background: #f0f0f1;
	color: #1d2327;
	text-align: center;
}

.nxcc-placeholder p {
	margin: 0;
}

.nxcc-placeholder .nxcc-btn {
	font-size: 15px;
}

.nxcc-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

@media (max-width: 782px) {
	.nxcc-root {
		font-size: 14px;
	}

	.nxcc-banner {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 16px;
		max-height: 85vh;
	}

	.nxcc-banner__content {
		overflow-y: auto;
		min-height: 0;
	}

	/* Accept and reject side by side, always visible without scrolling. */
	.nxcc-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.nxcc-actions [data-nxcc-action="customize"] {
		grid-column: 1 / -1;
		order: 2;
	}

	.nxcc-layout-box-left,
	.nxcc-layout-box-right {
		left: 8px;
		right: 8px;
		bottom: 8px;
		max-width: none;
	}

	.nxcc-banner__content {
		padding-right: 32px;
	}

	.nxcc-btn {
		padding: 10px 12px;
	}

	.nxcc-modal__footer .nxcc-btn {
		flex: 1 1 100%;
	}

	.nxcc-modal {
		padding: 0;
		align-items: flex-end;
	}

	.nxcc-modal__dialog {
		max-height: 92vh;
		border-radius: calc(var(--nxcc-radius) * 1.5) calc(var(--nxcc-radius) * 1.5) 0 0;
	}

	.nxcc-modal__header,
	.nxcc-modal__body,
	.nxcc-modal__footer {
		padding-left: 16px;
		padding-right: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nxcc-root * {
		transition: none !important;
	}
}
