/**
 * Websight — CTA widget stilleri.
 * Renkler .ws-cta üzerindeki CSS değişkenlerinden gelir (panelde ayarlanır):
 *   --ws-primary  buton/vurgu rengi
 *   --ws-bg       panel arka planı
 *   --ws-text     panel metin rengi
 */

.ws-cta {
	--ws-primary: #C79A3C;
	--ws-bg: #ffffff;
	--ws-text: #1f2430;
	--ws-muted: color-mix(in srgb, var(--ws-text) 55%, transparent);
	--ws-row-bg: color-mix(in srgb, var(--ws-text) 5%, var(--ws-bg));
	--ws-row-bg-hover: color-mix(in srgb, var(--ws-text) 9%, var(--ws-bg));
	--ws-border: color-mix(in srgb, var(--ws-text) 10%, transparent);
	--ws-wa: #25D366;

	position: fixed;
	/* İstifleme: aynı tarafta ikinci buton, birincinin üstüne biner (--ws-stack: 0|1). */
	bottom: calc(24px + (var(--ws-stack, 0) * 78px));
	z-index: 99990;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.4;
}

.ws-cta *,
.ws-cta *::before,
.ws-cta *::after {
	box-sizing: border-box;
}

.ws-cta--right { right: 24px; }
.ws-cta--left  { left: 24px; }

/* Cihaz görünürlüğü (kırılım: 1024px). Masaüstü ≥1024, mobil+tablet <1024. */
@media (min-width: 1024px) {
	.ws-cta--vis-mobile { display: none !important; } /* sadece mobil+tablet: masaüstünde gizle */
}
@media (max-width: 1023px) {
	.ws-cta--vis-desktop { display: none !important; } /* sadece masaüstü: mobil+tablette gizle */
}

/* ============================ Yüzen buton (FAB) ============================ */
.ws-cta__fab {
	position: relative;
	isolation: isolate; /* nabız halkalarını kendi katmanında tut (sayfa arkasına düşmesin) */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: var(--ws-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--ws-primary) 60%, transparent),
		0 4px 10px rgba(0, 0, 0, 0.12);
	transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease;
	-webkit-tap-highlight-color: transparent;
	text-decoration: none;
}

.ws-cta__fab:hover { transform: translateY(-2px) scale(1.04); }
.ws-cta__fab:active { transform: scale(.96); }
.ws-cta__fab:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--ws-primary) 45%, #fff);
	outline-offset: 3px;
}

.ws-cta__fab-icon {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity .2s ease, transform .28s ease;
}
.ws-cta__fab-icon svg { width: 28px; height: 28px; display: block; }

/* Açık/kapalı ikon geçişi */
.ws-cta__fab-icon--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.ws-cta.is-open .ws-cta__fab-icon--open  { opacity: 0; transform: rotate(90deg) scale(.6); }
.ws-cta.is-open .ws-cta__fab-icon--close { opacity: 1; transform: rotate(0) scale(1); }

/* Çevrimiçi noktası */
.ws-cta__dot {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid var(--ws-primary);
	box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
	animation: ws-dot-pulse 2.4s ease-out infinite;
}
.ws-cta.is-open .ws-cta__dot { display: none; }

@keyframes ws-dot-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
	70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Dış hâle (nabız) — butondan dışa yayılan çift dalga */
.ws-cta__pulse,
.ws-cta__pulse::before {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--ws-primary);
	z-index: -1;
	pointer-events: none;
}
.ws-cta__pulse {
	animation: ws-ring 2.6s ease-out infinite;
}
.ws-cta__pulse::before {
	content: "";
	animation: ws-ring 2.6s ease-out infinite;
	animation-delay: 1.3s; /* ikinci dalga kaydırmalı */
}
.ws-cta.is-open .ws-cta__pulse,
.ws-cta.is-open .ws-cta__pulse::before { animation: none; opacity: 0; }

@keyframes ws-ring {
	0%   { transform: scale(1);   opacity: .5; }
	80%  { transform: scale(2.1); opacity: 0; }
	100% { transform: scale(2.1); opacity: 0; }
}

/* ================================ Panel ================================== */
.ws-cta__panel {
	position: absolute;
	bottom: calc(100% + 16px);
	width: 360px;
	max-width: calc(100vw - 32px);
	padding: 22px;
	background: var(--ws-bg);
	color: var(--ws-text);
	border-radius: 22px;
	box-shadow: 0 24px 60px -12px rgba(16, 24, 40, .28), 0 8px 20px -8px rgba(16, 24, 40, .16);

	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(.96);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity .24s ease, transform .28s cubic-bezier(.34, 1.3, .5, 1), visibility .24s;
}
.ws-cta--left .ws-cta__panel { transform-origin: bottom left; }
.ws-cta--right .ws-cta__panel { right: 0; }
.ws-cta--left  .ws-cta__panel { left: 0; }

