/*
 * Cookie consent banner — AGO design reskin of the Complianz banner.
 * Figma: AGO Design → CookieConsent (desktop 1761:4585, mobile 1766:4593).
 *
 * Complianz (vendored) keeps the consent logic and DOM; this sheet only
 * restyles it: centered modal over Backdrop/background-dark, ink panel
 * (Gray/1000), Accept = tertiary filled (white), Decline = outlined —
 * deliberately equal weight (EDPB: rejecting as easy as accepting).
 * Selectors ride the #cmplz-cookiebanner-container id so they beat both
 * the plugin defaults and the generated banner-1-optin.css without
 * !important. Loaded site-wide (the banner shows on every surface);
 * fonts + tokens come from ago-tokens.css, also site-wide.
 */

/* Backdrop — visual only (pointer-events none: the page stays usable,
   there is no click-outside dismiss in Complianz). */
#cmplz-cookiebanner-container:has(.cmplz-cookiebanner.cmplz-show)::before {
	content: "";
	position: fixed;
	inset: 0;
	background: var(--backdrop-background-dark);
	pointer-events: none;
	z-index: 99998;
}

/* FOUC gate — the server-rendered banner briefly paints un-finalized
   (extra buttons, raw {title} links) before Complianz's JS settles it.
   Only show the panel once the JS has stamped .cmplz-show (also the
   backdrop's condition above). */
#cmplz-cookiebanner-container .cmplz-cookiebanner:not(.cmplz-show) {
	display: none;
}

/* Panel — centered modal, 1040 max, 16px side margins when clamped.
   Vertical centering via inset band + margin-block auto (not
   top:50%/translateY): the band floors at 88px (72px header + 16px)
   so a tall panel can never tuck its top under the sticky header —
   it centers when there's room and pins below the bar when not. */
#cmplz-cookiebanner-container .cmplz-cookiebanner {
	position: fixed;
	inset: auto;
	left: 50%;
	top: 88px;
	right: auto;
	bottom: 16px;
	transform: translateX(-50%);
	height: fit-content;
	margin-block: auto;
	width: min(1040px, calc(100vw - 32px));
	max-width: none;
	min-width: 0;
	margin-left: 0;
	margin-right: 0;
	max-height: calc(100dvh - 104px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--space-24);
	padding: var(--space-40);
	background: var(--gray-1000);
	border: 0;
	border-radius: var(--radius-15);
	box-shadow: none;
	z-index: 99999;
	font-family: var(--font-family-ui, 'Outfit', sans-serif);
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-divider,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-logo {
	display: none;
}

