/* Cookie consent — bottom bar + manage panel */

.cookie-consent {
	position: relative;
	z-index: 10050;
	font-family: "Gilroy", sans-serif;
}

.cookie-consent[hidden],
.cookie-consent [hidden] {
	display: none !important;
}

.cookie-consent__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(63, 58, 100, 0.45);
	backdrop-filter: blur(2px);
}

.cookie-consent__bar {
	position: fixed;
	right: clamp(16px, 3vw, 32px);
	bottom: clamp(16px, 3vw, 32px);
	left: clamp(16px, 3vw, 32px);
	z-index: 10051;
	pointer-events: none;
}

.cookie-consent__bar-inner {
	pointer-events: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	max-width: 920px;
	margin-inline: auto;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid rgba(63, 58, 100, 0.08);
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(34, 34, 34, 0.14);
	animation: cookie-consent-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cookie-consent__copy {
	flex: 1 1 280px;
	min-width: 0;
}

.cookie-consent__title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	color: #3f3a64;
}

.cookie-consent__bar .cookie-consent__title {
	margin: 0 0 2px;
	font-size: 17px;
}

.cookie-consent__text {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: #696969;
}

.cookie-consent__bar .cookie-consent__text {
	font-size: 14px;
	line-height: 1.45;
}

.cookie-consent__text a {
	color: #20ad96;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cookie-consent__text a:hover,
.cookie-consent__text a:focus-visible {
	color: #3f3a64;
}

.cookie-consent__withdraw-note {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(32, 173, 150, 0.08);
	color: #3f3a64;
}

.cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	flex: 0 1 auto;
}

.cookie-consent .cookie-consent__btn {
	height: 44px;
	line-height: 42px;
	padding: 0 22px;
	font-size: 15px;
}

.cookie-consent__bar .cookie-consent__btn {
	height: 40px;
	line-height: 38px;
	padding: 0 18px;
}

/* "Küpsiste haldamine" as a quiet text link. */
.cookie-consent .cookie-consent__btn--link {
	padding: 0 8px;
	border-color: transparent;
	background: transparent;
	color: #6f6a63;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cookie-consent .cookie-consent__btn--link:hover,
.cookie-consent .cookie-consent__btn--link:focus-visible {
	color: #3f3a64;
}

.cookie-consent__btn:focus-visible,
.cookie-consent__close:focus-visible,
.cookie-consent__category-summary:focus-visible {
	outline: 2px solid #20ad96;
	outline-offset: 2px;
}

.cookie-consent__panel {
	position: fixed;
	inset: 0;
	z-index: 10052;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
	pointer-events: none;
}

@media (min-width: 768px) {
	.cookie-consent__panel {
		align-items: center;
	}
}

.cookie-consent__panel-inner {
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	width: min(100%, 720px);
	max-height: min(88vh, 820px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(34, 34, 34, 0.18);
	animation: cookie-consent-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
	overflow: hidden;
}

.cookie-consent__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 8px;
	flex-shrink: 0;
}

.cookie-consent__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f5f5f5;
	color: #3f3a64;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cookie-consent__close:hover,
.cookie-consent__close:focus-visible {
	background: #ebebeb;
	color: #20ad96;
}

.cookie-consent__panel-body {
	padding: 0 24px 8px;
	overflow: auto;
	flex: 1 1 auto;
}

.cookie-consent__categories {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.cookie-consent__category {
	position: relative;
	border-radius: 8px;
	background: #f8f9fd;
	overflow: hidden;
}

.cookie-consent__category[data-cookie-category="necessary"] .cookie-consent__category-summary {
	padding-right: 180px;
}

.cookie-consent__category-summary {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 72px 14px 16px;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.cookie-consent__category-summary::-webkit-details-marker {
	display: none;
}

.cookie-consent__category-summary::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 10px;
	border-right: 2px solid #3f3a64;
	border-bottom: 2px solid #3f3a64;
	transform: rotate(-45deg);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.cookie-consent__category-details[open] > .cookie-consent__category-summary {
	border-bottom: 1px solid rgba(63, 58, 100, 0.06);
}

.cookie-consent__category-details[open] > .cookie-consent__category-summary::before {
	transform: rotate(45deg);
	margin-top: -4px;
}

.cookie-consent__category-label {
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 700;
	color: #3f3a64;
}

.cookie-consent__category-control {
	position: absolute;
	top: 12px;
	right: 16px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.cookie-consent__always {
	font-size: 13px;
	font-weight: 500;
	color: #696969;
	white-space: nowrap;
}

.cookie-consent__switch-label {
	display: inline-flex;
	align-items: center;
	margin: 0;
	cursor: pointer;
}

.cookie-consent__switch-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cookie-consent__switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 48px;
	height: 28px;
	padding: 3px;
	border-radius: 999px;
	background: #c9c9d3;
	transition: background-color 0.2s ease;
}

.cookie-consent__switch-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(63, 58, 100, 0.2);
	transform: translateX(0);
	transition: transform 0.2s ease;
}

.cookie-consent__switch-input:checked + .cookie-consent__switch,
.cookie-consent__switch--locked {
	background: #20ad96;
}

.cookie-consent__switch--locked {
	opacity: 0.85;
}

.cookie-consent__switch-input:checked + .cookie-consent__switch .cookie-consent__switch-thumb,
.cookie-consent__switch--locked .cookie-consent__switch-thumb {
	transform: translateX(20px);
}

.cookie-consent__switch-input:focus-visible + .cookie-consent__switch {
	outline: 2px solid #20ad96;
	outline-offset: 2px;
}

.cookie-consent__category-body {
	padding: 4px 16px 16px;
}

.cookie-consent__table-wrap {
	margin-top: 14px;
	overflow-x: auto;
}

.cookie-consent__table-label {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 600;
	color: #3f3a64;
}

.cookie-consent__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	line-height: 1.4;
}

.cookie-consent__table th,
.cookie-consent__table td {
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid rgba(63, 58, 100, 0.08);
}

.cookie-consent__table th {
	font-weight: 600;
	color: #3f3a64;
	background: rgba(255, 255, 255, 0.7);
}

.cookie-consent__table td {
	color: #696969;
}

.cookie-consent__table code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	color: #3f3a64;
	word-break: break-word;
}

