/* =========================================================================
   Newsletter bar + panel — modelled on the reference (loewe.com).
   Markup: inc/newsletter.php. Behaviour: assets/newsletter.js.
   Type and ink follow the header (header.css variables).
   ====================================================================== */

:root {
	--ao-nl: #f9824b;  /* bar and panel colour */
	--ao-nl-bar-h: 48px;
}

/* ---------- Bar ----------
   Sticky inside the footer part: rides the bottom of the window while the
   footer scrolls in, then docks on top of the Stone block. */

.ao-nl-bar {
	position: sticky;
	bottom: 0;
	z-index: 11;
	margin-top: 96px; /* takes over the footer's own top margin… */
	transform: translateY(calc(100% + 8px));
	transition: transform 0.7s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.3s ease 0.2s, visibility 0s;
	font-family: var(--ao-sans, 'Founders Grotesk', 'Helvetica Neue', Arial, sans-serif);
	-webkit-font-smoothing: antialiased;
}
.ao-nl-bar[hidden] { display: none; }
.ao-nl-bar.is-visible { transform: none; }
/* Gone while the panel is open; back when it closes. */
.ao-nl-bar.is-suppressed {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.7s cubic-bezier(0.42, 0, 0.58, 1), opacity 0.2s ease, visibility 0s linear 0.2s;
}
.ao-nl-bar + .ao-footer { margin-top: 0 !important; } /* …so the bar sits flush on it */

.wp-site-blocks > footer.wp-block-template-part:has(> .ao-nl-bar) { margin-block-start: 0; }

