/* HMF Vorbestellung – Bestellseite. Farben angelehnt an die Website der Brotbackstube.
   Alle Text- und Bedienfarben erreichen mindestens 4,5 : 1 Kontrast (WCAG AA). */

.hmf-vb {
	--hmf-vb-primary: #557020;       /* Grün, abgedunkelt für ausreichenden Kontrast */
	--hmf-vb-primary-dark: #3f5418;
	--hmf-vb-gold: #e5ca5f;
	--hmf-vb-text: #373737;
	--hmf-vb-muted: #595959;
	--hmf-vb-border: #8a8a8a;
	--hmf-vb-bg-soft: #f7f4ea;
	--hmf-vb-error: #b3261e;
	--hmf-vb-focus: #1a1a1a;
	color: var(--hmf-vb-text);
	font-size: 1rem;
	line-height: 1.6;
	max-width: 1100px;
	margin: 0 auto;
}

.hmf-vb *,
.hmf-vb *::before,
.hmf-vb *::after {
	box-sizing: border-box;
}

.hmf-vb-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Gut sichtbarer Fokus für Tastaturnutzer */
.hmf-vb a:focus-visible,
.hmf-vb button:focus-visible,
.hmf-vb select:focus-visible,
.hmf-vb input:focus-visible,
.hmf-vb [tabindex="-1"]:focus {
	outline: 3px solid var(--hmf-vb-focus);
	outline-offset: 3px;
}
.hmf-vb [tabindex="-1"]:focus:not(:focus-visible) {
	outline: none;
}

.hmf-vb h2.hmf-vb-heading {
	margin: 0.5em 0 0.5em;
	font-size: 1.6em;
	line-height: 1.3;
}
.hmf-vb h3 {
	font-size: 1.15em;
	line-height: 1.3;
	margin: 1.2em 0 0.5em;
}

/* Fortschritt */
.hmf-vb-progress ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.5em;
	list-style: none;
	margin: 0 0 1em;
	padding: 0;
}
.hmf-vb-progress li {
	display: flex;
	align-items: center;
	gap: 0.5em;
	color: var(--hmf-vb-muted);
	margin: 0;
	padding: 0;
}
.hmf-vb-progress-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9em;
	height: 1.9em;
	border-radius: 50%;
	border: 2px solid var(--hmf-vb-border);
	font-weight: 700;
}
.hmf-vb-progress li.is-current {
	color: var(--hmf-vb-text);
	font-weight: 700;
}
.hmf-vb-progress li.is-current .hmf-vb-progress-num {
	background: var(--hmf-vb-primary);
	border-color: var(--hmf-vb-primary);
	color: #fff;
}
.hmf-vb-progress li.is-done .hmf-vb-progress-num {
	border-color: var(--hmf-vb-primary);
	color: var(--hmf-vb-primary);
}

/* Hinweise und Fehler */
.hmf-vb-alert {
	border: 2px solid var(--hmf-vb-error);
	border-left-width: 8px;
	background: #fdf1f0;
	padding: 0.8em 1em;
	margin: 1em 0;
	color: var(--hmf-vb-text);
}
.hmf-vb-alert p {
	margin: 0;
	font-weight: 700;
}
.hmf-vb-alert ul {
	margin: 0.5em 0 0 1.2em;
}
.hmf-vb-alert a {
	color: var(--hmf-vb-error);
	text-decoration: underline;
}
.hmf-vb-pickup,
.hmf-vb-notice {
	background: var(--hmf-vb-bg-soft);
	border-left: 6px solid var(--hmf-vb-gold);
	padding: 0.7em 1em;
}
.hmf-vb-prewrap {
	white-space: pre-line;
}
.hmf-vb-small {
	font-size: 0.9em;
	color: var(--hmf-vb-muted);
}
.hmf-vb-small a {
	color: var(--hmf-vb-primary-dark);
	text-decoration: underline;
}

/* Schritt 1: Abholtage als Kacheln */
.hmf-vb-days {
	border: 0;
	margin: 0;
	padding: 0;
}
.hmf-vb-week {
	margin-bottom: 1.2em;
}
.hmf-vb-week-title {
	font-size: 1em !important;
	color: var(--hmf-vb-muted);
	margin: 1em 0 0.5em !important;
}
.hmf-vb-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.75em;
}
.hmf-vb-tile {
	position: relative;
}
.hmf-vb-tile input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.hmf-vb-tile label {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	height: 100%;
	padding: 0.8em 0.9em;
	border: 2px solid var(--hmf-vb-border);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}
