/* =========================================================================
 * Logoda Kampanya — yapay zekâ satış asistanı (sohbet penceresi)
 * ====================================================================== */

.lk-chat {
	--lk-chat-bottom: 20px;
	--lk-chat-size: 62px;
	position: fixed; right: 20px; bottom: var(--lk-chat-bottom); z-index: 95;
	font-family: var(--lk-body);
}
/* Açıkken sabit başlığın (z-index 100) da üzerinde dursun. */
.lk-chat.is-open { z-index: 200; }
/* WhatsApp butonu varsa onun üzerine otur. */
.lk-chat--with-wa { --lk-chat-bottom: 86px; }

/* ---------- Simge ---------- */
.lk-chat__launcher {
	position: relative; display: grid; place-items: center;
	width: var(--lk-chat-size); height: var(--lk-chat-size); margin-left: auto;
	border: 0; border-radius: 50%; cursor: pointer; color: #fff;
	background: radial-gradient(circle at 30% 25%, #ff3b3b 0%, var(--lk-red) 45%, #a80000 100%);
	box-shadow: 0 14px 30px -10px rgba(225, 0, 0, .65), 0 0 0 4px #fff, 0 0 0 5px rgba(22, 25, 31, .08);
	transition: transform .35s var(--lk-ease), box-shadow .35s var(--lk-ease);
	-webkit-tap-highlight-color: transparent;
}
.lk-chat__launcher:hover { transform: translateY(-3px) scale(1.04); }
.lk-chat__launcher:focus-visible { outline: 3px solid var(--lk-sky); outline-offset: 4px; }

.lk-chat__launcher-ring {
	position: absolute; inset: 0; border-radius: 50%;
	border: 2px solid var(--lk-red); opacity: 0;
	animation: lk-chat-ring 2.8s var(--lk-ease) infinite;
	pointer-events: none;
}
@keyframes lk-chat-ring {
	0% { transform: scale(1); opacity: .55; }
	70%, 100% { transform: scale(1.55); opacity: 0; }
}

.lk-chat__ico { position: absolute; width: 32px; height: 32px; transition: transform .4s var(--lk-ease), opacity .3s; }
.lk-chat__bubble { fill: #fff; }
.lk-chat__dot { fill: var(--lk-red); animation: lk-chat-dot 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.lk-chat__dot--2 { animation-delay: .18s; }
.lk-chat__dot--3 { animation-delay: .36s; }
@keyframes lk-chat-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: 1; }
	30% { transform: translateY(-2.4px); opacity: .55; }
}
.lk-chat__ico--close { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; opacity: 0; transform: rotate(-90deg) scale(.6); }

.lk-chat__online {
	position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 50%;
	background: #22c55e; border: 3px solid #fff;
}

.lk-chat.is-open .lk-chat__ico--chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.lk-chat.is-open .lk-chat__ico--close { opacity: 1; transform: none; }
.lk-chat.is-open .lk-chat__launcher-ring,
.lk-chat.is-open .lk-chat__online { display: none; }

/* ---------- Davet balonu ---------- */
.lk-chat__teaser {
	position: absolute; right: calc(var(--lk-chat-size) + 14px); bottom: 6px;
	display: flex; align-items: flex-start; gap: 4px;
	width: max-content; max-width: min(280px, calc(100vw - 120px));
	background: #fff; color: var(--lk-ink); border-radius: 18px 18px 4px 18px;
	padding: 12px 8px 12px 16px; box-shadow: var(--lk-shadow-lg);
	border: 1px solid var(--lk-line);
	animation: lk-chat-pop .5s var(--lk-ease) both;
}
.lk-chat__teaser[hidden] { display: none; }
.lk-chat__teaser-text { all: unset; cursor: pointer; font-weight: 600; font-size: .92rem; line-height: 1.4; }
.lk-chat__teaser-x { all: unset; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--lk-muted); flex-shrink: 0; }
.lk-chat__teaser-x:hover { background: var(--lk-red-tint); color: var(--lk-red); }
.lk-chat__teaser-x .lk-icon { width: 14px; height: 14px; }
@keyframes lk-chat-pop {
	from { opacity: 0; transform: translateY(10px) scale(.92); }
	to { opacity: 1; transform: none; }
}

