/*
 * Wholesale order form — styled as a working order slip/ledger rather than
 * a generic card form: hairline rules instead of shadows, numbered sections
 * in filling order, tabular figures in the item table and totals block, and
 * a single ink accent reserved for the total and the submit action.
 */

.vfdo-order-form-wrap {
	--vfdo-ink: #21231e;
	--vfdo-muted: #6e7064;
	--vfdo-faint: #9a9c8f;
	--vfdo-line: #dedad0;
	--vfdo-panel: #fbfaf7;
	--vfdo-accent: #7d2233;
	--vfdo-accent-soft: #f5e9ea;
	--vfdo-radius: 4px;

	max-width: 720px;
	margin: 0 auto;
	padding: 2em 2.25em 2.25em;
	background: #fff;
	border: 1px solid var(--vfdo-line);
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(33, 35, 30, 0.04), 0 8px 24px rgba(33, 35, 30, 0.05);
	color: var(--vfdo-ink);
	font-size: 15px;
	line-height: 1.45;
}

.vfdo-order-form-wrap *,
.vfdo-order-form-wrap *::before,
.vfdo-order-form-wrap *::after {
	box-sizing: border-box;
}

/* Toast (submission result) */

.vfdo-toast {
	position: fixed;
	top: 1.25em;
	left: 50%;
	transform: translateX(-50%);
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	max-width: min(90vw, 26em);
	padding: 0.85em 1em;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(33, 35, 30, 0.15);
	font-size: 0.9em;
	line-height: 1.4;
	opacity: 1;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.vfdo-toast.is-hiding {
	opacity: 0;
	transform: translateX(-50%) translateY(-8px);
}

.vfdo-toast-message {
	margin: 0;
	flex: 1 1 auto;
}

.vfdo-toast-close {
	flex: 0 0 auto;
	margin: -0.2em -0.2em 0 0;
	padding: 0 0.3em;
	border: none;
	background: none;
	font-size: 1.3em;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
}

.vfdo-toast-close:hover,
.vfdo-toast-close:focus {
	opacity: 1;
}

.vfdo-toast-success {
	background: #eef4ec;
	color: #33512f;
	border: 1px solid #c9dcc2;
}

.vfdo-toast-error {
	background: var(--vfdo-accent-soft);
	color: var(--vfdo-accent);
	border: 1px solid #e6c3c8;
}

@media (max-width: 640px) {
	.vfdo-toast {
		top: 0.75em;
		max-width: calc(100vw - 1.5em);
	}
}

/* Stepper (wizard progress) */

.vfdo-stepper {
	margin-bottom: 1.5em;
}

.vfdo-stepper-track {
	display: flex;
	gap: 0.4em;
	margin-bottom: 0.6em;
}

.vfdo-stepper-seg {
	flex: 1 1 0;
	height: 3px;
	background: var(--vfdo-line);
	border-radius: 2px;
}

.vfdo-stepper-seg.is-current,
.vfdo-stepper-seg.is-complete {
	background: var(--vfdo-accent);
}

.vfdo-stepper-seg.is-complete {
	cursor: pointer;
}

.vfdo-stepper-label {
	margin: 0;
	font-size: 0.85em;
	color: var(--vfdo-muted);
}

.vfdo-step-current {
	font-weight: 700;
	color: var(--vfdo-ink);
}

.vfdo-stepper-label-sep {
	color: var(--vfdo-faint);
	margin: 0 0.3em;
}

.vfdo-step-title {
	font-weight: 600;
	color: var(--vfdo-ink);
}

/* Section structure */

.vfdo-section {
	padding: 1.5em 0;
	border-bottom: 1px solid var(--vfdo-line);
}

.vfdo-section-heading {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	margin: 0 0 1em;
	font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
	font-weight: 600;
	font-size: 1.15em;
	letter-spacing: 0.01em;
	color: var(--vfdo-ink);
}

.vfdo-section-heading:focus {
	outline: none;
}

.vfdo-section-no {
	font-variant-numeric: tabular-nums;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 600;
	font-size: 0.7em;
	color: var(--vfdo-faint);
}

.vfdo-category-heading {
	margin: 1.25em 0 0.5em;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 600;
	font-size: 0.85em;
	text-transform: none;
	color: var(--vfdo-muted);
}

.vfdo-category-heading:first-of-type {
	margin-top: 0;
}

/* Fields */

.vfdo-field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em 1.25em;
}

