/* MyLoaf shop portal layout layer. Sits on tokens.css + house.css (brand pack). Phone-first,
   bottom tabs, logical properties (RTL safe). */

body { margin: 0; }

.wrap { max-width: 560px; margin-inline: auto; padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--card-border); }
.top__logo { width: 28px; height: 28px; }
.top__title { font-weight: 800; font-size: var(--text-body); margin-inline-end: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__link { border: 0; background: none; color: var(--accent); font-weight: 700;
  font-size: var(--text-sm); padding: 8px; cursor: pointer; font-family: inherit; flex: 0 0 auto; }

/* Bottom tabs */
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 10; display: grid;
  grid-template-columns: repeat(3, 1fr); background: var(--surface);
  border-top: 1px solid var(--card-border); padding-bottom: env(safe-area-inset-bottom); }
.tabs__item { text-align: center; padding: 14px 8px; font-size: var(--text-sm); font-weight: 700;
  color: var(--ink-2); text-decoration: none; }
.tabs__item.is-active { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

/* Hero cards */
.hero { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin: 16px 0; }
.hero > .card { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.hero__label { font-size: var(--text-xs); font-weight: 700; color: var(--ink-2); }
.hero__value { font-size: var(--text-h3); font-weight: 800; font-variant-numeric: tabular-nums; }
.hero__value--sm { font-size: var(--text-body-lg); }

/* Headings */
.htitle { margin: 0; font-size: var(--text-h2); font-weight: 800; }
.htitle--sm { font-size: var(--text-h3); margin-top: 8px; }
.hsub { margin: 4px 0 0; color: var(--ink-2); font-size: var(--text-sm); }

/* Order lines */
section.stackgap { margin-top: 20px; }
.stackgap { display: flex; flex-direction: column; gap: 10px; }
.olines { display: flex; flex-direction: column; gap: 10px; }
.oline { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.oline__body { flex: 1 1 auto; min-width: 0; }
.oline__name { font-weight: 700; font-size: var(--text-body); }
.oline__hint { color: var(--ink-2); font-size: var(--text-xs); margin-top: 2px; }
.num { flex: 0 0 96px; width: 96px; box-sizing: border-box; border: 1.5px solid var(--card-border);
  border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit;
  font-weight: 800; font-size: 20px; text-align: center; padding: 10px 4px; min-height: 52px;
  font-variant-numeric: tabular-nums; }
.num:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ototal { font-size: var(--text-body); color: var(--ink-2); font-weight: 600; }
.ototal strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.btn--big { min-height: 54px; font-size: var(--text-body-lg); }
.confirmed { padding: 14px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
  border-color: var(--success-500); }

/* Row cards (orders, invoices) */
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.row-card--btn { width: 100%; text-align: start; cursor: pointer; font-family: inherit; color: inherit; border: 1px solid var(--card-border); }
.row-card__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Summary lines + sheet */
.sumline { display: flex; justify-content: space-between; gap: 10px; font-size: var(--text-sm); }
.sumline strong { font-variant-numeric: tabular-nums; }
.sumline--total { border-top: 1px solid var(--card-border); padding-top: 10px; font-size: var(--text-body); font-weight: 700; }
.neg { color: var(--success-500); }
.sheet { border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 0; width: 100%;
  max-width: 560px; margin: auto auto 0; box-shadow: 0 -12px 40px rgb(43 33 24 / .2); }
.sheet::backdrop { background: rgb(43 33 24 / .4); }

/* Chips, toast, empty, login (shared idiom with the driver app) */
.chip { display: inline-flex; align-items: center; border-radius: var(--r-pill); padding: 5px 10px;
  font-size: var(--text-xs); font-weight: 700; white-space: nowrap; }
.chip--ok { background: var(--success-50); color: #256641; }
.chip--warn { background: var(--warning-50); color: var(--ink); }
.chip--info { background: var(--info-50); color: var(--info-500); }
.chip--danger { background: var(--danger-50); color: #9E3A2B; } /* danger-500 misses 4.5:1 on danger-50 at chip size */
.chip--plain { background: var(--accent-soft-bg); color: var(--ink-2); }

.toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline: 16px;
  margin-inline: auto; max-width: 420px; z-index: 50; background: var(--ink); color: var(--surface);
  border-radius: var(--r-md); padding: 12px 16px; font-size: var(--text-sm); font-weight: 600;
  text-align: center; box-shadow: 0 8px 24px rgb(43 33 24 / .25); }
.toast--danger { background: var(--danger-500); color: #fff; }

.empty { text-align: center; padding: 28px 16px; }
.empty__title { font-weight: 800; font-size: var(--text-body-lg); }
.empty__sub { color: var(--ink-2); font-size: var(--text-sm); margin-top: 6px; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; box-sizing: border-box; }
.login__card { width: 100%; max-width: 400px; padding: 24px; box-sizing: border-box; }
.login__logo { width: 44px; height: 44px; margin-inline: auto; display: block; }
.msg { color: var(--success-500); font-weight: 700; font-size: var(--text-sm); margin: 0; text-align: center; }
