/*
Theme Name: NeoLiefertheme
Theme URI: https://cormag.eu/
Author: Tom Schnorrenberg
Author URI: https://cormag.eu/
Description: Schlankes WooCommerce-Theme für Essenslieferdienste. Die Speisekarte ist die Startseite, Gerichte landen ohne Seitenwechsel im Warenkorb, Gerichte mit Optionen öffnen ein Overlay mit laufendem Gesamtpreis. Heller und dunkler Modus nach Systemeinstellung. Kein Page-Builder, keine externen Dienste, lokale Schriften, WCAG 2.1 AA.
Version: 1.4.0
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: neo-liefertheme
Tags: e-commerce, accessibility-ready, one-column, custom-colors, custom-logo, dark-mode
*/

/* ==========================================================================
   1. Gestaltungswerte
   Funktional benannt, damit das Umfärben pro Betrieb selbsterklärend bleibt.
   Grundflächen sind warm getönt, nicht neutral: warmes Dunkel wirkt nach
   Gastraum, neutrales Grau wirkt technisch.
   ========================================================================== */

:root {
	--flaeche:          #fdfdfb;
	--flaeche-erhoben:  #ffffff;
	--flaeche-gedaempft:#f4f2ee;
	--text:             rgba(0, 0, 0, 0.82);
	--text-leise:       rgba(0, 0, 0, 0.58);
	--rand:             rgba(0, 0, 0, 0.12);
	--akzent:           #c8102e;
	--akzent-text:      #ffffff;
	--warnung:          #8a1f11;
	--erfolg:           #1c6b32;

	--r-s:  6px;
	--r-m:  10px;
	--r-l:  16px;
	--max:  1180px;

	--schatten: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.06);

	color-scheme: light;
}

[data-farbmodus="dunkel"] {
	--flaeche:          #1c1a17;
	--flaeche-erhoben:  #262320;
	--flaeche-gedaempft:#151311;
	--text:             rgba(255, 255, 255, 0.9);
	--text-leise:       rgba(255, 255, 255, 0.62);
	--rand:             rgba(255, 255, 255, 0.14);
	--akzent-text:      #ffffff;
	--warnung:          #ff9a8a;
	--erfolg:           #7fd39a;

	--schatten: 0 1px 3px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);

	color-scheme: dark;
}

/* ==========================================================================
   2. Grundlagen
   ========================================================================== */

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

/*
 * clip statt hidden: verhindert seitliches Scrollen durch vollbreite Blöcke,
 * ohne die klebenden Elemente im Kopf zu zerstören — hidden würde einen
 * Scroll-Kontext erzeugen und position:sticky abschalten.
 */
html {
	-webkit-text-size-adjust: 100%;
	overflow-x: clip;
}

body {
	margin: 0;
	background: var(--flaeche);
	color: var(--text);
	font-family: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	/* Tabellenziffern: Preise stehen dadurch untereinander bündig. */
	font-variant-numeric: tabular-nums;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }

.neo-container {
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 16px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.neo-sprungmarke {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	padding: 12px 20px;
	background: var(--akzent);
	color: var(--akzent-text);
}

.neo-sprungmarke:focus { left: 0; }

/* Sichtbarer Fokus, überall. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
	outline: 3px solid var(--akzent);
	outline-offset: 2px;
}

/* ==========================================================================
   3. Kopf und Status
   ========================================================================== */

.neo-kopf {
	position: sticky;
	top: 0;
	z-index: 30;
	background: var(--flaeche-erhoben);
	border-bottom: 1px solid var(--rand);
}

.neo-kopf__innen {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 64px;
	flex-wrap: wrap;
}

.neo-kopf__marke {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	font-weight: 700;
	font-size: 1.05rem;
	margin-right: auto;
}

.neo-kopf__logo { max-height: 44px; width: auto; }

.neo-kopf__aktionen {
	display: flex;
	align-items: center;
	gap: 8px;
}

.neo-telefon {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	text-decoration: none;
	font-weight: 600;
}

.neo-modus {
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	background: transparent;
	color: inherit;
	cursor: pointer;
	font-size: 1.1rem;
}

/* Hauptmenü im Kopf — erscheint nur, wenn ein Menü zugewiesen ist. */
.neo-hauptnav {
	border-top: 1px solid var(--rand);
}

.neo-hauptnav__liste {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	list-style: none;
	margin: 0;
	padding: 4px 0;
	scrollbar-width: thin;
}

.neo-hauptnav__liste a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	border-radius: var(--r-s);
	white-space: nowrap;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.94rem;
}

.neo-hauptnav__liste a:hover {
	background: var(--flaeche-gedaempft);
}

