.eco-bubble {
	--eco-bg: #008b23;
	position: fixed;
	right: 1vw;
	bottom: 1vw;
	z-index: 9999;
	color: #fff;
	background: var(--eco-bg);
	border-radius: 999px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: clamp(1.25rem, 1.6vw, 60px);
	text-align: center;
	line-height: 1;
	padding: 1em;
	aspect-ratio: 1;
	width: 6em;
	white-space: nowrap;
	ul {
		list-style-type: none;
		padding: 0;
		display: flex;
		flex-direction: column;
	}

	#eco-consumption {
		pointer-events: auto;
		cursor: pointer;
	}

	#eco-consumption strong {
		font-weight: 700;
	}
}

/* hide extras when collapsed */
.eco-bubble .eco-extra {
	opacity: 0;
	max-height: 0;
	pointer-events: none;
	transition: opacity 0.22s ease 0.08s, max-height 0.28s ease 0.08s, margin 0.22s ease 0.08s;
	margin: 0;
}

/* expanded state */
.eco-bubble.is-open {
	width: 90vw;
	max-width: 480px;
	max-height: 90vh;
	overflow: auto;
	padding: 1em;
	border-radius: 20px;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 20px;
	white-space: normal;
	aspect-ratio: unset;
	text-align: left;
	line-height: 1.2;
}

.eco-bubble .max-label {
	display: none;
}
.eco-bubble.is-open .max-label {
	display: block;
}

.eco-bubble.is-open ul {
	gap: 0.5em;
}

.eco-bubble.is-open strong {
	font-weight: 700;
}

.eco-bubble.is-open .eco-extra {
	opacity: 1;
	max-height: none;
	pointer-events: auto;
}

.eco-bubble.is-open #eco-mes-info a {
	color: #fff;
	text-decoration: underline;
}

.eco-bubble.is-open #eco-consumption {
	font-weight: 400;
}

.eco-bubble.is-open li#eco-img {
	margin-top: 2em;
}

/* Full-screen expansion animation */
.eco-bubble.is-expanding {
	position: fixed;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	min-height: 100vh !important;
	border-radius: 0 !important;
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 99999;
}

.eco-bubble.is-expanding .eco-line,
.eco-bubble.is-expanding #eco-img {
	opacity: 0 !important;
	transition: opacity 0.3s ease;
}

@media (max-width: 480px) {
	.eco-bubble {
		right: 12px;
		bottom: 12px;
	}
	.eco-bubble.is-open {
		width: min(94vw, 360px);
	}
}
