/* Cookie Consent Manager — Banner & Modal (v0.9.1) */
/* Tüm seçiciler #kcz- veya .kcz- ile başlar. Global seçici yok. */

/* -----------------------------------------------------------------------
   CSS ZIRHI (M-18) — tema (ör. OceanWP) button'lara width:100% vb. dayatabiliyor.
   Eklentinin TÜM butonları için temel sıfırlama. Renk/padding/radius gibi mevcut buton
   stilleri değişmez; bu kuralın SONRASINDAki buton kuralları (banner tam genişlik vb.) üzerine yazar.
   ----------------------------------------------------------------------- */
#kcz-banner button,
#kcz-modal button,
#kcz-chat-ac,
.kcz-embed-kutu button {
	width: auto;
	min-width: 0;
	max-width: none;
	box-sizing: border-box;
	line-height: normal;
	text-transform: none;
	letter-spacing: normal;
}

/* -----------------------------------------------------------------------
   CSS DEĞİŞKENLERİ
   PHP'den inline style ile override edilir
   ----------------------------------------------------------------------- */
#kcz-banner,
#kcz-modal-kapsayici {
	--kcz-bg: #1E1E1E;
	--kcz-yazi: #FFFFFF;
	--kcz-buton: #b11e29;
	--kcz-buton-yazi: #FFFFFF;
	--kcz-kenar: color-mix(in srgb, var(--kcz-yazi) 14%, transparent);
	--kcz-hover: color-mix(in srgb, var(--kcz-yazi) 8%, transparent);
}

/* -----------------------------------------------------------------------
   BANNER
   ----------------------------------------------------------------------- */
#kcz-banner {
	display: none;
	position: fixed;
	z-index: 999990;
	background: var(--kcz-bg);
	color: var(--kcz-yazi);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}

#kcz-banner.kcz-acik { display: block; }

/* Konum sınıfları */
#kcz-banner.kcz-konum-alt {
	bottom: 0;
	left: 0;
	right: 0;
	border-top: 1px solid var(--kcz-kenar);
}

#kcz-banner.kcz-konum-alt-sol {
	bottom: 20px;
	left: 20px;
	max-width: 440px;
	width: calc(100% - 40px);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

#kcz-banner.kcz-konum-alt-sag {
	bottom: 20px;
	right: 70px; /* Yan İletişim Butonlarına çarpmamak için */
	max-width: 440px;
	width: calc(100% - 90px);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

#kcz-banner.kcz-konum-orta {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 540px;
	width: calc(100% - 40px);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* İçerik düzeni */
#kcz-banner-icerik {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	padding: 16px 20px;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
}

#kcz-banner-metin {
	flex: 1 1 300px;
	min-width: 0;
}

#kcz-banner-baslik {
	display: block;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--kcz-yazi);
}

#kcz-banner-aciklama {
	margin: 0 0 6px;
	color: var(--kcz-yazi);
	opacity: 0.88;
}

#kcz-politika-link {
	color: var(--kcz-yazi);
	opacity: 0.75;
	font-size: 12px;
	text-decoration: underline;
}

#kcz-politika-link:hover {
	opacity: 1;
}

/* Buton grubu — K-12: eşit görünürlük */
#kcz-banner-butonlar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

#kcz-banner-butonlar button {
	display: inline-block;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 4px;
	cursor: pointer;
	white-space: nowrap;
	border: 2px solid var(--kcz-buton);
	font-family: inherit;
	line-height: 1.4;
	transition: opacity 0.15s, background 0.15s;
}

/* Kabul ve Reddet: BİREBİR aynı stil (eşit görünürlük — GDPR/TTDSG) */
#kcz-kabul,
#kcz-reddet {
	background: var(--kcz-buton);
	color: var(--kcz-buton-yazi);
}

#kcz-kabul:hover,
#kcz-reddet:hover {
	opacity: 0.85;
}

