/* Hanten Bestellformular – Frontend
   Optik angelehnt an die Flyer: Papierton, dunkle Schrift,
   Weidegrün als einziger Akzent. Erbt bewusst die Theme-Schriftart. */

.hbf {
	--hbf-ink: #2a2622;
	--hbf-paper: #faf7f1;
	--hbf-line: #e4ddd0;
	--hbf-accent: #3e5c3a;      /* Weidegrün */
	--hbf-accent-dark: #2f4a2c;
	--hbf-muted: #7d766b;
	--hbf-error: #a83232;

	color: var(--hbf-ink);
	max-width: 100%;
	margin: 0 auto;
}

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

.hbf-group-title {
	margin: 2.2em 0 0.8em;
	padding-bottom: 0.35em;
	border-bottom: 2px solid var(--hbf-accent);
	font-size: 1.25em;
	letter-spacing: 0.01em;
}

/* Produktkarten */
.hbf-products {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: 14px;
}

.hbf-product {
	background: var(--hbf-paper);
	border: 1px solid var(--hbf-line);
	border-radius: 6px;
	padding: 16px 18px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	min-width: 0;
}

.hbf-product--selected {
	border-color: var(--hbf-accent);
	box-shadow: 0 0 0 1px var(--hbf-accent);
}

.hbf-product-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: baseline;
}

.hbf-product-name { font-weight: 700; }
.hbf-product-price { white-space: nowrap; font-weight: 700; color: var(--hbf-accent-dark); }

.hbf-product-desc {
	margin: 8px 0 0;
	font-size: 0.85em;
	line-height: 1.5;
	color: var(--hbf-muted);
}

.hbf-product-note {
	margin: 6px 0 0;
	font-size: 0.8em;
	color: var(--hbf-muted);
	font-style: italic;
}

/* Mengensteuerung */
.hbf-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}

.hbf-qty-btn {
	width: 34px;
	height: 34px;
	border: 1px solid var(--hbf-line);
	background: #fff;
	border-radius: 4px;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: var(--hbf-ink);
}

.hbf-qty-btn:hover { border-color: var(--hbf-accent); color: var(--hbf-accent); }

.hbf-qty-input {
	width: 64px !important;
	min-width: 64px !important;
	max-width: 64px !important;
	flex: 0 0 64px;
	height: 34px;
	padding: 0 4px;
	text-align: center;
	border: 1px solid var(--hbf-line);
	border-radius: 4px;
	background: #fff;
	color: var(--hbf-ink);
	margin: 0 !important;
}

.hbf-qty { flex-wrap: wrap; }

.hbf-qty-unit { font-size: 0.85em; color: var(--hbf-muted); min-width: 40px; }

.hbf-line-total {
	margin-left: auto;
	font-weight: 700;
	color: var(--hbf-accent-dark);
	font-variant-numeric: tabular-nums;
}

/* Zusammenfassung */
.hbf-summary {
	margin-top: 2.2em;
	background: var(--hbf-paper);
	border: 1px solid var(--hbf-line);
	border-left: 4px solid var(--hbf-accent);
	border-radius: 6px;
	padding: 18px 20px;
}

.hbf-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	font-size: 0.95em;
}

.hbf-summary-empty { margin: 0; color: var(--hbf-muted); font-style: italic; }

.hbf-summary-total {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--hbf-line);
	font-size: 1.1em;
}

.hbf-summary-total strong { font-variant-numeric: tabular-nums; }

.hbf-disclaimer {
	margin: 12px 0 0;
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--hbf-muted);
}

/* Kontaktfelder */
.hbf-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px 16px;
}

.hbf-field { display: flex; flex-direction: column; margin: 0 0 12px; }
.hbf-field-wide { grid-column: 1 / -1; }

.hbf-field label {
	font-size: 0.85em;
	font-weight: 600;
	margin-bottom: 4px;
}

.hbf-field input,
.hbf-field textarea {
	width: 100% !important;
	max-width: 100% !important;
	height: 44px;
	border: 1px solid var(--hbf-line) !important;
	border-radius: 4px;
	padding: 9px 12px !important;
	margin: 0 !important;
	background: #fff;
	color: var(--hbf-ink);
	font: inherit;
	line-height: 1.4;
}

.hbf-field textarea {
	height: auto;
	min-height: 96px;
	resize: vertical;
}

/* Datumsfeld: WebKit-Innenelemente an die feste Höhe anpassen */
.hbf-field input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
}

.hbf-privacy label {
	display: flex !important;
	gap: 12px;
	align-items: flex-start;
	font-weight: 400 !important;
	font-size: 0.85em;
	line-height: 1.5;
	margin: 0;
	cursor: pointer;
}

.hbf-privacy span { flex: 1; }

/* Checkbox von den Breitenregeln ausnehmen */
.hbf-field input[type="checkbox"] {
	width: 18px !important;
	min-width: 18px !important;
	max-width: 18px !important;
	height: 18px !important;
	flex: 0 0 18px;
	padding: 0 !important;
	margin: 3px 0 0 !important;
	accent-color: var(--hbf-accent);
	cursor: pointer;
}

.hbf-privacy input { margin-top: 3px; }
.hbf-privacy a { color: var(--hbf-accent-dark); }

/* Honeypot */
.hbf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px;
	overflow: hidden;
}

/* Aktionen */
.hbf-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.hbf-submit {
	background: var(--hbf-accent);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 13px 28px;
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease;
}

.hbf-submit:hover { background: var(--hbf-accent-dark); }
.hbf-submit:disabled { opacity: 0.6; cursor: wait; }

.hbf-status--error { color: var(--hbf-error); font-weight: 600; }

/* Erfolg */
.hbf-success {
	background: var(--hbf-paper);
	border: 1px solid var(--hbf-accent);
	border-radius: 6px;
	padding: 28px 30px;
	text-align: center;
}

.hbf-success h3 { margin-top: 0; color: var(--hbf-accent-dark); }
.hbf-success-no { font-weight: 700; }

/* Fokus sichtbar */
.hbf :focus-visible {
	outline: 2px solid var(--hbf-accent);
	outline-offset: 2px;
}

/* Mobil */
@media (max-width: 640px) {
	.hbf-products { grid-template-columns: 1fr; }
	.hbf-fields { grid-template-columns: 1fr; }
	.hbf-product-head { flex-wrap: wrap; }
}

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

/* Termin-Box (fester Bestell-/Abholtermin) */
.hbf-date-box,
.hbf-closed {
	background: var(--hbf-paper);
	border: 1px solid var(--hbf-line);
	border-left: 4px solid var(--hbf-accent);
	border-radius: 6px;
	padding: 14px 18px;
	margin-bottom: 1.5em;
}
.hbf-date-box p { margin: 0; }
.hbf-date-main { font-size: 1.1em; }
.hbf-date-main strong { color: var(--hbf-accent-dark); }
.hbf-date-info,
.hbf-date-deadline { margin-top: 4px !important; font-size: 0.9em; color: var(--hbf-muted); }
.hbf-closed h3 { margin: 0 0 0.4em; }
.hbf-closed p { margin: 0; }
