/**
 * Back-in-stock notifier, product signup form + My Account list.
 * Uses the theme design tokens so it inherits the Beautyforest look.
 */

/* ---- Product page signup (compact, modal-style content) ---- */
.bf-stock-alert {
	margin: var(--bf-space-1) 0;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--bf-hairline);
	border-radius: var(--bf-radius);
	background: var(--bf-paper);
}
/* Tighten the modal content pieces when reused inline in the compact block. */
.bf-stock-alert .bf-sa-modal__eyebrow { margin: 0 0 0.9rem; padding: 0.2em 0.7em; font-size: 0.68rem; }
.bf-stock-alert .bf-sa-modal__title { margin: 0 0 0.2rem; font-size: 1.05rem; }
.bf-stock-alert .bf-sa-modal__product { margin: 0 0 0.7rem; }
.bf-stock-alert .bf-sa-modal__fineprint { margin: 0.6rem 0 0; font-size: var(--bf-fs-ui); color: var(--bf-stone); }

.bf-stock-alert__lead {
	margin: 0 0 var(--bf-space-1);
	font-family: var(--bf-font-head);
	font-size: var(--bf-fs-h3);
	line-height: var(--bf-lh-tight);
	color: var(--bf-graphite);
}

.bf-stock-alert__intro {
	margin: 0 0 var(--bf-space-3);
	font-size: var(--bf-fs-body);
	color: var(--bf-stone-deep);
}

.bf-stock-alert__form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bf-space-2);
	align-items: stretch;
}

.bf-stock-alert__input {
	flex: 1 1 220px;
	min-width: 0;
	padding: var(--bf-btn-pad-y) var(--bf-btn-pad-x);
	font-size: var(--bf-fs-ui);
	border: 1px solid var(--bf-hairline);
	border-radius:var(--bf-radius);
	background: var(--bf-white, #fff);
	color: var(--bf-graphite);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bf-stock-alert__input:focus {
	outline: none;
	border-color: var(--bf-green);
	box-shadow: 0 0 0 3px rgba(47, 170, 90, 0.18);
}

.bf-stock-alert__btn {
	flex: 0 0 auto;
}

.bf-stock-alert__msg {
	flex: 1 0 100%;
	margin: var(--bf-space-1) 0 0;
	font-size: var(--bf-fs-ui);
	min-height: 1.2em;
}

.bf-stock-alert__msg[data-kind="error"] {
	color: var(--bf-error);
}

.bf-stock-alert__msg[data-kind="success"] {
	color: var(--bf-green-deep);
}

.bf-stock-alert__msg[data-kind="working"] {
	color: var(--bf-stone-deep);
}

.bf-stock-alert__notice {
	margin: var(--bf-space-3) 0;
}

/* ---- My Account → Stock alerts ---- */
.bf-stock-alerts__title {
	font-family: var(--bf-font-head);
	font-size: var(--bf-fs-h2);
	margin: 0 0 var(--bf-space-3);
}

.bf-stock-alerts__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bf-stock-alerts__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--bf-space-3);
	padding: var(--bf-space-3) 0;
	border-bottom: 1px solid var(--bf-hairline);
}

.bf-stock-alerts__name {
	font-size: var(--bf-fs-body);
	color: var(--bf-graphite);
}

.bf-stock-alerts__cancel {
	margin: 0;
	flex: 0 0 auto;
}

@media (max-width: 480px) {
	.bf-stock-alerts__row {
		flex-wrap: wrap;
	}
}

/* ---- Product card "Notify me" button (button element reusing .bf-card__cta) ---- */
.bf-card__cta--notify {
	border: 0;
	/* width:auto lets it stretch via flex like the add-to-cart <a>, so the
	   .bf-card__cta negative side margins bleed it to the card edges. width:100%
	   pinned it to the body content box (card minus padding) and broke the bleed. */
	width: auto;
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

/* ---- "Notify me" modal ---- */
body.bf-sa-modal-open {
	overflow: hidden;
}

.bf-sa-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--bf-space-4);
}

.bf-sa-modal[hidden] {
	display: none;
}

.bf-sa-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 30, 20, 0.50);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.bf-sa-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 440px;
	background: var(--bf-white, #fff);
	border: 1px solid var(--bf-hairline);
	border-radius:var(--bf-radius);
	box-shadow: 0 24px 60px rgba(20, 35, 24, 0.22);
	padding: 2.5rem 2rem 2rem;
	animation: bf-sa-pop 0.18s ease-out;
}

@keyframes bf-sa-pop {
	from { transform: translateY(8px) scale(0.98); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.bf-sa-modal__dialog { animation: none; }
}

.bf-sa-modal__close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--bf-stone-deep);
	cursor: pointer;
	border-radius:50%;
	transition: background 0.15s ease, color 0.15s ease;
}