.ws-cta.is-open .ws-cta__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Panel başlığı */
.ws-cta__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}
.ws-cta__eyebrow {
	margin: 0 0 6px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ws-muted);
}
.ws-cta__title {
	margin: 0;
	font-size: 25px;
	line-height: 1.18;
	font-weight: 800;
	letter-spacing: -.01em;
	color: var(--ws-text);
}
.ws-cta__collapse {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--ws-border);
	background: transparent;
	color: var(--ws-muted);
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
}
.ws-cta__collapse svg { width: 20px; height: 20px; }
.ws-cta__collapse:hover { background: var(--ws-row-bg-hover); color: var(--ws-text); }

/* Aksiyon listesi */
.ws-cta__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ws-cta__action {
	display: flex;
	flex-wrap: nowrap; /* host tema fazladan öğe eklese bile satır alt alta düşmesin */
	align-items: center;
	gap: 15px;
	padding: 14px 16px;
	border-radius: 16px;
	background: var(--ws-row-bg);
	color: var(--ws-text);
	text-decoration: none;
	transition: background .18s ease, transform .18s ease;
}
.ws-cta__action:hover {
	background: var(--ws-row-bg-hover);
	transform: translateX(2px);
}
.ws-cta__action:focus-visible {
	outline: 2px solid var(--ws-primary);
	outline-offset: 2px;
}

/* ===== TEMA ZIRHI =====
   Host temalar dış linkleri (`a[target="_blank"]` — bizim WhatsApp linkimiz) hedef alıp
   `display:inline-block`, ::after dış-bağlantı ikonu vb. ekleyebiliyor. Bu seçicilerin
   özgüllüğü tek-sınıfımızı (.ws-cta__action) geçtiği için satır dikey bozuluyordu — ve
   yalnızca WhatsApp'ta, çünkü telefon `tel:` dış link değil.
   Yüksek özgüllük + !important ile widget bağlantılarının düzenini kilitliyoruz. */
.ws-cta[data-ws-cta] a.ws-cta__action {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	text-decoration: none !important;
	float: none !important;
	width: auto !important;
}
.ws-cta[data-ws-cta] a.ws-cta__fab {
	display: inline-flex !important;
	text-decoration: none !important;
	float: none !important;
}
.ws-cta[data-ws-cta] a.ws-cta__action::before,
.ws-cta[data-ws-cta] a.ws-cta__action::after,
.ws-cta[data-ws-cta] a.ws-cta__fab::before,
.ws-cta[data-ws-cta] a.ws-cta__fab::after {
	content: none !important;
	display: none !important;
}

.ws-cta__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 14px;
	background: var(--ws-bg);
	color: var(--ws-primary);
	box-shadow: 0 4px 12px -4px rgba(16, 24, 40, .18), 0 0 0 1px var(--ws-border);
}
.ws-cta__icon svg { width: 24px; height: 24px; }

/* WhatsApp satırı yeşil vurgulu */
.ws-cta__action--whatsapp .ws-cta__icon {
	background: color-mix(in srgb, var(--ws-wa) 14%, #fff);
	color: var(--ws-wa);
	box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--ws-wa) 40%, transparent), 0 0 0 1px color-mix(in srgb, var(--ws-wa) 20%, transparent);
}

.ws-cta__meta {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ws-cta__label {
	font-size: 16.5px;
	font-weight: 700;
	color: var(--ws-text);
}
.ws-cta__desc {
	font-size: 13.5px;
	color: var(--ws-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ws-cta__chevron {
	flex: 0 0 auto;
	display: inline-flex;
	color: var(--ws-muted);
	transition: transform .18s ease;
}
.ws-cta__chevron svg { width: 20px; height: 20px; }
.ws-cta__action:hover .ws-cta__chevron { transform: translateX(3px); color: var(--ws-text); }

/* Küçük ekran ince ayar */
@media (max-width: 480px) {
	.ws-cta { bottom: calc(18px + (var(--ws-stack, 0) * 72px)); }
	.ws-cta--right { right: 18px; }
	.ws-cta--left  { left: 18px; }
	.ws-cta__title { font-size: 22px; }
	.ws-cta__panel { padding: 18px; }
}

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
	.ws-cta__pulse,
	.ws-cta__pulse::before,
	.ws-cta__dot { animation: none; }
	.ws-cta__fab,
	.ws-cta__panel,
	.ws-cta__action { transition: none; }
}

/* color-mix desteklemeyen çok eski tarayıcılar için geri düşüş */
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
	.ws-cta { --ws-muted: #6b7280; --ws-row-bg: #f3f4f6; --ws-row-bg-hover: #e9ebef; --ws-border: rgba(0,0,0,.08); }
	.ws-cta__icon { background: #fff; }
	.ws-cta__action--whatsapp .ws-cta__icon { background: #e9f9ef; }
}
