/**
 * Vitalia Floating Box – style frontu.
 * Bez zależności od motywu: wszystkie kolory jako własne zmienne CSS.
 */

.vfb {
	--vfb-bg: #1164c9;
	--vfb-fg: #ffffff;
	--vfb-muted: rgba(255, 255, 255, 0.85);
	--vfb-border: transparent;
	--vfb-cta-bg: #ffffff;
	--vfb-cta-fg: #0d4f9f;
	--vfb-close-bg: rgba(255, 255, 255, 0.18);
	--vfb-close-fg: #ffffff;
	--vfb-radius: 16px;
	--vfb-gap: 20px;

	position: fixed;
	z-index: 9990;
	box-sizing: border-box;
	max-width: calc(100vw - 32px);
	background: var(--vfb-bg);
	color: var(--vfb-fg);
	border: 1px solid var(--vfb-border);
	border-radius: var(--vfb-radius);
	box-shadow: 0 18px 44px rgba(10, 25, 45, 0.28);
	font-family: inherit;
	line-height: 1.5;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.28s ease, transform 0.28s ease;
}

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

.vfb[hidden] {
	display: none;
}

.vfb.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.vfb.is-leaving {
	opacity: 0;
	transform: translateY(14px);
}

/* ---------- Pozycje ---------- */
.vfb--pos-right {
	right: 20px;
	bottom: 20px;
}

.vfb--pos-left {
	left: 20px;
	bottom: 20px;
}

.vfb--pos-center {
	left: 50%;
	bottom: 20px;
	transform: translate(-50%, 14px);
}

.vfb--pos-center.is-visible {
	transform: translate(-50%, 0);
}

.vfb--pos-center.is-leaving {
	transform: translate(-50%, 14px);
}

/* ---------- Przycisk zamykania ---------- */
.vfb__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--vfb-close-bg);
	color: var(--vfb-close-fg);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
	z-index: 2;
}

/* Powiększone pole dotyku bez zmiany wyglądu (min. 44x44 px). */
.vfb__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
}

.vfb__close:hover,
.vfb__close:focus-visible {
	background: rgba(255, 255, 255, 0.32);
	transform: scale(1.06);
}

.vfb__close:focus-visible {
	outline: 2px solid var(--vfb-fg);
	outline-offset: 2px;
}

/* ---------- Treść ---------- */
.vfb__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: var(--vfb-gap);
	padding-right: calc(var(--vfb-gap) + 24px);
}

.vfb__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--vfb-fg);
}

.vfb__content {
	margin: 0;
	font-size: 0.92rem;
	color: var(--vfb-muted);
}

.vfb__content a {
	color: inherit;
	text-decoration: underline;
}

.vfb__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	min-height: 44px;
	padding: 10px 22px;
	border-radius: 9999px;
	background: var(--vfb-cta-bg);
	color: var(--vfb-cta-fg);
	font-size: 0.92rem;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.vfb__cta:hover,
.vfb__cta:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
	color: var(--vfb-cta-fg);
	filter: brightness(0.97);
}

.vfb__cta:focus-visible {
	outline: 2px solid var(--vfb-fg);
	outline-offset: 2px;
}

/* ---------- Układ: karta ---------- */
.vfb--card,
.vfb--card_image {
	width: 360px;
}

/* ---------- Układ: karta z obrazkiem ---------- */
.vfb--card_image .vfb__media {
	margin: 0;
	line-height: 0;
	border-radius: var(--vfb-radius) var(--vfb-radius) 0 0;
	overflow: hidden;
}

.vfb--card_image .vfb__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* ---------- Układ: kontakt ---------- */
.vfb--contact {
	width: auto;
}

.vfb--contact .vfb__body {
	flex-direction: row;
	align-items: center;
	gap: 14px;
}

.vfb__phone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: var(--vfb-fg);
}

.vfb__phone {
	display: block;
	font-size: 1.1rem;
	font-weight: 800;
	color: var(--vfb-fg);
	text-decoration: none;
	white-space: nowrap;
}

.vfb__phone:hover,
.vfb__phone:focus-visible {
	text-decoration: underline;
	color: var(--vfb-fg);
}

.vfb--contact .vfb__cta {
	align-self: center;
	flex-shrink: 0;
}

/* ---------- Układ: pasek ---------- */
.vfb--bar {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	transform: translateY(100%);
}

