/* Casetti Asistan: the button above "Hızlı Destek" (bottom right) and the chat panel; Casetti's dark + gold. */
.cai {
	--cai-dark: #121110;
	--cai-dark-2: #1c1916;
	--cai-gold: #c9a46a;
	--cai-gold-l: #ecd29b;
	--cai-cream: #f7f4ef;
	--cai-ink: #1c1612;
	--cai-muted: #7d7368;
	position: fixed;
	z-index: 121;
	inset-block-end: calc(24px + 62px + 12px + var(--myco-sticky-cart-height, 0px));
	inset-inline-end: 24px;
	font-family: var(--myco-font-sans, system-ui, sans-serif);
	color: var(--cai-ink);
}

.cai__fab {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 20px 8px 8px;
	border: 1px solid rgba(201, 164, 106, 0.55);
	border-radius: 999px;
	background: linear-gradient(120deg, #1a1612 0%, var(--cai-dark) 60%);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
	color: var(--cai-cream);
	font: inherit;
	line-height: 1.3;
	text-align: start;
	cursor: pointer;
	transition: transform 0.3s, box-shadow 0.3s;
}
.cai__fab:hover { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34); transform: translateY(-2px); }
.cai__spark {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, #b98d45 0%, var(--cai-gold-l) 55%, #b98d45 100%);
	color: var(--cai-dark);
}
.cai__fab-t { display: flex; flex-direction: column; }
.cai__fab-t b { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; }
.cai__fab-t span { color: rgba(247, 244, 239, 0.7); font-size: 12px; }
.cai.is-open .cai__fab { visibility: hidden; }

/* The panel */
.cai__panel {
	position: absolute;
	inset-block-end: 0;
	inset-inline-end: 0;
	display: flex;
	flex-direction: column;
	width: 390px;
	height: min(600px, calc(100dvh - 240px));
	overflow: hidden;
	border: 1px solid rgba(201, 164, 106, 0.35);
	border-radius: 18px;
	background: var(--cai-cream);
	box-shadow: 0 30px 70px rgba(18, 14, 10, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s;
}
.cai.is-open .cai__panel { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.25s; }

.cai__head {
	display: flex;
	flex: none;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background: var(--cai-dark);
	color: var(--cai-cream);
}
.cai__head > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.cai__head b { font-size: 15px; font-weight: 600; }
.cai__head span { color: rgba(247, 244, 239, 0.65); font-size: 12px; }
.cai__avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, #b98d45 0%, var(--cai-gold-l) 55%, #b98d45 100%);
	color: var(--cai-dark);
}
.cai__head .cai__avatar { display: grid; flex-direction: row; }
.cai__new,
.cai__close {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(247, 244, 239, 0.8);
	cursor: pointer;
}
.cai__new:hover,
.cai__close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.cai__log {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.cai__msg { max-width: 88%; font-size: 14px; line-height: 1.55; }
.cai__msg p { margin: 0 0 6px; }
.cai__msg p:last-child { margin-bottom: 0; }
.cai__msg--bot { align-self: flex-start; padding: 11px 14px; border: 1px solid #ebe3d6; border-radius: 4px 14px 14px 14px; background: #fff; }
.cai__msg--me { align-self: flex-end; padding: 10px 14px; border-radius: 14px 4px 14px 14px; background: var(--cai-dark-2); color: var(--cai-cream); }
.cai__msg--wait { color: var(--cai-muted); }
.cai__dots { display: inline-flex; gap: 4px; }
.cai__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--cai-gold); animation: cai-dot 1.2s infinite ease-in-out; }
.cai__dots i:nth-child(2) { animation-delay: 0.15s; }
.cai__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cai-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cai__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cai__chips button {
	padding: 8px 13px;
	border: 1px solid rgba(185, 141, 69, 0.45);
	border-radius: 999px;
	background: #fff;
	color: var(--cai-ink);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}