.bf-sa-modal__close:hover {
	color: var(--bf-graphite);
	background: var(--bf-mint);
}

.bf-sa-modal__eyebrow {
	display: inline-block;
	margin: 0 0 var(--bf-space-2);
	padding: 0.3em 0.85em;
	font-size: var(--bf-fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--bf-track-eyebrow);
	text-transform: uppercase;
	color: #9a6212;
	background: rgba(183, 121, 31, 0.12);
	border-radius: var(--bf-radius-pill);
}

.bf-sa-modal__title {
	margin: 0 0 var(--bf-space-2);
	font-family: var(--bf-font-head);
	font-size: var(--bf-fs-h3);
	line-height: var(--bf-lh-tight);
	color: var(--bf-graphite);
}

.bf-sa-modal__product {
	margin: 0 0 var(--bf-space-3);
	font-size: var(--bf-fs-body);
	font-weight: 600;
	color: var(--bf-green-deep);
}

.bf-sa-modal__product:empty {
	display: none;
}

/* ---- Modal: enhanced content, horizontal media + content layout ---- */
/* Respect the hidden attribute the JS toggles (beats the display rules below). */
.bf-sa-modal [hidden] {
	display: none !important;
}

.bf-sa-modal__dialog {
	max-width: 600px;
	text-align: left;
}

/* Two-column row: media on the left, copy + form on the right. */
.bf-sa-modal__main {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 1.5rem;
}

.bf-sa-modal__done {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.bf-sa-modal__media {
	flex: 0 0 auto;
	/* Stretched to the content column's height (align-items: stretch),
	   then width is derived from the 3:4 ratio so the image lines up with
	   the right column's top and bottom edges. */
	aspect-ratio: 3 / 4;
	align-self: stretch;
	max-width: 9.5rem;
}

.bf-sa-modal__content {
	flex: 1 1 auto;
	min-width: 0;
}

.bf-sa-modal__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius:50%;
	background: rgba(47, 170, 90, 0.12);
	color: var(--bf-green-deep);
}

.bf-sa-modal__thumb {
	display: block;
	width: 100%;
	height: 100%;
	/* Fill the 3:4 media box and crop the overflow (no distortion). */
	object-fit: cover;
	object-position: center;
	border-radius:var(--bf-radius);
	border: 1px solid var(--bf-hairline);
	background: var(--bf-white, #fff);
	box-shadow: 0 6px 16px rgba(20, 35, 24, 0.10);
}

.bf-sa-modal__title,
.bf-sa-modal__product {
	text-align: left;
}

/* Inline form: email field + button on one row, message wraps below. */
.bf-sa-modal__form {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
	margin-top: var(--bf-space-2);
}

.bf-sa-modal__form .bf-stock-alert__input {
	flex: 1 1 180px;
	width: auto;
	text-align: left;
}

.bf-sa-modal__form .bf-stock-alert__btn {
	flex: 0 0 auto;
}

.bf-sa-modal__form .bf-stock-alert__msg {
	flex: 1 0 100%;
	margin: 0;
	min-height: 0;
	text-align: left;
}

.bf-sa-modal__form .bf-stock-alert__msg:not(:empty) {
	margin-top: var(--bf-space-1);
}

.bf-sa-modal__fineprint {
	margin: 0.55rem 0 0;
	font-size: var(--bf-fs-ui);
	line-height: 1.4;
	color: var(--bf-stone-deep);
}

/* Stack media above content on very narrow screens. */
@media (max-width: 460px) {
	.bf-sa-modal__main {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.bf-sa-modal__media {
		align-self: center;
		width: 9rem;
		max-width: 60%;
		aspect-ratio: 3 / 4;
	}

	.bf-sa-modal__content {
		width: 100%;
	}

	.bf-sa-modal__title,
	.bf-sa-modal__product,
	.bf-sa-modal__form .bf-stock-alert__msg {
		text-align: center;
	}

	.bf-sa-modal__form .bf-stock-alert__btn {
		flex: 1 1 100%;
	}
}

/* ---- Success state ---- */
.bf-sa-modal__tick {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: var(--bf-space-3);
	border-radius:50%;
	background: rgba(47, 170, 90, 0.14);
	color: var(--bf-green-deep);
	animation: bf-sa-pop 0.22s ease-out;
}

.bf-sa-modal__done-title {
	margin: 0 0 var(--bf-space-1);
	font-family: var(--bf-font-head);
	font-size: var(--bf-fs-h3);
	line-height: var(--bf-lh-tight);
	color: var(--bf-graphite);
}

.bf-sa-modal__done-msg {
	margin: 0;
	font-size: var(--bf-fs-body);
	color: var(--bf-stone-deep);
}

.bf-sa-modal__done-btn {
	min-width: 9rem;
}
