/**
 * Sabit İletişim Butonu — frontend + editör önizleme stilleri
 * Tüm görsel değerler CSS değişkenlerinden gelir; blok ayarları bu değişkenleri yazar.
 */

.bwa-fc {
	position: fixed;
	bottom: calc(var(--fc-bottom, 24px) + env(safe-area-inset-bottom, 0px));
	z-index: var(--fc-z, 55);
	display: flex;
	align-items: flex-end;
	gap: var(--fc-gap, 12px);
	font-family: var(--fc-font, inherit);
	line-height: 1.2;
	transition: opacity var(--fc-dur, 300ms) ease, transform var(--fc-dur, 300ms) ease;
}

.bwa-fc--right {
	right: calc(var(--fc-side, 20px) + env(safe-area-inset-right, 0px));
}

.bwa-fc--left {
	left: calc(var(--fc-side, 20px) + env(safe-area-inset-left, 0px));
	flex-direction: row-reverse;
}

.bwa-fc *,
.bwa-fc *::before,
.bwa-fc *::after {
	box-sizing: border-box;
}

.bwa-fc__stack {
	position: relative;
	display: flex;
}

/* ---------- Kart listesi ---------- */

.bwa-fc__list {
	position: absolute;
	bottom: calc(var(--fc-fab-size, 56px) + var(--fc-gap, 12px));
	display: flex;
	flex-direction: column;
	gap: var(--fc-gap, 12px);
	pointer-events: none;

	/* Kartlar eşit genişlikte: en geniş içeriğe göre, ekranı taşmayacak şekilde. */
	width: max-content;
	min-width: min( var(--fc-card-min, 250px), var(--fc-avail, 100vw) );
	max-width: min( var(--fc-card-max, 320px), var(--fc-avail, 100vw) );
}

/* Kullanılabilir genişlik: ekran − iki yan boşluk − küçük pay. */
.bwa-fc {
	--fc-avail: calc( 100vw - 2 * var(--fc-side, 20px) - 12px );
}

/* "Eşit genişlik" kapalıysa her kart kendi içeriği kadar. */
.bwa-fc--auto-width .bwa-fc__list {
	width: auto;
	min-width: 0;
}

.bwa-fc--right .bwa-fc__list {
	right: 0;
	align-items: flex-end;
}

.bwa-fc--left .bwa-fc__list {
	left: 0;
	align-items: flex-start;
}

.bwa-fc.is-open .bwa-fc__list {
	pointer-events: auto;
}

.bwa-fc__item {
	display: flex;
	align-items: center;
	gap: var(--fc-card-gap, 12px);
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding: var(--fc-card-py, 8px) var(--fc-card-px, 16px);
	border: var(--fc-border-w, 1px) solid var(--fc-item-bd, rgba(0, 0, 0, 0.08));
	border-radius: var(--fc-card-radius, 999px);
	background: var(--fc-item-bg, #ffffff);
	box-shadow: var(--fc-shadow, 0 10px 24px rgba(0, 0, 0, 0.14));
	text-decoration: none;
	cursor: pointer;
	opacity: 0;
	transform: translateY(16px);
	transition:
		opacity var(--fc-dur, 300ms) ease,
		transform var(--fc-dur, 300ms) ease,
		box-shadow 0.25s ease,
		background-color 0.25s ease;
}

.bwa-fc.is-open .bwa-fc__item {
	opacity: 1;
	transform: translateY(0);
}

.bwa-fc--stagger.is-open .bwa-fc__item {
	transition-delay: calc(var(--fc-i, 1) * 55ms);
}

.bwa-fc:not(.is-open) .bwa-fc__item {
	transition-delay: 0s;
}

.bwa-fc.is-open a.bwa-fc__item:hover,
.bwa-fc.is-open a.bwa-fc__item:focus-visible {
	transform: scale(var(--fc-hover-scale, 1.05));
	box-shadow: var(--fc-shadow-hover, 0 16px 34px rgba(0, 0, 0, 0.2));
}

.bwa-fc__item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.bwa-fc__icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--fc-icon-size, 32px);
	height: var(--fc-icon-size, 32px);
	border-radius: var(--fc-icon-radius, 999px);
	background: var(--fc-item-ibg, #111827);
	color: var(--fc-item-ic, #ffffff);
}

.bwa-fc__icon:empty {
	display: none;
}

.bwa-fc__icon svg {
	display: block;
	width: var(--fc-icon-glyph, 18px);
	height: var(--fc-icon-glyph, 18px);
}

.bwa-fc__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-align: var(--fc-align, left);
	gap: 1px;
}