.ao-nl-bar__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	width: 100%;
	height: var(--ao-nl-bar-h);
	margin: 0;
	padding: 0 var(--ao-gutter, 30px);
	border: 0;
	border-radius: 0;
	background: var(--ao-nl);
	color: var(--ao-ink, #000);
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
}
.ao-nl-bar__btn:focus-visible { outline: 1px solid var(--ao-ink, #000); outline-offset: -5px; }

.ao-nl-bar__texts {
	position: relative;
	flex: 1;
	align-self: stretch;
}

.ao-nl-bar__pretext,
.ao-nl-bar__text {
	position: absolute;
	top: 50%;
	left: 0;
	transform: translateY(-50%);
	white-space: nowrap;
	overflow: hidden;
}

/* At rest: "Pssst…" */
.ao-nl-bar__pretext {
	opacity: 1;
	transition: opacity 0.7s ease-in-out 0.3s;
}
/* "Let's stay in touch" opens left to right */
.ao-nl-bar__text {
	max-width: 0;
	opacity: 0;
	transition: max-width 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.ao-nl-bar__icon { display: grid; place-items: center; line-height: 0; }
.ao-nl-bar__plus { width: 16px; height: 16px; }

/* Expanded: hover on desktop, or after 2s on touch (set by the script) */
.ao-nl-bar.is-expanded .ao-nl-bar__pretext {
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
}
.ao-nl-bar.is-expanded .ao-nl-bar__text {
	max-width: 100%;
	opacity: 1;
	transition: max-width 0.7s ease-in-out 0.3s, opacity 0.7s ease-in-out 0.3s;
}

@media (hover: hover) and (pointer: fine) {
	.ao-nl-bar__btn:hover .ao-nl-bar__pretext,
	.ao-nl-bar__btn:focus-visible .ao-nl-bar__pretext { opacity: 0; transition: opacity 0.3s ease-in-out; }
	.ao-nl-bar__btn:hover .ao-nl-bar__text,
	.ao-nl-bar__btn:focus-visible .ao-nl-bar__text {
		max-width: 100%;
		opacity: 1;
		transition: max-width 0.7s ease-in-out 0.3s, opacity 0.7s ease-in-out 0.3s;
	}
}

/* Phone and tablet: rides just above the bottom tab bar and slides out
   from behind it (the tab bar is z-index 90, the bar 11). */
@media (max-width: 1023px) {
	.ao-nl-bar {
		bottom: calc(var(--ao-tabbar-h, 56px) + env(safe-area-inset-bottom));
		margin-top: 64px;
		transform: translateY(calc(100% + var(--ao-tabbar-h, 56px) + env(safe-area-inset-bottom)));
	}
	.ao-nl-bar.is-visible { transform: none; }
	.ao-nl-bar__btn { padding: 0 var(--ao-gutter, 16px); }
}

@media (prefers-reduced-motion: reduce) {
	.ao-nl-bar,
	.ao-nl-bar *,
	.ao-nl__panel,
	.ao-nl__scrim { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}

/* ---------- Panel ---------- */

.ao-nl {
	position: fixed;
	inset: 0;
	z-index: 100001; /* above the header, its drawer and the admin bar */
	font-family: var(--ao-sans, 'Founders Grotesk', 'Helvetica Neue', Arial, sans-serif);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--ao-ink, #000);
	-webkit-font-smoothing: antialiased;
}
.ao-nl[hidden] { display: none; }
.ao-nl *, .ao-nl *::before, .ao-nl *::after { box-sizing: border-box; }
.ao-nl p { margin: 0; }
.ao-nl a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ao-nl button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	border-radius: 0;
	cursor: pointer;
}
.ao-nl :focus-visible { outline: 1px solid var(--ao-ink, #000); outline-offset: 3px; }

.ao-nl__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	opacity: 0;
	transition: opacity 0.2s cubic-bezier(0.42, 0, 1, 1);
}
.ao-nl.is-open .ao-nl__scrim { opacity: 1; }

/* Same width as the basket drawer, so the two panels line up. */
.ao-nl__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	--ao-nl-inner: calc(100% - 2 * var(--ao-gutter, 30px));
	width: calc(var(--ao-gutter, 30px) + var(--ao-nl-inner) / 5 + 0.8 * max(12.5rem, var(--ao-nl-inner) / 6));
	display: flex;
	flex-direction: column;
	background: var(--ao-nl);
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.42, 0, 1, 1); /* closing */
	outline: none;
}
.ao-nl.is-open .ao-nl__panel {
	transform: none;
	transition: transform 0.5s ease-out; /* opening */
}

.ao-nl__head {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex: none;
	min-height: 72px;
	padding: 24px 24px 0;
}
.ao-nl__close { display: grid; place-items: center; width: 32px; height: 32px; margin-right: -4px; }
.ao-nl__close .ao-icon { width: 20px; height: 20px; }

.ao-nl__body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 24px 24px 24px;
}

.ao-nl__title {
	margin: 0 0 24px;
	font-family: inherit;
	font-size: clamp(32px, 2.9vw, 42px);
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: inherit;
}

.ao-nl__intro { max-width: 34em; }
.ao-nl__more-btn {
	margin-top: 8px !important;
	text-decoration: underline !important;
	text-underline-offset: 2px;
}
.ao-nl__more { margin-top: 12px; font-size: 13px; }
.ao-nl__more[hidden] { display: none; }

.ao-nl__form {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-top: auto; /* form sits at the foot of the panel */
	padding-top: 48px;
}

/* Email field: same as the checkout's fields — 64px box, 1px ink border,
   12px label sitting on the top border (here on the panel colour). */
.ao-nl__field { position: relative; }
.ao-nl__label {
	position: absolute;
	z-index: 1;
	top: -8px;
	left: 12px;
	max-width: calc(100% - 24px);
	margin: 0;
	padding: 0 4px;
	background: var(--ao-nl);
	font-size: 12px;
	font-weight: 400;
	line-height: 17px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
.ao-nl__input {
	display: block;
	width: 100%;
	height: 64px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--ao-ink, #000);
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus */
	line-height: 20px;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}
.ao-nl__input:focus,
.ao-nl__input[aria-invalid="true"] { outline: none; box-shadow: inset 0 0 0 1px var(--ao-ink, #000); }
/* Autofill styling is neutralised site-wide in style.css */

.ao-nl .ao-nl__submit {
	display: block;
	width: 100%;
	height: 72px;
	padding: 16px 16px 24px;
	background: var(--ao-ink, #000);
	color: #fff;
	font-weight: 500;
	text-align: left;
}
.ao-nl .ao-nl__submit:hover { opacity: 0.88; }
.ao-nl .ao-nl__submit[disabled] { opacity: 0.6; cursor: progress; }

.ao-nl__msg[hidden] { display: none; }
.ao-nl__msg--error { font-size: 13px; }
.ao-nl__msg--success {
	margin-top: auto;
	padding-top: 48px;
	font-size: 18px;
	outline: none;
}

html.ao-nl-locked,
html.ao-nl-locked body { overflow: hidden; }

/* Tablet: still a side drawer, half the screen (as the basket). */
@media (max-width: 1023px) {
	.ao-nl__panel { width: 50%; }
	.ao-nl__head { padding: 16px 16px 0; min-height: 60px; }
	.ao-nl__body { padding: 16px; }
}

/* Phone: full-screen sheet from the bottom. */
@media (max-width: 767px) {
	.ao-nl__panel {
		width: 100%;
		transform: translateY(100%);
		padding-bottom: env(safe-area-inset-bottom);
	}
	.ao-nl.is-open .ao-nl__panel { transform: none; }
}
