/* ==========================================================================
   Newsletter popup: bottom-right card, two panels in the brand colours.
   Hidden until popup.js opens it (the `hidden` attribute).
   ========================================================================== */
.nl-popup[hidden] { display: none; }
.nl-popup {
	position: fixed;
	right: var(--space-4);
	bottom: var(--space-4);
	z-index: 80;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	width: min(700px, calc(100vw - var(--space-5)));
	max-height: calc(100vh - var(--space-5));
	overflow: auto;
	background: var(--color-brand-dark);
	color: var(--color-ivory);
	box-shadow: var(--shadow-overlay);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}
.nl-popup.is-open { opacity: 1; transform: none; }
.nl-popup a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.nl-popup__close {
	position: absolute;
	top: var(--space-1);
	right: var(--space-1);
	z-index: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--color-ivory);
	cursor: pointer;
}
.nl-popup__close .icon { width: 20px; height: 20px; }
.nl-popup__close:focus-visible, .nl-popup a:focus-visible, .nl-popup .newsletter__button:focus-visible { outline: 2px solid var(--color-ivory); outline-offset: 2px; }

/* Left panel: the promise */
.nl-popup__promo {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--space-3);
	padding: var(--space-7) var(--space-5);
	background: var(--color-brand);
}
.nl-popup__eyebrow { margin: 0; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; opacity: 0.85; }
.nl-popup__title { margin: 0; font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 500; line-height: 1.05; }
.nl-popup__offer { margin: var(--space-2) 0 0; padding-top: var(--space-3); border-top: 1px solid rgba(250, 247, 242, 0.35); font-size: var(--text-sm); line-height: 1.5; }

/* Welcome offer: terms under the offer line, and the code shown after sign-up */
.nl-popup__terms { margin: 0; font-size: var(--text-xs); line-height: 1.5; opacity: 0.9; }
.nl-popup__terms summary { display: inline-block; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.nl-popup__terms p { margin: var(--space-2) 0 0; }
.nl-popup__code[hidden] { display: none; }
.nl-popup__code { margin-top: var(--space-2); }
.nl-popup__code-label { margin: 0 0 var(--space-2); font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; opacity: 0.85; }
.nl-popup__code-row { display: flex; align-items: stretch; gap: var(--space-2); }
.nl-popup__code-value { flex: 1; display: flex; align-items: center; justify-content: center; min-height: var(--tap-size); padding: 0 var(--space-3); border: 1px dashed rgba(250, 247, 242, 0.6); font-size: var(--text-lg); font-weight: 500; letter-spacing: 0.12em; user-select: all; }
.nl-popup__copy { flex: none; min-height: var(--tap-size); padding: 0 var(--space-4); background: var(--color-ivory); color: var(--color-brand-dark); border: 0; border-radius: var(--radius-control); font: 500 var(--text-sm) var(--font-body); letter-spacing: var(--tracking-caps); text-transform: uppercase; cursor: pointer; }
.nl-popup__copy:focus-visible { outline: 2px solid var(--color-ivory); outline-offset: 2px; }
.nl-popup__code-help { margin: var(--space-3) 0 0; font-size: var(--text-xs); line-height: 1.5; opacity: 0.85; }

/* Left panel with a picture (Customize > Newsletter popup > Picture).
   Text stays at the top, the picture fills the space below it (cut-out) or the whole panel (photo). */
.nl-popup__promo.has-image { position: relative; isolation: isolate; justify-content: flex-start; min-height: 400px; overflow: hidden; }
.nl-popup__promo.has-image > :not(.nl-popup__img) { position: relative; z-index: 2; }
.nl-popup__img { position: absolute; display: block; max-width: none; }

/* Bottle cut-out: sits at the bottom, with a soft glow behind it */
.nl-popup__promo--contain { background: radial-gradient(ellipse at 50% 88%, rgba(250, 247, 242, 0.20), rgba(250, 247, 242, 0) 62%), var(--color-brand); }
.nl-popup__promo--contain .nl-popup__img { left: 50%; bottom: 0; z-index: 1; width: 88%; height: 62%; object-fit: contain; object-position: center bottom; transform: translateX(-50%); }

/* Full photo: fills the panel, darkened at the top so the words stay readable */
.nl-popup__promo--cover .nl-popup__img { inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.nl-popup__promo--cover::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to bottom, rgba(66, 21, 34, 0.88) 0%, rgba(66, 21, 34, 0.55) 38%, rgba(66, 21, 34, 0) 70%); pointer-events: none; }

/* Right panel: the form (the field and button reuse the footer form styles) */
.nl-popup__body { display: flex; flex-direction: column; justify-content: center; padding: var(--space-6) var(--space-5); }
.nl-popup__heading { margin: 0 var(--space-6) var(--space-2) 0; font-family: var(--font-heading); font-size: var(--text-2xl); font-weight: 500; line-height: 1.1; }
.nl-popup__lead { margin: 0 0 var(--space-4); font-size: var(--text-sm); line-height: 1.55; opacity: 0.85; }
.nl-popup .newsletter__notice[hidden] { display: none; }
.nl-popup .newsletter__form[hidden] { display: none; }
.nl-popup .newsletter__fine { margin-top: var(--space-3); }

@media (max-width: 639px) {
	.nl-popup { right: var(--space-3); bottom: var(--space-3); width: calc(100vw - var(--space-5)); grid-template-columns: minmax(0, 1fr); }
	.nl-popup__promo { gap: var(--space-2); padding: var(--space-5) var(--space-4) var(--space-4); }
	/* With a picture on a phone: words on the left, picture on the right */
	.nl-popup__promo.has-image { min-height: 168px; padding-right: 44%; justify-content: center; }
	.nl-popup__promo--contain .nl-popup__img { left: auto; right: 0; bottom: 0; width: 40%; height: 100%; transform: none; padding: var(--space-3) var(--space-2) 0; box-sizing: border-box; }
	.nl-popup__promo--cover .nl-popup__img { left: auto; right: 0; width: 40%; }
	.nl-popup__promo--cover::after { display: none; }
	.nl-popup__title { font-size: var(--text-2xl); }
	.nl-popup__body { padding: var(--space-4); }
	.nl-popup__heading { margin-right: 0; font-size: var(--text-xl); }
	.nl-popup .newsletter__button { padding: 0 var(--space-4); }
}

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