.hmf-vb-tile label:hover {
	border-color: var(--hmf-vb-primary);
	background: var(--hmf-vb-bg-soft);
}
.hmf-vb-tile input:checked + label {
	border-color: var(--hmf-vb-primary);
	border-width: 3px;
	background: var(--hmf-vb-bg-soft);
	box-shadow: inset 0 0 0 1px var(--hmf-vb-primary);
}
.hmf-vb-tile input:checked + label::after {
	content: "✓";
	position: absolute;
	top: 0.4em;
	right: 0.6em;
	font-weight: 700;
	color: var(--hmf-vb-primary);
	font-size: 1.2em;
}
.hmf-vb-tile input:focus-visible + label {
	outline: 3px solid var(--hmf-vb-focus);
	outline-offset: 3px;
}
/* Farben fest setzen: Das Theme färbt Texte in Labels sonst hellgrün (zu wenig Kontrast). */
.hmf-vb .hmf-vb-tile label,
.hmf-vb .hmf-vb-tile label span {
	color: var(--hmf-vb-text);
}
.hmf-vb .hmf-vb-tile label .hmf-vb-tile-deadline {
	color: var(--hmf-vb-muted);
}
.hmf-vb .hmf-vb-tile-day {
	font-weight: 700;
	font-size: 1.1em;
}
.hmf-vb .hmf-vb-tile-date {
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1.1;
}
.hmf-vb-tile-deadline {
	font-size: 0.85em;
	color: var(--hmf-vb-muted);
}
.hmf-vb-badge {
	display: inline-block;
	align-self: flex-start;
	background: var(--hmf-vb-gold);
	color: var(--hmf-vb-text);
	font-size: 0.8em;
	font-weight: 700;
	padding: 0.1em 0.5em;
	border-radius: 4px;
}

/* Schaltflächen */
.hmf-vb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 1.2em 0;
}
.hmf-vb .hmf-vb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.6em 1.4em;
	border: 2px solid var(--hmf-vb-primary);
	border-radius: 6px;
	background: var(--hmf-vb-primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
}
.hmf-vb .hmf-vb-button:hover {
	background: var(--hmf-vb-primary-dark);
	border-color: var(--hmf-vb-primary-dark);
}
.hmf-vb .hmf-vb-button--secondary {
	background: #fff;
	color: var(--hmf-vb-primary-dark);
}
.hmf-vb .hmf-vb-button--secondary:hover {
	background: var(--hmf-vb-bg-soft);
	color: var(--hmf-vb-primary-dark);
}
.hmf-vb .hmf-vb-button[aria-disabled="true"] {
	opacity: 0.7;
	cursor: progress;
}
.hmf-vb .hmf-vb-link {
	background: none;
	border: 0;
	padding: 0.2em 0;
	margin: 0;
	min-height: 32px;
	color: var(--hmf-vb-primary-dark);
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
}
.hmf-vb .hmf-vb-link:hover {
	text-decoration-thickness: 2px;
}