/* Tercihleri yönet: ikincil, çerçeveli */
#kcz-yonet {
	background: transparent;
	color: var(--kcz-yazi);
	border-color: color-mix(in srgb, var(--kcz-yazi) 45%, transparent);
}

#kcz-yonet:hover {
	background: var(--kcz-hover);
	border-color: var(--kcz-yazi);
}

/* Kart konumlarında (alt-sol, alt-sağ, orta): Kabul/Reddet yan yana, Yönet altta tam genişlik */
#kcz-banner.kcz-konum-alt-sol #kcz-banner-butonlar button,
#kcz-banner.kcz-konum-alt-sag #kcz-banner-butonlar button,
#kcz-banner.kcz-konum-orta #kcz-banner-butonlar button {
	flex: 1 1 calc(50% - 8px);
	text-align: center;
}

#kcz-banner.kcz-konum-alt-sol #kcz-yonet,
#kcz-banner.kcz-konum-alt-sag #kcz-yonet,
#kcz-banner.kcz-konum-orta #kcz-yonet {
	flex-basis: 100%;
}

/* -----------------------------------------------------------------------
   MODAL — ARKAPLAN
   ----------------------------------------------------------------------- */
#kcz-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999995;
}

#kcz-modal.kcz-acik { display: block; }

#kcz-modal-arkaplan {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.6);
}

/* -----------------------------------------------------------------------
   MODAL — KAPSAYICI
   ----------------------------------------------------------------------- */
#kcz-modal-kapsayici {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(640px, calc(100vw - 32px));
	max-height: 85vh;
	overflow-y: auto;
	background: var(--kcz-bg);
	color: var(--kcz-yazi);
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.5);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/* Modal başlık satırı */
#kcz-modal-baslik-satiri {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 14px;
	border-bottom: 1px solid var(--kcz-kenar);
	flex-shrink: 0;
}

#kcz-modal-baslik-el {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: var(--kcz-yazi);
	flex: 1 1 auto;
	min-width: 0;
	word-break: normal;
	overflow-wrap: anywhere;
}

/* #kcz-modal ön eki: zırh kuralını (#kcz-modal button) özgüllükte geçsin (line-height:1) */
#kcz-modal #kcz-modal-kapat {
	flex: 0 0 auto;
	width: 32px !important;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--kcz-yazi);
	opacity: 0.6;
	font-size: 20px;
	line-height: 1;
	padding: 0;
	border-radius: 4px;
	font-family: inherit;
}

#kcz-modal #kcz-modal-kapat:hover {
	opacity: 1;
	background: var(--kcz-hover);
}

/* Modal gövde */
#kcz-modal-govde {
	padding: 16px 20px;
	overflow-y: auto;
	flex: 1 1 auto;
}

#kcz-modal-aciklama {
	margin: 0 0 16px;
	opacity: 0.85;
}

/* Kategori satırları */
.kcz-kat-satir {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid var(--kcz-kenar);
}

.kcz-kat-satir:first-of-type {
	border-top: none;
}

.kcz-kat-bilgi {
	flex: 1 1 auto;
	min-width: 0;
}

.kcz-kat-ad {
	display: block;
	font-weight: 600;
	margin-bottom: 3px;
	color: var(--kcz-yazi);
}

.kcz-kat-aciklama {
	margin: 0;
	font-size: 12px;
	opacity: 0.75;
}

.kcz-kat-kontrol {
	flex-shrink: 0;
	padding-top: 2px;
}

/* Toggle switch */
.kcz-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.kcz-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.kcz-slider {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--kcz-yazi) 30%, transparent);
	border-radius: 24px;
	cursor: pointer;
	transition: background 0.2s;
}

.kcz-slider::before {
	content: '';
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
}

.kcz-switch input:checked + .kcz-slider {
	background: var(--kcz-buton);
}

.kcz-switch input:checked + .kcz-slider::before {
	transform: translateX(20px);
}

