/**
 * Çerez Onayı (Cookie Consent) — KUK Çiçek
 *
 * Tasarım dili: renk/radius token'ları diğer bileşenlerle (404, iletişim,
 * hakkımızda) ortaktır. Tipografi Avada'nın küresel fontundan miras alınır
 * (font-family: inherit) — ekstra font yükü veya tasarım borcu yaratmaz.
 *
 * Yerleşim: mobilde alt sabit sheet, masaüstünde sol alt köşede float card.
 */

.kuk-cc {
	--cc-primary: #227759;
	--cc-primary-dark: #185844;
	--cc-primary-light: #e8f5ef;
	--cc-border: #e3ebe7;
	--cc-bg: #f8faf9;
	--cc-text: #1f2b27;
	--cc-muted: #73817c;
	--cc-radius: 18px;
	--cc-radius-sm: 12px;

	/* Avada header / sticky öğelerinin üstünde kalsın */
	--cc-z: 999990;

	font-family: inherit;
	color: var(--cc-text);
}

.kuk-cc[hidden] {
	display: none;
}

.kuk-cc *,
.kuk-cc *::before,
.kuk-cc *::after {
	box-sizing: border-box;
}

/* =========================================================
   BANNER — masaüstü: sol alt float card
   ========================================================= */

.kuk-cc__banner {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: var(--cc-z);
	width: 400px;
	max-width: calc(100vw - 48px);
	padding: 22px 24px;
	border: 1px solid var(--cc-border);
	border-radius: var(--cc-radius);
	background: #fff;
	box-shadow: 0 18px 48px rgba(0, 0, 0, .16);

	/* Giriş animasyonu */
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .35s ease, transform .35s ease;
}

.kuk-cc.is-open .kuk-cc__banner {
	opacity: 1;
	transform: translateY(0);
}

/* Çıkış animasyonu */
.kuk-cc.is-closing .kuk-cc__banner {
	opacity: 0;
	transform: translateY(12px);
}

.kuk-cc__banner[hidden] {
	display: none;
}

.kuk-cc__title {
	margin: 0 0 8px !important;
	padding: 0 !important;
	color: var(--cc-text) !important;
	font-size: 17px !important;
	font-weight: 800 !important;
	line-height: 1.3 !important;
}

.kuk-cc__desc {
	color: var(--cc-muted);
	font-size: 13.5px;
	line-height: 1.6;
}

.kuk-cc__desc p {
	margin: 0 0 8px;
}

.kuk-cc__desc p:last-child {
	margin-bottom: 0;
}

.kuk-cc__desc a {
	color: var(--cc-primary);
	font-weight: 600;
	text-decoration: underline;
}

.kuk-cc__desc a:hover {
	color: var(--cc-primary-dark);
}

/* Aksiyonlar */
.kuk-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.kuk-cc__btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--cc-radius-sm);
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.kuk-cc__btn:focus-visible {
	outline: 2px solid var(--cc-primary-dark);
	outline-offset: 2px;
}

.kuk-cc__btn--primary {
	background: var(--cc-primary);
	color: #fff;
}

/* Banner'da iki buton yan yana ve 8/12 + 4/12 oranında:
   Kabul Et baskın, Seçenekleri Yönet ikincil.
   flex-basis 0 + farklı flex-grow → oran net korunur. */
.kuk-cc__banner .kuk-cc__actions > .kuk-cc__btn--primary {
	flex: 8 1 0;
	min-width: 0;
}

.kuk-cc__banner .kuk-cc__actions > .kuk-cc__btn--ghost {
	flex: 4 1 0;
	min-width: 0;
	padding: 0 10px;
	font-size: 13.5px;
}

.kuk-cc__modal-foot .kuk-cc__btn--primary {
	flex: 1 1 auto;
}

.kuk-cc__btn--primary:hover {
	background: var(--cc-primary-dark);
	transform: translateY(-1px);
}

.kuk-cc__btn--ghost {
	flex: 1 1 auto;
	border-color: var(--cc-border);
	background: #fff;
	color: var(--cc-text);
}