.cai__chips button:hover { border-color: var(--cai-gold); background: #fbf6ec; }

/* Product cards: a row that scrolls sideways */
.cai__cards {
	display: grid;
	grid-auto-columns: 148px;
	grid-auto-flow: column;
	gap: 10px;
	margin: 2px -16px 0;
	padding: 2px 16px 6px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.cai__cards::-webkit-scrollbar { display: none; }
.cai__card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #ebe3d6;
	border-radius: 10px;
	background: #fff;
	color: var(--cai-ink);
	text-decoration: none;
	scroll-snap-align: start;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.cai__card:hover { border-color: var(--cai-gold); box-shadow: 0 10px 24px -14px rgba(60, 40, 15, 0.45); }
.cai__card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #f4efe7; mix-blend-mode: multiply; }
.cai__card span { display: block; padding: 8px 10px 0; font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cai__card b { display: block; padding: 4px 10px 10px; font-size: 13px; font-weight: 600; }
.cai__card s { margin-inline-end: 6px; color: var(--cai-muted); font-weight: 400; }

.cai__wa { align-self: flex-start; color: #6b5427; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.cai__form {
	display: flex;
	flex: none;
	align-items: flex-end;
	gap: 8px;
	margin: 0 12px;
	padding: 6px 6px 6px 14px;
	border: 1px solid #e3d9c8;
	border-radius: 22px;
	background: #fff;
}
.cai__form:focus-within { border-color: var(--cai-gold); }
.cai__form textarea {
	flex: 1;
	min-height: 22px;
	max-height: 110px;
	padding: 6px 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--cai-ink);
	font: inherit;
	font-size: 16px; /* no zoom on iPhone */
	line-height: 1.4;
	resize: none;
}
.cai__send {
	display: grid;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--cai-dark);
	color: var(--cai-gold-l);
	cursor: pointer;
}
.cai__send:disabled { opacity: 0.45; cursor: default; }
.cai__foot { flex: none; margin: 8px 16px 12px; color: var(--cai-muted); font-size: 11px; line-height: 1.4; text-align: center; }
.cai__foot a { color: #6b5427; }

/* Tablets: the support button moves left (support.css); this one stays right, above the bottom bar */
@media (max-width: 899.98px) {
	.cai { inset-block-end: calc(var(--casetti-mobile-nav-h, 74px) + 14px + env(safe-area-inset-bottom) + var(--myco-sticky-cart-height, 0px)); inset-inline-end: 14px; }
}

/* Phones: a round button; the panel fills the screen */
@media (max-width: 767px) {
	.cai__fab { padding: 5px; }
	.cai__fab-t { display: none; }
	.cai__spark { width: 46px; height: 46px; }
	.cai.is-open { z-index: 1000; }
	.cai__panel {
		position: fixed;
		inset: 0;
		width: auto;
		height: 100dvh;
		border: 0;
		border-radius: 0;
		transform: translateY(16px);
	}
	.cai__head { padding-top: calc(12px + env(safe-area-inset-top)); }
	.cai__foot { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }
	.cai__msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
	.cai__panel, .cai__fab { transition: none; }
	.cai__dots i { animation: none; opacity: 0.7; }
}
html.cai-lock, html.cai-lock body { overflow: hidden; }
.cai__msg ul { margin: 0 0 6px; padding-inline-start: 18px; }
.cai__msg li { margin: 2px 0; }
/* KVKK consent before the first message */
.cai__consent { padding: 14px; border: 1px solid rgba(185, 141, 69, 0.45); border-radius: 12px; background: #fbf6ec; font-size: 13px; line-height: 1.5; }
.cai__consent[hidden], .cai__chips[hidden] { display: none; }
.cai__consent p { margin: 0 0 12px; }
.cai__consent a { color: #6b5427; }
.cai__consent button { width: 100%; padding: 11px 16px; border: 0; border-radius: 999px; background: var(--cai-dark); color: var(--cai-gold-l); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cai__form textarea:disabled { cursor: not-allowed; }
/* Photo of the room */
.cai__cam { display: grid; flex: none; place-items: center; width: 36px; height: 36px; margin-inline-start: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8a6a32; cursor: pointer; }
.cai__cam:hover { background: #f6efe2; }
.cai__att { display: flex; flex: none; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 8px; border: 1px solid #e3d9c8; border-radius: 12px; background: #fff; font-size: 12px; line-height: 1.35; color: var(--cai-muted); }
.cai__att[hidden] { display: none; }
.cai__att img { flex: none; width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.cai__att span { flex: 1; }
.cai__att button { display: grid; flex: none; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: #f3ede3; color: var(--cai-ink); cursor: pointer; }
.cai__shot { display: block; width: 160px; max-width: 100%; margin: 2px 0 8px auto; border-radius: 10px; }
.cai__msg--me .cai__shot:last-child { margin-bottom: 2px; }
.cai__chips .cai__chip-photo { display: inline-flex; align-items: center; gap: 7px; border-color: var(--cai-gold); background: #fbf6ec; }
.cai__msg--me:not(:has(p)) { padding: 5px; background: transparent; }
.cai__msg--me:not(:has(p)) .cai__shot { width: 180px; margin: 0; }
/* The panel keeps its own scrolling to itself (no pull of the page behind it) */
.cai__panel { overscroll-behavior: contain; }

/* ================= v2: a calmer, more premium panel; products in place ================= */
.cai--v2 .cai__panel { width: 410px; height: min(640px, calc(100dvh - 240px)); border: 0; border-radius: 20px; background: #f6f2ec; box-shadow: 0 34px 80px rgba(18, 14, 10, 0.38), 0 0 0 1px rgba(201, 164, 106, 0.28); }
.cai--v2 .cai__head { position: relative; padding: 16px 12px 16px 18px; background: radial-gradient(120% 140% at 0% 0%, #2a221a 0%, #121110 60%); }
.cai--v2 .cai__head::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: linear-gradient(90deg, rgba(201,164,106,0), rgba(201,164,106,.8), rgba(201,164,106,0)); }
.cai--v2 .cai__head b { font-family: var(--casetti-font-display, "Cormorant Garamond", serif); font-size: 21px; font-weight: 500; letter-spacing: 0.01em; line-height: 1.1; }
.cai--v2 .cai__head span { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11.5px; letter-spacing: 0.02em; }
.cai--v2 .cai__live { width: 7px; height: 7px; border-radius: 50%; background: #3ec46d; box-shadow: 0 0 0 3px rgba(62, 196, 109, 0.18); }
.cai--v2 .cai__avatar { width: 40px; height: 40px; }

.cai--v2 .cai__log { gap: 14px; padding: 18px 16px 12px; }
.cai--v2 .cai__msg { font-size: 14.5px; line-height: 1.6; }
.cai--v2 .cai__msg--bot { max-width: 100%; padding: 14px 16px; border: 0; border-radius: 4px 16px 16px 16px; background: #fff; box-shadow: 0 1px 2px rgba(60, 40, 15, 0.06), 0 8px 24px -16px rgba(60, 40, 15, 0.25); }
.cai--v2 .cai__msg--bot b { color: #1c1612; font-weight: 600; }
.cai--v2 .cai__msg--me { padding: 10px 15px; border-radius: 16px 4px 16px 16px; background: #1c1916; }
.cai--v2 .cai__msg--wait { display: flex; align-items: center; gap: 10px; color: #7d7368; font-size: 13px; }

/* Product card in the reply */
.cai__pc { display: flex; gap: 12px; margin: 10px 0 12px; padding: 10px; border: 1px solid #efe6d8; border-radius: 14px; background: #fcfaf6; }
.cai__pc:last-child { margin-bottom: 2px; }
.cai__pc-img { flex: none; display: block; width: 84px; height: 84px; overflow: hidden; border-radius: 10px; background: #f1ebe1; }
.cai__pc-img img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform 0.35s ease; }
.cai__pc:hover .cai__pc-img img { transform: scale(1.05); }
.cai__pc-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.cai__pc-body small { color: #9a7438; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cai__pc-name { margin-top: 2px; color: #1c1612; font-family: var(--casetti-font-display, "Cormorant Garamond", serif); font-size: 17px; font-weight: 500; line-height: 1.2; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cai__pc-name:hover { color: #8a6a32; }
.cai__pc-price { margin-top: 4px; color: #1c1612; font-size: 14px; font-weight: 600; }
.cai__pc-price s { color: #9b9187; font-weight: 400; }
.cai__pc-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.cai__pc-see, .cai__pc-cart, .cai__pc-done { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; cursor: pointer; }
.cai__pc-see { border: 1px solid #d9cbb3; background: #fff; color: #1c1612; }
.cai__pc-see:hover { border-color: #b98d45; }
.cai__pc-cart { border: 0; background: #1c1612; color: #ecd29b; }
.cai__pc-cart:hover { background: #000; }
.cai__pc-cart:disabled { opacity: 0.6; cursor: default; }
.cai__pc-done { border: 0; background: #e9f6ee; color: #1d6b3c; }

/* Chips: one row that scrolls sideways */
.cai--v2 .cai__chips { flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.cai--v2 .cai__chips::-webkit-scrollbar { display: none; }
.cai--v2 .cai__chips button { flex: none; white-space: nowrap; }

.cai--v2 .cai__form { margin: 4px 12px 0; padding: 6px 6px 6px 14px; border-color: #e6dccb; border-radius: 24px; box-shadow: 0 6px 18px -12px rgba(60, 40, 15, 0.35); }
.cai--v2 .cai__send { width: 38px; height: 38px; background: linear-gradient(135deg, #b98d45, #ecd29b 55%, #b98d45); color: #121110; }
.cai--v2 .cai__foot { margin-top: 8px; font-size: 10.5px; }

@media (max-width: 767px) {
	.cai--v2 .cai__panel { width: auto; height: 100dvh; border-radius: 0; box-shadow: none; }
	.cai--v2 .cai__pc-img { width: 78px; height: 78px; }
}
/* The theme's button rules (padding, min-height, letter-spacing) stay out of the card */
.cai .cai__pc-act .cai__pc-see, .cai .cai__pc-act .cai__pc-cart, .cai .cai__pc-act .cai__pc-done { box-sizing: border-box; min-height: 0; height: 30px; margin: 0; padding: 0 13px; line-height: 1; text-transform: none; letter-spacing: 0.02em; white-space: nowrap; box-shadow: none; }

/* The conversation is the part that scrolls (iOS: momentum, and a flex child that may shrink below its content) */
.cai__log { min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
@media (max-width: 767px) {
	.cai--v2 .cai__panel { bottom: auto; transition: opacity 0.2s, visibility 0s 0.2s; transform: none; }
	.cai--v2.is-open .cai__panel { transition: opacity 0.2s; }
}