.bwa-fc__label {
	margin: 0;
	font-size: var(--fc-label-size, 10px);
	font-weight: var(--fc-label-weight, 600);
	letter-spacing: var(--fc-label-spacing, 0.08em);
	text-transform: var(--fc-label-tt, uppercase);
	color: var(--fc-item-label, #6b7280);
	line-height: 1.35;
}

.bwa-fc__text {
	margin: 0;
	font-size: var(--fc-text-size, 14px);
	font-weight: var(--fc-text-weight, 600);
	color: var(--fc-item-text, #111827);
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: var(--fc-clamp, 2);
	line-clamp: var(--fc-clamp, 2);
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

/* ---------- Ana buton (FAB) ---------- */

.bwa-fc__fab {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fc-fab-size, 56px);
	height: var(--fc-fab-size, 56px);
	padding: 0;
	border: 0;
	border-radius: var(--fc-fab-radius, 999px);
	background: var(--fc-fab-bg, #111827);
	color: var(--fc-fab-color, #ffffff);
	box-shadow: var(--fc-shadow, 0 10px 24px rgba(0, 0, 0, 0.14));
	cursor: pointer;
	transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}

.bwa-fc__fab:hover,
.bwa-fc__fab:focus-visible {
	background: var(--fc-fab-bg-hover, #1f2937);
	box-shadow: var(--fc-shadow-hover, 0 16px 34px rgba(0, 0, 0, 0.2));
}

.bwa-fc__fab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.bwa-fc__glyph {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity var(--fc-dur, 300ms) ease, transform var(--fc-dur, 300ms) ease;
}

.bwa-fc__fab .bwa-fc__glyph {
	position: absolute;
	inset: 0;
}

.bwa-fc__fab svg {
	display: block;
	width: var(--fc-fab-glyph, 22px);
	height: var(--fc-fab-glyph, 22px);
	margin: auto;
}

.bwa-fc__glyph--open {
	opacity: 0;
	transform: scale(0.6) rotate(-90deg);
}

.bwa-fc.is-open .bwa-fc__glyph--open {
	opacity: 1;
	transform: none;
}

.bwa-fc.is-open .bwa-fc__glyph--closed {
	opacity: 0;
	transform: scale(0.6) rotate(90deg);
}

/* Açık ikon tanımlanmadıysa kapalı ikon görünür kalsın. */
.bwa-fc__glyph--open:empty {
	display: none;
}

.bwa-fc__fab:has(.bwa-fc__glyph--open:empty) .bwa-fc__glyph--closed {
	opacity: 1;
}

.bwa-fc--rotate.is-open .bwa-fc__fab:has(.bwa-fc__glyph--open:empty) .bwa-fc__glyph--closed {
	transform: rotate(135deg);
}

/* Nabız efekti */
.bwa-fc--pulse .bwa-fc__fab::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--fc-pulse, #111827);
	opacity: 0.55;
	z-index: -1;
	animation: bwa-fc-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bwa-fc--pulse.is-open .bwa-fc__fab::after {
	animation: none;
	opacity: 0;
}

@keyframes bwa-fc-pulse {
	0% {
		transform: scale(1);
		opacity: 0.5;
	}
	70% {
		transform: scale(1.6);
		opacity: 0;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

/* ---------- Yukarı çık ---------- */

.bwa-fc__top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--fc-top-size, 56px);
	height: var(--fc-top-size, 56px);
	padding: 0;
	border: 0;
	border-radius: var(--fc-top-radius, 999px);
	background: var(--fc-top-bg, #f3f4f6);
	color: var(--fc-top-color, #111827);
	box-shadow: var(--fc-shadow, 0 10px 24px rgba(0, 0, 0, 0.14));
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background-color 0.25s ease, box-shadow 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}

.bwa-fc__top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.bwa-fc__top:hover,
.bwa-fc__top:focus-visible {
	background: var(--fc-top-bg-hover, #e5e7eb);
	box-shadow: var(--fc-shadow-hover, 0 16px 34px rgba(0, 0, 0, 0.2));
}

.bwa-fc__top svg {
	display: block;
	width: var(--fc-top-glyph, 24px);
	height: var(--fc-top-glyph, 24px);
}

/* ---------- Görünürlük ---------- */

.bwa-fc--hidden {
	display: none !important;
}

.bwa-fc--reveal {
	opacity: 0;
	transform: translateY(14px);
	pointer-events: none;
}

.bwa-fc--reveal.is-revealed {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.bwa-fc,
	.bwa-fc *,
	.bwa-fc *::after {
		transition-duration: 0.01ms !important;
		animation: none !important;
	}
}

.bwa-fc--auto-width .bwa-fc__item {
	width: auto;
	min-width: min( var(--fc-card-min, 250px), var(--fc-avail, 100vw) );
	max-width: min( var(--fc-card-max, 320px), var(--fc-avail, 100vw) );
}

/* Mobil: kartlar ekranın tamamına yayılsın, daha küçük bir alt sınırla. */
@media (max-width: 480px) {
	.bwa-fc__list {
		min-width: 0;
		max-width: calc( 100vw - 2 * var(--fc-side, 20px) );
	}

	.bwa-fc__item,
	.bwa-fc--auto-width .bwa-fc__item {
		min-width: min( var(--fc-card-min-m, 220px), calc( 100vw - 2 * var(--fc-side, 20px) ) );
		max-width: calc( 100vw - 2 * var(--fc-side, 20px) );
	}
}

/* ---------- Editör önizlemesi ---------- */

.bwa-fc--preview {
	position: relative;
	inset: auto;
	bottom: auto;
	right: auto;
	left: auto;
	opacity: 1;
	transform: none;
	pointer-events: auto;
	align-items: flex-end;
	padding: 8px 0;
}

.bwa-fc--preview {
	--fc-avail: 100%;
}

.bwa-fc--preview .bwa-fc__list {
	position: static;
	pointer-events: auto;
	margin-bottom: var(--fc-gap, 12px);
}

.bwa-fc--preview .bwa-fc__stack {
	flex-direction: column;
}

.bwa-fc--right.bwa-fc--preview .bwa-fc__stack {
	align-items: flex-end;
}

.bwa-fc--left.bwa-fc--preview .bwa-fc__stack {
	align-items: flex-start;
}

.bwa-fc--preview .bwa-fc__item {
	opacity: 1;
	transform: none;
	transition-delay: 0s;
}

.bwa-fc--preview .bwa-fc__top {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (max-width: 480px) {
	.bwa-fc--preview .bwa-fc__list,
	.bwa-fc--preview .bwa-fc__item {
		max-width: 100%;
	}
}
