/* ATER Cookie Consent — self-hosted, brand-matched (Avada monochrome).
   Tokens come from the inline #ater-cc-vars block (per-site overridable). */

:root {
	--ater-cc-bg: #fff;
	--ater-cc-surface: #f5f5f5;
	--ater-cc-text: #333;
	--ater-cc-heading: #050505;
	--ater-cc-accent: #050505;
	--ater-cc-accent-text: #fff;
	--ater-cc-border: #333;
	--ater-cc-overlay: rgba(5, 5, 5, 0.45);
	--ater-cc-radius: 8px;
	--ater-cc-btn-transform: uppercase;
}

.ater-cc-root[hidden] {
	display: none;
}

.ater-cc-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99990;
	background: var(--ater-cc-overlay);
	backdrop-filter: blur(4px);
}

.ater-cc-dialog {
	position: fixed;
	z-index: 99991;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	width: calc(100% - 32px);
	max-width: 720px;
	box-sizing: border-box;
	padding: 24px;
	background: var(--ater-cc-bg);
	color: var(--ater-cc-text);
	border: 1px solid var(--ater-cc-border);
	border-radius: var(--ater-cc-radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
	font-size: 14px;
	line-height: 1.5;
	max-height: 85vh;
	overflow-y: auto;
}

.ater-cc-pos-bottom-bar .ater-cc-dialog {
	left: 0;
	right: 0;
	bottom: 0;
	transform: none;
	width: 100%;
	max-width: none;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
}

.ater-cc-title {
	margin: 0 0 8px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--ater-cc-heading);
}

.ater-cc-desc {
	margin: 0 0 8px;
	color: var(--ater-cc-text);
}

.ater-cc-learn {
	margin: 0 0 20px;
}

.ater-cc-learn a {
	color: var(--ater-cc-heading);
	text-decoration: underline;
}

/* Buttons — all equal prominence (Garante anti-dark-pattern). */
.ater-cc-actions {
	display: flex;
	gap: 12px;
}

.ater-cc-btn {
	flex: 1;
	min-height: 44px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: var(--ater-cc-btn-transform);
	cursor: pointer;
	border: 1px solid var(--ater-cc-accent);
	border-radius: var(--ater-cc-radius);
	background: var(--ater-cc-accent);
	color: var(--ater-cc-accent-text);
	transition: background 0.15s, color 0.15s;
}

.ater-cc-btn:hover {
	background: #000;
	border-color: #000;
}

/* Outline variant — only ever used for the optional "Personalizza/Back". */
.ater-cc-btn--alt {
	background: var(--ater-cc-bg);
	color: var(--ater-cc-heading);
}

.ater-cc-btn--alt:hover {
	background: var(--ater-cc-surface);
	color: var(--ater-cc-heading);
}

.ater-cc-btn:focus-visible,
.ater-cc-switch:focus-visible,
.ater-cc-learn a:focus-visible,
.ater-cc-fab:focus-visible {
	outline: 2px solid var(--ater-cc-accent);
	outline-offset: 2px;
}

/* Preferences categories. */
.ater-cc-cats {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 8px 0 20px;
}

.ater-cc-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	background: var(--ater-cc-surface);
	border: 1px solid #ddd;
	border-radius: var(--ater-cc-radius);
}

.ater-cc-cat-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ater-cc-heading);
}

.ater-cc-cat-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--ater-cc-text);
}

.ater-cc-badge {
	display: inline-block;
	padding: 2px 10px;
	font-size: 12px;
	text-transform: var(--ater-cc-btn-transform);
	background: var(--ater-cc-accent);
	color: var(--ater-cc-accent-text);
	border-radius: var(--ater-cc-radius);
	white-space: nowrap;
}

