/* Tombrand Floating Contact */

.tbfc {
	--tbfc-s: var(--tbfc-s-d, 60px);
	--tbfc-x: var(--tbfc-x-d, 24px);
	--tbfc-y: var(--tbfc-y-d, 24px);
	--tbfc-dir: 1;
	--tbfc-ease-out: cubic-bezier(.16, 1, .3, 1);
	--tbfc-ease-io: cubic-bezier(.65, 0, .35, 1);
	--tbfc-spring: cubic-bezier(.34, 1.56, .64, 1);

	position: fixed;
	z-index: var(--tbfc-z, 9990);
	width: var(--tbfc-s);
	display: flex;
	flex-direction: column;
	align-items: center;
	pointer-events: none;
	font-family: inherit;
	line-height: 1.2;
	-webkit-tap-highlight-color: transparent;
	animation: tbfc-in .8s var(--tbfc-spring) var(--tbfc-delay, 0s) both;
}

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

/* Pozycje */
.tbfc--br { right: var(--tbfc-x); bottom: calc(var(--tbfc-y) + env(safe-area-inset-bottom, 0px)); }
.tbfc--bl { left: var(--tbfc-x);  bottom: calc(var(--tbfc-y) + env(safe-area-inset-bottom, 0px)); }
.tbfc--tr { right: var(--tbfc-x); top: calc(var(--tbfc-y) + env(safe-area-inset-top, 0px)); }
.tbfc--tl { left: var(--tbfc-x);  top: calc(var(--tbfc-y) + env(safe-area-inset-top, 0px)); }

.tbfc--tr,
.tbfc--tl {
	--tbfc-dir: -1;
	flex-direction: column-reverse;
}

