/* ============================================================
   Back Home Bakery — shared theme
   Tokens are lifted from the current backhomebakeryco.com so the
   rebuild feels like the same bakery. Both the customer site and
   Amanda's console use this file. Don't hardcode colors elsewhere.
   ============================================================ */

:root {
  /* Farmhouse neutrals */
  --cream: #F8F4EE;
  --cream-dark: #EFE8DE;
  --shiplap: #F5F1E9;
  --shiplap-line: rgba(90, 70, 55, 0.07);
  --white: #FFFDF8;
  --line: rgba(92, 70, 54, 0.13);
  --line-strong: rgba(92, 70, 54, 0.22);

  /* Brand */
  --terracotta: #C45C3E;
  --terracotta-deep: #B4512F;   /* buttons: keeps white text readable */
  --terracotta-dark: #A3482F;
  --terracotta-wash: rgba(196, 92, 62, 0.10);
  --sage: #7A8B6E;
  --sage-dark: #5C6B52;
  --sage-light: #A3B194;
  --sage-wash: rgba(122, 139, 110, 0.13);
  --wood: #5C4636;
  --wood-light: #7A624E;
  --butter: #E8D5A3;
  --butter-light: #F5E8C0;
  --butter-wash: rgba(232, 213, 163, 0.38);

  /* Chalkboard (the "This Week" board) */
  --chalk: #F5F0E6;
  --chalk-board: #2A382C;
  --chalk-frame: #3D4F40;

  /* Ink */
  --charcoal: #2F2A26;
  --muted: #6B5E52;
  --faint: #9A8E82;

  /* Order states */
  --st-new: #A3482F;        --st-new-bg: rgba(196, 92, 62, 0.12);
  --st-confirmed: #4E5D45;  --st-confirmed-bg: rgba(122, 139, 110, 0.16);
  --st-baking: #8A5A12;     --st-baking-bg: rgba(232, 190, 110, 0.28);
  --st-ready: #2F6B3F;      --st-ready-bg: rgba(63, 125, 78, 0.14);
  --st-done: #6B5E52;       --st-done-bg: rgba(92, 70, 54, 0.08);

  /* Type */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-script: 'Yellowtail', 'Brush Script MT', cursive;
  --font-chalk: 'Amatic SC', 'Segoe Print', cursive;   /* chalkboard lettering */
  --font-hand: 'Caveat', 'Segoe Print', cursive;       /* chalkboard handwriting */

  /* Shape */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 28px rgba(92, 70, 54, 0.10);
  --shadow-soft: 0 4px 16px rgba(92, 70, 54, 0.07);
  --shadow-lift: 0 18px 50px rgba(47, 42, 38, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--shiplap);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--terracotta-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgba(196, 92, 62, 0.45); outline-offset: 2px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Textures ---------- */
.shiplap {
  background-color: var(--shiplap);
  background-image: linear-gradient(to bottom, transparent 0, transparent calc(100% - 1.5px), var(--shiplap-line) calc(100% - 1.5px));
  background-size: 100% 44px;
}
.shiplap-dark {
  background-color: #EDE6DB;
  background-image: linear-gradient(to bottom, transparent 0, transparent calc(100% - 1.5px), rgba(70, 55, 40, 0.09) calc(100% - 1.5px));
  background-size: 100% 44px;
}

/* ---------- Type helpers ---------- */
.script { font-family: var(--font-script); font-weight: 400; color: var(--terracotta); }
.display { font-family: var(--font-display); font-weight: 600; color: var(--wood); }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--terracotta-deep); color: #fff; }
.btn-primary:hover { background: var(--terracotta-dark); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(196, 92, 62, 0.28); }
.btn-outline { background: transparent; border-color: var(--wood); color: var(--wood); }
.btn-outline:hover { background: var(--wood); color: #fff; }
.btn-sage { background: var(--sage-dark); color: #fff; }
.btn-sage:hover { background: #4E5D45; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--wood); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--cream-dark); }
.btn-butter { background: var(--butter); color: var(--chalk-board); }
.btn-butter:hover { background: var(--butter-light); transform: translateY(-1px); }
.btn-sm { min-height: 36px; padding: 0.45rem 0.95rem; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 0.9rem 1.8rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--wood);
  cursor: pointer;
}
.icon-btn:hover { background: var(--cream-dark); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ---------- Status (a colored dot + text, no bubble) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.no-dot::before { display: none; }
.st-new       { color: var(--st-new); }
.st-confirmed { color: var(--st-confirmed); }
.st-baking    { color: var(--st-baking); }
.st-ready     { color: var(--st-ready); }
.st-done      { color: var(--st-done); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.35rem; }
.field > span, .field-label { font-size: 0.85rem; font-weight: 700; color: var(--wood); }
.field small { color: var(--muted); font-size: 0.8rem; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-wash); }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; }
.stepper button { width: 38px; height: 38px; border: 0; background: none; cursor: pointer; color: var(--wood); display: grid; place-items: center; border-radius: 8px; }
.stepper button:hover { background: var(--cream-dark); }
.stepper button svg { width: 14px; height: 14px; }
.stepper output { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: #D8CFC4; position: relative; transition: background 0.2s ease; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s ease; }
.switch input:checked + .track { background: var(--sage-dark); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(122, 139, 110, 0.5); outline-offset: 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 500; right: 16px; bottom: calc(16px + var(--toast-lift, 0px)); display: grid; gap: 0.6rem; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--chalk-board);
  color: var(--chalk);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  font-size: 0.92rem;
  animation: toast-in 0.25s ease;
}
.toast strong { color: var(--butter); display: block; }
.toast svg { width: 20px; height: 20px; flex: none; color: var(--butter); margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