.vfdo-field-full {
	grid-column: 1 / -1;
}

.vfdo-field {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
}

.vfdo-field label,
.vfdo-discount-row > .vfdo-field label {
	font-size: 0.85em;
	font-weight: 600;
	color: var(--vfdo-muted);
}

.vfdo-required {
	color: var(--vfdo-accent);
}

.vfdo-order-form input[type="text"],
.vfdo-order-form input[type="email"],
.vfdo-order-form input[type="number"],
.vfdo-order-form textarea {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid var(--vfdo-line);
	border-radius: var(--vfdo-radius);
	background: var(--vfdo-panel);
	color: var(--vfdo-ink);
	font-size: 0.95em;
	font-family: inherit;
}

.vfdo-order-form textarea {
	resize: vertical;
}

.vfdo-order-form input:focus,
.vfdo-order-form textarea:focus {
	outline: 2px solid var(--vfdo-accent);
	outline-offset: 1px;
	border-color: var(--vfdo-accent);
}

/* $ / % prefixed inputs */

.vfdo-input-prefix {
	display: inline-flex;
	align-items: center;
	width: 100%;
	border: 1px solid var(--vfdo-line);
	border-radius: var(--vfdo-radius);
	background: var(--vfdo-panel);
	padding-left: 0.6em;
	font-size: 0.95em;
	color: var(--vfdo-muted);
}

.vfdo-input-prefix input {
	border: none !important;
	background: transparent !important;
	padding-left: 0.3em !important;
}

.vfdo-input-prefix input:focus {
	outline: none !important;
}

.vfdo-input-prefix:focus-within {
	outline: 2px solid var(--vfdo-accent);
	outline-offset: 1px;
	border-color: var(--vfdo-accent);
}

/* Items table */

.vfdo-table-wrap {
	overflow-x: auto;
}

.vfdo-items-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.vfdo-items-table thead th {
	text-align: left;
	font-size: 0.78em;
	font-weight: 600;
	color: var(--vfdo-faint);
	padding: 0 0.5em 0.5em;
	border-bottom: 1px solid var(--vfdo-line);
}

.vfdo-items-table thead th:not(:first-child) {
	text-align: right;
	width: 6.5em;
}

.vfdo-items-table td {
	padding: 0.4em 0.5em;
	vertical-align: middle;
	border-bottom: 1px solid #ece9e0;
}

.vfdo-items-table tbody tr:last-child td {
	border-bottom: none;
}

.vfdo-item-label {
	font-size: 0.92em;
}

.vfdo-items-table td:not(.vfdo-item-label) {
	text-align: right;
}

.vfdo-items-table .vfdo-qty {
	width: 4.5em;
	text-align: right;
}

.vfdo-items-table .vfdo-input-prefix {
	width: 6em;
	margin-left: auto;
}

.vfdo-item-amount {
	font-weight: 600;
	white-space: nowrap;
}

/* Discount row */

.vfdo-discount-row {
	display: grid;
	grid-template-columns: 1fr 12em;
	gap: 1em 1.25em;
	align-items: end;
	margin-top: 1em;
}

.vfdo-discount-toggle {
	display: flex;
	gap: 0.5em;
}

.vfdo-radio-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.5em 0.85em;
	border: 1px solid var(--vfdo-line);
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
	color: var(--vfdo-muted);
	cursor: pointer;
}