.cookie-consent__more {
	margin-top: 18px;
	padding: 16px;
	border: 1px solid rgba(63, 58, 100, 0.1);
	border-radius: 8px;
}

.cookie-consent__more-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: #3f3a64;
}

.cookie-consent__panel-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 16px 24px 22px;
	border-top: 1px solid rgba(63, 58, 100, 0.06);
	flex-shrink: 0;
}

.cookie-consent__panel-actions-end {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

.cookie-consent .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

body.cookie-consent-open {
	overflow: hidden;
}

/* Footer "Küpsiste seaded" link */
.et-cookie-settings-link {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.et-cookie-settings-link:hover,
.et-cookie-settings-link:focus-visible {
	color: #20ad96;
}

@keyframes cookie-consent-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cookie-consent__bar-inner,
	.cookie-consent__panel-inner {
		animation: none;
	}
}

/* Mobile: short copy + one row of actions ("Seaded" | Keeldun | Nõustun). */
.cookie-consent__text-short {
	display: none;
}

@media (max-width: 767.98px) {
	.cookie-consent__bar {
		right: 0;
		bottom: 0;
		left: 0;
	}

	.cookie-consent__bar-inner {
		gap: 10px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		border-width: 1px 0 0;
		border-radius: 16px 16px 0 0;
	}

	/* Title stays for screen readers (aria-labelledby), hidden visually. */
	.cookie-consent__bar .cookie-consent__title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.cookie-consent__bar .cookie-consent__text {
		font-size: 13px;
		line-height: 1.4;
	}

	.cookie-consent__bar .cookie-consent__text-long {
		display: none;
	}

	.cookie-consent__bar .cookie-consent__text-short {
		display: inline;
	}

	.cookie-consent__bar .cookie-consent__actions {
		display: grid;
		grid-template-columns: auto 1fr 1fr;
		gap: 8px;
		width: 100%;
	}

	.cookie-consent__bar .cookie-consent__btn--link {
		padding: 0 8px 0 4px;
		font-size: 14px;
	}

	.cookie-consent__panel-actions,
	.cookie-consent__panel-actions-end {
		width: 100%;
	}

	.cookie-consent__panel-actions .cookie-consent__btn {
		flex: 1 1 100%;
	}

	.cookie-consent__panel-head {
		padding: 18px 16px 8px;
	}

	.cookie-consent__panel-body {
		padding: 0 16px 8px;
	}

	.cookie-consent__panel-actions {
		padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.cookie-consent__category[data-cookie-category="necessary"] .cookie-consent__category-summary {
		padding-right: 72px;
	}

	.cookie-consent__always {
		display: none;
	}
}
