/* ============================================================
   eatbase Bestellstatus-Redesign (Seite /checkout/success/:hash
   und /account/order/:hash) – gleiche Designsprache wie menus.css
   und checkout.css: --eb-* Variablen, 24px-Karten, Pill-Buttons.
   Gescoped unter .eb-order (Views: resources/views/vendor/
   igniter-orange/livewire/order-preview.blade.php + includes/order/*).
   Farben NUR über var(--eb-*) bzw. color-mix daraus – die Variablen
   überschreibt custom/mailbranding pro Restaurant. Feste Akzenttöne
   (amber/grün/rot) sind bewusst markenunabhängig, wie die
   Segmented-Control-Chips im Checkout.
   ============================================================ */

/* ----- Seite ----- */
body:has(.eb-order) {
    background: var(--eb-bg-soft);
}

.eb-order {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 12px calc(56px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 14px;
}

@media (min-width: 768px) {
    .eb-order { padding: 28px 24px 72px; }
}

/* ----- Karte (Grundbaustein) ----- */
.eb-o-card {
    background: var(--eb-bg);
    border: 1px solid var(--eb-border);
    border-radius: var(--eb-radius);
    box-shadow: var(--eb-shadow);
    padding: 18px 16px;
}

@media (min-width: 768px) {
    .eb-o-card { padding: 22px; }
}

.eb-o-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.eb-o-card__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--eb-blue) 9%, #fff);
    color: var(--eb-blue-dark);
    font-size: 14px;
}

.eb-o-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--eb-text);
    margin: 0;
}

/* Vendor-Karten (z.B. leave-review) an den Look angleichen */
.eb-order .card {
    border-radius: var(--eb-radius);
    border-color: var(--eb-border);
    box-shadow: var(--eb-shadow);
}

/* ----- Grid: mobil 1 Spalte (Bestellung -> Details -> Restaurant),
   ab lg Bestellung links + klebende Seitenspalte rechts ----- */
.eb-order__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.eb-order__main { min-width: 0; }

.eb-order__aside {
    min-width: 0;
    display: grid;
    gap: 14px;
    align-content: start;
}

@media (min-width: 992px) {
    .eb-order__grid {
        grid-template-columns: minmax(0, 1fr) 384px;
        gap: 20px;
        align-items: start;
    }
    .eb-order__aside {
        position: sticky;
        top: 20px;
    }
}

/* ============================================================
   Status-Hero
   ============================================================ */
.eb-o-hero {
    text-align: center;
    padding: 20px 16px 24px;
}

@media (min-width: 768px) {
    .eb-o-hero { padding: 24px 28px 30px; }
}

.eb-o-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 22px;
}

.eb-o-orderno {
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--eb-bg-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--eb-text-soft);
    white-space: nowrap;
}

.eb-o-orderno b { color: var(--eb-text); margin-left: 4px; }

/* Live-Badge: zeigt, dass sich der Status von selbst aktualisiert */
.eb-o-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    background: #e2f6ea;
    color: #1e7a43;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.eb-o-live__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e9e5b;
    animation: eb-o-blink 1.6s ease-in-out infinite;
}

@keyframes eb-o-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

/* Grosses Status-Icon mit Puls-Ring, solange die Bestellung laeuft */
.eb-o-dot {
    --tone: var(--eb-blue);
    --tone-soft: color-mix(in srgb, var(--eb-blue) 12%, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 1.6rem;
    margin-bottom: 14px;
}

.eb-o-dot--received  { --tone: #e79b09; --tone-soft: #fdf3d7; }
.eb-o-dot--active    { --tone: var(--eb-blue); --tone-soft: color-mix(in srgb, var(--eb-blue) 12%, #fff); }
.eb-o-dot--done      { --tone: #2e9e5b; --tone-soft: #e2f6ea; }
.eb-o-dot--canceled  { --tone: #d64545; --tone-soft: #fdeaea; }

.eb-o-dot--pulse { animation: eb-o-pulse 2.2s ease-out infinite; }

@keyframes eb-o-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 30%, transparent); }
    70%  { box-shadow: 0 0 0 16px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Statusname in der Display-Schrift der Speisekarte */
.eb-o-hero__name {
    font-family: 'Roboto', 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 1.55rem;
    line-height: 1.2;
    color: var(--eb-text);
    margin: 0 0 4px;
}

@media (min-width: 768px) {
    .eb-o-hero__name { font-size: 1.85rem; }
}

.eb-o-hero__comment {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--eb-text-soft);
    margin: 0;
    max-width: 460px;
    margin-inline: auto;
}

/* ETA-Pille */
.eb-o-eta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 9px 17px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--eb-blue) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--eb-blue) 22%, transparent);
    color: var(--eb-blue-dark);
    font-size: 14px;
    font-weight: 500;
}

.eb-o-eta b { font-weight: 700; }
.eb-o-eta i { font-size: 13px; }

/* ----- Stepper: 3 Schritte mit Icons + Labels ----- */
.eb-o-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
    margin: 24px auto 0;
    padding: 0;
    max-width: 460px;
}

.eb-o-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Verbindungslinie zum vorherigen Schritt */
.eb-o-step::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 50%;
    width: 100%;
    height: 3px;
    background: var(--eb-border);
    border-radius: 99px;
    z-index: 0;
    transition: background-color 0.4s ease;
}

.eb-o-step:first-child::before { display: none; }

.eb-o-step.is-done::before,
.eb-o-step.is-current::before {
    background: var(--eb-blue);
}

.eb-o-step__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--eb-border);
    color: var(--eb-text-muted);
    font-size: 14px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.eb-o-step.is-done .eb-o-step__icon {
    background: var(--eb-blue);
    border-color: var(--eb-blue);
    color: #fff;
}