/* Header */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-header {
	display: flex;
	align-items: center;
	gap: var(--space-16);
	padding: 0;
	border: 0;
	min-height: 0;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
	display: block; /* generated css hides it ≤425px; design keeps it */
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	font-family: var(--font-family-display, 'Special Gothic Expanded One', sans-serif);
	font-weight: var(--font-weight-regular);
	font-size: var(--font-size-32);
	line-height: 1.1;
	letter-spacing: 0.025em;
	text-transform: uppercase;
	text-align: left;
	color: var(--gray-0);
	word-break: break-word;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close {
	position: static;
	flex: none;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-999);
	background: var(--icon-button-primary-background-enabled);
	color: var(--gray-0);
	cursor: pointer;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close:focus-visible {
	background: var(--icon-button-primary-background-hover);
	color: var(--gray-0);
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close svg {
	width: 14px;
	height: 14px;
}

/* Body copy */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-body {
	margin: 0;
	padding: 0;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message p {
	width: auto; /* generated banner css pins it to the old 526px banner width */
	margin: 0;
	font-family: var(--font-family-ui, 'Outfit', sans-serif);
	font-weight: var(--font-weight-regular);
	font-size: var(--font-size-16);
	line-height: 1.5;
	color: var(--gray-300);
}

/* "Tvarkyti parinktis" — the manage/preferences links row. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-information {
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--space-24);
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-information .cmplz-link {
	font-family: var(--font-family-ui, 'Outfit', sans-serif);
	font-weight: var(--font-weight-medium);
	font-size: var(--font-size-16);
	line-height: 1.5;
	color: var(--gray-0);
	text-decoration: underline;
	text-underline-position: from-font;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-information .cmplz-link:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-information .cmplz-link:focus-visible {
	color: var(--gray-300);
	text-decoration: underline;
}

/* Actions — Accept filled white, Decline outlined; equal weight.
   Grid, not flex: with flex-basis 0 the Decline's 2px borders add on
   top of its grown size (4px asymmetry); minmax(0,1fr) tracks split
   exactly 50/50. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-16);
	width: 100%;
	margin: 0;
	padding: 0;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
	min-width: 0;
	height: 60px;
	margin: 0;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-15);
	font-family: var(--font-family-ui, 'Outfit', sans-serif);
	font-weight: var(--font-weight-medium);
	font-size: var(--font-size-16);
	line-height: 1.5;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color 0.25s ease-out, color 0.25s ease-out, border-color 0.25s ease-out;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-accept,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences {
	background: var(--button-tertiary-background-enabled);
	border: 0;
	color: var(--text-primary);
	outline: none;
	box-shadow: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-accept:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-accept:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-accept:active,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences:active {
	background: var(--button-tertiary-background-hover);
	border: 0;
	color: var(--text-primary);
	outline: none;
	box-shadow: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-deny,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons a.cmplz-manage-options {
	background: transparent;
	border: 2px solid var(--gray-0);
	color: var(--gray-0);
	outline: none;
	box-shadow: none;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-deny:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-deny:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-deny:active,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences:focus,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences:active {
	background: transparent;
	border: 2px solid var(--gray-300);
	color: var(--gray-300);
	outline: none;
	box-shadow: none;
}

/* This banner runs Complianz's accept-deny mode: the preferences/save/tcf
   buttons never take part (the "Tvarkyti parinktis" link covers manage).
   Hidden explicitly at this specificity because the .cmplz-btn display:flex
   above would otherwise beat the plugin's own low-specificity hide rules.
   If categories mode is ever enabled, the plugin's JS toggles these via
   inline style.display, which still wins over this rule. */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons a.cmplz-manage-options {
	display: none;
}

/* Footer document links. Only the three design links stay: Slapukų
   politika (Complianz cookie-statement) + Pristatymas ir grąžinimas +
   Kontaktai (added via cmplz_after_documents in functions.php). */
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents {
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: var(--space-8) var(--space-24);
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents .cmplz-link {
	font-family: var(--font-family-ui, 'Outfit', sans-serif);
	font-weight: var(--font-weight-regular);
	font-size: var(--font-size-14);
	line-height: 1.5;
	color: var(--gray-300);
	text-decoration: underline;
	text-underline-position: from-font;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents .cmplz-link:hover,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents .cmplz-link:focus-visible {
	color: var(--gray-0);
	text-decoration: underline;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents .cmplz-link.privacy-statement,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents .cmplz-link.impressum {
	display: none;
}

/* ── Cookie policy page — per-service consent checkboxes ──
   Complianz's cookies-overview block (`[cmplz-cookies-overview]` on
   /slapuku-politika-es/) emits bare native checkboxes. Skinned as the
   AGO checkbox primitive, in lockstep with `.ap-pp__personalize__checkbox`
   (product-page-ago.css / account-auth.css): appearance:none 20px white
   square, radius 6, gray-200 border, checked = the shared SVG. States
   pinned per the brand-wash rule. */
/* Dropdown rows — rounded per the AGO card radius, and expand/collapse
   animates like the project accordion primitive (180ms ease-out drawer
   unroll + chevron in lockstep — see .ap-pp__details__item). <details>
   content animates via ::details-content + interpolate-size; browsers
   without support simply snap open (the previous behavior). */
#cmplz-cookies-overview details.cmplz-dropdown,
#cmplz-manage-consent-container details.cmplz-category {
	border-radius: var(--radius-15);
	overflow: hidden;
	interpolate-size: allow-keywords;
}

#cmplz-cookies-overview details.cmplz-dropdown::details-content,
#cmplz-manage-consent-container details.cmplz-category::details-content {
	block-size: 0;
	overflow-y: clip;
	transition: content-visibility 180ms allow-discrete, block-size 180ms ease-out;
}

#cmplz-cookies-overview details.cmplz-dropdown[open]::details-content,
#cmplz-manage-consent-container details.cmplz-category[open]::details-content {
	block-size: auto;
}

/* Chevron rotation in lockstep with the unroll (plugin default is 0.5s). */
#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div::after,
#cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-icon.cmplz-open {
	transition: transform 180ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
	#cmplz-cookies-overview details.cmplz-dropdown::details-content,
	#cmplz-manage-consent-container details.cmplz-category::details-content,
	#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div::after,
	#cmplz-manage-consent-container.cmplz-manage-consent-container .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-icon.cmplz-open {
		transition: none;
	}
}

/* Service rows — the plugin lays each summary out as its own grid with
   content-sized columns ("heading paragraph label checkbox chevron",
   2fr auto 0 auto 25px), so the checkbox/chevron columns land at a
   different x on every row. Replace with one flex row: name left,
   category pushed right, then checkbox, then chevron — identical
   geometry on every row. */
#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div {
	display: flex;
	align-items: center;
	gap: var(--space-12);
	width: 100%;
	min-width: 0;
}

