/**
 * Bonza. Meal Plan Wizard off-canvas styling (ClickUp 86eypb6kn).
 *
 * Config investigated: same Customizer/typography gap as every other
 * Bonza task (footer.css/homepage.css/health-hub.css): no site-wide
 * 8-slot palette or global heading/body font family configured yet.
 * Local `var(--mpw-*, <hex>)` custom properties, same pattern.
 *
 * Figma: cY9QX6IwGVaaGI4r7J2RRF, component set 34317:185606. Colours/
 * fonts extracted from the Dog step's node data (visually confirmed via
 * downloaded screenshots this session): Nominee Heavy Extended 900
 * (uppercase headings/labels), Kobe1.1 400/700 (body/links), #F8EDE3
 * cream top bar / sticky bottom, #FDFBF7 panel background, #247B4E
 * green (active progress segment, selected toggle, primary button),
 * #D1D5DB progress track / borders, #494545 ink.
 *
 * SCOPE: this file has two distinct halves.
 *  1. The SHELL (backdrop, panel, top-bar, progress-bar, sticky-bottom):
 *     built from Figma's literal spec, identical across all 9 steps
 *     (confirmed by reading each step's shell structure this session).
 *  2. The FIELD restyle (everything below "Plugin field restyle"):
 *     a consistent design-token pass over the cp-bonza plugin's OWN
 *     existing markup (class names read directly from
 *     onboarding-form.php this session), matching Figma's colour/font/
 *     spacing tokens site-wide rather than pixel-matching each of the
 *     plugin's 11 sub-steps against its own individual Figma frame --
 *     that finer pass is a real follow-up, not attempted here, flagged
 *     in the PR rather than silently skipped.
 */

