/**
 * IMPERVORA -- First Order Offer popup + floating tab.
 *
 * White ground, black type, one gold accent, Cormorant Garamond headline over
 * Jost supporting copy, and a jewelry band across the foot of the panel.
 *
 * ROUNDED CORNERS ARE DELIBERATE HERE and are scoped to this component only.
 * The house rule elsewhere on the site is square (border-radius: 0) buttons;
 * that rule is untouched -- every radius below is namespaced under
 * .impervora-foo / .impervora-foo-tab and cannot leak into site chrome.
 *
 * The dialog's z-index sits below the notice/cookie layer on purpose so the
 * popup can never cover a required disclosure.
 */

.impervora-foo {
	--foo-ink: #0E0E0E;
	--foo-gold: #C9A34A;
	--foo-gold-deep: #A8823D;
	--foo-warm: #F7F5F2;
	--foo-grey: #DFDCD7;
	--foo-charcoal: #3A3A3A;
	--foo-muted: #6E6E6E;
	--foo-radius: 16px;
	--foo-radius-sm: 8px;
	--foo-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.impervora-foo[hidden] {
	display: none;
}

.impervora-foo__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(14, 14, 14, 0.58);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 320ms var(--foo-ease);
}

.impervora-foo__dialog {
	position: relative;
	width: 100%;
	max-width: 470px;
	max-height: calc(100vh - 48px);
	/* Vertical scroll for short viewports; horizontal hidden so the image
	   band and the radius clip cleanly against the panel edge. */
	overflow-x: hidden;
	overflow-y: auto;
	background: #FFFFFF;
	border-radius: var(--foo-radius);
	box-shadow:
		0 32px 80px rgba(14, 14, 14, 0.24),
		0 6px 18px rgba(14, 14, 14, 0.08);
	opacity: 0;
	transform: translateY(22px) scale(0.985);
	transition:
		opacity 380ms var(--foo-ease),
		transform 380ms var(--foo-ease);
}

.impervora-foo.is-open .impervora-foo__backdrop {
	opacity: 1;
}

.impervora-foo.is-open .impervora-foo__dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
	.impervora-foo__backdrop,
	.impervora-foo__dialog {
		transition: opacity 120ms linear;
		transform: none;
	}

	.impervora-foo.is-open .impervora-foo__dialog {
		transform: none;
	}
}

/* Close ----------------------------------------------------------------- */

.impervora-foo__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--foo-muted);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: color 200ms ease, background 200ms ease;
}

.impervora-foo__close:hover {
	background: var(--foo-warm);
	color: var(--foo-ink);
}

.impervora-foo__close:focus-visible,
.impervora-foo__submit:focus-visible,
.impervora-foo__decline:focus-visible,
.impervora-foo__input:focus-visible,
.impervora-foo__consent input:focus-visible {
	outline: 2px solid var(--foo-gold);
	outline-offset: 2px;
}

/* Body ------------------------------------------------------------------ */

.impervora-foo__body {
	padding: 40px 40px 26px;
	text-align: center;
}

.impervora-foo__unlock {
	margin: 0 0 12px;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.38em;
	/* Optical centring: the last letter's tracking is dead space. */
	text-indent: 0.38em;
	text-transform: uppercase;
	color: var(--foo-gold);
}

.impervora-foo__title {
	margin: 0 0 12px;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 600;
	font-size: 54px;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--foo-ink);
}

.impervora-foo__star {
	font-size: 0.42em;
	font-weight: 400;
	vertical-align: super;
	color: var(--foo-gold);
	margin-left: 2px;
}

.impervora-foo__qualifier {
	margin: 0 0 16px;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--foo-ink);
}

/* Hairline flanking the qualifier -- the one piece of ornament. */
.impervora-foo__rule {
	width: 46px;
	height: 1px;
	margin: 0 auto 18px;
	border: 0;
	background: var(--foo-gold);
	opacity: 0.75;
}

/* Offer details --------------------------------------------------------- */

/*
 * Seated between the headline and the field. A left-aligned list inside an
 * otherwise centred panel needs an edge to sit against, or it reads as stray
 * fine print that drifted up the page -- hence the tinted card. Type stays
 * quiet so it explains the offer without competing with the CTA below it.
 */
.impervora-foo__details {
	margin: 0 0 24px;
	padding: 17px 20px;
	border: 1px solid var(--foo-grey);
	border-radius: var(--foo-radius-sm);
	background: var(--foo-warm);
	list-style: none;
	text-align: left;
}