/* Accessible switch (role=switch button) — state by color AND position. */
.ater-cc-switch {
	flex: none;
	width: 44px;
	height: 24px;
	min-width: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.ater-cc-switch-track {
	display: block;
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: var(--ater-cc-bg);
	border: 2px solid var(--ater-cc-border);
	box-sizing: border-box;
	position: relative;
	transition: background 0.15s;
}

.ater-cc-switch-knob {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--ater-cc-border);
	transition: transform 0.15s, background 0.15s;
}

.ater-cc-switch[aria-checked="true"] .ater-cc-switch-track {
	background: var(--ater-cc-accent);
	border-color: var(--ater-cc-accent);
}

.ater-cc-switch[aria-checked="true"] .ater-cc-switch-knob {
	transform: translateX(20px);
	background: var(--ater-cc-accent-text);
}

/* Floating reopen button. */
.ater-cc-fab {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99980;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--ater-cc-radius);
	background: var(--ater-cc-accent);
	color: var(--ater-cc-accent-text);
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ater-cc-fab[hidden] {
	display: none;
}

/* Inline trigger (shortcode / reopen link) — brand button, like .ater-cc-btn. */
.ater-cc-trigger {
	display: inline-block;
	min-height: 44px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: var(--ater-cc-btn-transform, uppercase);
	cursor: pointer;
	border: 1px solid var(--ater-cc-accent, #050505);
	border-radius: var(--ater-cc-radius, 8px);
	background: var(--ater-cc-accent, #050505);
	color: var(--ater-cc-accent-text, #fff);
}

.ater-cc-trigger:hover {
	background: #000;
	border-color: #000;
	color: var(--ater-cc-accent-text, #fff);
}

/* Visually-hidden aria-live region for save confirmation. */
.ater-cc-status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Blocked third-party embed (iframe) — click-to-load placeholder. */
.ater-cc-embed {
	position: relative;
	display: block;
}

.ater-cc-embed:not(.ater-cc-embed--loaded) {
	min-height: 220px;
	background: var(--ater-cc-surface);
	border: 1px dashed var(--ater-cc-border);
	border-radius: var(--ater-cc-radius);
}

/* Keep the inert iframe from painting its default 300x150 box behind the
   placeholder before the visitor loads it. */
.ater-cc-embed:not(.ater-cc-embed--loaded) > iframe {
	visibility: hidden;
}

.ater-cc-embed > iframe {
	max-width: 100%;
}

.ater-cc-embed-ph {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	box-sizing: border-box;
	padding: 20px;
	text-align: center;
	font-size: 14px;
	line-height: 1.45;
	color: var(--ater-cc-text);
}

.ater-cc-embed--loaded > .ater-cc-embed-ph {
	display: none;
}

.ater-cc-embed-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.ater-cc-embed-btn {
	min-height: 40px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: var(--ater-cc-btn-transform);
	cursor: pointer;
	border: 1px solid var(--ater-cc-accent);
	border-radius: var(--ater-cc-radius);
	background: var(--ater-cc-accent);
	color: var(--ater-cc-accent-text);
}

.ater-cc-embed-btn--alt {
	background: var(--ater-cc-bg);
	color: var(--ater-cc-heading);
}

.ater-cc-embed-btn:focus-visible {
	outline: 2px solid var(--ater-cc-accent);
	outline-offset: 2px;
}

/* Cookie-policy table. */
.ater-cc-policy-table-wrap {
	overflow-x: auto;
	margin-bottom: 24px;
}

.ater-cc-policy-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ater-cc-policy-table th,
.ater-cc-policy-table td {
	border: 1px solid #ddd;
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
}

.ater-cc-policy-table th {
	background: var(--ater-cc-surface);
	color: var(--ater-cc-heading);
	font-weight: 600;
}

@media (max-width: 640px) {
	.ater-cc-actions {
		flex-direction: column;
		gap: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ater-cc-backdrop {
		backdrop-filter: none;
	}
	.ater-cc-btn,
	.ater-cc-switch-track,
	.ater-cc-switch-knob {
		transition: none;
	}
}
