/**
 * Build Your Own Meal Box — frontend styles (stepper UI).
 *
 * Scoped under .mb-* so nothing leaks into the host theme.
 */

.mb-builder {
	--mb-primary: #2f7d4f;
	--mb-primary-dark: #24603d;
	--mb-accent: #b26a00;
	--mb-border: #e3e6e8;
	--mb-bg: #ffffff;
	--mb-bg-soft: #f7f9fa;
	--mb-text: #1e2b32;
	--mb-muted: #6b7a82;
	--mb-danger: #c0392b;
	--mb-radius: 12px;
	--mb-shadow: 0 1px 3px rgba(16, 34, 43, .07), 0 8px 24px rgba(16, 34, 43, .05);

	max-width: 100%;
	margin: 0 0 32px;
	color: var(--mb-text);
	font-size: 15px;
	line-height: 1.5;
}

.mb-builder * {
	box-sizing: border-box;
}

/* ---------- Header: title + live total ---------- */

.mb-head {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.mb-head-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
}

.mb-head-price {
	display: flex;
	gap: 8px;
	align-items: baseline;
}

.mb-head-price-label {
	color: var(--mb-muted);
	font-size: 13px;
	font-weight: 600;
}

.mb-head-price-value {
	color: var(--mb-primary);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
}

.mb-head-price-value .amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
}

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

.mb-track {
	height: 6px;
	overflow: hidden;
	background: var(--mb-border);
	border-radius: 99px;
}

.mb-track-fill {
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, var(--mb-primary), var(--mb-primary-dark));
	border-radius: 99px;
	transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

.mb-track-label {
	margin: 7px 0 16px;
	color: var(--mb-muted);
	font-size: 13px;
	font-weight: 600;
}

/* ---------- Meals: simple stacked cards, always visible ---------- */