/* Schritt 2: Brote */
.hmf-vb-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.2em;
	list-style: none;
	margin: 1em 0;
	padding: 0;
}
.hmf-vb-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}
.hmf-vb-card-img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: var(--hmf-vb-bg-soft);
}
.hmf-vb-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	padding: 0.9em 1em 1.1em;
	flex: 1;
}
.hmf-vb h3.hmf-vb-card-title {
	margin: 0;
	font-size: 1.2em;
}
.hmf-vb-card-body p {
	margin: 0;
	padding: 0;
}
.hmf-vb-unit {
	color: var(--hmf-vb-muted);
	font-size: 0.9em;
}
.hmf-vb-card-excerpt {
	font-size: 0.95em;
}
.hmf-vb-limit {
	font-size: 0.9em;
	font-weight: 700;
	color: var(--hmf-vb-primary-dark);
}
.hmf-vb-soldout {
	font-weight: 700;
	color: var(--hmf-vb-error);
	margin-top: auto !important;
}
.hmf-vb-card.is-soldout .hmf-vb-card-img {
	filter: grayscale(1);
	opacity: 0.6;
}
.hmf-vb-toggle {
	align-self: flex-start;
	text-align: left;
}
.hmf-vb-details {
	border-top: 1px solid #e0e0e0;
	padding-top: 0.6em;
	font-size: 0.95em;
}
.hmf-vb-details h4 {
	font-size: 1em;
	margin: 0.8em 0 0.2em;
}
.hmf-vb-description p {
	margin: 0 0 0.6em !important;
}
.hmf-vb-qty {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-top: auto;
	padding-top: 0.6em;
}
.hmf-vb-qty label {
	font-weight: 700;
}
.hmf-vb .hmf-vb-qty select {
	min-height: 44px;
	min-width: 8em;
	padding: 0.3em 0.6em;
	border: 2px solid var(--hmf-vb-border);
	border-radius: 6px;
	background: #fff;
	color: var(--hmf-vb-text);
	font: inherit;
	width: auto;
}

/* Auswahl-Leiste bleibt beim Scrollen unten sichtbar */
.hmf-vb-cartbar {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em 1em;
	padding: 0.6em 1em;
	margin: 1em 0 0;
	background: #fff;
	border-top: 3px solid var(--hmf-vb-primary);
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}
.hmf-vb-cartbar-sum {
	margin: 0 !important;
	padding: 0 !important;
}
.hmf-vb-cartbar .hmf-vb-actions {
	margin: 0;
}

/* Schritt 3: Formular */
.hmf-vb-summary {
	width: 100%;
	max-width: 640px;
	border-collapse: collapse;
	margin: 0.5em 0 1em;
}
.hmf-vb-summary th,
.hmf-vb-summary td {
	text-align: left;
	padding: 0.4em 0.5em;
	border-bottom: 1px solid #e0e0e0;
}
.hmf-vb-summary .hmf-vb-num {
	text-align: right;
	white-space: nowrap;
}
.hmf-vb-summary tfoot th,
.hmf-vb-summary tfoot td {
	font-weight: 700;
	border-bottom: 0;
}
.hmf-vb-form {
	max-width: 640px;
}
.hmf-vb-field {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
	margin-bottom: 1em;
}
.hmf-vb-field label {
	font-weight: 700;
}
.hmf-vb-hint {
	font-size: 0.9em;
	color: var(--hmf-vb-muted);
}
.hmf-vb .hmf-vb-field input {
	min-height: 48px;
	padding: 0.5em 0.7em;
	border: 2px solid var(--hmf-vb-border);
	border-radius: 6px;
	font: inherit;
	color: var(--hmf-vb-text);
	background: #fff;
	width: 100%;
}
.hmf-vb .hmf-vb-field.has-error input {
	border-color: var(--hmf-vb-error);
}
.hmf-vb-field-error {
	color: var(--hmf-vb-error);
	font-weight: 700;
}
.hmf-vb-field-error::before {
	content: "⚠ ";
}
.hmf-vb-check {
	display: flex;
	align-items: flex-start;
	gap: 0.6em;
	margin: 0.5em 0 1em;
}
.hmf-vb-check input {
	width: 22px;
	height: 22px;
	margin-top: 0.15em;
	flex: none;
	accent-color: var(--hmf-vb-primary);
}
.hmf-vb-hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Bestätigung */
.hmf-vb-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.3em 1.2em;
	margin: 1em 0;
}
.hmf-vb-facts dt {
	font-weight: 700;
}
.hmf-vb-facts dd {
	margin: 0;
}

.hmf-vb-loading {
	color: var(--hmf-vb-muted);
	font-style: italic;
}

@media (max-width: 600px) {
	.hmf-vb-tiles {
		grid-template-columns: repeat(2, 1fr);
	}
	.hmf-vb-actions .hmf-vb-button {
		flex: 1 1 auto;
	}
	.hmf-vb-cartbar {
		margin-left: -0.5em;
		margin-right: -0.5em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmf-vb * {
		transition: none !important;
	}
}

@media (forced-colors: active) {
	.hmf-vb-tile input:checked + label {
		outline: 3px solid Highlight;
	}
}
