/* Restock Alerts: storefront. Inherits the theme's font and text colour; tints derive from currentColor so it sits well on light or dark themes. */

.rsa {
	--rsa-accent: #16130f;
	--rsa-on-accent: #fff;
	--rsa-line: rgba(22, 19, 15, .14);
	--rsa-tint: rgba(22, 19, 15, .035);
	--rsa-muted: rgba(22, 19, 15, .62);
	--rsa-radius: 14px;
	--rsa-alert: #b4410f;
	--rsa-good: #2e7d4f;
	margin: 18px 0 24px;
	clear: both;
	font-size: 15px;
	line-height: 1.5;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.rsa {
		--rsa-line: color-mix(in srgb, currentColor 15%, transparent);
		--rsa-tint: color-mix(in srgb, currentColor 4%, transparent);
		--rsa-muted: color-mix(in srgb, currentColor 64%, transparent);
	}
}
.rsa[hidden] { display: none !important; }
.rsa *, .rsa *::before, .rsa *::after { box-sizing: border-box; }

.rsa__inner {
	position: relative;
	padding: 18px 20px;
	border: 1px solid var(--rsa-line);
	border-radius: var(--rsa-radius);
	background: var(--rsa-tint);
}

.rsa__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rsa__bell {
	flex: 0 0 40px;
	width: 40px; height: 40px;
	border-radius: 50%;
	display: grid; place-items: center;
	background: var(--rsa-accent);
	color: var(--rsa-on-accent);
}
.rsa__bell svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.rsa__titles { min-width: 0; }
.rsa .rsa__eyebrow {
	margin: 0 0 2px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rsa-alert);
}
.rsa__variant:not(:empty)::before { content: ", "; }
.rsa__variant { color: var(--rsa-muted); text-transform: none; letter-spacing: 0; }
.rsa .rsa__title {
	margin: 0;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 600;
	text-transform: none;
	color: inherit;
}
.rsa .rsa__desc { margin: 0 0 14px; color: var(--rsa-muted); font-size: 14px; }

/* Input and button share one rounded field. */
.rsa__form { margin: 0; }
.rsa__row {
	display: flex;
	align-items: stretch;
	padding: 4px;
	border: 1.5px solid var(--rsa-line);
	border-radius: 999px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.rsa__row:focus-within { border-color: var(--rsa-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rsa-accent) 14%, transparent); }
.rsa.is-invalid .rsa__row { border-color: var(--rsa-alert); }

