/* ============================================================
   Milau — floating widgets
   ------------------------------------------------------------
   Two overlays that ride on top of the page:

     .milau-wa             the WhatsApp button, bottom right
     .milau-consent        the cookie bar, along the bottom
     .milau-cookie-settings the quiet link that re-opens the bar

   Every colour comes from tokens.css. Nothing here carries one of
   its own, so the palette stays in one place.

   Two measurements are read from the page by floating.js:

     --milau-float-stack   the height of the sticky add-to-cart bar
                           under the bottom edge (0 when it is away)
     --milau-consent-h     the measured height of the consent bar

   They keep the three overlays from sitting on top of each other.
   ============================================================ */

/* ------------------------------------------------------- WhatsApp button */

.milau-wa {
	--milau-wa-gap: 20px;

	position: fixed;
	right: 20px;
	bottom: calc( var(--milau-wa-gap) + var(--milau-float-stack, 0px) );
	z-index: 95;

	box-sizing: border-box;
	width: 54px;
	height: 54px;
	border-radius: 50%;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	background: var(--milau-ok);
	color: var(--milau-panel);
	text-decoration: none;

	box-shadow: 0 10px 30px rgba(26, 26, 26, .22);
	transition:
		transform .35s cubic-bezier(.22, 1, .36, 1),
		box-shadow .35s ease;
}

.milau-wa:hover {
	transform: translateY(-3px);
	box-shadow: 0 16px 36px rgba(26, 26, 26, .28);
}

.milau-wa:focus {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

.milau-wa:focus:not(:focus-visible) {
	outline: none;
}

.milau-wa:focus-visible {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

.milau-wa__icon {
	display: block;
	line-height: 0;
}

.milau-wa__icon svg {
	display: block;
	width: 28px;
	height: 28px;
}

/* The bubble is white; the handset is knocked out of it in the button's
   own green, which is the same green the button is painted in. */
.milau-wa__bubble {
	fill: currentColor;
}

.milau-wa__handset {
	fill: var(--milau-ok);
}

/* While the consent bar is open the button climbs above it. */
body.milau-consent-open .milau-wa {
	bottom: calc(
		var(--milau-wa-gap) +
		var(--milau-float-stack, 0px) +
		var(--milau-consent-h, 72px) +
		12px
	);
}

/* --------------------------------------------------------- consent bar */

.milau-consent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--milau-float-stack, 0px);
	z-index: 96;

	/* The visible state is decided in the browser, never by the server —
	   the page is cached and shared between visitors. */
	display: none;

	background: var(--milau-panel);
	border-top: 1px solid var(--milau-line);
	box-shadow: 0 -12px 40px -12px rgba(26, 26, 26, .15);
}

.milau-consent.is-open {
	display: block;
}

/* The head script marks the document as "already answered" so the bar is
   never painted for a visitor who has already made a choice. */
html.milau-consent-done .milau-consent {
	display: none !important;
}

.milau-consent__inner {
	box-sizing: border-box;
	max-width: 1360px;
	margin-inline: auto;
	padding: 14px clamp(20px, 4vw, 60px);

	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.milau-consent__copy {
	margin: 0;
	max-width: 820px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--milau-ink);
}

.milau-consent__policy {
	color: var(--milau-ink);
	border-bottom: 1px solid var(--milau-line);
	margin-left: 8px;
	white-space: nowrap;
	transition: border-color .2s ease;
}

.milau-consent__policy:hover {
	border-color: var(--milau-ink);
}

.milau-consent__policy:focus {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

.milau-consent__policy:focus:not(:focus-visible) {
	outline: none;
}

.milau-consent__policy:focus-visible {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

.milau-consent__actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* The two buttons are the house button — one filled, one outlined.
   The bar owns only its layout. */
.milau-consent__btn {
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.2;
}

/* --------------------------------------------------- cookie settings link */

.milau-cookie-settings {
	position: fixed;
	left: 20px;
	bottom: calc( 12px + var(--milau-float-stack, 0px) );
	z-index: 95;

	box-sizing: border-box;
	padding: 5px 10px;
	border: 0;
	background: transparent;

	font-family: inherit;
	font-size: 10.5px;
	letter-spacing: .06em;
	color: var(--milau-muted);
	cursor: pointer;

	transition: color .2s ease;
}

.milau-cookie-settings:hover {
	color: var(--milau-ink);
}

.milau-cookie-settings:focus {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

.milau-cookie-settings:focus:not(:focus-visible) {
	outline: none;
}

.milau-cookie-settings:focus-visible {
	outline: 2px solid var(--milau-ink);
	outline-offset: 3px;
}

/* On a phone the quiet link that re-opens the bar has to be big
   enough to hit. */
@media ( max-width: 640px ) {
	.milau-cookie-settings {
		padding: 11px 6px;
	}
}

/* While the bar is open the link has nowhere to sit — the bar owns the
   bottom of the screen. It comes back as soon as the bar is closed. */
body.milau-consent-open .milau-cookie-settings {
	opacity: 0;
	visibility: hidden;
}

/* --------------------------------------------------- page bottom safety */

/* The bar is fixed, so it floats over the bottom of the page instead of
   pushing it. The page therefore keeps a matching amount of room at the
   very bottom, so the last line of the footer is never hidden behind it.
   The room is always there — it does not come and go with the bar, so
   nothing on the page ever jumps. */
body.milau-has-consent .milau-footer__bottom {
	padding-bottom: 96px;
}

/* ------------------------------------------------------- phone layout */

@media (max-width: 782px) {
	.milau-wa {
		--milau-wa-gap: 14px;

		right: 14px;
		width: 48px;
		height: 48px;
	}

	.milau-wa__icon svg {
		width: 24px;
		height: 24px;
	}

	.milau-consent__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding: 12px 20px;
	}

	.milau-consent__copy {
		font-size: 12.5px;
		line-height: 1.55;
	}

	.milau-consent__actions {
		display: flex;
		gap: 10px;
	}

	.milau-consent__btn {
		flex: 1 1 0;
		text-align: center;
	}

	.milau-cookie-settings {
		left: 14px;
		bottom: calc( 10px + var(--milau-float-stack, 0px) );
	}

	body.milau-has-consent .milau-footer__bottom {
		padding-bottom: 138px;
	}
}

/* ------------------------------------------------------------ motion */