.kuk-cc__btn--ghost:hover {
	border-color: var(--cc-primary);
	color: var(--cc-primary);
}

.kuk-cc__btn--link {
	flex: 1 1 100%;
	min-height: 38px;
	padding: 0;
	color: var(--cc-muted);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
}

.kuk-cc__btn--link:hover {
	color: var(--cc-primary);
}

/* =========================================================
   ÖZELLEŞTİRME PANELİ (modal)
   ========================================================= */

.kuk-cc__overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--cc-z) + 1);
	background: rgba(15, 25, 21, .55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .3s ease;
}

.kuk-cc__overlay[hidden],
.kuk-cc__modal[hidden] {
	display: none;
}

.kuk-cc.is-modal-open .kuk-cc__overlay {
	opacity: 1;
}

.kuk-cc__modal {
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: calc(var(--cc-z) + 2);
	/* Çerez tabloları için biraz daha geniş */
	width: 720px;
	max-width: calc(100vw - 32px);
	max-height: min(86vh, 720px);
	display: flex;
	flex-direction: column;
	border-radius: var(--cc-radius);
	background: #fff;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
	overflow: hidden;

	opacity: 0;
	transform: translate(-50%, -46%);
	transition: opacity .3s ease, transform .3s ease;
}

.kuk-cc.is-modal-open .kuk-cc__modal {
	opacity: 1;
	transform: translate(-50%, -50%);
}

.kuk-cc__modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 22px;
	border-bottom: 1px solid var(--cc-border);
}

.kuk-cc__modal-title {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--cc-text) !important;
	font-size: 18px !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
}

.kuk-cc__close {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--cc-bg);
	color: var(--cc-muted);
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.kuk-cc__close:hover {
	background: var(--cc-primary-light);
	color: var(--cc-primary);
}

.kuk-cc__close:focus-visible {
	outline: 2px solid var(--cc-primary);
	outline-offset: 2px;
}

.kuk-cc__modal-body {
	padding: 8px 22px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Kategori satırı — accordion + sağda anahtar */
.kuk-cc__group {
	position: relative;
	padding: 4px 0;
	border-bottom: 1px solid var(--cc-border);
}

.kuk-cc__group:last-child {
	border-bottom: 0;
}

/* Accordion (native <details>) */
.kuk-cc__acc {
	margin: 0;
}

.kuk-cc__acc-head {
	display: flex;
	align-items: center;
	gap: 8px;
	/* Sağda anahtar için yer bırak */
	padding: 14px 66px 14px 0;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.kuk-cc__acc-head::-webkit-details-marker,
.kuk-cc__acc-head::marker {
	display: none;
	content: "";
}

.kuk-cc__acc-head:focus-visible {
	outline: 2px solid var(--cc-primary);
	outline-offset: 2px;
	border-radius: 6px;
}

.kuk-cc__chev {
	flex: none;
	color: var(--cc-muted);
	transition: transform .22s ease;
}

.kuk-cc__acc[open] .kuk-cc__chev {
	transform: rotate(90deg);
}

.kuk-cc__group-title {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--cc-text) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
}

.kuk-cc__acc-body {
	padding: 0 0 16px 24px;
}

.kuk-cc__group-desc {
	margin: 0 0 14px;
	color: var(--cc-muted);
	font-size: 13px;
	line-height: 1.6;
}

/* Çerez tablosu */
.kuk-cc__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--cc-border);
	border-radius: 10px;
}

.kuk-cc__table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	margin: 0;
	font-size: 12.5px;
	background: #fff;
}

.kuk-cc__table thead th {
	padding: 9px 12px;
	background: var(--cc-bg);
	border-bottom: 1px solid var(--cc-border);
	color: var(--cc-text);
	font-size: 11.5px;
	font-weight: 700;
	text-align: left;
	white-space: nowrap;
}

.kuk-cc__table tbody td {
	padding: 9px 12px;
	border-bottom: 1px solid #f1f5f3;
	color: var(--cc-muted);
	line-height: 1.5;
	vertical-align: top;
}

.kuk-cc__table tbody tr:last-child td {
	border-bottom: 0;
}

