.dia-bottom-popup {
	--bottom-popup-bg: var(--dia-blue);
	--bottom-popup-text: var(--dia-white);

	position: fixed;
	inset-inline: 0;
	bottom: 0;
	/* Just above the chat widget (2147483049) */
	z-index: 2147483050;
	padding-block: max(0.75rem, calc(0.75 * var(--su)));
	/* Same side spacing as the header */
	padding-inline: calc(var(--pk-site-gutter) + var(--pk-site-spacer));
	background-color: var(--bottom-popup-bg);
	color: var(--bottom-popup-text);
	border-radius: max(1rem, calc(1.25 * var(--su))) max(1rem, calc(1.25 * var(--su))) 0 0;
	box-shadow: 0 -0.25rem 1.5rem rgba(var(--dia-blue-rgb), 0.12);
	transform: translateY(100%);
	transition: transform 0.4s ease;
}

.dia-bottom-popup[hidden] {
	display: none;
}

.dia-bottom-popup.is-visible {
	transform: translateY(0);
}

/* Colour variants: text colour follows the background for contrast */
.dia-bottom-popup--blue {
	--bottom-popup-bg: var(--dia-blue);
	--bottom-popup-text: var(--dia-white);
}
.dia-bottom-popup--blue-dark {
	--bottom-popup-bg: var(--dia-blue-dark);
	--bottom-popup-text: var(--dia-white);
}
.dia-bottom-popup--purple {
	--bottom-popup-bg: var(--dia-purple);
	--bottom-popup-text: var(--dia-white);
}
.dia-bottom-popup--pink {
	--bottom-popup-bg: var(--dia-pink);
	--bottom-popup-text: var(--dia-white);
}
.dia-bottom-popup--blue-light {
	--bottom-popup-bg: var(--dia-blue-light);
	--bottom-popup-text: var(--dia-blue);
}
.dia-bottom-popup--white {
	--bottom-popup-bg: var(--dia-white);
	--bottom-popup-text: var(--dia-blue);
}
.dia-bottom-popup--green {
	--bottom-popup-bg: var(--dia-green);
	--bottom-popup-text: var(--dia-blue);
}
.dia-bottom-popup--green-light {
	--bottom-popup-bg: var(--dia-green-light);
	--bottom-popup-text: var(--dia-blue);
}

/* The default button is green, so on a green bar it turns white */
.dia-bottom-popup--green .pk-button-group {
	--button-bg-1: var(--dia-white);
	--button-bg-1-hover: var(--dia-blue-light);
}

.dia-bottom-popup .dia-bottom-popup__inner {
	display: flex;
	align-items: center;
	gap: max(1rem, calc(2 * var(--su)));
}

.dia-bottom-popup .dia-bottom-popup__content {
	flex: 1 1 auto;
	--pk-text-color: var(--bottom-popup-text);
	--pk-heading-color: var(--bottom-popup-text);
	color: var(--bottom-popup-text);
	font-size: var(--desktop-body-md);
}

.dia-bottom-popup .dia-bottom-popup__content > :last-child {
	margin-bottom: 0;
}

.dia-bottom-popup .dia-bottom-popup__content a {
	color: inherit;
	text-decoration: underline;
}

.dia-bottom-popup .pk-button-group {
	flex: 0 0 auto;
	margin: 0;
	/* Outline button keeps the bar's text colour on dark backgrounds */
	--button-text-color-2: var(--bottom-popup-text);
	--button-text-color-2-hover: var(--bottom-popup-text);
}

.dia-bottom-popup .dia-bottom-popup__close {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: max(2rem, calc(2 * var(--su)));
	height: max(2rem, calc(2 * var(--su)));
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 100%;
	background-color: transparent;
	color: var(--bottom-popup-text);
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.dia-bottom-popup .dia-bottom-popup__close:hover {
	opacity: 0.7;
}

.dia-bottom-popup .dia-bottom-popup__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.dia-bottom-popup {
		transition: none;
	}
}

@media only screen and (max-width: 767px) {
	.dia-bottom-popup .dia-bottom-popup__inner {
		position: relative;
		flex-direction: column;
		align-items: flex-start;
	}

	.dia-bottom-popup .dia-bottom-popup__content {
		padding-right: 3rem;
	}

	.dia-bottom-popup .dia-bottom-popup__close {
		position: absolute;
		top: 0;
		right: 0;
	}
}