@keyframes tbfc-in {
	from {
		opacity: 0;
		visibility: hidden;
		transform: translateY(calc(28px * var(--tbfc-dir))) scale(.4);
	}
	to {
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

/* Tło: kółko, które rozciąga się w pastylkę */
.tbfc__panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--tbfc-s);
	border-radius: calc(var(--tbfc-s) / 2);
	background: var(--tbfc-bg, #1c1b19);
	box-shadow:
		0 14px 34px -10px rgba(0, 0, 0, .38),
		0 4px 12px -4px rgba(0, 0, 0, .18);
	pointer-events: none;
	transition: height .42s var(--tbfc-ease-io) .12s;
	will-change: height;
}

.tbfc--tr .tbfc__panel,
.tbfc--tl .tbfc__panel {
	bottom: auto;
	top: 0;
}

.tbfc.is-open .tbfc__panel {
	height: 100%;
	pointer-events: auto;
	transition: height .6s var(--tbfc-ease-out) 0s;
}

/* Lista opcji */
.tbfc .tbfc__list {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin: 0;
	padding: calc(var(--tbfc-s) * .12) 0 0;
	list-style: none;
	pointer-events: none;
}

.tbfc--tr .tbfc__list,
.tbfc--tl .tbfc__list {
	flex-direction: column-reverse;
	padding: 0 0 calc(var(--tbfc-s) * .12);
}

.tbfc.is-open .tbfc__list {
	pointer-events: auto;
}

.tbfc .tbfc__item {
	--tbfc-d: calc((var(--tbfc-n, 3) - 1 - var(--i, 0)) * 55ms + 90ms);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: calc(var(--tbfc-s) * .92);
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(calc(14px * var(--tbfc-dir))) scale(.5);
	transition:
		opacity .18s ease calc(var(--i, 0) * 25ms),
		transform .25s ease calc(var(--i, 0) * 25ms),
		visibility 0s linear calc(.25s + var(--i, 0) * 25ms);
}

.tbfc .tbfc__item::before,
.tbfc .tbfc__item::marker {
	content: none;
	display: none;
}

.tbfc.is-open .tbfc__item {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition:
		opacity .35s ease var(--tbfc-d),
		transform .55s var(--tbfc-spring) var(--tbfc-d),
		visibility 0s linear 0s;
}

/* Link z ikoną */
.tbfc .tbfc__link {
	all: unset;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--tbfc-s) * .82);
	height: calc(var(--tbfc-s) * .82);
	border-radius: 50%;
	color: var(--tbfc-icon, #bdb8ad);
	cursor: pointer;
	text-decoration: none;
	transition: color .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.tbfc .tbfc__link:hover,
.tbfc .tbfc__link:focus-visible {
	color: var(--tbfc-icon-hover, #fff);
	background-color: color-mix(in srgb, var(--tbfc-icon-hover, #fff) 7%, transparent);
}

.tbfc .tbfc__link:focus-visible {
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tbfc-icon-hover, #fff) 55%, transparent);
}

.tbfc .tbfc__icon {
	display: block;
	width: calc(var(--tbfc-s) * .38);
	height: calc(var(--tbfc-s) * .38);
	transition: transform .4s var(--tbfc-spring);
}

.tbfc .tbfc__link:hover .tbfc__icon {
	transform: scale(1.12);
}

.tbfc svg {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
}

/* Etykieta (dymek) */
.tbfc .tbfc__tip {
	position: absolute;
	top: 50%;
	right: calc(100% + var(--tbfc-s) * .09 + 12px);
	padding: .72em 1.4em;
	border-radius: 999px;
	background: var(--tbfc-tip-bg, #fff);
	color: var(--tbfc-tip-text, #1c1b19);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	box-shadow:
		0 10px 30px -8px rgba(0, 0, 0, .2),
		0 2px 6px rgba(0, 0, 0, .06);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(10px, -50%) scale(.92);
	transform-origin: right center;
	transition:
		opacity .2s ease,
		transform .35s var(--tbfc-spring),
		visibility 0s linear .2s;
}

.tbfc--bl .tbfc__tip,
.tbfc--tl .tbfc__tip {
	right: auto;
	left: calc(100% + var(--tbfc-s) * .09 + 12px);
	transform: translate(-10px, -50%) scale(.92);
	transform-origin: left center;
}

.tbfc .tbfc__link:hover .tbfc__tip,
.tbfc .tbfc__link:focus-visible .tbfc__tip,
.tbfc.is-open.tbfc--labels-always .tbfc__tip {
	opacity: 1;
	visibility: visible;
	transform: translate(0, -50%) scale(1);
	transition:
		opacity .25s ease,
		transform .45s var(--tbfc-spring),
		visibility 0s linear 0s;
}

.tbfc.is-open.tbfc--labels-always .tbfc__tip {
	transition-delay: calc(var(--tbfc-d) + 80ms);
}

/* Na ekranach dotykowych nie ma najechania, więc etykiety pokazują się od razu */
@media (hover: none) {
	.tbfc.is-open .tbfc__tip {
		opacity: 1;
		visibility: visible;
		transform: translate(0, -50%) scale(1);
		transition:
			opacity .25s ease calc(var(--tbfc-d) + 80ms),
			transform .45s var(--tbfc-spring) calc(var(--tbfc-d) + 80ms),
			visibility 0s linear 0s;
	}
}

/* Przycisk główny */
.tbfc .tbfc__toggle {
	all: unset;
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tbfc-s);
	height: var(--tbfc-s);
	border-radius: 50%;
	color: var(--tbfc-icon-hover, #fff);
	cursor: pointer;
	pointer-events: auto;
}

.tbfc .tbfc__toggle:focus-visible {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbfc-bg, #1c1b19) 35%, transparent);
}

.tbfc .tbfc__plus {
	display: block;
	width: calc(var(--tbfc-s) * .4);
	height: calc(var(--tbfc-s) * .4);
	transition: transform .6s var(--tbfc-spring);
}

.tbfc:not(.is-open) .tbfc__toggle:hover .tbfc__plus {
	transform: rotate(90deg);
}

.tbfc.is-open .tbfc__plus {
	transform: rotate(135deg);
}

/* Pulsowanie przyciągające uwagę */
.tbfc--pulse .tbfc__toggle::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--tbfc-bg, #1c1b19);
	pointer-events: none;
	animation: tbfc-pulse 2.8s var(--tbfc-ease-out) 1.2s infinite;
}

.tbfc--pulse.is-open .tbfc__toggle::before {
	animation: none;
	opacity: 0;
}

@keyframes tbfc-pulse {
	0%        { transform: scale(1);   opacity: .4; }
	70%, 100% { transform: scale(1.75); opacity: 0; }
}

/* Widoczność i rozmiary na telefonach */
@media (max-width: 767px) {
	.tbfc:not(.tbfc--preview) {
		--tbfc-s: var(--tbfc-s-m, 54px);
		--tbfc-x: var(--tbfc-x-m, 16px);
		--tbfc-y: var(--tbfc-y-m, 16px);
	}
	.tbfc--hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
	.tbfc--hide-desktop { display: none !important; }
}

/* Podgląd w panelu */
.tbfc.tbfc--preview { position: absolute; }
.tbfc.tbfc--preview.is-mobile {
	--tbfc-s: var(--tbfc-s-m, 54px);
	--tbfc-x: var(--tbfc-x-m, 16px);
	--tbfc-y: var(--tbfc-y-m, 16px);
}

@media (prefers-reduced-motion: reduce) {
	.tbfc,
	.tbfc *,
	.tbfc *::before {
		animation: none !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
}
