/*
 * Çerez çubuğu ve tercih penceresi (tambenlik-kitap-cookie-consent / kscc) — tema görünümü.
 * Eklentinin işaretlemesi ve rıza mantığı değişmez; yalnız görünüm ezilir (seçiciler `body #kscc-root` ile eklentinin önüne geçer).
 * Masaüstünde sol altta kart, telefonda alt yaprak; pencere ortada kart. Kategori satırlarındaki araç etiketleri assets/js/cerez.js ile.
 */

body #kscc-root {
	--kscc-accent: var(--wp--preset--color--lacivert);
	--kscc-text: var(--wp--preset--color--metin);
	--kscc-muted: var(--wp--preset--color--metin-ikincil);
	--kscc-line: var(--wp--preset--color--cizgi);
	--kscc-bg: #fff;
	--kscc-card: #fff;
	--kscc-shadow: 0 24px 60px rgba(22, 33, 58, 0.22), 0 2px 8px rgba(22, 33, 58, 0.08);
	color: var(--kscc-text);
	font-family: var(--wp--preset--font-family--inter, inherit);
}

/* ── Çubuk: sol altta kart ── */
body #kscc-root .kscc-banner {
	left: 1.25rem;
	right: auto;
	bottom: 1.25rem;
	width: min(420px, calc(100vw - 2.5rem));
	display: block;
	padding: 1.25rem 1.25rem 1rem;
	border: 1px solid var(--kscc-line);
	border-radius: var(--tbk-radius-lg, 16px);
	background: #fff;
	box-shadow: var(--kscc-shadow);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	animation: tbk-cerez-in 0.25s var(--tbk-ease, ease-out) both;
}

body #kscc-root .kscc-pill {
	display: none;
}

body #kscc-root .kscc-banner-content {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.25rem 0.75rem;
	align-items: start;
}

body #kscc-root .tbk-cerez__icon {
	grid-row: 1 / 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--wp--preset--color--gok-acik);
	color: var(--wp--preset--color--lacivert);
}

body #kscc-root .kscc-banner h2 {
	margin: 0.35rem 0 0;
	font-family: var(--wp--preset--font-family--nunito, inherit);
	font-weight: 800;
	font-size: 1.0625rem;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--wp--preset--color--lacivert);
}

body #kscc-root .kscc-banner p {
	grid-column: 2;
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--kscc-muted);
}

body #kscc-root .kscc-policy-link {
	grid-column: 2;
	display: inline-block;
	margin-top: 0.125rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--wp--preset--color--lacivert);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	border: 0;
	padding: 0;
	background: none;
}

body #kscc-root .kscc-banner-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-top: 1rem;
}

body #kscc-root .kscc-banner-actions [data-kscc-open] {
	grid-column: 1 / -1;
}

/* ── Düğmeler ── */
body #kscc-root .kscc-btn {
	min-height: 44px;
	padding: 0.5rem 0.875rem;
	border-radius: var(--tbk-radius, 10px);
	font-family: var(--wp--preset--font-family--nunito, inherit);
	font-weight: 700;
	font-size: 0.9375rem;
	line-height: 1.2;
	letter-spacing: 0;
	box-shadow: none;
	transform: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

body #kscc-root .kscc-btn-primary {
	background: var(--wp--preset--color--lacivert);
	border: 1px solid var(--wp--preset--color--lacivert);
	color: #fff;
}

body #kscc-root .kscc-btn-primary:hover {
	background: var(--wp--preset--color--lacivert-koyu);
	border-color: var(--wp--preset--color--lacivert-koyu);
}

body #kscc-root .kscc-btn-ghost {
	background: #fff;
	border: 1.5px solid var(--wp--preset--color--lacivert);
	color: var(--wp--preset--color--lacivert);
}

body #kscc-root .kscc-btn-ghost:hover {
	background: var(--wp--preset--color--gok-acik);
}

body #kscc-root .kscc-btn-soft {
	min-height: 36px;
	background: transparent;
	border: 1px solid transparent;
	color: var(--wp--preset--color--lacivert);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

body #kscc-root .kscc-btn-soft:hover {
	background: var(--wp--preset--color--zemin-alt);
	text-decoration: none;
}

body #kscc-root .kscc-btn:focus-visible,
body #kscc-root .kscc-close:focus-visible,
body #kscc-root .kscc-switch input:focus-visible + span,
body #kscc-root .kscc-policy-link:focus-visible {
	outline: 3px solid var(--wp--preset--color--gok);
	outline-offset: 2px;
}