.rsa .rsa__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 14px 0 16px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: #16130f;
	font: inherit;
	font-size: 15px;
	outline: none;
}
.rsa .rsa__input::placeholder { color: #9a958c; opacity: 1; }
.rsa .rsa__input--name {
	display: block;
	width: 100%;
	margin-bottom: 10px;
	border: 1.5px solid var(--rsa-line);
	background: #fff;
}
.rsa .rsa__input--name:focus { border-color: var(--rsa-accent); }

.rsa .rsa__btn {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center;
	height: 44px;
	min-width: 124px;
	margin: 0;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: var(--rsa-accent);
	color: var(--rsa-on-accent);
	font: inherit;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: filter .15s;
}
.rsa .rsa__btn:hover { filter: brightness(1.15); }
.rsa .rsa__btn:focus-visible { outline: 2px solid var(--rsa-accent); outline-offset: 3px; }
.rsa__spinner {
	position: absolute;
	width: 18px; height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	opacity: 0;
}
.rsa.is-loading .rsa__btn { pointer-events: none; }
.rsa.is-loading .rsa__btn-label { opacity: 0; }
.rsa.is-loading .rsa__spinner { opacity: 1; animation: rsa-spin .7s linear infinite; }

.rsa__consent {
	display: flex; align-items: flex-start; gap: 10px;
	margin: 12px 4px 0;
	font-size: 13px;
	color: var(--rsa-muted);
	cursor: pointer;
}
.rsa__consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rsa__check {
	flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px;
	border: 1.5px solid var(--rsa-line);
	border-radius: 5px;
	display: grid; place-items: center;
	background: #fff;
}
.rsa__check svg { width: 12px; height: 12px; fill: none; stroke: var(--rsa-on-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.rsa__consent input:checked + .rsa__check { background: var(--rsa-accent); border-color: var(--rsa-accent); }
.rsa__consent input:checked + .rsa__check svg { opacity: 1; }
.rsa__consent input:focus-visible + .rsa__check { outline: 2px solid var(--rsa-accent); outline-offset: 2px; }

.rsa__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rsa__sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.rsa .rsa__error { margin: 10px 4px 0; font-size: 13px; color: var(--rsa-alert); }
.rsa .rsa__error[hidden] { display: none; }

/* After sign-up */
.rsa__success { display: flex; gap: 12px; align-items: flex-start; }
.rsa__success[hidden] { display: none; }
.rsa__tick { flex: 0 0 36px; width: 36px; height: 36px; color: var(--rsa-good); }
.rsa__tick svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rsa .rsa__success-title { margin: 0 0 2px; font-weight: 600; font-size: 16px; }
.rsa .rsa__success-text { margin: 0 0 6px; color: var(--rsa-muted); font-size: 14px; overflow-wrap: anywhere; }
.rsa .rsa__link {
	padding: 0; margin: 0; border: 0; background: none; box-shadow: none;
	color: inherit; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: .75;
	min-height: 0; line-height: 1.4; text-transform: none; letter-spacing: 0;
}
.rsa .rsa__link:hover { opacity: 1; background: none; }
.rsa.is-done .rsa__form, .rsa.is-done .rsa__desc { display: none; }

.rsa .rsa__count { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rsa-line); font-size: 13px; color: var(--rsa-muted); }
.rsa .rsa__count[hidden] { display: none; }

@media (max-width: 440px) {
	.rsa__row { flex-direction: column; border-radius: 12px; gap: 4px; }
	.rsa .rsa__input { border-radius: 8px; }
	.rsa .rsa__btn { width: 100%; border-radius: 8px; }
}

/* ---------------------------------------------------------------- shop loop */
.rsa-loop-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
.rsa-loop-btn svg { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* -------------------------------------------------------------- shop dialog */
.rsa-modal {
	--rsa-accent: #16130f;
	width: min(440px, calc(100vw - 24px));
	max-width: none;
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: #fff;
	color: #16130f;
	box-shadow: 0 24px 60px -20px rgba(22, 19, 15, .4);
	overflow: visible;
}
.rsa-modal::backdrop { background: rgba(22, 19, 15, .45); }
.rsa-modal__panel { position: relative; padding: 20px 20px 6px; }
.rsa-modal__close {
	position: absolute; top: 12px; right: 12px;
	width: 32px; height: 32px; padding: 0; margin: 0;
	display: grid; place-items: center;
	border: 0; border-radius: 50%;
	background: #f2efe9; color: #16130f; cursor: pointer;
}
.rsa-modal__close:hover { background: #e7e2d9; }
.rsa-modal__close svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rsa-modal__product { display: flex; align-items: center; gap: 14px; padding-right: 40px; margin-bottom: 4px; }
.rsa-modal__img { width: 72px; height: 72px; flex: 0 0 72px; object-fit: cover; border-radius: 12px; background: #f2efe9; }
.rsa-modal__name { margin: 0 0 2px; font-weight: 600; font-size: 16px; line-height: 1.3; }
.rsa-modal__price { margin: 0; color: #6b665d; font-size: 14px; }
.rsa-modal .rsa { color: #16130f; margin: 12px 0 14px; }
.rsa-modal .rsa__inner { border: 0; background: none; padding: 0; }

@media (max-width: 600px) {
	.rsa-modal { width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
	.rsa-modal__panel { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

@keyframes rsa-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.rsa *, .rsa-modal, .rsa-modal * { animation: none !important; transition: none !important; }
}