#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div h3 {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div p {
	flex: 0 1 auto;
	margin: 0;
	text-align: right;
}

/* Screen-reader label — out of flow so it doesn't eat a flex gap slot,
   but kept rendered so the input keeps its accessible name. */
#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div .cmplz_consent_per_service_label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	margin: 0;
}

/* Chevron — the plugin's ::after got its size from the 25px grid track;
   as a flex item it needs explicit box + no shrink. */
#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div::after {
	flex: none;
	width: 20px;
	height: 20px;
	background-size: 20px 20px;
	background-position: center;
}

/* Always-active rows (plugin hides their input with visibility:hidden):
   visibility keeps the 20px slot, so checkbox + chevron stay aligned
   with every other row. Uncategorized services ("Įvairūs") instead get
   .cmplz-hidden — display:none !important via the plugin's inline
   <style> — which collapses the slot and lets that row's text run 32px
   wider than the rest. Convert it to the same visibility-hidden slot
   (!important required to beat the inline rule; the input stays
   non-interactive either way). */
#cmplz-cookies-overview .cmplz-dropdown summary.cmplz-service-header div input.cmplz-accept-service.cmplz-hidden {
	display: block !important;
	visibility: hidden;
}

/* The plugin sizes these two blocks content-box (width 50%/100% + 15px
   padding), so their painted box runs 30px past the row; the rounded
   details' overflow:hidden now clips that instead of overflowing the
   viewport — border-box keeps the padding inside the row. */
#cmplz-cookies-overview .cmplz-dropdown .cmplz-service-description,
#cmplz-cookies-overview .cmplz-dropdown .cmplz-sharing-data {
	box-sizing: border-box;
}

#cmplz-cookies-overview input.cmplz-accept-service,
.cmplz-manage-consent-container input.cmplz-consent-checkbox {
	appearance: none;
	-webkit-appearance: none;
	accent-color: initial;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin: 0;
	border: 1px solid var(--gray-200);
	border-radius: var(--radius-4);
	background: var(--gray-0);
	cursor: pointer;
}

#cmplz-cookies-overview input.cmplz-accept-service:not(:checked):hover,
#cmplz-cookies-overview input.cmplz-accept-service:not(:checked):focus,
#cmplz-cookies-overview input.cmplz-accept-service:not(:checked):focus-visible,
#cmplz-cookies-overview input.cmplz-accept-service:not(:checked):active,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:not(:checked):hover,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:not(:checked):focus,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:not(:checked):focus-visible,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:not(:checked):active {
	background: var(--gray-0);
	border-color: var(--gray-200);
	outline: none;
	box-shadow: none;
}

#cmplz-cookies-overview input.cmplz-accept-service:checked,
#cmplz-cookies-overview input.cmplz-accept-service:checked:hover,
#cmplz-cookies-overview input.cmplz-accept-service:checked:focus,
#cmplz-cookies-overview input.cmplz-accept-service:checked:focus-visible,
#cmplz-cookies-overview input.cmplz-accept-service:checked:active,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:checked,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:checked:hover,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:checked:focus,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:checked:focus-visible,
.cmplz-manage-consent-container input.cmplz-consent-checkbox:checked:active {
	background-color: transparent;
	background-image: url('../img/sandbox/checkbox-checked.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px 20px;
	border-color: transparent;
	outline: none;
	box-shadow: none;
}

/* Mobile (design frame: 358 panel on a 390 viewport) */
@media (max-width: 600px) {
	#cmplz-cookiebanner-container .cmplz-cookiebanner {
		padding: var(--space-24);
		/* Mobile header is 60px — the no-tuck band floors at 76px. */
		top: 76px;
		max-height: calc(100dvh - 92px);
	}

	#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-title {
		font-size: 27px;
	}

	#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message,
	#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message p {
		font-size: var(--font-size-14);
	}

	#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-buttons {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-12);
	}

	#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-links.cmplz-documents {
		gap: var(--space-8) var(--space-12);
	}
}