.eb-o-step.is-current .eb-o-step__icon {
    border-color: var(--eb-blue);
    background: color-mix(in srgb, var(--eb-blue) 10%, #fff);
    color: var(--eb-blue-dark);
    --tone: var(--eb-blue);
    animation: eb-o-pulse 2.2s ease-out infinite;
}

.eb-o-step__label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--eb-text-muted);
    text-align: center;
    padding: 0 4px;
}

.eb-o-step.is-done .eb-o-step__label,
.eb-o-step.is-current .eb-o-step__label {
    color: var(--eb-text);
}

/* ----- Aktionen im Hero (Erneut bestellen / Stornieren) ----- */
.eb-o-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.eb-o-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--eb-tap);
    padding: 11px 22px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.eb-o-btn:active { transform: translateY(1px); }
.eb-o-btn i { font-size: 13px; }

.eb-o-btn--primary {
    background: var(--eb-blue);
    color: #fff;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--eb-blue-dark) 30%, transparent);
}

.eb-o-btn--primary:hover { background: var(--eb-blue-dark); color: #fff; }

.eb-o-btn--soft {
    background: var(--eb-bg-soft);
    color: var(--eb-blue-dark);
}

.eb-o-btn--soft:hover { background: var(--eb-blue); color: #fff; }

.eb-o-btn--danger {
    background: transparent;
    color: #c62828;
    box-shadow: inset 0 0 0 1.5px rgba(198, 40, 40, 0.3);
}

.eb-o-btn--danger:hover {
    background: #fdeaea;
    box-shadow: inset 0 0 0 1.5px #c62828;
    color: #c62828;
}

/* ============================================================
   Bestellübersicht (Positionen + Summen)
   ============================================================ */
.eb-o-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.eb-o-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.eb-o-item__qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 7px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--eb-bg-soft);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--eb-text);
}

.eb-o-item__main { flex: 1 1 auto; min-width: 0; }

.eb-o-item__name {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--eb-text);
    overflow-wrap: anywhere;
}

.eb-o-item__opts {
    margin-top: 3px;
    display: grid;
    gap: 1px;
}

.eb-o-item__opt {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--eb-text-muted);
    overflow-wrap: anywhere;
}

.eb-o-item__opt > span:first-child {
    font-weight: 600;
    color: var(--eb-text-soft);
}

.eb-o-item__opt-price { opacity: 0.75; }

.eb-o-item__comment {
    margin: 4px 0 0;
    padding: 4px 9px;
    border-radius: 8px;
    background: var(--eb-bg-soft);
    font-size: 12.5px;
    color: var(--eb-text-soft);
    overflow-wrap: anywhere;
}

.eb-o-item__price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--eb-text);
    white-space: nowrap;
}

/* Summen – Gesamtbetrag ist bewusst die lauteste Zeile */
.eb-o-totals {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--eb-border);
    display: grid;
    gap: 7px;
}

.eb-o-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.eb-o-totals__row dt {
    font-weight: 400;
    font-size: 14px;
    color: var(--eb-text-soft);
}

.eb-o-totals__row dd {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--eb-text);
    white-space: nowrap;
}

.eb-o-totals__row--total {
    margin-top: 5px;
    padding-top: 12px;
    border-top: 1px solid var(--eb-border);
}

.eb-o-totals__row--total dt {
    font-size: 16px;
    font-weight: 700;
    color: var(--eb-text);
}

.eb-o-totals__row--total dd {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ============================================================
   Details (Adresse / Zahlungsart / Anmerkung)
   ============================================================ */
.eb-o-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 15px;
}

.eb-o-detail {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.eb-o-detail__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--eb-bg-soft);
    color: var(--eb-text-soft);
    font-size: 15px;
}

.eb-o-detail__body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }

.eb-o-detail__label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--eb-text-muted);
    margin-bottom: 2px;
}

.eb-o-detail__value {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--eb-text);
    overflow-wrap: anywhere;
    margin: 0;
}

.eb-o-detail__value strong { font-weight: 700; }

/* ============================================================
   Restaurant-Karte
   ============================================================ */
.eb-o-rest__row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.eb-o-rest__logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    padding: 5px;
    border: 1px solid var(--eb-border);
    border-radius: var(--eb-radius-sm);
    background: #fff;
    box-shadow: var(--eb-shadow);
    overflow: hidden;
}

.eb-o-rest__logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eb-o-rest__info { flex: 1 1 auto; min-width: 0; }

.eb-o-rest__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--eb-text);
    margin: 0 0 2px;
}

.eb-o-rest__address {
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--eb-text-soft);
    margin: 0;
}

.eb-o-rest__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.eb-o-rest__actions .eb-o-btn { flex: 1 1 auto; }

/* ----- Leerzustand ----- */
.eb-o-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--eb-text-soft);
    font-size: 15px;
}

/* ----- Fehlermeldungen der Aktions-Buttons ----- */
.eb-o-actions-error {
    margin-top: 10px;
    font-size: 13.5px;
}

/* ----- Sehr kleine Smartphones ----- */
@media (max-width: 380px) {
    .eb-order { padding-left: 10px; padding-right: 10px; }
    .eb-o-card { padding: 15px 13px; }
    .eb-o-hero__name { font-size: 1.4rem; }
    .eb-o-step__label { font-size: 11px; }
}

/* ----- Weniger Bewegung, wenn gewünscht ----- */
@media (prefers-reduced-motion: reduce) {
    .eb-o-live__dot,
    .eb-o-dot--pulse,
    .eb-o-step.is-current .eb-o-step__icon {
        animation: none;
    }
}
