.opt-foody-customer-state {
	--foody-status-ink: var(--foody-ink, #2d1d18);
	--foody-status-muted: var(--foody-muted, #725f55);
	--foody-status-paper: var(--foody-surface, #fffdf7);
	--foody-status-line: var(--foody-line, #dfd0c2);
	--foody-status-accent: var(--foody-brand, #b33a2b);
	--foody-status-highlight: var(--foody-status-accent);
	--foody-status-state: var(--foody-status-highlight);
	margin: 22px 0;
	padding: clamp(20px, 4vw, 30px);
	color: var(--foody-status-ink);
	background: var(--foody-status-paper);
	border: 1px solid var(--foody-status-line);
	border-top: 4px solid var(--foody-status-highlight);
}

.opt-foody-customer-state__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.opt-foody-customer-state__copy h2,
.opt-foody-customer-state__copy p {
	margin: 0;
}

.opt-foody-customer-state__order-number span,
.opt-foody-customer-state__order-number strong {
	display: block;
}

.opt-foody-customer-state__order-number > span {
	color: var(--foody-status-highlight);
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 0.14em;
}

.opt-foody-customer-state__order-number strong {
	margin-top: 4px;
	color: var(--foody-status-ink);
	font-size: clamp(32px, 6vw, 48px);
	font-weight: 950;
	letter-spacing: -0.045em;
	line-height: 0.9;
}

/* Before acceptance: no number, one line saying when the code comes (the hidden one must stay hidden despite display: block). */
.opt-foody-customer-state__order-number [hidden] {
	display: none;
}

.opt-foody-customer-state__order-number small {
	display: block;
	max-width: 24ch;
	margin-top: 6px;
	color: var(--foody-status-ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.opt-foody-customer-state__order-number strong span {
	display: inline;
	margin-right: 2px;
	color: var(--foody-status-highlight);
}

.opt-foody-customer-state__live {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--foody-status-muted);
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.opt-foody-customer-state__live i {
	width: 7px;
	height: 7px;
	background: var(--foody-status-state);
	border-radius: 50%;
	animation: opt-foody-live-pulse 1.8s ease-out infinite;
}

.opt-foody-customer-state__live.is-retrying i {
	background: var(--foody-accent, #e7a33e);
}

.opt-foody-customer-state__live.is-offline i {
	background: var(--foody-error, #922e22);
	animation: none;
}

.opt-foody-customer-state__live.is-final i {
	animation: none;
}

.opt-foody-customer-state__copy h2 {
	margin-top: 5px;
	font-size: clamp(27px, 4vw, 38px);
	font-weight: 900;
	letter-spacing: -0.035em;
	line-height: 1.05;
}

.opt-foody-customer-state__copy p {
	margin-top: 6px;
	color: var(--foody-status-muted);
}

.opt-foody-customer-state__driver {
	display: grid;
	gap: 4px;
	margin-top: 14px;
	padding: 12px 14px;
	background: color-mix(in srgb, var(--foody-success, #486348) 9%, var(--foody-status-paper));
	border-left: 3px solid var(--foody-success, #486348);
}

.opt-foody-customer-state__driver[hidden],
.opt-foody-customer-state__driver [hidden] {
	display: none;
}

.opt-foody-customer-state__driver > span {
	color: var(--foody-success, #486348);
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 0.14em;
}

.opt-foody-customer-state__driver strong {
	font-size: 16px;
}

.opt-foody-customer-state__driver small {
	color: var(--foody-status-muted);
}

.opt-foody-customer-state__driver div {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
}

.opt-foody-customer-state__driver a {
	color: var(--foody-status-accent);
	font-size: 12px;
	font-weight: 850;
}

.opt-foody-customer-state__waiting {
	display: flex;
	flex-wrap: wrap;
	gap: 3px;
	margin-top: 12px;
	color: var(--foody-status-highlight);
	font-size: 12px;
	font-weight: 900;
	line-height: 1.35;
}

.opt-foody-customer-state__waiting[hidden] {
	display: none;
}

.opt-foody-customer-state__waiting span:last-child {
	color: var(--foody-status-muted);
	font-weight: 800;
}

.opt-foody-customer-state__payment {
	display: block;
	margin-top: 10px;
	padding: 9px 11px;
	color: var(--foody-status-ink);
	font-size: 11px;
	font-weight: 850;
	line-height: 1.35;
	background: var(--foody-wash, #f3dfc4);
	border-left: 3px solid var(--foody-status-highlight);
}

.opt-foody-customer-state__payment--voided,
.opt-foody-customer-state__payment--void_requested,
.opt-foody-customer-state__payment--refunded {
	background: color-mix(in srgb, var(--foody-success, #486348) 11%, var(--foody-status-paper));
	border-left-color: var(--foody-success, #486348);
}

.opt-foody-customer-state__payment[hidden] {
	display: none;
}

.opt-foody-customer-state__sync-note {
	display: block;
	margin-top: 5px;
	color: var(--foody-status-muted);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.35;
}

.opt-foody-customer-state__sync-note[hidden] {
	display: none;
}

.opt-foody-customer-state.is-sync-offline .opt-foody-customer-state__sync-note,
.opt-foody-customer-state.is-sync-stale .opt-foody-customer-state__sync-note {
	color: var(--foody-error, #922e22);
}

.opt-foody-customer-state__progress {
	height: 7px;
	margin-top: 15px;
	overflow: hidden;
	background: color-mix(in srgb, var(--foody-status-line) 72%, transparent);
}

.opt-foody-customer-state__progress > span {
	display: block;
	width: var(--foody-status-progress, 0%);
	height: 100%;
	background: var(--foody-status-highlight);
	transform-origin: left center;
	transition: width 750ms cubic-bezier(0.22, 1, 0.36, 1), background-color 250ms ease;
	animation: opt-foody-progress-enter 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.opt-foody-customer-state__timeline {
	display: flex;
	gap: 0;
	margin: 17px 0 0;
	padding: 0;
	list-style: none;
}

.opt-foody-customer-state__timeline li {
	position: relative;
	flex: 1 1 0;
	padding-top: 25px;
	color: #7b7e77;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.opt-foody-customer-state__timeline li::before {
	position: absolute;
	top: 8px;
	right: 50%;
	left: -50%;
	height: 2px;
	background: #d7d2c8;
	content: '';
}

.opt-foody-customer-state__timeline li:first-child::before {
	display: none;
}

.opt-foody-customer-state__timeline li > span {
	position: absolute;
	top: 2px;
	left: calc(50% - 7px);
	z-index: 1;
	width: 14px;
	height: 14px;
	background: #ded9cf;
	border: 2px solid var(--foody-status-paper);
	border-radius: 50%;
	box-shadow: 0 0 0 1px #bdb8ae;
}

.opt-foody-customer-state__timeline li.is-complete {
	color: #2f603c;
}

.opt-foody-customer-state__timeline li.is-complete::before,
.opt-foody-customer-state__timeline li.is-complete > span {
	background: #3c7a4c;
}

.opt-foody-customer-state__timeline li.is-current {
	color: var(--foody-status-ink);
}

.opt-foody-customer-state__timeline li.is-current > span {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--foody-status-state) 26%, transparent);
	animation: opt-foody-current-pulse 1.8s ease-out infinite;
}

.opt-foody-customer-state--placed {
	--foody-status-highlight: var(--foody-accent, #e7a33e);
}

.opt-foody-customer-state--ready,
.opt-foody-customer-state--completed {
	--foody-status-highlight: var(--foody-success, #486348);
}

.opt-foody-customer-state--rejected,
.opt-foody-customer-state--cancelled,
.opt-foody-customer-state--delivery_issue {
	--foody-status-highlight: var(--foody-error, #922e22);
}

body.opt-foody-order-received-app .opt-foody-customer-state {
	--foody-status-highlight: var(--foody-brand);
	--foody-status-state: var(--foody-brand);
	width: min(760px, calc(100% - 32px));
	max-width: 760px;
	margin: 0 auto 12px !important;
	padding: 25px 28px 24px;
	color: var(--foody-ink);
	background: var(--foody-surface);
	border: 1px solid var(--foody-line);
	border-top: 4px solid var(--foody-brand);
}

body.opt-foody-order-received-app .opt-foody-customer-state--placed {
	--foody-status-state: var(--foody-accent);
}

body.opt-foody-order-received-app .opt-foody-customer-state--ready,
body.opt-foody-order-received-app .opt-foody-customer-state--completed {
	--foody-status-state: var(--foody-success);
}

body.opt-foody-order-received-app .opt-foody-customer-state--rejected,
body.opt-foody-order-received-app .opt-foody-customer-state--cancelled,
body.opt-foody-order-received-app .opt-foody-customer-state--delivery_issue {
	--foody-status-highlight: var(--foody-error);
	--foody-status-state: var(--foody-error);
	border-top-color: var(--foody-error);
}

body.opt-foody-order-received-app .opt-foody-customer-state__order-number > span {
	color: var(--foody-brand);
}

body.opt-foody-order-received-app .opt-foody-customer-state__live,
body.opt-foody-order-received-app .opt-foody-customer-state__copy p {
	color: var(--foody-muted);
}

body.opt-foody-order-received-app .opt-foody-customer-state__live i {
	background: var(--foody-status-state);
}

body.opt-foody-order-received-app .opt-foody-customer-state__copy h2 {
	color: var(--foody-ink);
	font-size: clamp(31px, 6vw, 46px);
}

body.opt-foody-order-received-app .opt-foody-customer-state__progress {
	background: var(--foody-line);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li {
	color: var(--foody-muted);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li::before {
	background: var(--foody-line);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li > span {
	background: var(--foody-surface);
	border-color: var(--foody-surface);
	box-shadow: 0 0 0 1px var(--foody-line);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li.is-complete {
	color: var(--foody-ink);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li.is-current {
	color: var(--foody-status-state);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li.is-complete::before,
body.opt-foody-order-received-app .opt-foody-customer-state__timeline li.is-complete > span {
	background: var(--foody-status-highlight);
}

body.opt-foody-order-received-app .opt-foody-customer-state__timeline li.is-current > span {
	background: var(--foody-status-state);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--foody-status-state) 20%, transparent);
}

.opt-foody-customer-state[data-order-terminal="1"] .opt-foody-customer-state__timeline li.is-current > span {
	animation: none;
}

body.opt-foody-order-received-app .opt-foody-customer-state.is-state-changing .opt-foody-customer-state__copy {
	animation: opt-foody-status-update 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes opt-foody-progress-enter {
	from {
		width: 0;
	}
}

@keyframes opt-foody-live-pulse {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--foody-status-state) 45%, transparent);
	}
	70%,
	100% {
		box-shadow: 0 0 0 7px transparent;
	}
}

@keyframes opt-foody-current-pulse {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.2);
	}
}

@keyframes opt-foody-status-update {
	from {
		opacity: 0.45;
		transform: translateY(5px);
	}
}

.opt-foody-order-actions {
	--foody-action-ink: var(--foody-ink, #2d1d18);
	--foody-action-muted: var(--foody-muted, #725f55);
	--foody-action-paper: var(--foody-surface, #fffdf7);
	--foody-action-line: var(--foody-line, #dfd0c2);
	--foody-action-accent: var(--foody-brand, #b33a2b);
	margin: 22px 0;
	padding: clamp(20px, 4vw, 30px);
	color: var(--foody-action-ink);
	background: var(--foody-action-paper);
	border: 1px solid var(--foody-action-line);
}

.opt-foody-order-actions p,
.opt-foody-order-actions h3 {
	margin: 0;
}

.opt-foody-order-actions__heading > p,
.opt-foody-order-actions--cancelled > p,
.opt-foody-order-actions--requested > p,
.opt-foody-order-actions--pending > p,
.opt-foody-order-actions--approved > p,
.opt-foody-order-actions--declined > p,
.opt-foody-order-actions--locked > p {
	color: var(--foody-action-accent);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.14em;
}

.opt-foody-order-actions__heading h3,
.opt-foody-order-actions--cancelled h3,
.opt-foody-order-actions--requested h3,
.opt-foody-order-actions--pending h3,
.opt-foody-order-actions--approved h3,
.opt-foody-order-actions--declined h3,
.opt-foody-order-actions--locked h3 {
	margin-top: 5px;
	font-size: clamp(24px, 4vw, 31px);
	font-weight: 900;
	letter-spacing: -0.035em;
	line-height: 1.05;
}

.opt-foody-order-actions__policy,
.opt-foody-order-actions__locked,
.opt-foody-order-actions__contact {
	margin-top: 9px !important;
	color: var(--foody-action-muted);
}

.opt-foody-order-actions__cancel {
	margin-top: 18px;
	border-top: 1px solid var(--foody-action-line);
}

.opt-foody-order-actions__cancel summary {
	padding: 14px 0 3px;
	color: #8a321f;
	font-weight: 800;
	cursor: pointer;
}

.opt-foody-order-actions__cancel form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 13px;
}

.opt-foody-order-actions__cancel label {
	display: grid;
	gap: 6px;
}

.opt-foody-order-actions__cancel label > span {
	font-size: 12px;
	font-weight: 800;
}

.opt-foody-order-actions__cancel select,
.opt-foody-order-actions__cancel textarea {
	width: 100%;
	padding: 10px 12px;
	color: var(--foody-action-ink);
	background: #fff;
	border: 1px solid #aaa395;
	border-radius: 0;
	font: inherit;
}

.opt-foody-order-actions__warning {
	grid-column: 1 / -1;
	padding: 12px 14px;
	color: #79301f;
	background: #fff1e8;
	border-left: 3px solid var(--foody-action-accent);
}

.opt-foody-order-actions__cancel button {
	grid-column: 1 / -1;
	justify-self: start;
	min-height: 42px;
	padding: 9px 16px;
	color: #fff;
	background: var(--foody-action-accent);
	border: 1px solid var(--foody-action-accent);
	border-radius: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 800;
	cursor: pointer;
}

.opt-foody-order-actions__cancel select:focus-visible,
.opt-foody-order-actions__cancel textarea:focus-visible,
.opt-foody-order-actions__cancel button:focus-visible,
.opt-foody-order-actions__cancel summary:focus-visible {
	outline: 3px solid #d37861;
	outline-offset: 3px;
}

.opt-foody-order-actions__error {
	margin-top: 13px;
	padding: 11px 13px;
	color: #7b2d1b;
	background: #fff0e7;
	border-left: 3px solid var(--foody-action-accent);
}

.opt-foody-order-actions--cancelled {
	border-left: 4px solid #3c7a4c;
}

.opt-foody-order-actions--requested,
.opt-foody-order-actions--pending {
	border-left: 4px solid #b57a28;
}

.opt-foody-order-actions--approved {
	border-left: 4px solid #3c7a4c;
}

.opt-foody-order-actions--declined {
	border-left: 4px solid var(--foody-action-accent);
}

.opt-foody-order-actions--locked {
	border-left: 4px solid var(--foody-action-line);
}

.opt-foody-order-actions--cancelled > span,
.opt-foody-order-actions--requested > span,
.opt-foody-order-actions--requested > small,
.opt-foody-order-actions--pending > small,
.opt-foody-order-actions--approved > span,
.opt-foody-order-actions--approved > small,
.opt-foody-order-actions--declined > span,
.opt-foody-order-actions--declined > small,
.opt-foody-order-actions--cancelled > small,
.opt-foody-order-actions--locked > small {
	display: block;
	margin-top: 6px;
	color: var(--foody-action-muted);
}

@media (max-width: 560px) {
	.opt-foody-customer-state__timeline {
		align-items: stretch;
		flex-direction: column;
		gap: 8px;
	}

	.opt-foody-customer-state__timeline li {
		padding: 2px 0 2px 25px;
		text-align: left;
	}

	.opt-foody-customer-state__timeline li::before {
		top: -10px;
		bottom: 50%;
		left: 7px;
		width: 2px;
		height: auto;
	}

	.opt-foody-customer-state__timeline li > span {
		top: 3px;
		left: 1px;
	}

	.opt-foody-order-actions__cancel form {
		grid-template-columns: 1fr;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state {
		width: calc(100% - 16px);
		padding: 18px 16px 17px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__copy h2 {
		font-size: 30px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__order-number strong {
		font-size: 42px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__copy p {
		font-size: 12px;
		line-height: 1.4;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__progress {
		margin-top: 17px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__timeline {
		align-items: initial;
		flex-direction: row;
		gap: 0;
		margin-top: 13px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__timeline li {
		padding: 20px 3px 0;
		font-size: 9px;
		line-height: 1.2;
		text-align: center;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__timeline li::before {
		top: 7px;
		bottom: auto;
		left: -50%;
		width: auto;
		height: 2px;
	}

	body.opt-foody-order-received-app .opt-foody-customer-state__timeline li > span {
		top: 1px;
		left: calc(50% - 7px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.opt-foody-customer-state__live i,
	.opt-foody-customer-state__timeline li.is-current > span,
	.opt-foody-customer-state__progress > span,
	body.opt-foody-order-received-app .opt-foody-customer-state.is-state-changing .opt-foody-customer-state__copy {
		animation: none;
		transition: none;
	}
}

/* Customer order totals: preserve the Woo row while disclosing its components. */
.opt-foody-order-tax-others__amount {
	white-space: nowrap;
}

.opt-foody-order-tax-others__details {
	display: inline-block;
	margin-left: 7px;
	vertical-align: middle;
}

.opt-foody-order-tax-others__details summary {
	display: inline-grid;
	width: 22px;
	height: 22px;
	place-items: center;
	border: 1px solid currentColor;
	border-radius: 50%;
	cursor: pointer;
	font-size: 12px;
	list-style: none;
}

.opt-foody-order-tax-others__details summary::-webkit-details-marker {
	display: none;
}

.opt-foody-order-tax-others__details summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.opt-foody-order-tax-others__breakdown {
	width: min(190px, 42vw);
	margin-top: 8px;
	padding: 9px 0;
	font-size: 0.9em;
}

.opt-foody-order-tax-others__detail {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	padding: 3px 0;
}

/* Native order tables use their existing label/amount columns for open details. */
.opt-foody-order-tax-others__details.is-table-breakdown > .opt-foody-order-tax-others__breakdown,
.woocommerce-order-details .opt-foody-order-tax-breakdown-row[hidden] {
	display: none !important;
}

body.opt-foody-account-app .woocommerce-order-details .opt-foody-order-tax-breakdown-row th,
body.opt-foody-account-app .woocommerce-order-details .opt-foody-order-tax-breakdown-row td {
	padding-block: 4px;
	font-size: 12px;
	font-weight: normal;
}