.bnz-mpw {
	--mpw-cream: var(--wp--preset--color--bhp-cream, #F8EDE3);
	--mpw-panel-bg: var(--wp--preset--color--bhp-panel, #FDFBF7);
	--mpw-green: var(--wp--preset--color--bhp-green, #247B4E);
	--mpw-green-soft: rgba(36, 123, 78, 0.1);
	--mpw-ink: var(--wp--preset--color--bhp-ink, #494545);
	/* WCAG 2.2 AA fix (code-review audit, 2026-09-01): Figma's literal
	   #6B7A72/#FFA825/#D1D5DB measured 4.37:1 / 1.87:1 / 1.43:1 against
	   this panel -- all below the 4.5:1 (small text) / 3:1 (UI borders)
	   minimums. Darkened to the same hue family; measured (WCAG 2.x
	   relative-luminance formula) against both --mpw-panel-bg and
	   --mpw-cream: muted 6.02:1 / 5.55:1, amber-alert 5.15:1 (vs panel),
	   track 3.41:1 (vs panel). A deliberate deviation from Figma's exact
	   hex values, required because contrast is a DoD requirement. */
	--mpw-muted: #55635C;
	--mpw-track: #808790;
	--mpw-white: var(--wp--preset--color--bhp-white, #FFFFFF);
	--mpw-amber: #A65200;

	--mpw-heading-font: var(--wp--preset--font-family--bhp-heading, "Nominee", var(--theme-headings-font-family, var(--theme-font-family, sans-serif)));
	--mpw-body-font: var(--wp--preset--font-family--bhp-body, "Kobe1.1", var(--theme-font-family, sans-serif));

	position: fixed;
	inset: 0;
	z-index: 10000;
}

.bnz-mpw[hidden] {
	display: none;
}

/* FIX (full-site audit, 2026-09-01, critical): scroll lock never worked --
   meal-plan-wizard.js adds body.bnz-mpw-open on open, but no CSS rule
   existed for it, so the background page stayed scrollable behind the
   drawer. */
body.bnz-mpw-open {
	overflow: hidden;
}

/* FIX (full-site audit, 2026-09-01, critical): the MyStickyMenu plugin's
   OWN inline CSS sets its sticky top promo bar to z-index:9999999, about
   1000x higher than this drawer (z-index:10000), so it stayed visible and
   clickable on top of the drawer's own close button at every breakpoint,
   confirmed via document.elementFromPoint() hit-testing the close button's
   coordinates. Out-z-indexing a third party's arbitrary value is an arms
   race we would lose again on their next update; hiding it while THIS
   drawer is open (tied to the real open-state class, not a magic number)
   is robust to that. Escape/backdrop-click already worked as a fallback
   close path, this restores the primary Figma-drawn close affordance too. */
body.bnz-mpw-open .mysticky-welcomebar-fixed-wrap {
	display: none;
}

.bnz-mpw__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.bnz-mpw__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 100%;
	background: var(--mpw-panel-bg);
	border-radius: 24px 0 0 24px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bnz-mpw__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

/* ---- Top bar -------------------------------------------------------- */

.bnz-mpw__top-bar {
	flex: 0 0 auto;
	height: 56px;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--mpw-cream);
}

.bnz-mpw__title {
	font-family: var(--mpw-heading-font);
	font-weight: 900;
	font-size: 14px;
	line-height: 16px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mpw-ink);
	margin: 0;
}

.bnz-mpw__close {
	width: 32px;
	height: 32px;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: var(--mpw-green);
}

.bnz-mpw__close svg {
	width: 16px;
	height: 16px;
}

.bnz-mpw__close:focus-visible {
	outline: 2px solid var(--mpw-green);
	outline-offset: 2px;
}

/* ---- Progress bar ----------------------------------------------------- */

.bnz-mpw__progress {
	flex: 0 0 auto;
	padding: 12px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-bottom: 1px solid var(--mpw-track);
}

.bnz-mpw__segments {
	display: flex;
	gap: 4px;
}

.bnz-mpw__segment {
	flex: 1 1 0;
	height: 4px;
	border-radius: 2px;
	background: var(--mpw-track);
}

.bnz-mpw__segment.is-complete,
.bnz-mpw__segment.is-current {
	background: var(--mpw-green);
}

.bnz-mpw__step-labels {
	display: flex;
	justify-content: space-between;
	gap: 4px;
}

.bnz-mpw__step-label {
	font-family: var(--mpw-body-font);
	font-weight: 400;
	font-size: 12px;
	color: var(--mpw-muted);
}

.bnz-mpw__step-label.is-current {
	font-weight: 700;
	color: var(--mpw-green);
}

/* ---- Sticky helper line ------------------------------------------------ */

.bnz-mpw__helper {
	font-family: var(--mpw-body-font);
	font-size: 14px;
	color: var(--mpw-muted);
	margin: 0 0 12px;
	padding: 0 20px;
}

/* =========================================================================
 * Plugin field restyle -- targets cp-bonza's own onboarding-form.php
 * markup directly (class names read from the live partial this session).
 * ========================================================================= */

.bnz-mpw .onboarding-form-wrapper {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: var(--mpw-panel-bg);
	font-family: var(--mpw-body-font);
	color: var(--mpw-ink);
}

.bnz-mpw .onboarding-form-wrapper > img.bowl {
	display: none;
}

.bnz-mpw .onboarding-form {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding: 20px;
	gap: 16px;
}

.bnz-mpw .step-title {
	font-family: var(--mpw-heading-font);
	font-weight: 900;
	font-size: 20px;
	text-transform: uppercase;
	color: var(--mpw-ink);
	margin: 0 0 4px;
}

.bnz-mpw .onboarding-form > p {
	font-size: 14px;
	color: var(--mpw-muted);
	margin: 0 0 8px;
}

.bnz-mpw .step-row,
.bnz-mpw .step-sub-row,
.bnz-mpw .inner-sub-row {
	margin: 0 0 16px;
	font-size: 14px;
}

.bnz-mpw select.inline-input,
.bnz-mpw input.inline-input {
	font-family: var(--mpw-body-font);
	font-size: 14px;
	color: var(--mpw-ink);
	border: 1px solid var(--mpw-track);
	border-radius: 8px;
	padding: 10px 12px;
	background: var(--mpw-white);
}

.bnz-mpw select.inline-input:focus-visible,
.bnz-mpw input.inline-input:focus-visible {
	outline: 2px solid var(--mpw-green);
	outline-offset: 1px;
}

.bnz-mpw .margin-both {
	margin-left: 8px;
	margin-right: 8px;
}

.bnz-mpw .margin-left {
	margin-left: 8px;
}

.bnz-mpw .margin-right {
	margin-right: 8px;
}

/* Radio-styled-as-pill: knownBirthday/knownWeight/gender-shaped inputs
   share this look across the plugin's markup (`.selected` is the
   plugin's own reactive class, toggled by its Alpine bindings). */
.bnz-mpw input[type="radio"] {
	accent-color: var(--mpw-green);
}

.bnz-mpw .message.side {
	font-size: 13px;
	color: var(--mpw-muted);
}

.bnz-mpw .message.side.alert {
	color: var(--mpw-amber);
}

.bnz-mpw .doglist-wrapper {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: 8px;
}

.bnz-mpw .doglist {
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--mpw-track);
	font-size: 13px;
	cursor: pointer;
}

.bnz-mpw .doglist.active {
	background: var(--mpw-green-soft);
	border-color: var(--mpw-green);
	color: var(--mpw-green);
}

.bnz-mpw .health-issues_wrapper,
.bnz-mpw .food-types {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bnz-mpw .health-issue,
.bnz-mpw .food-type {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.bnz-mpw input[type="checkbox"] {
	accent-color: var(--mpw-green);
	width: 18px;
	height: 18px;
}

.bnz-mpw .slider {
	width: 100%;
	accent-color: var(--mpw-green);
}

.bnz-mpw .percentage {
	font-weight: 700;
	color: var(--mpw-green);
}

.bnz-mpw .product__radio .product-wrapper {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bnz-mpw .product__radio label {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--mpw-track);
	border-radius: 12px;
	cursor: pointer;
}

.bnz-mpw .product__image-wrapper img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.bnz-mpw .onboarding-form button[type="button"] {
	width: 100%;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--mpw-green);
	color: var(--mpw-white);
	border: 1px solid var(--mpw-green);
	font-family: var(--mpw-body-font);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}

.bnz-mpw .onboarding-form button[type="button"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.bnz-mpw .onboarding-form button[type="button"]:focus-visible {
	outline: 2px solid var(--mpw-ink);
	outline-offset: 2px;
}

.bnz-mpw .remove-dog {
	background: transparent;
	border: 0;
	color: var(--mpw-muted);
	cursor: pointer;
	font-size: 12px;
}

/* Results view */

.bnz-mpw .feeding_plan {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px;
}

.bnz-mpw .feeding_plan .important {
	color: var(--mpw-green);
	font-weight: 700;
}

.bnz-mpw .feeding_plan h3,
.bnz-mpw .feeding_plan h4 {
	font-family: var(--mpw-heading-font);
	font-weight: 900;
	text-transform: uppercase;
	color: var(--mpw-ink);
}

.bnz-mpw .brand-gallery {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 16px 0;
}

.bnz-mpw .brand-logo {
	max-height: 32px;
	width: auto;
}

.bnz-mpw .delivery-frequency-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bnz-mpw .delivery-frequency-list li {
	padding: 12px;
	border: 1px solid var(--mpw-track);
	border-radius: 999px;
	text-align: center;
	cursor: pointer;
	font-family: var(--mpw-body-font);
	font-weight: 700;
}

.bnz-mpw .delivery-frequency-list li.active {
	background: var(--mpw-green-soft);
	border-color: var(--mpw-green);
	color: var(--mpw-green);
}

/* ---- Responsive ----------------------------------------------------------
   Figma: desktop/tablet 420x987 (same panel width down to tablet), mobile
   320 as drawn / 375 as the project floor. Below 744 the panel goes
   full-width, matching every other Bonza off-canvas (cart/wishlist). */

@media (max-width: 743px) {
	.bnz-mpw__panel {
		width: 100%;
		border-radius: 0;
	}
}

@media (max-width: 428px) {
	.bnz-mpw .onboarding-form {
		padding: 16px;
	}
}