/* ── Tercih penceresi ── */
body #kscc-root .kscc-modal-backdrop {
	background: rgba(22, 33, 58, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

body #kscc-root .kscc-modal {
	width: min(600px, calc(100vw - 2rem));
	max-height: calc(100vh - 3rem);
	padding: 1.5rem 1.5rem 1.25rem;
	border: 0;
	border-radius: var(--tbk-radius-lg, 16px);
	background: #fff;
	box-shadow: var(--kscc-shadow);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	animation: tbk-cerez-pop 0.2s var(--tbk-ease, ease-out) both;
}

body #kscc-root .kscc-close {
	top: 0.875rem;
	right: 0.875rem;
	width: 40px;
	height: 40px;
	border: 1px solid var(--kscc-line);
	border-radius: 50%;
	background: #fff;
	color: var(--wp--preset--color--metin);
	font-size: 1.375rem;
	line-height: 1;
}

body #kscc-root .kscc-close:hover {
	background: var(--wp--preset--color--zemin-alt);
}

body #kscc-root .kscc-modal h2 {
	margin: 0 2.75rem 0.375rem 0;
	font-family: var(--wp--preset--font-family--nunito, inherit);
	font-weight: 800;
	font-size: 1.375rem;
	line-height: 1.2;
	letter-spacing: 0;
	color: var(--wp--preset--color--lacivert);
}

body #kscc-root .kscc-modal-intro {
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--kscc-muted);
}

body #kscc-root .kscc-category {
	gap: 0.75rem 1rem;
	align-items: start;
	margin: 0 0 0.625rem;
	padding: 0.875rem 1rem;
	border: 1px solid var(--kscc-line);
	border-radius: 12px;
	background: var(--wp--preset--color--zemin-alt);
}

body #kscc-root .kscc-category strong {
	display: block;
	margin-bottom: 0.125rem;
	font-family: var(--wp--preset--font-family--nunito, inherit);
	font-weight: 800;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--metin);
}

body #kscc-root .kscc-category p {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--kscc-muted);
}

/* Araç etiketleri (cerez.js) */
body #kscc-root .tbk-cerez__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

body #kscc-root .tbk-cerez__tools li {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.6rem 0.2rem 0.5rem;
	border: 1px solid var(--kscc-line);
	border-radius: 999px;
	background: #fff;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--wp--preset--color--metin);
}

body #kscc-root .tbk-cerez__tools li::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--gok);
}

body #kscc-root .tbk-cerez__always {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--wp--preset--color--yesil);
}

/* Anahtar */
body #kscc-root .kscc-switch {
	width: 46px;
	height: 26px;
	flex: 0 0 auto;
	margin-top: 0.125rem;
}

body #kscc-root .kscc-switch span {
	background: #cfd6e2;
	border: 0;
}

body #kscc-root .kscc-switch span:before {
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	box-shadow: 0 1px 3px rgba(22, 33, 58, 0.3);
}

body #kscc-root .kscc-switch input:checked + span {
	background: var(--wp--preset--color--lacivert);
}

body #kscc-root .kscc-switch input:checked + span:before {
	transform: translateX(20px);
}

body #kscc-root .kscc-switch input:disabled + span {
	background: var(--wp--preset--color--yesil);
	opacity: 0.55;
	cursor: not-allowed;
}

body #kscc-root .kscc-modal-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--kscc-line);
}

body #kscc-root .kscc-modal-actions [data-kscc-reject-all] {
	grid-column: 1 / -1;
}

@keyframes tbk-cerez-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes tbk-cerez-pop {
	from {
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	body #kscc-root .kscc-banner,
	body #kscc-root .kscc-modal {
		animation: none;
	}
}

/*
 * Telefon ve küçük tablet (eklentinin kendi kırılma noktası 782 px): çubuk ve pencere alt yaprak. Eklenti pencereyi soldan
 * açılan çekmece yapıyor (inset/transform/animation); hepsi burada ezilir, yoksa masaüstü animasyonu pencereyi kaydırır.
 * mobil.css çubuğu alt gezinmenin üstüne kaldırır.
 */
@media (max-width: 782px) {
	body #kscc-root .kscc-banner {
		left: 0;
		right: 0;
		width: auto;
		border-radius: 16px 16px 0 0;
		border-bottom: 0;
		padding: 1rem 1rem 0.875rem;
	}

	body #kscc-root .kscc-modal {
		inset: auto 0 0 0;
		width: auto;
		height: auto;
		max-height: 88dvh;
		padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
		border-radius: 16px 16px 0 0;
		transform: none;
		animation: tbk-cerez-in 0.25s var(--tbk-ease, ease-out) both;
	}

	body #kscc-root .kscc-modal h2 {
		font-size: 1.1875rem;
	}

	body #kscc-root .kscc-category {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}
