/* Startseite für Besteller: Begrüßung, Wochen und Tageskarten mit ihren Zuständen (geschlossen, bestellt, offen, Frist vorbei) und dem Hinweis „Von der Kantine storniert“.
   Smartphone zuerst, ab 960 px das Desktop-Layout. Nur var(--kantine-…) und var(--mud-palette-…), keine Farbwerte. */

/* Seite: Begrüßung, Wochen und Hinweis untereinander; der Rand (16 px bzw. 32 px) kommt vom Inhaltsbereich des Layouts (.kantine-content) */
.kantine-home {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kantine-home-date {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--mud-palette-text-secondary);
}

/* Woche: Kopfzeile mit Titel und Zeitraum, darunter die Tageskarten. Auf dem Smartphone ist der Titel ein Abschnittslabel. */
.kantine-home-week {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kantine-home-week-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 8px;
}

.kantine-home-week-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.kantine-home-week-range {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

/* Karten einer Woche: auf dem Smartphone eine Spalte, die nie breiter wird als der Bildschirm (minmax(0, 1fr)) */
.kantine-home-days {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

/* Hinweis „KW 44 ist noch nicht freigegeben.“ und leerer Zustand: ein kurzer Satz */
.kantine-home-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Tageskarte (DayCard): weiß, 1 px Rahmen, Radius 12 px, ohne Schatten. Heute = 2 px Rahmen in der Akzentfarbe; der Innenabstand
   schrumpft dann um 1 px, damit die Karte nicht wächst. */
.kantine-day {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background-color: var(--mud-palette-surface);
}

.kantine-day--today {
    padding: 13px 15px;
    border: 2px solid var(--mud-palette-secondary);
}

/* Titel links, Chips rechts daneben; reicht der Platz nicht, rutschen die Chips unter den Titel */
.kantine-day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.kantine-day-title {
    margin: 0 auto 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

/* Grund der Schließzeit und „Bestellfrist vorbei“: ein kurzer Satz in Nebenfarbe */
.kantine-day-reason,
.kantine-day-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-secondary);
}

/* Hinweis „Von der Kantine storniert: 12:30 Uhr · Gericht“ (Hinweis-Farben) unter Kopf bzw. Schließgrund, in jedem Zustand der Karte: Warn-Icon links, der Text bricht um */
.kantine-day-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--kantine-notice-bg);
    color: var(--kantine-notice-text);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.kantine-day-notice .mud-icon-root {
    flex: none;
    margin-top: 1px;
    font-size: 16px;
    color: inherit;
}

/* Tagesgericht: Label (.kantine-label), darunter Name und Kennzeichen; auf dem Smartphone nebeneinander, solange sie passen */
.kantine-day-dish {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kantine-day-dish-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.kantine-day-dish-name {
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-primary);
}

/* Anzahl der À-la-carte-Gerichte („+ 9 Gerichte à la carte“) unter dem Tagesgericht, ohne Tagesgericht allein („9 Gerichte à la carte“): nur die Zahl, keine Liste, keine Restmengen */
.kantine-day-alc {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

/* Zustand „bestellt“: Info-Block (Info-Farben) mit CheckCircle links, rechts daneben „Bestellt · 12:00 Uhr“, Gericht und Portion untereinander */
.kantine-day-ordered {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--kantine-info-bg);
    color: var(--kantine-info-text);
}

.kantine-day-ordered .mud-icon-root {
    flex: none;
    margin-top: 1px;
    font-size: 18px;
    color: inherit;
}

.kantine-day-ordered-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kantine-day-ordered-title {
    font-size: 13px;
    font-weight: 700;
}

.kantine-day-ordered-dish {
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
    color: var(--mud-palette-text-primary);
}

.kantine-day-ordered-portion {
    font-size: 13px;
    color: var(--kantine-neutral-text);
}

/* Aktionszeile am Kartenende (margin-top: auto schiebt sie im Kartenraster an den unteren Rand der Karte): links der Hinweis („bis 10:00 Uhr“, „Nicht mehr stornierbar“,
   „Bestellbar bis 10:00 Uhr“), rechts der Button „Stornieren“ bzw. „Bestellen“, auch wenn der Hinweis fehlt. Klickfläche mindestens 44 px. */
.kantine-day-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: auto;
}

.kantine-day-actions .mud-button-root {
    flex: none;
    min-height: 44px;
    margin-inline-start: auto;
}

.kantine-day-actions-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.kantine-day-actions-hint .mud-icon-root {
    font-size: 16px;
    color: inherit;
}

@media (min-width: 960px) {
    .kantine-home {
        gap: 28px;
    }

    .kantine-home-date {
        margin-top: 6px;
    }

    .kantine-home-week {
        gap: 12px;
    }

    .kantine-home-week-head {
        justify-content: flex-start;
        column-gap: 12px;
    }

    /* Abschnittstitel 18 px statt Label */
    .kantine-home-week-title {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: normal;
        text-transform: none;
        color: var(--mud-palette-text-primary);
    }

    .kantine-home-week-range {
        font-size: 14px;
    }

    /* Kartenraster: Karten mindestens 208 px breit, bei 1280 px Inhaltsbreite fünf Spalten */
    .kantine-home-days {
        grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
        gap: 16px;
    }

    .kantine-home-note {
        font-size: 14px;
        text-align: start;
    }

    .kantine-day {
        padding: 16px;
    }

    .kantine-day--today {
        padding: 15px;
    }

    .kantine-day-title {
        font-size: 17px;
    }

    .kantine-day-dish {
        gap: 4px;
    }

    .kantine-day-dish-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .kantine-day-dish-name,
    .kantine-day-ordered-dish {
        font-size: 15px;
    }

    /* Bestellen: der Hinweis steht über dem Button, der Button füllt die Breite der Karte */
    .kantine-day-actions--order {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .kantine-day-actions--order .mud-button-root {
        margin-inline-start: 0;
    }
}
