/*
 * Floating contact menu. A round button with a pulsing ring opens a column of round shortcuts that pop up one after
 * another (scale from 0, 30 ms apart) and slide up; hovering a shortcut shrinks it slightly. Colours follow the Blocksy palette.
 */
.vilifa-fab {
	--fab-green: #145e39;
	--fab-green-light: color-mix(in srgb, var(--fab-green) 70%, #fff);
	--fab-ring: 20 94 57;
	--fab-hotline: #ff3b3b;
	position: fixed;
	inset-inline-end: var(--fab-side, 26px);
	inset-block-end: var(--fab-bottom, 48px);
	z-index: 9980;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: var(--theme-font-family, inherit);
}

.vilifa-fab__button {
	position: relative;
	isolation: isolate;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-image: linear-gradient(90deg, var(--fab-green), var(--fab-green-light));
	background-size: 140% 100%;
	background-position: left center;
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease, background-position .15s ease-in-out;
	box-shadow: 0 8px 10px rgb(var(--fab-ring) / 30%);
}

/* The pulsing ring is a pseudo-element that only scales and fades (composited), instead of animating box-shadow, which repaints every frame. */
.vilifa-fab__button::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgb(var(--fab-ring) / 28%);
	pointer-events: none;
	z-index: -1;
	animation: vilifa-fab-wave .9s ease-out infinite;
}