.mb-meals {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

.mb-meal {
	padding: 14px 16px;
	background: var(--mb-bg);
	border: 1px solid var(--mb-border);
	border-left: 3px solid var(--mb-border);
	border-radius: 10px;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.mb-meal:hover {
	box-shadow: var(--mb-shadow);
}

.mb-meal-done {
	border-left-color: var(--mb-primary);
}

.mb-meal-head {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 12px;
}

.mb-meal-num {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: var(--mb-muted);
	font-size: 12px;
	font-weight: 700;
	background: var(--mb-bg-soft);
	border: 1px solid var(--mb-border);
	border-radius: 50%;
	transition: all .2s ease;
}

.mb-meal-done .mb-meal-num {
	color: transparent;
	background: var(--mb-primary);
	border-color: var(--mb-primary);
}

.mb-meal-done .mb-meal-num::after {
	content: "\2713";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.mb-meal-title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.mb-clear {
	flex: 0 0 auto;
	padding: 4px 11px;
	color: var(--mb-muted);
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	background: var(--mb-bg-soft);
	border: 1px solid var(--mb-border);
	border-radius: 6px;
	cursor: pointer;
	transition: all .18s ease;
}

.mb-clear:hover {
	color: var(--mb-danger);
	background: #fff;
	border-color: var(--mb-danger);
}

/* ---------- Fields: 2x2 grid ---------- */

.mb-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.mb-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mb-field-label {
	margin-bottom: 5px;
	color: var(--mb-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.mb-select {
	width: 100%;
	max-width: 100%;
	height: auto;
	min-height: 44px;
	padding: 10px 32px 10px 12px;
	color: var(--mb-text);
	font-size: 15px;
	line-height: 1.3;
	background-color: var(--mb-bg);
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7a82' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	background-size: 11px;
	border: 1px solid var(--mb-border);
	border-radius: 8px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.mb-select:hover {
	border-color: #b9c1c6;
}

.mb-select:focus {
	border-color: var(--mb-primary);
	box-shadow: 0 0 0 3px rgba(47, 125, 79, .15);
	outline: none;
}

.mb-select-filled {
	font-weight: 600;
	background-color: rgba(47, 125, 79, .05);
	border-color: rgba(47, 125, 79, .4);
}

/* ---------- Footer ---------- */

.mb-foot {
	padding: 16px 18px;
	background: var(--mb-bg-soft);
	border: 1px solid var(--mb-border);
	border-radius: var(--mb-radius);
}

.mb-cost {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 3px 0;
	font-size: 14px;
}

.mb-cost span {
	color: var(--mb-muted);
}

.mb-cost-extra strong {
	color: var(--mb-accent);
}

.mb-foot-note {
	margin: 10px 0 12px;
	padding-top: 10px;
	color: var(--mb-muted);
	font-size: 12px;
	line-height: 1.45;
	border-top: 1px dashed var(--mb-border);
}

/* ---------- Status pill ---------- */

.mb-status {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 600;
	background: var(--mb-bg-soft);
	border: 1px solid var(--mb-border);
	border-radius: 8px;
	transition: all .25s ease;
}

.mb-status-dot {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	background: #c6ccd0;
	border-radius: 50%;
	transition: background .25s ease;
}

.mb-status-ready {
	color: var(--mb-primary-dark);
	background: rgba(47, 125, 79, .08);
	border-color: rgba(47, 125, 79, .35);
}

.mb-status-ready .mb-status-dot {
	background: var(--mb-primary);
	box-shadow: 0 0 0 3px rgba(47, 125, 79, .2);
	animation: mb-pulse 1.8s ease-in-out infinite;
}

@keyframes mb-pulse {
	0%, 100% { box-shadow: 0 0 0 3px rgba(47, 125, 79, .2); }
	50% { box-shadow: 0 0 0 6px rgba(47, 125, 79, 0); }
}

.mb-errors {
	margin-top: 12px;
	padding: 10px 12px;
	color: var(--mb-danger);
	font-size: 13px;
	background: rgba(192, 57, 43, .07);
	border: 1px solid rgba(192, 57, 43, .3);
	border-radius: 8px;
}

.mb-errors p {
	margin: 0;
}

/* ---------- Add to cart ---------- */

/*
 * This plugin deliberately styles NOTHING on the Add to Cart button.
 *
 * It no longer disables the button, so there is no disabled state to style.
 * A rule here that dimmed `.disabled` would make the button look permanently
 * dead if any theme or other plugin ever added that class — so it is gone.
 */

/* ---------- Admin-facing error ---------- */

.mb-builder-error {
	padding: 16px 18px;
	margin-bottom: 20px;
	color: #7a2d22;
	background: #fdf1ef;
	border: 1px solid #f0c7c0;
	border-left: 4px solid #c0392b;
	border-radius: 8px;
}

.mb-builder-error p {
	margin: 0 0 6px;
}

.mb-builder-error p:last-child {
	margin-bottom: 0;
}

.mb-builder-error-admin {
	font-size: 13px;
	opacity: .85;
}

/* ---------- Cart / order meta ---------- */

.woocommerce-cart .variation,
.woocommerce-checkout .variation {
	font-size: 13px;
	line-height: 1.6;
}

.woocommerce-cart .variation dt,
.woocommerce-checkout .variation dt {
	font-weight: 700;
}




/* ---------- Responsive ---------- */

@media (max-width: 600px) {
	.mb-fields {
		grid-template-columns: 1fr;
	}

	.mb-head {
		align-items: flex-start;
	}

	.mb-head-title {
		font-size: 18px;
	}

	.mb-head-price-value {
		font-size: 22px;
	}

	.mb-meal {
		padding: 12px;
	}

	/* 16px prevents iOS zoom-on-focus. */
	.mb-select {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mb-builder *,
	.mb-builder *::before,
	.mb-builder *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* ---------- Cart: meal details under the product name ---------- */

.mb-cart-meta {
	margin-top: 6px;
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.55;
	color: #6b7a82;
}

.mb-cart-meta-row {
	padding: 1px 0;
}

.mb-cart-meta-key {
	font-weight: 600;
	color: #1e2b32;
}