.vfb--bar.is-visible {
	transform: translateY(0);
}

.vfb--bar.is-leaving {
	transform: translateY(100%);
}

.vfb--bar .vfb__body {
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 18px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 14px 64px;
}

.vfb--bar .vfb__text {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.vfb--bar .vfb__title,
.vfb--bar .vfb__content {
	font-size: 0.95rem;
}

.vfb--bar .vfb__cta {
	align-self: center;
	flex-shrink: 0;
}

.vfb--bar .vfb__close {
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
}

.vfb--bar .vfb__close:hover,
.vfb--bar .vfb__close:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

/* ---------- Palety ---------- */
.vfb--vitalia {
	--vfb-bg: #1164c9;
	--vfb-fg: #ffffff;
	--vfb-muted: rgba(255, 255, 255, 0.86);
	--vfb-cta-bg: #ffffff;
	--vfb-cta-fg: #0d4f9f;
}

.vfb--navy {
	--vfb-bg: #0a192d;
	--vfb-fg: #ffffff;
	--vfb-muted: rgba(226, 232, 240, 0.86);
	--vfb-cta-bg: #38bdf8;
	--vfb-cta-fg: #06263c;
}

.vfb--green {
	--vfb-bg: #047857;
	--vfb-fg: #ffffff;
	--vfb-muted: rgba(236, 253, 245, 0.88);
	--vfb-cta-bg: #ffffff;
	--vfb-cta-fg: #04684c;
}

.vfb--light {
	--vfb-bg: #ffffff;
	--vfb-fg: #0a192d;
	--vfb-muted: #475569;
	--vfb-border: #e2e8f0;
	--vfb-cta-bg: #1164c9;
	--vfb-cta-fg: #ffffff;
	--vfb-close-bg: #f1f5f9;
	--vfb-close-fg: #334155;
	box-shadow: 0 18px 44px rgba(10, 25, 45, 0.16);
}

.vfb--light .vfb__phone-icon {
	background: #eff6ff;
	color: #1164c9;
}

.vfb--light .vfb__close:hover,
.vfb--light .vfb__close:focus-visible {
	background: #e2e8f0;
}

.vfb--amber {
	--vfb-bg: #b45309;
	--vfb-fg: #ffffff;
	--vfb-muted: rgba(255, 247, 237, 0.9);
	--vfb-cta-bg: #ffffff;
	--vfb-cta-fg: #9a4408;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.vfb--hide-mobile {
		display: none !important;
	}

	.vfb:not(.vfb--preview) {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.vfb--pos-center:not(.vfb--preview) {
		transform: translateY(14px);
	}

	.vfb--pos-center.is-visible:not(.vfb--preview) {
		transform: translateY(0);
	}

	.vfb--pos-center.is-leaving:not(.vfb--preview) {
		transform: translateY(14px);
	}

	.vfb--bar:not(.vfb--preview) {
		left: 0;
		right: 0;
		bottom: 0;
		border-radius: 0;
	}

	.vfb--bar .vfb__body,
	.vfb--contact .vfb__body {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px));
	}

	.vfb--bar .vfb__text,
	.vfb--contact .vfb__text {
		justify-content: center;
		align-items: center;
		flex-direction: column;
		gap: 4px;
	}

	.vfb__cta,
	.vfb--contact .vfb__cta,
	.vfb--bar .vfb__cta {
		align-self: stretch;
		width: 100%;
	}

	.vfb--contact .vfb__phone-icon {
		display: none;
	}

	.vfb--bar .vfb__close {
		top: 8px;
		right: 8px;
		transform: none;
	}

	.vfb--bar .vfb__close:hover,
	.vfb--bar .vfb__close:focus-visible {
		transform: scale(1.06);
	}
}

/* ---------- Ograniczone animacje ---------- */
@media (prefers-reduced-motion: reduce) {
	.vfb,
	.vfb__cta,
	.vfb__close {
		transition: none !important;
	}

	.vfb,
	.vfb--bar,
	.vfb--pos-center {
		transform: none !important;
	}
}

/* ---------- Podgląd w panelu ---------- */
.vfb--preview {
	position: relative;
	inset: auto;
	opacity: 1;
	transform: none;
	margin: 0;
	box-shadow: 0 10px 26px rgba(10, 25, 45, 0.18);
}