.kuk-cc__table tbody td:nth-child(2),
.kuk-cc__table tbody td:nth-child(3) {
	white-space: nowrap;
}

.kuk-cc__table code {
	padding: 2px 5px;
	border-radius: 4px;
	background: var(--cc-primary-light);
	color: var(--cc-primary-dark);
	font-size: 11.5px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	word-break: break-word;
}

/* Anahtar (switch) */
/* Anahtar: accordion başlığının sağında, summary'nin DIŞINDA konumlanır ki
   açma/kapama tıklamasıyla çakışmasın. */
.kuk-cc__switch {
	position: absolute;
	top: 18px;
	right: 0;
	z-index: 2;
	display: inline-block;
	width: 46px;
	height: 26px;
	cursor: pointer;
}

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

.kuk-cc__switch-ui {
	position: absolute;
	inset: 0;
	border-radius: 20px;
	background: #d5ddd9;
	transition: background .22s ease;
	pointer-events: none;
}

.kuk-cc__switch-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .22s ease;
}

.kuk-cc__switch input:checked ~ .kuk-cc__switch-ui {
	background: var(--cc-primary);
}

.kuk-cc__switch input:checked ~ .kuk-cc__switch-ui::after {
	transform: translateX(20px);
}

.kuk-cc__switch input:focus-visible ~ .kuk-cc__switch-ui {
	outline: 2px solid var(--cc-primary-dark);
	outline-offset: 2px;
}

.kuk-cc__switch.is-locked {
	cursor: not-allowed;
	opacity: .65;
}

.kuk-cc__modal-foot {
	display: flex;
	gap: 10px;
	padding: 16px 22px;
	border-top: 1px solid var(--cc-border);
	background: var(--cc-bg);
}

.kuk-cc__modal-foot .kuk-cc__btn {
	flex: 1 1 auto;
}

/* =========================================================
   YENİDEN AÇMA BUTONU (shortcode)
   ========================================================= */

.kuk-cc__reopen {
	appearance: none;
	-webkit-appearance: none;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.kuk-cc__reopen:hover {
	color: #227759;
}

/* =========================================================
   RESPONSIVE — mobilde alt sheet
   ========================================================= */

@media (max-width: 640px) {
	.kuk-cc__banner {
		left: 0;
		right: 0;
		bottom: 0;
		width: auto;
		max-width: none;
		padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
		box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
	}

	.kuk-cc.is-open .kuk-cc__banner {
		transform: translateY(0);
	}

	.kuk-cc.is-closing .kuk-cc__banner {
		transform: translateY(100%);
	}

	/* Mobilde de 8/12 + 4/12 oranı korunur (yan yana). */
	.kuk-cc__actions {
		gap: 8px;
		flex-wrap: nowrap;
	}

	.kuk-cc__banner .kuk-cc__actions > .kuk-cc__btn--ghost {
		padding: 0 6px;
		font-size: 13px;
	}

	/* Modal da alt sheet olarak gelsin */
	.kuk-cc__modal {
		left: 0;
		top: auto;
		bottom: 0;
		width: 100%;
		max-width: none;
		max-height: 88vh;
		border-radius: 18px 18px 0 0;
		transform: translate(0, 100%);
	}

	.kuk-cc.is-modal-open .kuk-cc__modal {
		transform: translate(0, 0);
	}

	.kuk-cc__modal-foot {
		flex-direction: column-reverse;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	/* Accordion ve tablo mobil düzeni */
	.kuk-cc__acc-head {
		padding-right: 60px;
	}

	.kuk-cc__acc-body {
		padding-left: 8px;
	}

	.kuk-cc__table {
		min-width: 460px;
		font-size: 12px;
	}

	.kuk-cc__switch {
		top: 16px;
	}
}

/* =========================================================
   HAREKET AZALTMA
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
	.kuk-cc__banner,
	.kuk-cc__modal,
	.kuk-cc__overlay,
	.kuk-cc__btn,
	.kuk-cc__switch-ui,
	.kuk-cc__switch-ui::after {
		transition: none;
	}

	.kuk-cc__btn--primary:hover {
		transform: none;
	}
}
