/* ══════════════════════════════════════════════════════════
   Shared popup (BottomSlidePopup) — single source of truth.
   Desktop: centred 521 px card. Mobile (<768): full-height sheet
   sliding up from the bottom. Imported by every WCDS bundle and
   mirrored verbatim in ASP (src/shared/popup.css).
   ══════════════════════════════════════════════════════════ */
.wcds-bsp-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wcds-bsp-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 521px;
	max-height: 90vh;
	max-height: 90dvh;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 32px rgba(0, 0, 0, 0.15);
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
	z-index: 100001;
	overflow: hidden;
	color: #262626;
}

.wcds-bsp-panel.wcds-bsp--narrow { max-width: 440px; }
.wcds-bsp-panel.wcds-bsp--wide { max-width: 640px; }

.wcds-bsp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 14px 20px;
	border-bottom: 1px solid #E2E0DC;
	flex-shrink: 0;
}

.wcds-bsp-header .wcds-bsp-close { margin-left: auto; }

.wcds-bsp-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: #262626;
}

.wcds-bsp-close {
	min-width: 32px;
	min-height: 32px;
	padding: 6px;
	background: #f3f1ed;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	color: #262626;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}

.wcds-bsp-close:hover { background: #e8e4dd; }
.wcds-bsp-close:focus-visible { outline: 2px solid #262626; outline-offset: 2px; }

.wcds-bsp-close svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.wcds-bsp-body {
	padding: 16px 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1 1 auto;
	min-height: 0;
}

.wcds-bsp-body > * + * { margin-top: 0; }

.wcds-bsp-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid #E2E0DC;
	flex-shrink: 0;
	background: #fff;
}

.wcds-bsp-footer .wcds-btn { flex: 0 0 auto; min-height: 44px; padding: 0 20px; }

/* Stacked fields inside popups (reference: boxed floating fields) */
.wcds-bsp-fields { display: flex; flex-direction: column; gap: 10px; }
.wcds-bsp-note { font-size: 12px; line-height: 1.45; color: #6b6b6b; margin: 12px 0 0; }
.wcds-bsp-error { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fdecec; color: #b3261e; font-size: 13px; }

/* Mobile: full height, slide from bottom */
@media (max-width: 767px) {
	.wcds-bsp-overlay {
		align-items: flex-end;
		padding: 0;
	}
	.wcds-bsp-panel,
	.wcds-bsp-panel.wcds-bsp--narrow,
	.wcds-bsp-panel.wcds-bsp--wide {
		max-width: 100%;
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
	}
	.wcds-bsp-footer {
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
		position: sticky;
		bottom: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wcds-bsp-overlay, .wcds-bsp-panel { transition: none; }
}

/* ══════════════════════════════════════════════════════════
   Toasts — bottom-left, white card with a green accent bar
   ══════════════════════════════════════════════════════════ */
.wcds-toast-host {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(360px, calc(100vw - 40px));
	pointer-events: none;
}

.wcds-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.08);
	border-left: 5px solid #447964;
	color: #262626;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: auto;
}

.wcds-toast.is-visible { opacity: 1; transform: translateY(0); }
.wcds-toast.is-hiding { opacity: 0; transform: translateY(16px); }
.wcds-toast--error { border-left-color: #b3261e; }
.wcds-toast--info { border-left-color: #6b6b6b; }

.wcds-toast__icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.wcds-toast__icon svg { width: 18px; height: 18px; }
.wcds-toast__body { flex: 1; min-width: 0; }
.wcds-toast__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.wcds-toast__msg { font-size: 13px; line-height: 1.4; color: #4b4b4b; margin-top: 2px; }
.wcds-toast__close {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 6px;
	background: #f3f1ed;
	color: #262626;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wcds-toast__close:hover { background: #e8e4dd; }
.wcds-toast__close svg { width: 14px; height: 14px; }

@media (max-width: 767px) {
	.wcds-toast-host { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; }
}

/* ══════════════════════════════════════════════════════════
   Boxed field (label on top) — used inside popups and forms
   ══════════════════════════════════════════════════════════ */
.wcds-field {
	display: block;
	border: 1px solid #d9d4cb;
	border-radius: 6px;
	background: #fff;
	padding: 8px 12px 8px;
	transition: border-color 0.15s, box-shadow 0.15s;
	cursor: text;
	margin: 0;
}
.wcds-field.is-focused { border-color: #262626; box-shadow: 0 0 0 1px #262626; }
.wcds-field.has-error { border-color: #b3261e; }
.wcds-field.is-disabled { background: #f6f4f0; color: #8a8a8a; }
.wcds-field__label { display: block; font-size: 11px; line-height: 1.3; color: #6b6b6b; letter-spacing: 0.01em; }
.wcds-field__row { display: flex; align-items: center; gap: 8px; position: relative; }
.wcds-field__control,
.wcds-field select.wcds-field__control,
.wcds-field input.wcds-field__control,
.wcds-field textarea.wcds-field__control {
	flex: 1;
	width: 100%;
	min-width: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 2px 0 0 !important;
	margin: 0 !important;
	font-size: 15px;
	line-height: 1.4;
	color: #262626;
	height: auto !important;
	min-height: 0 !important;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
}
.wcds-field select.wcds-field__control { padding-right: 24px !important; cursor: pointer; }
.wcds-field__chevron { position: absolute; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; color: #262626; }
.wcds-field__trailing { flex-shrink: 0; }
.wcds-field__trailing .wcds-btn { min-height: 28px; padding: 0 10px; font-size: 13px; }
.wcds-field__error { display: block; margin-top: 4px; font-size: 12px; color: #b3261e; }
.wcds-field__hint { display: block; margin-top: 4px; font-size: 12px; color: #6b6b6b; }

/* Danger button variant used by confirm dialogs */
.wcds-btn--danger, .wcds-btn.wcds-btn--danger { background: #b3261e !important; border-color: #b3261e !important; color: #fff !important; }
.wcds-btn--danger:hover { background: #961f19 !important; }
.wcds-confirm-popup__text { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.wcds-confirm-popup__type { margin-top: 12px; }

/* ── Button fallbacks (WCDS defines .wcds-btn site-wide; these only fill gaps) ── */
.wcds-bsp-footer .wcds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #262626; font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.wcds-bsp-footer .wcds-btn--filled { background: #262626; color: #fff; }
.wcds-bsp-footer .wcds-btn--filled:hover { background: #000; }
.wcds-bsp-footer .wcds-btn--outlined { background: #fff; color: #262626; }
.wcds-bsp-footer .wcds-btn--outlined:hover { background: #f3f1ed; }
.wcds-bsp-footer .wcds-btn:disabled { opacity: .5; cursor: default; }
.wcds-bsp-heading { min-width: 0; }
.wcds-bsp-subtitle { font-size: 13px; color: #6b6b6b; margin-top: 2px; }