.neo-hauptnav__liste .current-menu-item > a {
	background: var(--flaeche-gedaempft);
	box-shadow: inset 0 -2px 0 var(--akzent);
}

/* Status nie allein über Farbe: Symbol und Text gehören dazu. */
.neo-status {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	font-size: 0.92rem;
	border-top: 1px solid var(--rand);
}

.neo-status__punkt { font-size: 0.8em; }
.neo-status--zu { color: var(--warnung); font-weight: 600; }
.neo-status--auf { color: var(--erfolg); }

/* ==========================================================================
   4. Hero
   ========================================================================== */

.neo-hero { padding: 28px 0 8px; }

.neo-hero__bild {
	width: 100%;
	aspect-ratio: 21 / 7;
	object-fit: cover;
	border-radius: var(--r-l);
	display: block;
}

.neo-hero__titel { margin-top: 20px; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.neo-hero__claim { color: var(--text-leise); margin: 0 0 14px; }

.neo-hero__fakten {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.95rem;
}

.neo-hero__fakten li {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* ==========================================================================
   5. Kategorie-Navigation
   ========================================================================== */

.neo-katnav {
	position: sticky;
	top: 64px;
	z-index: 20;
	background: var(--flaeche);
	border-bottom: 1px solid var(--rand);
	margin: 20px 0 0;
}

.neo-katnav__liste {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	scrollbar-width: thin;
}

.neo-katnav__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	white-space: nowrap;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.94rem;
	border: 1px solid var(--rand);
}

.neo-katnav__link[aria-current="true"] {
	background: var(--akzent);
	color: var(--akzent-text);
	border-color: var(--akzent);
}

/* ==========================================================================
   6. Speisekarte
   ========================================================================== */

.neo-karte { padding: 24px 0 120px; }

.neo-abschnitt { margin-bottom: 40px; scroll-margin-top: 130px; }

/*
 * Mit zugewiesenem Kopfmenü wird der Kopf um eine Zeile höher. Klebehöhe und
 * Sprungabstand ziehen mit, sonst klebt die Kategorie-Navigation unter dem
 * Menü fest oder Abschnitte springen zu weit nach oben.
 */
body:has(.neo-hauptnav) .neo-katnav { top: 116px; }
body:has(.neo-hauptnav) .neo-abschnitt { scroll-margin-top: 182px; }
.neo-abschnitt__titel { font-size: 1.35rem; margin-bottom: 4px; }
.neo-abschnitt__hinweis { color: var(--text-leise); margin: 0 0 16px; font-size: 0.95rem; }

.neo-gerichte {
	display: grid;
	gap: 10px;
}

@media (min-width: 780px) {
	.neo-gerichte { grid-template-columns: 1fr 1fr; }
}

/* Textzeile ist die Grundlage — Bilder sind die Ausnahme, nicht die Regel. */
.neo-gericht {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 14px 16px;
	background: var(--flaeche-erhoben);
	border: 1px solid var(--rand);
	border-radius: var(--r-m);
}

.neo-gericht__inhalt { flex: 1 1 auto; min-width: 0; }

.neo-gericht__kopf {
	display: flex;
	gap: 10px;
	align-items: baseline;
}

.neo-gericht__nummer {
	color: var(--text-leise);
	font-weight: 600;
	font-size: 0.9rem;
}

.neo-gericht__name { font-weight: 600; margin: 0; font-size: 1rem; }

.neo-gericht__text {
	color: var(--text-leise);
	font-size: 0.92rem;
	margin: 2px 0 0;
}

.neo-gericht__fuss {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.neo-gericht__preis { font-weight: 700; }

.neo-gericht__bild {
	flex: 0 0 84px;
	width: 84px;
	height: 84px;
	object-fit: cover;
	border-radius: var(--r-s);
}

/* Kennzeichnung: aufklappbar in der Zeile, kein Seitenwechsel. */
.neo-kennzeichnung { font-size: 0.85rem; }

.neo-kennzeichnung__schalter {
	background: none;
	border: 0;
	padding: 6px 0;
	min-height: 32px;
	color: var(--text-leise);
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
}

.neo-kennzeichnung__inhalt {
	margin-top: 4px;
	color: var(--text-leise);
}

.neo-kennzeichnung__inhalt[hidden] { display: none; }

/* Hinzufügen: der meistgenutzte Bedienpunkt überhaupt. */
.neo-plus {
	flex: 0 0 auto;
	min-width: 44px;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--r-s);
	background: var(--akzent);
	color: var(--akzent-text);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.08s ease;
}

.neo-plus:active { transform: scale(0.97); }
.neo-plus[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   7. Optionskarte (Overlay)
   ========================================================================== */

.neo-optionskarte {
	width: min(560px, 94vw);
	max-height: 88vh;
	padding: 0;
	border: 1px solid var(--rand);
	border-radius: var(--r-l);
	background: var(--flaeche-erhoben);
	color: var(--text);
	box-shadow: var(--schatten);
}

.neo-optionskarte::backdrop { background: rgba(0, 0, 0, 0.55); }

.neo-optionskarte__form {
	display: flex;
	flex-direction: column;
	max-height: 88vh;
}

.neo-optionskarte__kopf {
	padding: 20px 20px 12px;
	border-bottom: 1px solid var(--rand);
}

.neo-optionskarte__koerper {
	padding: 16px 20px;
	overflow-y: auto;
}

.neo-optionskarte__fuss {
	padding: 14px 20px 20px;
	border-top: 1px solid var(--rand);
	display: flex;
	gap: 10px;
	align-items: center;
}

.neo-gruppe { border: 0; margin: 0 0 20px; padding: 0; }

.neo-gruppe__titel {
	font-weight: 700;
	padding: 0;
	margin-bottom: 2px;
}

.neo-gruppe__hinweis {
	color: var(--text-leise);
	font-size: 0.86rem;
	margin: 0 0 8px;
}

.neo-option {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 4px 0;
	cursor: pointer;
}

.neo-option input { width: 20px; height: 20px; flex: 0 0 auto; }
.neo-option__name { flex: 1 1 auto; }
.neo-option__preis { color: var(--text-leise); font-size: 0.9rem; }

.neo-menge {
	display: flex;
	align-items: center;
	gap: 8px;
}

.neo-menge input {
	width: 68px;
	min-height: 44px;
	padding: 0 8px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	background: var(--flaeche);
	color: inherit;
	font: inherit;
}

.neo-optionskarte__senden {
	flex: 1 1 auto;
	min-height: 48px;
	border: 0;
	border-radius: var(--r-s);
	background: var(--akzent);
	color: var(--akzent-text);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}

.neo-optionskarte__abbrechen {
	min-height: 48px;
	padding: 0 16px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.neo-optionskarte__meldung {
	margin: 0 20px;
	color: var(--warnung);
	font-weight: 600;
}

.neo-optionskarte__meldung:empty { display: none; }

/* ==========================================================================
   8. Warenkorb
   ========================================================================== */

.neo-warenkorbleiste {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 40;
	background: var(--flaeche-erhoben);
	border-top: 1px solid var(--rand);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
	/* Seitliches Polster kommt vom Container, hier nur der sichere Rand unten. */
	padding: 0 0 env(safe-area-inset-bottom);
}

.neo-warenkorbleiste[hidden] { display: none; }

.neo-warenkorbleiste__innen {
	display: flex;
	align-items: center;
	gap: 12px;
	/* Nur senkrecht — waagerecht bleibt das Polster von .neo-container. */
	padding-block: 10px;
}

/* Der linke Teil ist die Schaltfläche zum Ausklappen. */
.neo-warenkorbleiste__schalter {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 8px 0 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.neo-warenkorbleiste__text { font-weight: 600; }

/*
 * Als runde Schaltfläche gestaltet, damit sie auch bei schlechter Sicht als
 * Bedienelement erkennbar ist. Vorher war es ein blasses Zeichen in
 * gedämpfter Schrift — zu leise für die Funktion, die dahintersteckt.
 */
.neo-warenkorbleiste__pfeil {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 2px solid var(--rand);
	border-radius: 50%;
	background: var(--flaeche-gedaempft);
	color: var(--text);
	font-size: 1.15rem;
	line-height: 1;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.neo-warenkorbleiste__schalter:hover .neo-warenkorbleiste__pfeil {
	background: var(--akzent);
	border-color: var(--akzent);
	color: var(--akzent-text);
}

.neo-warenkorbleiste__schalter[aria-expanded="true"] .neo-warenkorbleiste__pfeil {
	transform: rotate(180deg);
}

/* Preis mit „ab" — das Wort etwas zurücknehmen, der Betrag trägt. */
.neo-gericht__ab {
	font-weight: 400;
	color: var(--text-leise);
	font-size: 0.88em;
}

/* ── Ausklappbarer Teil ────────────────────────────────────────────────── */

.neo-warenkorbpanel {
	border-bottom: 1px solid var(--rand);
	max-height: min(60vh, 460px);
	overflow-y: auto;
	padding: 8px 0;
}

.neo-warenkorbpanel[hidden] { display: none; }
.neo-warenkorbpanel[aria-busy="true"] { opacity: 0.6; }

.neo-warenkorbpanel__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.neo-warenkorbpanel__leer,
.neo-warenkorbpanel__hinweis {
	margin: 8px 0 4px;
	color: var(--text-leise);
	font-size: 0.92rem;
}

.neo-warenkorbpanel__hinweis {
	color: var(--warnung);
	font-weight: 600;
}

.neo-position {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rand);
}

.neo-position:last-child { border-bottom: 0; }

.neo-position__text { flex: 1 1 auto; min-width: 0; }
.neo-position__name { display: block; font-weight: 600; }

.neo-position__optionen {
	display: block;
	color: var(--text-leise);
	font-size: 0.86rem;
}

/* WooCommerce liefert die Optionen als Definitionsliste aus. */
.neo-position__optionen dl,
.neo-position__optionen dt,
.neo-position__optionen dd {
	display: inline;
	margin: 0;
	font-weight: inherit;
}

.neo-position__optionen dd::after { content: " "; }

.neo-position__menge {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
}

.neo-mengenknopf {
	width: 40px;
	height: 40px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	background: var(--flaeche);
	color: inherit;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

.neo-mengenknopf:hover {
	background: var(--flaeche-gedaempft);
}

.neo-position__anzahl {
	min-width: 28px;
	text-align: center;
	font-weight: 600;
}

.neo-position__preis {
	flex: 0 0 auto;
	min-width: 72px;
	text-align: right;
	font-weight: 700;
}

.neo-position__entfernen {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 1px solid var(--rand);
	border-radius: var(--r-s);
	background: transparent;
	color: var(--warnung);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.neo-position__entfernen:hover {
	background: var(--warnung);
	color: var(--flaeche);
	border-color: var(--warnung);
}

@media (max-width: 560px) {
	.neo-position { flex-wrap: wrap; }
	.neo-position__text { flex: 1 1 100%; }
	.neo-position__preis { margin-left: auto; }
}

.neo-warenkorbleiste__knopf {
	min-height: 48px;
	padding: 0 22px;
	border-radius: var(--r-s);
	background: var(--akzent);
	color: var(--akzent-text);
	text-decoration: none;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
}

/* ==========================================================================
   9. Meldungen
   ========================================================================== */

.neo-live {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
}

.neo-hinweisband {
	padding: 12px 0;
	background: var(--flaeche-gedaempft);
	border-bottom: 1px solid var(--rand);
	font-weight: 600;
}

.neo-hinweisband--zu { color: var(--warnung); }

/* ==========================================================================
   10. Inhalt und Fuß
   ========================================================================== */

.neo-inhalt { padding: 32px 0 60px; }

/*
 * Fließtext bleibt auf angenehmer Lesebreite, Blöcke mit „Breit" oder
 * „Vollbreite" dürfen ausbrechen.
 */
.neo-inhalt article > * {
	max-width: 68ch;
	margin-left: auto;
	margin-right: auto;
}

.neo-inhalt article > .alignwide {
	max-width: var(--max);
}

.neo-inhalt article > .alignfull {
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.neo-inhalt article > .alignfull img {
	width: 100%;
}

.neo-inhalt article > .alignleft {
	float: left;
	margin: 0 1.5rem 1rem 0;
	max-width: 50%;
}

.neo-inhalt article > .alignright {
	float: right;
	margin: 0 0 1rem 1.5rem;
	max-width: 50%;
}

/*
 * Wo die fixe Warenkorbleiste tatsächlich läuft, braucht der Inhalt darunter
 * Luft — sonst verdeckt sie die letzten Zeilen. Gilt bewusst nur dann, damit
 * auf Seiten ohne Leiste kein leerer Streifen entsteht.
 */
body:has(.neo-warenkorbleiste:not([hidden])) .neo-inhalt {
	padding-bottom: 130px;
}

.neo-fuss {
	padding: 28px 0 100px;
	border-top: 1px solid var(--rand);
	color: var(--text-leise);
	font-size: 0.92rem;
}

.neo-fuss__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.neo-fuss__menu a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	text-decoration: none;
}

/* ==========================================================================
   11. Nach oben
   ========================================================================== */

.neo-nachoben {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 35;
	width: 48px;
	height: 48px;
	border: 1px solid var(--rand);
	border-radius: 50%;
	background: var(--flaeche-erhoben);
	color: var(--text);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--schatten);
}

.neo-nachoben[hidden] { display: none; }

.neo-nachoben:hover {
	background: var(--akzent);
	color: var(--akzent-text);
	border-color: var(--akzent);
}

/* Über der Warenkorbleiste bleiben, wenn die läuft. */
body:has(.neo-warenkorbleiste:not([hidden])) .neo-nachoben {
	bottom: 92px;
}

/* ==========================================================================
   12. Bewegung
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