.vilifa-fab__button:hover { background-position: right center; }
.vilifa-fab__button:focus-visible { outline: 3px solid var(--theme-palette-color-5, #dce7de); outline-offset: 3px; }
.vilifa-fab__button svg { width: 32px; height: 32px; }
.vilifa-fab__open, .vilifa-fab__close { display: grid; place-items: center; }
.vilifa-fab__close, .vilifa-fab[data-open="true"] .vilifa-fab__open { display: none; }
.vilifa-fab[data-open="true"] .vilifa-fab__close { display: grid; }
.vilifa-fab[data-open="true"] .vilifa-fab__button { box-shadow: 0 8px 16px rgb(107 112 119 / 20%); }
.vilifa-fab[data-open="true"] .vilifa-fab__button::after { display: none; }

@keyframes vilifa-fab-wave {
	0% { transform: scale(1); opacity: .8; }
	100% { transform: scale(1.55); opacity: 0; }
}

/* The shortcuts sit above the button, hidden (and out of the tab order) until opened. */
.vilifa-fab__items {
	position: absolute;
	inset-block-end: 74px;
	inset-inline-end: 2px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(16px);
	transition: opacity .12s, transform .12s, visibility 0s .25s;
}

.vilifa-fab[data-open="true"] .vilifa-fab__items {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
	transition: opacity .12s, transform .12s, visibility 0s;
}

.vilifa-fab__item {
	position: relative;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--fab-green);
	color: #fff;
	text-decoration: none;
	box-shadow: 0 8px 16px rgb(107 112 119 / 20%);
	transform: scale(0);
	transition: transform .25s ease-out, background-color .12s;
}

.vilifa-fab__item svg { width: 30px; height: 30px; }
.vilifa-fab__item:focus-visible { outline: 3px solid var(--theme-palette-color-5, #dce7de); outline-offset: 3px; }
.vilifa-fab__item--phone:hover { background: var(--theme-palette-color-2, #365743); }
.vilifa-fab__item--mail { background: #fff; color: var(--fab-green); }
.vilifa-fab__item--mail:hover { background: var(--theme-palette-color-6, #e6f3ec); }
.vilifa-fab__item--form { background: var(--theme-palette-color-6, #e6f3ec); color: var(--fab-green); }
.vilifa-fab__item--form:hover { background: var(--theme-palette-color-5, #dce7de); }

.vilifa-fab[data-open="true"] .vilifa-fab__item { transform: scale(1); }
.vilifa-fab[data-open="true"] li:nth-last-child(2) .vilifa-fab__item { transition-delay: 20ms, 0s; }
.vilifa-fab[data-open="true"] li:nth-last-child(1) .vilifa-fab__item { transition-delay: 0s, 0s; }
.vilifa-fab[data-open="true"] li:nth-last-child(3) .vilifa-fab__item { transition-delay: 40ms, 0s; }
.vilifa-fab[data-open="true"] li:nth-last-child(4) .vilifa-fab__item { transition-delay: 60ms, 0s; }
.vilifa-fab[data-open="true"] li:nth-last-child(n+5) .vilifa-fab__item { transition-delay: 80ms, 0s; }

/* Name of the shortcut, shown to the left on hover or keyboard focus (desktop). */
.vilifa-fab__label {
	position: absolute;
	inset-inline-end: calc(100% + 12px);
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--theme-palette-color-4, #192c27);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(6px);
	pointer-events: none;
	transition: opacity .1s, transform .1s;
}

.vilifa-fab__item:hover .vilifa-fab__label, .vilifa-fab__item:focus-visible .vilifa-fab__label { opacity: 1; transform: none; }

@media (max-width: 689px) {
	.vilifa-fab { inset-inline-end: var(--fab-side-m, 16px); inset-block-end: var(--fab-bottom-m, 24px); }
	.vilifa-fab__button { width: 56px; height: 56px; }
	.vilifa-fab__button svg { width: 30px; height: 30px; }
	.vilifa-fab__items { inset-block-end: 70px; inset-inline-end: 2px; gap: 14px; }
	.vilifa-fab__item { width: 52px; height: 52px; }
	.vilifa-fab__item svg { width: 28px; height: 28px; }
	.vilifa-fab__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.vilifa-fab__button::after { animation: none; display: none; }
	.vilifa-fab__button { box-shadow: 0 8px 16px rgb(107 112 119 / 20%); transition: none; }
	.vilifa-fab__button svg, .vilifa-fab__item, .vilifa-fab__item svg, .vilifa-fab__items, .vilifa-fab__label { transition: none; }
}

@media print { .vilifa-fab { display: none; } }

/* Blocksy turns link text orange on hover; keep each shortcut's own icon colour. */
.vilifa-fab a.vilifa-fab__item--phone, .vilifa-fab a.vilifa-fab__item--phone:hover, .vilifa-fab a.vilifa-fab__item--phone:focus { color: #fff; }
.vilifa-fab a.vilifa-fab__item--mail, .vilifa-fab a.vilifa-fab__item--mail:hover, .vilifa-fab a.vilifa-fab__item--mail:focus,
.vilifa-fab a.vilifa-fab__item--form, .vilifa-fab a.vilifa-fab__item--form:hover, .vilifa-fab a.vilifa-fab__item--form:focus { color: var(--fab-green); }

/* Brand logos are shown as they are on a white disc; the hotline keeps the old site's red. */
.vilifa-fab__item--shopee, .vilifa-fab__item--messenger, .vilifa-fab__item--zalo { background: #fff; }
.vilifa-fab__item--shopee:hover, .vilifa-fab__item--messenger:hover, .vilifa-fab__item--zalo:hover,
.vilifa-fab__item--shopee:focus-visible, .vilifa-fab__item--messenger:focus-visible, .vilifa-fab__item--zalo:focus-visible { background: #e8eaed; }
.vilifa-fab__item img { display: block; width: 34px; height: 34px; }
.vilifa-fab a.vilifa-fab__item--phone { background: var(--fab-hotline); box-shadow: 0 4px 12px color-mix(in srgb, var(--fab-hotline) 35%, transparent); }
.vilifa-fab a.vilifa-fab__item--phone:hover, .vilifa-fab a.vilifa-fab__item--phone:focus-visible { background: color-mix(in srgb, var(--fab-hotline) 82%, #000); }
@media (max-width: 689px) { .vilifa-fab__item img { width: 32px; height: 32px; } }

/* The scroll-to-top button (Blocksy) sits right above the contact button; hide it while the contact menu is open. */
.ct-back-to-top { z-index: 9970; }
body:has(.vilifa-fab[data-open="true"]) .ct-back-to-top { opacity: 0; visibility: hidden; pointer-events: none; }

/* Scroll-to-top follows the same quick, colour-only hover. */
.ct-back-to-top { transition: opacity .15s ease, background-color .12s ease, transform .15s ease, visibility .15s ease; }
.ct-back-to-top { width: 44px; height: 44px; padding: 0; }
.ct-back-to-top:focus-visible { outline: 3px solid var(--theme-palette-color-5, #dce7de); outline-offset: 3px; }
.ct-back-to-top { border: 1px solid var(--theme-palette-color-1, #145e39); box-sizing: border-box; }

.vilifa-fab__item--email, .vilifa-fab__item--link { background: #fff; color: var(--fab-green); }
.vilifa-fab a.vilifa-fab__item--email, .vilifa-fab a.vilifa-fab__item--email:hover, .vilifa-fab a.vilifa-fab__item--link, .vilifa-fab a.vilifa-fab__item--link:hover { color: var(--fab-green); }
.vilifa-fab__item--email:hover, .vilifa-fab__item--link:hover, .vilifa-fab__item--facebook:hover { background: #e8eaed; }
.vilifa-fab__item--facebook { background: #fff; }

/* Placed on the left: the column, the labels and the corner flip. */
.vilifa-fab--left { inset-inline-end: auto; inset-inline-start: var(--fab-side, 26px); }
.vilifa-fab--left .vilifa-fab__items { inset-inline-end: auto; inset-inline-start: 2px; }
.vilifa-fab--left .vilifa-fab__label { inset-inline-end: auto; inset-inline-start: calc(100% + 12px); transform: translateX(-6px); }
.vilifa-fab--left .vilifa-fab__item:hover .vilifa-fab__label, .vilifa-fab--left .vilifa-fab__item:focus-visible .vilifa-fab__label { transform: none; }
@media (max-width: 689px) { .vilifa-fab--left { inset-inline-end: auto; inset-inline-start: var(--fab-side-m, 16px); } }