.kcz-switch input:disabled + .kcz-slider {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Envanter tablosu (modal içinde) */
#kcz-modal-envanter {
	margin-top: 20px;
	border-top: 1px solid var(--kcz-kenar);
	padding-top: 16px;
}

#kcz-modal-envanter-baslik {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px;
	opacity: 0.85;
}

.kcz-env-tablo-kapsayici {
	overflow-x: auto;
}

.kcz-env-tablo {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.kcz-env-tablo th,
.kcz-env-tablo td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid var(--kcz-kenar);
	color: var(--kcz-yazi);
	vertical-align: middle;
}

.kcz-env-tablo th {
	font-weight: 600;
	opacity: 0.7;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.kcz-env-tablo td {
	opacity: 0.88;
}

.kcz-env-kat-baslik {
	padding: 10px 8px 4px;
	font-weight: 600;
	font-size: 12px;
	color: var(--kcz-yazi);
	opacity: 0.6;
	border-bottom: 1px solid var(--kcz-kenar);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Modal alt buton alanı */
#kcz-modal-alt {
	padding: 14px 20px 18px;
	border-top: 1px solid var(--kcz-kenar);
	display: flex;
	justify-content: flex-end;
	flex-shrink: 0;
}

#kcz-modal-kaydet {
	display: inline-block;
	padding: 10px 22px;
	font-size: 14px;
	font-weight: 500;
	background: var(--kcz-buton);
	color: var(--kcz-buton-yazi);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.15s;
}

#kcz-modal-kaydet:hover {
	opacity: 0.85;
}

/* -----------------------------------------------------------------------
   SHORTCODE ENVANTER TABLOSU (açık arkaplan — politika sayfası)
   .kcz-envanter-shortcode → banner CSS değişkenlerini KULLANMAZ
   ----------------------------------------------------------------------- */
.kcz-envanter-shortcode {
	overflow-x: auto;
	margin: 1em 0;
}

.kcz-env-sc-tablo {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 1.5;
}

.kcz-env-sc-tablo th,
.kcz-env-sc-tablo td {
	text-align: left;
	padding: 8px 12px;
	border-bottom: 1px solid #ddd;
	vertical-align: top;
}

.kcz-env-sc-tablo th {
	font-weight: 600;
	background: #f5f5f5;
	white-space: nowrap;
}

.kcz-env-sc-kat-baslik td {
	font-weight: 600;
	background: #eee;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.04em;
	padding: 6px 12px;
}

@media (max-width: 600px) {
	.kcz-env-sc-tablo th,
	.kcz-env-sc-tablo td { padding: 6px 8px; font-size: 12px; }
}

/* -----------------------------------------------------------------------
   GÖMÜLÜ İÇERİK İZİN KUTUSU
   Tüm seçiciler .kcz- ile başlar — global seçici yok
   --kcz-buton ve --kcz-buton-yazi :root'ta tanımlı (varlik_yukle inline style)
   ----------------------------------------------------------------------- */
.kcz-embed-kutu {
	background: #f7f7f7;
	border: 1px solid #e0e0e0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 300px;
	padding: 24px;
	box-sizing: border-box;
}

