/**
 * Cookie banner (Complianz) in the theme's look. Only the look:
 * the texts, categories and choices stay Complianz's (legal content, unchanged).
 * Complianz reads its colours and sizes from CSS variables; set on the banner they win
 * over its own :root values, so its stylesheet needs few overrides.
 */

.cmplz-cookiebanner,
#cmplz-manage-consent {
	--cmplz_banner_width: 440px;
	--cmplz_banner_background_color: var(--color-background);
	--cmplz_banner_border_color: var(--color-kraft-line);
	--cmplz_banner_border_width: 1px;
	--cmplz_banner_border_radius: var(--radius-xl);
	--cmplz_banner_margin: 16px;
	--cmplz_title_font_size: var(--text-headline);
	--cmplz_text_color: var(--color-text-secondary);
	--cmplz_text_font_size: var(--text-footnote);
	--cmplz_text_line_height: 1.6;
	--cmplz_hyperlink_color: var(--color-on-button-tinted);
	--cmplz_link_font_size: var(--text-footnote);
	--cmplz_category_body_font_size: var(--text-footnote);
	--cmplz_category_header_title_font_size: var(--text-subheadline);
	--cmplz_category_header_active_font_size: var(--text-caption);
	--cmplz_category_header_always_active_color: var(--color-on-status-success);
	--cmplz_button_accept_background_color: var(--color-button-primary);
	--cmplz_button_accept_border_color: var(--color-button-primary);
	--cmplz_button_accept_text_color: var(--color-on-button-primary);
	--cmplz_button_deny_background_color: var(--color-button-tinted);
	--cmplz_button_deny_border_color: transparent;
	--cmplz_button_deny_text_color: var(--color-on-button-tinted);
	--cmplz_button_settings_background_color: var(--color-button-tinted);
	--cmplz_button_settings_border_color: transparent;
	--cmplz_button_settings_text_color: var(--color-on-button-tinted);
	--cmplz_button_border_radius: var(--radius-md);
	--cmplz_button_font_size: var(--text-subheadline);
	--cmplz_slider_active_color: var(--color-button-primary);
	--cmplz_slider_inactive_color: var(--color-separator);
	--cmplz_slider_bullet_color: #fff;
}

/* ---------- The banner ---------- */

body .cmplz-cookiebanner {
	gap: var(--space-sm);
	padding: var(--space-lg);
	font-family: var(--font-family);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 16px 48px rgba(0, 0, 0, 0.14);
}

/* Title row: the theme's cookie icon in a tinted circle, the title, the close button. */
body .cmplz-cookiebanner .cmplz-header {
	gap: var(--space-sm);
}

body .cmplz-cookiebanner .cmplz-logo {
	display: none;
}

body .cmplz-cookiebanner .cmplz-title {
	justify-self: start;
	grid-column: 1 / 3;
	color: var(--color-text-primary);
	font-weight: var(--font-weight-bold);
}

body .cmplz-cookiebanner .cmplz-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--radius-full);
	background: var(--color-background-secondary);
	color: var(--color-text-secondary);
	transition: background var(--transition-fast), color var(--transition-fast);
}

body .cmplz-cookiebanner .cmplz-close svg {
	width: 14px;
	height: 14px;
}

body .cmplz-cookiebanner .cmplz-close:hover {
	background: var(--color-button-tinted);
	color: var(--color-on-button-tinted);
}

body .cmplz-cookiebanner .cmplz-divider {
	display: none;
}

body .cmplz-cookiebanner .cmplz-message {
	margin: 0;
}

/* ---------- Categories (after "Prikaži podešavanja") ---------- */

body .cmplz-cookiebanner .cmplz-categories .cmplz-category {
	border: 1px solid var(--color-kraft-line);
	border-radius: var(--radius-md);
	background: var(--color-background);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header {
	padding: var(--space-sm) var(--space-md);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-title {
	color: var(--color-text-primary);
	font-weight: var(--font-weight-semibold);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-description {
	padding: 0 var(--space-md) var(--space-sm);
	color: var(--color-text-secondary);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-icon svg {
	width: 14px;
	height: 14px;
	fill: var(--color-text-tertiary);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-always-active {
	font-weight: var(--font-weight-semibold);
}

/* ---------- Buttons: the theme's buttons (accept red, the others tinted) ---------- */

/* "Prihvati" and "Odbij" side by side, the same width; the settings button below them. */
body .cmplz-cookiebanner .cmplz-buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-sm);
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences,
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences,
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-manage-options {
	grid-column: 1 / -1;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
	height: auto;
	min-height: var(--size-button-small);
	margin: 0;
	padding: 0 var(--space-md);
	font-family: var(--font-family);
	font-weight: var(--font-weight-semibold);
	white-space: nowrap;
	transition: background var(--transition-fast), color var(--transition-fast);
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:hover {
	border-color: var(--color-button-primary-pressed);
	background: var(--color-button-primary-pressed);
	text-decoration: none;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn:not(.cmplz-accept):hover {
	background: var(--color-button-tinted-pressed);
	color: var(--color-on-button-tinted-pressed);
	text-decoration: none;
}

/* Links under the buttons: quiet, centred, separated by a dot. */
body .cmplz-cookiebanner .cmplz-documents ul {
	gap: var(--space-xs) var(--space-md);
}

body .cmplz-cookiebanner .cmplz-links .cmplz-link {
	color: var(--color-text-secondary);
	font-weight: var(--font-weight-medium, 500);
	text-decoration: underline;
	text-decoration-color: var(--color-separator);
	text-underline-offset: 3px;
}

body .cmplz-cookiebanner .cmplz-links .cmplz-link:hover {
	color: var(--color-on-button-tinted);
	text-decoration-color: currentColor;
}

/* Keyboard focus as elsewhere in the theme. */
body .cmplz-cookiebanner .cmplz-btn:focus-visible,
body .cmplz-cookiebanner .cmplz-close:focus-visible,
body .cmplz-cookiebanner .cmplz-link:focus-visible,
body .cmplz-cookiebanner .cmplz-category-toggle:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

/* Phones: a sheet along the bottom edge, taller buttons. */
@media (max-width: 767px) {
	body .cmplz-cookiebanner {
		--cmplz_banner_margin: 0;
		border-width: 1px 0 0;
		border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	}

	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
		width: 100%;
		min-height: var(--size-button);
	}

	/* Complianz hides the title on small phones; the theme keeps it (left, next to the close). */
	body .cmplz-cookiebanner .cmplz-header {
		grid-template-columns: 1fr auto;
	}

	body .cmplz-cookiebanner .cmplz-header .cmplz-title {
		display: block;
		grid-column: 1;
	}

	body .cmplz-cookiebanner .cmplz-close {
		grid-column: 2;
	}
}

/* ---------- "Upravljajte saglasnostima" tab after a choice ---------- */

#cmplz-manage-consent .cmplz-manage-consent {
	border: 1px solid var(--color-kraft-line);
	border-bottom: 0;
	border-radius: var(--radius-md) var(--radius-md) 0 0;
	background: var(--color-background);
	color: var(--color-text-secondary);
	font-family: var(--font-family);
	font-size: var(--text-caption);
	font-weight: var(--font-weight-semibold);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

#cmplz-manage-consent .cmplz-manage-consent:hover {
	color: var(--color-on-button-tinted);
}