.vfdo-radio-pill:has(input:checked) {
	border-color: var(--vfdo-accent);
	color: var(--vfdo-accent);
	background: var(--vfdo-accent-soft);
}

.vfdo-radio-pill input {
	margin: 0;
}

/* Summary */

.vfdo-summary {
	margin: 1.5em 0;
	padding: 1em 1.25em;
	background: var(--vfdo-panel);
	border: 1px solid var(--vfdo-line);
	border-radius: var(--vfdo-radius);
	font-variant-numeric: tabular-nums;
}

.vfdo-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 0.3em 0;
	font-size: 0.92em;
	color: var(--vfdo-muted);
}

.vfdo-summary-total {
	margin-top: 0.4em;
	padding-top: 0.7em;
	border-top: 1px solid var(--vfdo-line);
	font-size: 1.15em;
	font-weight: 700;
	color: var(--vfdo-accent);
}

/* Internal use section — visually de-emphasized */

.vfdo-section-internal {
	border-bottom: none;
	padding-top: 1em;
}

.vfdo-section-internal .vfdo-section-heading {
	font-size: 0.95em;
	color: var(--vfdo-faint);
}

.vfdo-section-internal .vfdo-field-grid {
	max-width: 26em;
}

/* Wizard navigation / submit */

.vfdo-wizard-nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75em;
	margin-top: 1.5em;
}

.vfdo-submit-btn,
.vfdo-btn-next {
	display: inline-block;
	padding: 0.75em 1.75em;
	border: none;
	border-radius: var(--vfdo-radius);
	background: var(--vfdo-accent);
	color: #fff;
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
}

.vfdo-submit-btn:hover,
.vfdo-submit-btn:focus,
.vfdo-btn-next:hover,
.vfdo-btn-next:focus {
	background: #661c2a;
}

.vfdo-submit-btn:focus-visible,
.vfdo-btn-next:focus-visible,
.vfdo-btn-back:focus-visible {
	outline: 2px solid var(--vfdo-ink);
	outline-offset: 2px;
}

.vfdo-btn-back {
	display: inline-block;
	margin-right: auto;
	padding: 0.75em 0.25em;
	border: none;
	background: none;
	color: var(--vfdo-muted);
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
}

.vfdo-btn-back:hover,
.vfdo-btn-back:focus {
	color: var(--vfdo-ink);
}

/* Responsive */

@media (max-width: 640px) {
	.vfdo-order-form-wrap {
		padding: 1.5em 1.25em 1.75em;
		border-radius: 0;
	}

	.vfdo-field-grid {
		grid-template-columns: 1fr;
	}

	.vfdo-discount-row {
		grid-template-columns: 1fr;
	}

	.vfdo-items-table,
	.vfdo-items-table thead,
	.vfdo-items-table tbody,
	.vfdo-items-table th,
	.vfdo-items-table td,
	.vfdo-items-table tr {
		display: block;
	}

	.vfdo-items-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.vfdo-items-table tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		gap: 0.25em 0.75em;
		padding: 0.6em 0;
		border-bottom: 1px solid var(--vfdo-line);
	}

	.vfdo-items-table tbody tr:last-child {
		border-bottom: none;
	}

	.vfdo-items-table .vfdo-item-label {
		grid-column: 1 / -1;
		font-weight: 600;
		border-bottom: none;
		padding: 0;
	}

	.vfdo-items-table td {
		border-bottom: none;
		padding: 0.15em 0;
	}

	.vfdo-items-table td::before {
		content: attr(data-label);
		font-size: 0.75em;
		font-weight: 600;
		color: var(--vfdo-faint);
		display: block;
	}

	.vfdo-items-table td:not(.vfdo-item-label) {
		text-align: left;
	}

	.vfdo-items-table .vfdo-input-prefix,
	.vfdo-items-table .vfdo-qty {
		margin-left: 0;
		width: 100%;
		max-width: 10em;
	}
}