.kcz-embed-metin {
	color: #444;
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.5;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

.kcz-embed-izin-ver {
	display: inline-block;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 500;
	background: var(--kcz-buton, #b11e29);
	color: var(--kcz-buton-yazi, #FFFFFF);
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
	transition: opacity 0.15s;
}

.kcz-embed-izin-ver:hover {
	opacity: 0.85;
}

/* -----------------------------------------------------------------------
   CHAT "TIKLA-YÜKLE" BUTONU (M-17)
   Sağ alt köşe; z-index banner'ın (999990) ALTINDA. RTL'de de SAĞDA kalır (konum aynalanmaz).
   ----------------------------------------------------------------------- */
#kcz-chat-ac {
	position: fixed;
	right: 20px;
	bottom: 20px;
	left: auto;
	top: auto;
	width: auto !important; /* tema ezmesine karşı */
	max-width: 240px;
	z-index: 999985;
	display: none; /* JS .kcz-acik sınıfıyla gösterir */
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	background: var(--kcz-buton, #b11e29);
	color: var(--kcz-buton-yazi, #FFFFFF);
	border: none;
	border-radius: 28px;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

/* !important: PHP butonu geçmiş sürümlerden kalma inline style="display:none" ile basıyor olabilir (cache) */
#kcz-chat-ac.kcz-acik { display: inline-flex !important; }

#kcz-chat-ac:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0,0,0,0.4);
	opacity: 0.95;
}

#kcz-chat-ac .kcz-chat-ikon {
	display: inline-flex;
}

/* -----------------------------------------------------------------------
   RTL (Arapça) — M-04
   PHP, aktif dil RTL ise #kcz-banner / #kcz-modal / shortcode kutusu / embed kutusuna
   .kcz-rtl sınıfı + dir="rtl" verir. Yukarıdaki LTR kurallar DEĞİŞMEZ; her şey .kcz-rtl kapsamında.
   NOT: dir="rtl" flex satırlarının (banner içerik, buton grubu, kategori satırı, başlık satırı,
   modal alt) yönünü zaten tersine çevirir; ayrıca row-reverse verilirse çift ters = LTR olurdu.
   ----------------------------------------------------------------------- */
.kcz-rtl {
	direction: rtl;
	text-align: right;
}

/* Banner / modal metinleri */
#kcz-banner.kcz-rtl #kcz-banner-metin,
#kcz-banner.kcz-rtl #kcz-banner-baslik,
#kcz-banner.kcz-rtl #kcz-banner-aciklama,
.kcz-rtl #kcz-modal-kapsayici,
.kcz-rtl #kcz-modal-aciklama,
.kcz-rtl .kcz-kat-bilgi,
.kcz-rtl .kcz-kat-ad,
.kcz-rtl .kcz-kat-aciklama {
	text-align: right;
}

/* Banner KONUMU RTL'de aynalanmaz (M-13): konum tercihi her dilde aynıdır.
   Sitedeki canlı destek widget'ı dilden bağımsız sağ alttadır; aynalama çakışma yaratır. */

/* Toggle switch: düğme sağdan başlar, sola kayar */
.kcz-rtl .kcz-slider::before {
	left: auto;
	right: 3px;
}

.kcz-rtl .kcz-switch input:checked + .kcz-slider::before {
	transform: translateX(-20px);
}

/* Envanter tabloları (modal + shortcode) */
.kcz-rtl .kcz-env-tablo th,
.kcz-rtl .kcz-env-tablo td,
.kcz-rtl.kcz-envanter-shortcode .kcz-env-sc-tablo th,
.kcz-rtl.kcz-envanter-shortcode .kcz-env-sc-tablo td {
	text-align: right;
}

/* Embed izin kutusu */
.kcz-embed-kutu.kcz-rtl {
	direction: rtl;
}

/* -----------------------------------------------------------------------
   MOBİL (≤600 px)
   ----------------------------------------------------------------------- */
@media (max-width: 600px) {
	#kcz-banner-icerik {
		flex-direction: column;
		align-items: stretch;
		padding: 14px 16px;
	}

	#kcz-banner-butonlar {
		flex-direction: column;
	}

	#kcz-banner-butonlar button {
		width: 100%;
		text-align: center;
	}

	#kcz-banner.kcz-konum-alt-sol,
	#kcz-banner.kcz-konum-alt-sag {
		left: 0;
		right: 0;
		bottom: 0;
		max-width: none;
		width: 100%;
		border-radius: 0;
		box-shadow: none;
	}

	#kcz-modal-kapsayici {
		max-height: 92vh;
	}

	#kcz-chat-ac {
		right: 12px;
		bottom: 12px;
		padding: 10px 14px;
		font-size: 13px;
	}
}