.impervora-foo__details li {
	position: relative;
	margin: 0 0 5px;
	padding-left: 15px;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 11px;
	line-height: 1.6;
	color: var(--foo-muted);
}

.impervora-foo__details li:last-child {
	margin-bottom: 0;
}

.impervora-foo__details li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 7px;
	width: 4px;
	height: 4px;
	border-radius: 999px;
	background: var(--foo-gold);
}

.impervora-foo__lede {
	margin: 0 0 24px;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.65;
	color: var(--foo-charcoal);
}

/* Form ------------------------------------------------------------------ */

.impervora-foo__label {
	display: block;
	margin-bottom: 8px;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	text-align: left;
	color: var(--foo-muted);
}

.impervora-foo__input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--foo-grey);
	border-radius: var(--foo-radius-sm);
	background: var(--foo-warm);
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	color: var(--foo-ink);
	transition: border-color 200ms ease, background 200ms ease;
}

.impervora-foo__input:focus {
	border-color: var(--foo-gold);
	background: #FFFFFF;
}

.impervora-foo__input::placeholder {
	color: #A2A2A2;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.impervora-foo__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.impervora-foo__consent {
	margin: 14px 0 20px;
	text-align: left;
}

.impervora-foo__consent label {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--foo-muted);
	cursor: pointer;
}

.impervora-foo__consent input {
	flex: 0 0 auto;
	margin-top: 2px;
	accent-color: var(--foo-gold);
}

.impervora-foo__consent a {
	color: var(--foo-gold-deep);
}

.impervora-foo__submit {
	display: block;
	width: 100%;
	padding: 16px 20px;
	border: 0;
	border-radius: var(--foo-radius-sm);
	background: var(--foo-ink);
	color: #FFFFFF;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 220ms ease, transform 220ms var(--foo-ease);
}

.impervora-foo__submit:hover:not(:disabled) {
	background: var(--foo-gold-deep);
	transform: translateY(-1px);
}

.impervora-foo__submit:disabled {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

.impervora-foo__message {
	margin: 14px 0 0;
	min-height: 1em;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
}

.impervora-foo__message.is-error {
	color: #9B2C2C;
}

.impervora-foo__message.is-ok {
	color: #2F6B45;
}

.impervora-foo__decline {
	display: inline-block;
	margin: 18px auto 0;
	padding: 4px 6px;
	border: 0;
	border-radius: var(--foo-radius-sm);
	background: none;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 12px;
	letter-spacing: 0.08em;
	color: #8A8A8A;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color 200ms ease;
}

.impervora-foo__decline:hover {
	color: var(--foo-ink);
}

/* Image band ------------------------------------------------------------ */

/*
 * Sits flush to the panel's foot. The dialog clips it to the radius, so no
 * radius is needed here -- and must not be, or a hairline of white shows in
 * the corners while the panel is animating.
 */
.impervora-foo__figure {
	position: relative;
	margin: 30px 0 0;
	height: 150px;
	border-top: 1px solid var(--foo-gold);
	background: #0E0E0E;
	overflow: hidden;
}

.impervora-foo__figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* The piece sits below centre in the source frame. */
	object-position: center 58%;
}

/* Scroll lock ----------------------------------------------------------- */

body.impervora-foo-locked {
	position: fixed;
	width: 100%;
	overflow: hidden;
}

/* Floating offer tab ----------------------------------------------------- */

/*
 * Lower-left corner. The right-hand corner is already occupied by the
 * quick-actions cluster (.impervora-fab, z-index 9990), so the two never meet.
 *
 * z-index is below the dialog and below any notice/cookie layer, and the tab is
 * only printed on browsing pages -- it can never sit over a payment field or a
 * required disclosure.
 */
.impervora-foo-tab {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 8000;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	/* 44px minimum touch target (WCAG 2.5.5). */
	min-height: 44px;
	padding: 13px 22px;
	border: 1px solid #C9A34A;
	border-radius: 999px;
	background: #0E0E0E;
	color: #FFFFFF;
	font-family: "Jost", "Helvetica Neue", Arial, sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(14, 14, 14, 0.22);
	transform: translateY(14px);
	opacity: 0;
	transition:
		transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
		opacity 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
		background 220ms ease,
		color 220ms ease;
}

.impervora-foo-tab[hidden] {
	display: none;
}

.impervora-foo-tab.is-in {
	transform: translateY(0);
	opacity: 1;
}

.impervora-foo-tab__mark {
	font-size: 8px;
	line-height: 1;
	color: #C9A34A;
	transition: color 220ms ease;
}

