@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #FF4D1C;
  --brand-dark: #CC3A10;
  --brand-light: #FFF0EB;
  --text: #1A1207;
  --text-muted: #6B6052;
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue: #1d4ed8;
  --blue-bg: #dbeafe;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ---- UTILS ---- */
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 500; cursor: pointer;
  border: none; font-family: 'DM Sans', sans-serif; transition: all .15s;
  text-decoration: none;
}
.btn-primary  { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline  { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger   { background: var(--red-bg); color: var(--red); }
.btn-green    { background: var(--green-bg); color: var(--green); }
.btn-blue     { background: var(--blue-bg); color: var(--blue); }
.btn-sm       { padding: .3rem .65rem; font-size: .73rem; }

.form-row { display: flex; gap: 7px; margin-bottom: 7px; flex-wrap: wrap; }
.fg { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 110px; }
.fg label { font-size: .7rem; color: var(--text-muted); font-weight: 500; }
.fg input, .fg select, .fg textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .42rem .65rem; font-size: .82rem;
  font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text);
  transition: border-color .2s; width: 100%;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--brand); }

.sc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; margin-bottom: .85rem; }
.sc-title { font-family: 'Syne', sans-serif; font-size: .88rem; font-weight: 700; margin-bottom: .75rem; }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: .68rem; font-weight: 600; }
.b-pending   { background: var(--amber-bg); color: var(--amber); }
.b-confirmed { background: var(--blue-bg); color: var(--blue); }
.b-preparing { background: #fce7f3; color: #9d174d; }
.b-ready     { background: var(--green-bg); color: var(--green); }
.b-delivered { background: #f0fdf4; color: #15803d; }
.b-cancelled { background: var(--red-bg); color: var(--red); }

.tag { display: inline-flex; padding: 1px 7px; border-radius: 20px; font-size: .67rem; font-weight: 500; background: var(--brand-light); color: var(--brand); }
.tag.new     { background: #d1fae5; color: #065f46; }
.tag.popular { background: var(--amber-bg); color: var(--amber); }
.tag.promo   { background: #ede9fe; color: #5b21b6; }

.toggle { width: 34px; height: 18px; background: #d1d5db; border-radius: 9px; cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--brand); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .2s; }
.toggle.on::after { left: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.toggle-row:last-child { border-bottom: none; }

.sr  { display: flex; justify-content: space-between; font-size: .81rem; margin-bottom: 4px; }
.sr.tot { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .92rem; border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }

/* ---- MODAL ---- */
.mo { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 540px; padding: 1.3rem;
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1rem; margin-bottom: .2rem; }
.mclose { float: right; background: var(--bg); border: none; border-radius: 50%; width: 27px; height: 27px; cursor: pointer; font-size: .88rem; color: var(--text-muted); }

/* ---- PAGE HEADER ---- */
.page-header { padding: .85rem 1.1rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-header h1 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 800; }
.page-body { padding: 1rem 1.1rem; }

/* ---- METRICS ---- */
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: .85rem; }
.mc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; }
.mc-lbl { font-size: .7rem; color: var(--text-muted); margin-bottom: .25rem; }
.mc-val { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; }
.mc-sub { font-size: .68rem; color: var(--text-muted); margin-top: 1px; }
.mc.green .mc-val { color: var(--green); }
.mc.brand .mc-val { color: var(--brand); }
.mc.blue  .mc-val { color: var(--blue); }

/* ---- PIX BOX ---- */
.pix-box { background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 10px; padding: .75rem; font-size: .78rem; line-height: 1.5; }
.pix-key { font-family: monospace; font-size: .85rem; font-weight: 700; color: var(--green); background: #dcfce7; padding: 3px 8px; border-radius: 6px; display: inline-block; margin-top: 3px; word-break: break-all; }

/* ---- DELIVERY OPTS ---- */
.delivery-opts { display: flex; gap: 6px; margin-bottom: .65rem; }
.dopt { flex: 1; padding: .65rem; border-radius: 10px; border: 1.5px solid var(--border); background: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: .78rem; text-align: center; transition: all .15s; color: var(--text); }
.dopt.sel { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }
.dopt .do-icon { font-size: 1.2rem; display: block; margin-bottom: 2px; }

/* ---- WA BUTTON ---- */
.wa-btn {
  width: 100%; padding: .85rem; border-radius: 12px;
  background: #25D366; color: #fff; border: none;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem;
  cursor: pointer; margin-top: .75rem;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s;
}
.wa-btn:hover { background: #1da851; }
.wa-btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* ---- PAY OPTS ---- */
.pay-opts { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.popt { padding: .35rem .75rem; border-radius: 8px; border: 1.5px solid var(--border); background: none; font-size: .74rem; cursor: pointer; font-family: 'DM Sans', sans-serif; color: var(--text); transition: all .15s; }
.popt.sel { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }

/* ---- CART ITEMS ---- */
.cart-line { display: flex; align-items: center; gap: 7px; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: none; }
.cl-emoji { font-size: 1.3rem; width: 32px; text-align: center; }
.cl-info { flex: 1; }
.cl-info strong { font-size: .83rem; display: block; }
.cl-info em { font-size: .71rem; color: var(--text-muted); font-style: normal; }
.cl-qty { display: flex; align-items: center; gap: 6px; }
.cqb { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); background: none; cursor: pointer; font-size: .85rem; color: var(--text); display: flex; align-items: center; justify-content: center; }
.cqb:hover { border-color: var(--brand); color: var(--brand); }
.cl-num { font-size: .82rem; font-weight: 600; min-width: 16px; text-align: center; }
.cl-sub { font-size: .82rem; font-weight: 600; min-width: 52px; text-align: right; }

/* ---- QTY CTRL ---- */
.qty-ctrl-row { display: flex; align-items: center; gap: 5px; }
.qbtn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border); background: none; cursor: pointer; font-size: .9rem; color: var(--text); display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.qbtn:hover { border-color: var(--brand); color: var(--brand); }
.qbtn.add { background: var(--brand); color: #fff; border-color: var(--brand); }
.qbtn.add:hover { background: var(--brand-dark); }
.qdisplay { font-size: .82rem; font-weight: 600; min-width: 16px; text-align: center; }

/* ---- WA SVG ---- */
.wa-icon { width: 19px; height: 19px; flex-shrink: 0; }
