/* ═══════════════════════════════════════════════════════════
   app.css — reprend la charte de customer_screen.dart
   ═══════════════════════════════════════════════════════════ */

:root {
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-light: #fbbf24;
  --amber-pale: #fef3c7;
  --amber-bg: #fffbeb;
  --cream: #fde68a;
  --bg: #f9fafb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --border: #e5e7eb;
  --divider: #f3f4f6;
  --green: #10b981;
  --green-dark: #065f46;
  --amber-text: #92400e;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* ─── Ecran de demarrage ─────────────────────────────────── */

.boot {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--amber-bg);
}
.boot-logo {
  font-size: 64px;
}
.boot-text {
  font-weight: 800;
  font-size: 22px;
  color: #78350f;
}

/* ─── Ecran « scannez le QR code » ───────────────────────── */

.scan {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--amber-bg);
  text-align: center;
}
.scan h1 {
  font-size: 30px;
  font-weight: 900;
  color: #78350f;
  margin: 12px 0 32px;
}
.scan-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  max-width: 380px;
}
.scan-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 14px 0 10px;
}
.scan-card p {
  color: var(--gray-400);
  line-height: 1.6;
  margin: 0;
}

/* ─── En-tete ────────────────────────────────────────────── */

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--amber);
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 10;
}
.head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
}
.head-title {
  flex: 1;
  min-width: 0;
}
.head-title strong {
  display: block;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.head-title span {
  color: var(--cream);
  font-size: 13px;
}
.head-back {
  color: #fff;
  font-size: 22px;
  padding: 4px 8px;
  line-height: 1;
}

.pill-ghost {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 22px;
  white-space: nowrap;
}
.pill-solid {
  background: var(--amber-dark);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 22px;
  white-space: nowrap;
}
.cart-badge {
  background: #fff;
  color: var(--amber-dark);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.cart-badge .count {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

/* ─── Onglets categories ─────────────────────────────────── */

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar {
  display: none;
}
.cat {
  background: var(--amber-light);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 22px;
  white-space: nowrap;
}
.cat.active {
  background: #fff;
  color: var(--amber-dark);
}

/* ─── Liste des plats ────────────────────────────────────── */

main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: stretch;
  margin-bottom: 10px;
  overflow: hidden;
  width: 100%;
  text-align: left;
}
.card img,
.card .ph {
  width: 90px;
  height: 90px;
  object-fit: cover;
  flex: 0 0 90px;
  background: var(--amber-pale);
  display: grid;
  place-items: center;
  font-size: 26px;
}
.card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-body .name {
  font-weight: 700;
  font-size: 14px;
}
.card-body .desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
  margin: 4px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-body .price {
  font-weight: 800;
  color: var(--amber);
  font-size: 14px;
}
.card-add {
  align-self: center;
  margin-right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-size: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
}

.empty {
  text-align: center;
  color: var(--gray-400);
  padding: 48px 16px;
}
.empty .big {
  font-size: 52px;
  display: block;
  margin-bottom: 12px;
}

/* ─── Bouton flottant panier ─────────────────────────────── */

.fab {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  z-index: 20;
}

/* ─── Detail d'un plat ───────────────────────────────────── */

.hero {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: var(--amber-pale);
  display: grid;
  place-items: center;
  font-size: 56px;
}
.detail {
  padding: 20px 20px 140px;
}
.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.detail-top h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}
.detail-top .price {
  font-size: 22px;
  font-weight: 800;
  color: var(--amber);
  white-space: nowrap;
}
.detail p.desc {
  color: var(--gray-500);
  font-size: 15px;
  line-height: 1.6;
  margin: 8px 0 0;
}
.detail h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 28px 0 12px;
}
.supp {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.supp.on {
  border-color: var(--amber);
  background: var(--amber-bg);
}
.supp .box {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid #d1d5db;
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  flex: 0 0 22px;
}
.supp.on .box {
  background: var(--amber);
  border-color: var(--amber);
}
.supp .label {
  flex: 1;
  font-size: 15px;
  text-align: left;
}
.supp .plus {
  color: var(--amber);
  font-weight: 700;
  white-space: nowrap;
}

.back-btn {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--gray-700);
  z-index: 30;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
  z-index: 20;
}
.btn-primary {
  width: 100%;
  background: var(--amber);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  padding: 16px;
  border-radius: 18px;
}
.btn-primary:disabled {
  background: var(--amber-light);
  cursor: default;
}

/* ─── Panier ─────────────────────────────────────────────── */

.line {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 12px;
}
.line-body {
  flex: 1;
  min-width: 0;
}
.line-body .name {
  font-weight: 700;
  font-size: 14px;
}
.line-body .supps {
  font-size: 12px;
  color: var(--amber-dark);
  margin-top: 2px;
}
.line-body .sub {
  font-weight: 800;
  color: var(--amber);
  font-size: 14px;
  margin-top: 4px;
}
.qty {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber-pale);
  color: var(--amber-dark);
  font-weight: 800;
  font-size: 18px;
  display: grid;
  place-items: center;
}
.qty span {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.note-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.note-card label {
  font-weight: 700;
  color: var(--gray-700);
  display: block;
  margin-bottom: 8px;
}
.note-card textarea {
  width: 100%;
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.note-card textarea:focus {
  outline: none;
  border-color: var(--amber);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.total-row .label {
  font-weight: 800;
  font-size: 18px;
}
.total-row .value {
  font-weight: 800;
  font-size: 26px;
  color: var(--amber);
}

/* ─── Suivi des commandes ────────────────────────────────── */

.banner {
  background: var(--green-dark);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
}

.section-title {
  font-weight: 800;
  color: var(--gray-700);
  margin: 4px 0 10px;
}

.order {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.order.ready {
  border: 2px solid var(--green);
}
.order-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-pill {
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
}
.order-head .time {
  margin-left: auto;
  color: var(--gray-400);
  font-size: 12px;
}

.steps {
  display: flex;
  align-items: center;
  margin: 14px 0 4px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.step .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
}
.step.done .dot {
  background: var(--green);
}
.step .lbl {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
}
.step.done .lbl {
  color: var(--green);
}
.step-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  margin: 0 4px 16px;
  border-radius: 2px;
}
.step-line.done {
  background: var(--green);
}

.order hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 12px 0;
}
.oline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.oline .q {
  background: var(--amber-pale);
  color: var(--amber-dark);
  font-weight: 800;
  font-size: 12px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
}
.oline .n {
  flex: 1;
  font-size: 14px;
}
.oline .n small {
  display: block;
  color: var(--amber-dark);
  font-size: 12px;
}
.oline .s {
  color: var(--gray-500);
  font-size: 13px;
  white-space: nowrap;
}
.note-shown {
  background: var(--amber-pale);
  color: var(--amber-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 4px 0 0;
}
.order-total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
}
.order-total .v {
  color: var(--amber);
}

.hist {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.hist-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-400);
  font-size: 12px;
  margin-bottom: 8px;
}
.hist-head .paid {
  margin-left: auto;
  background: var(--divider);
  color: var(--gray-500);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.hist .row {
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.hist .tot {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--divider);
  padding-top: 8px;
  margin-top: 8px;
  font-weight: 800;
  color: var(--gray-700);
  font-size: 13px;
}

/* ─── Bandeau hors-ligne / erreur ────────────────────────── */

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  background: #b91c1c;
  color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 40;
}

.offline-bar {
  background: var(--gray-700);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 6px 12px;
}
