/* Tööriistakeskus - küpsiste bänner ja Kohanda aken.
   Kõik reeglid skoobitud .tkcookie-root alla, et vältida Divi globaalseid
   stiile (nupud, lingid, checkboxid) sisu üle kirjutamast. */

.tkcookie-root {
	--tkcookie-steel-white: #F2F3EF;
	--tkcookie-charcoal: #1C1F22;
	--tkcookie-amber: #F1D949;
	--tkcookie-amber-dark: #BBA20E;
	--tkcookie-steel-blue: #3D5A73;
	--tkcookie-steel-blue-light: #eef2f5;
	--tkcookie-border: #dcdfe0;
	--tkcookie-muted: #6a7075;
	--tkcookie-radius: 4px;

	all: unset;
	display: contents;
}

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

/* -------------------- Bänner (esimene tase) -------------------- */

.tkcookie-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	transform: translateY(110%);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
	pointer-events: none;
	background: var(--tkcookie-charcoal);
	border-top: 3px solid var(--tkcookie-amber);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
	font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.tkcookie-banner.is-visible {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.tkcookie-banner-inner {
	max-width: 1240px;
	margin: 0 auto;
	padding: 22px 24px;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.tkcookie-banner-icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(241, 217, 73, 0.14);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tkcookie-amber);
}

.tkcookie-banner-icon svg {
	width: 22px;
	height: 22px;
}

.tkcookie-banner-copy {
	flex: 1 1 320px;
	min-width: 240px;
}

.tkcookie-banner-title {
	all: unset;
	display: block;
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 700;
	font-size: 19px;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	color: var(--tkcookie-steel-white);
	margin-bottom: 4px;
}

.tkcookie-banner-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: #c4c9cc;
}

.tkcookie-privacy-link {
	color: var(--tkcookie-amber);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tkcookie-privacy-link:hover {
	color: var(--tkcookie-steel-white);
}

.tkcookie-banner-actions {
	flex: 0 0 auto;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* -------------------- Nupud (jagatud bänneri ja modaali vahel) -------------------- */

.tkcookie-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	padding: 12px 22px;
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 600;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-radius: var(--tkcookie-radius);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tkcookie-btn-primary {
	background: var(--tkcookie-amber);
	color: var(--tkcookie-charcoal);
}

.tkcookie-btn-primary:hover {
	background: #EED123;
}

.tkcookie-btn-outline {
	background: transparent;
	color: var(--tkcookie-steel-white);
	border: 1.5px solid rgba(242, 243, 239, 0.35);
}

.tkcookie-btn-outline:hover {
	border-color: var(--tkcookie-amber);
	color: var(--tkcookie-amber);
}

/* Kohanda aknas on taust valge, seega ümberdame outline-nupu värvid. */
.tkcookie-modal .tkcookie-btn-outline {
	color: var(--tkcookie-steel-blue);
	border-color: var(--tkcookie-border);
}

.tkcookie-modal .tkcookie-btn-outline:hover {
	border-color: var(--tkcookie-steel-blue);
	color: var(--tkcookie-charcoal);
}

/* -------------------- Kohanda aken (teine tase) -------------------- */

.tkcookie-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
}

.tkcookie-modal.is-open {
	display: block;
}

.tkcookie-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(28, 31, 34, 0.6);
}

.tkcookie-modal-box {
	position: relative;
	z-index: 1;
	width: min(560px, calc(100vw - 32px));
	max-height: min(85vh, 680px);
	margin: max(5vh, 20px) auto 0;
	background: #ffffff;
	border-radius: var(--tkcookie-radius);
	border-top: 3px solid var(--tkcookie-steel-blue);
	padding: 32px 26px 24px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.tkcookie-modal-close {
	all: unset;
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--tkcookie-muted);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.tkcookie-modal-close:hover {
	background: var(--tkcookie-steel-blue-light);
	color: var(--tkcookie-charcoal);
}

.tkcookie-modal-close svg {
	width: 18px;
	height: 18px;
}

.tkcookie-modal-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	flex: 0 0 auto;
}

.tkcookie-modal-icon {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--tkcookie-steel-blue-light);
	color: var(--tkcookie-steel-blue);
	display: flex;
	align-items: center;
	justify-content: center;
}

.tkcookie-modal-icon svg {
	width: 18px;
	height: 18px;
}

.tkcookie-modal-title {
	all: unset;
	display: block;
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 700;
	font-size: 22px;
	text-transform: uppercase;
	color: var(--tkcookie-charcoal);
}

.tkcookie-modal-intro {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--tkcookie-muted);
	flex: 0 0 auto;
}

.tkcookie-modal-body {
	overflow-y: auto;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 20px;
}

.tkcookie-category {
	border: 1px solid var(--tkcookie-border);
	border-left: 3px solid var(--tkcookie-steel-blue);
	border-radius: var(--tkcookie-radius);
	padding: 14px 16px;
}

.tkcookie-category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.tkcookie-category-label {
	font-family: 'Barlow Condensed', sans-serif;
	font-weight: 600;
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	color: var(--tkcookie-charcoal);
}

.tkcookie-category-desc {
	margin: 8px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--tkcookie-muted);
}

.tkcookie-modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

/* -------------------- Lüliti (toggle switch) -------------------- */

.tkcookie-switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-block;
	width: 42px;
	height: 24px;
}

.tkcookie-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.tkcookie-switch-track {
	position: absolute;
	inset: 0;
	background: var(--tkcookie-border);
	border-radius: 999px;
	transition: background 0.15s ease;
}

.tkcookie-switch-track::before {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.tkcookie-switch input:checked + .tkcookie-switch-track {
	background: var(--tkcookie-amber-dark);
}

.tkcookie-switch input:checked + .tkcookie-switch-track::before {
	transform: translateX(18px);
}

.tkcookie-switch input:focus-visible + .tkcookie-switch-track {
	box-shadow: 0 0 0 3px rgba(61, 90, 115, 0.35);
}

.tkcookie-switch-locked {
	opacity: 0.55;
}

.tkcookie-switch-locked input {
	cursor: not-allowed;
}

/* -------------------- Halda küpsiseid link (jaluses jne) -------------------- */

.tkcookie-manage-link {
	cursor: pointer;
}

body.tkcookie-modal-open {
	overflow: hidden;
}

/* -------------------- Väiksed ekraanid -------------------- */

@media (max-width: 640px) {
	.tkcookie-banner-inner {
		padding: 18px 16px;
	}
	.tkcookie-banner-actions {
		width: 100%;
	}
	.tkcookie-banner-actions .tkcookie-btn {
		flex: 1 1 auto;
	}
	.tkcookie-modal-box {
		padding: 30px 18px 20px;
	}
}
