/* =========================================
   Amest WA Button - Frontend floating button
   ========================================= */

.amest-wa-button {
	--amest-wa-size: 48px;

	position: fixed;
	bottom: 24px;
	z-index: 99999;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px;

	background-color: #25d366;
	color: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);

	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.amest-wa-button:hover,
.amest-wa-button:focus {
	background-color: #1eb95a;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	transform: translateY(-2px);
}

.amest-wa-button:focus-visible {
	outline: 3px solid #128c7e;
	outline-offset: 3px;
}

/* Position */

.amest-wa-button--right {
	right: 24px;
}

.amest-wa-button--left {
	left: 24px;
}

/* Size */

.amest-wa-button--small {
	--amest-wa-size: 40px;
}

.amest-wa-button--medium {
	--amest-wa-size: 48px;
}

.amest-wa-button--large {
	--amest-wa-size: 68px;
}

/* Icon */

.amest-wa-button__icon {
	display: block;
	flex: none;
	width: var(--amest-wa-size);
	height: var(--amest-wa-size);
}

/* Label, revealed on hover */

.amest-wa-button__label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.amest-wa-button:not(.amest-wa-button--no-label):hover .amest-wa-button__label,
.amest-wa-button:not(.amest-wa-button--no-label):focus-visible .amest-wa-button__label {
	max-width: 220px;
	margin-left: 10px;
	opacity: 1;
}

/* Message hidden: the icon only, but the text stays in the accessibility tree
   so the button keeps a name and the string stays translatable. */
.amest-wa-button--no-label .amest-wa-button__label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
}

/* Small screens */

@media (max-width: 480px) {
	.amest-wa-button {
		bottom: 16px;
	}

	.amest-wa-button--right {
		right: 16px;
	}

	.amest-wa-button--left {
		left: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amest-wa-button,
	.amest-wa-button__label {
		transition: none;
	}

	.amest-wa-button:hover,
	.amest-wa-button:focus {
		transform: none;
	}
}

/* =========================================
   Amest WA Button - Options page
   ========================================= */

.amest-wa-link {
	display: inline-block;
	margin-top: 4px;
	padding: 4px 8px;
	background: #f0f0f1;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	word-break: break-all;
}

.amest-wa-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 130px;
	padding: 20px;
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
}

/* The preview shows the real markup, but pinned inside the box. */
.amest-wa-preview .amest-wa-button {
	position: static;
}

/* Hidden while the button is disabled or the number is empty. */
.amest-wa-preview .amest-wa-button.amest-wa-preview--hidden {
	display: none;
}