.impervora-foo-tab:hover {
	background: #C9A34A;
	color: #0E0E0E;
}

.impervora-foo-tab:hover .impervora-foo-tab__mark {
	color: #0E0E0E;
}

.impervora-foo-tab:focus-visible {
	outline: 2px solid #C9A34A;
	outline-offset: 3px;
}

/* Clear the sticky add-to-cart bar on product pages, mirroring the same
   offset .impervora-fab--raised uses on the opposite corner. */
.impervora-foo-tab--raised {
	bottom: 88px;
}

@media (prefers-reduced-motion: reduce) {
	.impervora-foo-tab {
		transition: opacity 120ms linear;
		transform: none;
	}

	.impervora-foo-tab.is-in {
		transform: none;
	}
}

/* Tablet ---------------------------------------------------------------- */

@media (max-width: 782px) {
	.impervora-foo__dialog {
		max-width: 430px;
	}

	.impervora-foo__body {
		padding: 38px 32px 24px;
	}

	.impervora-foo__title {
		font-size: 46px;
	}

	.impervora-foo__details {
		padding: 15px 17px;
		margin-bottom: 22px;
	}

	.impervora-foo__figure {
		height: 132px;
	}
}

/* Mobile ---------------------------------------------------------------- */

@media (max-width: 600px) {
	.impervora-foo {
		padding: 14px;
		align-items: flex-end;
	}

	.impervora-foo__dialog {
		max-width: 100%;
		max-height: calc(100vh - 28px);
		/* Sheet-style rise from the foot of the screen. */
		transform: translateY(34px) scale(1);
	}

	.impervora-foo__body {
		padding: 38px 22px 24px;
	}

	.impervora-foo__unlock {
		font-size: 11px;
		letter-spacing: 0.32em;
		text-indent: 0.32em;
		margin-bottom: 10px;
	}

	.impervora-foo__title {
		font-size: 42px;
	}

	.impervora-foo__qualifier {
		font-size: 13px;
		letter-spacing: 0.08em;
		margin-bottom: 14px;
	}

	.impervora-foo__rule {
		margin-bottom: 16px;
	}

	.impervora-foo__lede {
		font-size: 13.5px;
		margin-bottom: 20px;
	}

	/* 16px minimum stops iOS Safari zooming the viewport on focus. */
	.impervora-foo__input {
		font-size: 16px;
	}

	.impervora-foo__details {
		padding: 14px 16px;
		margin-bottom: 20px;
	}

	.impervora-foo__details li {
		padding-left: 14px;
		font-size: 10.5px;
		line-height: 1.55;
	}

	.impervora-foo__figure {
		height: 112px;
		margin-top: 24px;
	}

	.impervora-foo-tab {
		left: 14px;
		bottom: 14px;
		padding: 12px 18px;
		font-size: 10px;
		letter-spacing: 0.13em;
	}

	.impervora-foo-tab--raised {
		bottom: 84px;
	}
}

/* Short viewports -------------------------------------------------------- */

/*
 * Two tiers, and the order matters: these have the same specificity as the
 * rules above, so the tighter query has to come second to win.
 *
 * The details card sits above the field now, which pushes the CTA down by its
 * full height. On a laptop the panel would otherwise need a scroll to reach
 * the button, so the first tier buys that space back out of the headline and
 * the image rather than out of the terms.
 */
@media (max-height: 860px) {
	.impervora-foo__body {
		padding: 34px 40px 22px;
	}

	.impervora-foo__title {
		font-size: 46px;
	}

	.impervora-foo__unlock {
		margin-bottom: 10px;
	}

	.impervora-foo__details {
		padding: 15px 18px;
		margin-bottom: 20px;
	}

	.impervora-foo__lede {
		margin-bottom: 20px;
	}

	.impervora-foo__figure {
		height: 118px;
		margin-top: 24px;
	}
}

@media (max-height: 620px) {
	.impervora-foo__body {
		padding: 30px 26px 20px;
	}

	.impervora-foo__title {
		font-size: 36px;
	}

	.impervora-foo__unlock {
		margin-bottom: 8px;
	}

	.impervora-foo__lede {
		margin-bottom: 16px;
	}

	.impervora-foo__details {
		padding: 12px 14px;
		margin-bottom: 16px;
	}

	.impervora-foo__details li {
		margin-bottom: 3px;
		font-size: 10.5px;
		line-height: 1.5;
	}

	.impervora-foo__figure {
		height: 92px;
		margin-top: 20px;
	}
}