/* ---------- Pencere ---------- */
.lk-chat__panel {
	position: absolute; right: 0; bottom: calc(var(--lk-chat-size) + 16px);
	display: flex; flex-direction: column;
	width: 390px; max-width: calc(100vw - 40px);
	height: min(620px, calc(100vh - var(--lk-chat-bottom) - var(--lk-chat-size) - 40px));
	height: min(620px, calc(100dvh - var(--lk-chat-bottom) - var(--lk-chat-size) - 40px));
	background: var(--lk-bg); border-radius: 26px; overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(22, 25, 31, .45), 0 0 0 1px rgba(22, 25, 31, .06);
	transform-origin: bottom right;
	animation: lk-chat-open .42s var(--lk-ease) both;
}
.lk-chat__panel[hidden] { display: none; }
@keyframes lk-chat-open {
	from { opacity: 0; transform: translateY(16px) scale(.94); }
	to { opacity: 1; transform: none; }
}

.lk-chat__head {
	position: relative; display: flex; align-items: center; gap: 12px;
	padding: 16px 14px 16px 18px; color: #fff;
	background: linear-gradient(135deg, var(--lk-red) 0%, #b80000 100%);
	overflow: hidden; flex-shrink: 0;
}
.lk-chat__head::after {
	content: "%"; position: absolute; right: 92px; top: -34px;
	font-family: var(--lk-display); font-weight: 800; font-size: 120px; line-height: 1;
	color: rgba(255, 255, 255, .08); pointer-events: none; transform: rotate(-12deg);
}
.lk-chat__avatar {
	position: relative; display: grid; place-items: center; flex-shrink: 0;
	width: 44px; height: 44px; border-radius: 14px; background: #fff; transform: rotate(-6deg);
	box-shadow: 3px 3px 0 rgba(22, 25, 31, .35);
}
.lk-chat__avatar svg { width: 22px; height: 22px; fill: none; stroke: var(--lk-red); stroke-width: 2.6; stroke-linecap: round; }
.lk-chat__avatar i { position: absolute; right: -4px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; }
.lk-chat__who { display: flex; flex-direction: column; min-width: 0; flex: 1; position: relative; z-index: 1; }
.lk-chat__who strong { font-family: var(--lk-display); font-size: 1.02rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-chat__who small { font-size: .78rem; opacity: .88; }
.lk-chat__head-btn {
	position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
	height: 34px; min-width: 34px; padding: 0 8px; justify-content: center;
	border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
	font: 600 .78rem var(--lk-body); transition: background .2s;
}
.lk-chat__head-btn:hover { background: rgba(255, 255, 255, .26); }
.lk-chat__head-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lk-chat__end svg { width: 16px; height: 16px; }

/* Mesajlar */
.lk-chat__body {
	flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px;
	background:
		radial-gradient(circle at 100% 0, rgba(144, 194, 231, .18), transparent 40%),
		var(--lk-bg);
	scroll-behavior: smooth;
}
.lk-chat__msg {
	max-width: 86%; padding: 11px 14px; border-radius: 18px;
	font-size: .92rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere;
	animation: lk-chat-msg .32s var(--lk-ease) both;
}
@keyframes lk-chat-msg {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
.lk-chat__msg--bot { align-self: flex-start; background: #fff; color: var(--lk-ink); border-bottom-left-radius: 6px; box-shadow: var(--lk-shadow); }
.lk-chat__msg--user { align-self: flex-end; background: var(--lk-red); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -10px rgba(225, 0, 0, .7); }
.lk-chat__msg--note { align-self: center; max-width: 92%; text-align: center; background: rgba(78, 128, 152, .1); color: var(--lk-steel); font-size: .84rem; border-radius: 14px; }
.lk-chat__msg p { margin: 0 0 6px; }
.lk-chat__msg p:last-child { margin-bottom: 0; }
.lk-chat__msg ul, .lk-chat__msg ol { margin: 4px 0 8px; padding-left: 18px; }
.lk-chat__msg li { margin: 3px 0; }
.lk-chat__msg li::marker { color: var(--lk-red); }
.lk-chat__msg strong { font-weight: 700; }
.lk-chat__msg a { color: var(--lk-red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.lk-chat__msg--user a { color: #fff; }
.lk-chat__msg a.lk-chat__cta {
	display: inline-flex; align-items: center; gap: 6px; margin: 2px 0;
	padding: 5px 11px; border-radius: 999px; text-decoration: none;
	background: var(--lk-red-tint); border: 1px solid rgba(225, 0, 0, .18); font-size: .86rem;
}
.lk-chat__msg a.lk-chat__cta--wa { background: rgba(37, 211, 102, .12); border-color: rgba(37, 211, 102, .4); color: #0c8a3c; }
.lk-chat__msg a.lk-chat__cta:hover { background: var(--lk-red); color: #fff; border-color: var(--lk-red); }
.lk-chat__msg a.lk-chat__cta--wa:hover { background: #25d366; border-color: #25d366; color: #fff; }

/* Yazıyor göstergesi */
.lk-chat__typing { display: inline-flex; gap: 5px; align-items: center; padding: 15px 16px; }
.lk-chat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--lk-red); animation: lk-chat-dot 1.2s ease-in-out infinite; opacity: .8; }
.lk-chat__typing span:nth-child(2) { animation-delay: .15s; }
.lk-chat__typing span:nth-child(3) { animation-delay: .3s; }

/* Hazır sorular */
.lk-chat__chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; flex-shrink: 0; scrollbar-width: none; }
.lk-chat__chips::-webkit-scrollbar { display: none; }
.lk-chat__chips[hidden] { display: none; }
.lk-chat__chip {
	flex-shrink: 0; border: 1.5px solid rgba(225, 0, 0, .28); background: #fff; color: var(--lk-red);
	font: 600 .82rem var(--lk-body); padding: 8px 13px; border-radius: 999px; cursor: pointer;
	white-space: nowrap; transition: background .2s, color .2s, transform .2s;
}
.lk-chat__chip:hover { background: var(--lk-red); color: #fff; transform: translateY(-1px); }

.lk-chat__restart { display: flex; justify-content: center; padding: 6px 16px 12px; flex-shrink: 0; }
.lk-chat__restart[hidden] { display: none; }

/* Yazma alanı */
.lk-chat__form {
	display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px;
	background: #fff; border-radius: 20px; border: 1.5px solid var(--lk-gray);
	transition: border-color .2s, box-shadow .2s; flex-shrink: 0;
}
.lk-chat__form:focus-within { border-color: var(--lk-red); box-shadow: 0 0 0 4px var(--lk-red-tint); }
.lk-chat__form[hidden] { display: none; }
.lk-chat__input {
	flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent;
	font: 400 .95rem/1.45 var(--lk-body); color: var(--lk-ink); padding: 8px 0; max-height: 120px;
}
.lk-chat__input::placeholder { color: rgba(22, 25, 31, .45); }
.lk-chat__send {
	display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px;
	border: 0; border-radius: 14px; background: var(--lk-red); color: #fff; cursor: pointer;
	transition: transform .2s, background .2s, opacity .2s;
}
.lk-chat__send:hover { background: var(--lk-red-dark); transform: scale(1.05); }
.lk-chat__send:disabled { opacity: .45; cursor: default; transform: none; }
.lk-chat__send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }

/* Hızlı iletişim */
.lk-chat__quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; padding: 10px 12px 4px; flex-shrink: 0; }
.lk-chat__q {
	display: inline-flex; align-items: center; justify-content: center; gap: 5px;
	padding: 8px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--lk-line);
	color: var(--lk-ink); font: 600 .76rem var(--lk-body); white-space: nowrap; transition: background .2s, color .2s, border-color .2s;
}
.lk-chat__q .lk-icon { width: 15px; height: 15px; color: var(--lk-red); flex-shrink: 0; }
.lk-chat__q:hover { background: var(--lk-red); border-color: var(--lk-red); color: #fff; }
.lk-chat__q:hover .lk-icon { color: #fff; }
.lk-chat__q--wa .lk-icon { color: #25d366; }
.lk-chat__q--wa:hover { background: #25d366; border-color: #25d366; }
.lk-chat__note { margin: 0; padding: 4px 16px 10px; text-align: center; font-size: .7rem; color: var(--lk-muted); flex-shrink: 0; }

/* Pencere açıkken WhatsApp butonunu sohbetin arkasında bırakma. */
body.lk-chat-open .lk-wa { opacity: 0; pointer-events: none; transform: translateY(10px); }

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
	.lk-chat { right: 16px; }
	.lk-chat--with-wa { --lk-chat-bottom: 80px; }
	.lk-chat { --lk-chat-size: 56px; }
	.lk-chat__ico { width: 28px; height: 28px; }
}
@media (max-width: 560px) {
	.lk-chat__panel {
		position: fixed; inset: 0; width: 100%; max-width: none; height: 100%;
		border-radius: 0; transform-origin: bottom center;
	}
	.lk-chat__head { padding-top: max(16px, env(safe-area-inset-top)); }
	.lk-chat__note { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
	.lk-chat__input { font-size: 16px; } /* iOS yakınlaştırmasın */
	.lk-chat.is-open .lk-chat__launcher,
	.lk-chat.is-open .lk-chat__teaser { display: none; }
	body.lk-chat-open { overflow: hidden; }
	.lk-chat__teaser { max-width: calc(100vw - 110px); }
}

@media (prefers-reduced-motion: reduce) {
	.lk-chat__launcher-ring, .lk-chat__dot, .lk-chat__typing span { animation: none !important; }
}

@media print {
	.lk-chat { display: none !important; }
}
