/* ============================================================
   Bagel Dash — on-site ordering (cart + checkout) UI
   Slide-over "Order" panel + cart FAB. Brand tokens come from
   styles.css (:root). Buttons reuse .btn / .btn-order / .btn-online.
   ============================================================ */

/* ---------- Cart FAB (floating, opens the order panel) ---------- */
.bd-cart-fab {
  position: fixed; right: 20px; bottom: 22px; z-index: 130;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 20px 13px 17px; border: 0; cursor: pointer;
  border-radius: 999px; font-family: inherit; font-weight: 800; font-size: 1rem;
  color: #fff; background: linear-gradient(180deg, var(--green-700), var(--green));
  box-shadow: 0 16px 34px rgba(22, 53, 40, .34);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.bd-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 44px rgba(22, 53, 40, .42); }
.bd-cart-fab:active { transform: translateY(1px) scale(.99); }
.bd-cart-fab svg { flex: none; }
.bd-cart-fab .bd-fab-count {
  display: none; min-width: 23px; height: 23px; padding: 0 6px;
  align-items: center; justify-content: center;
  background: var(--gold); color: #fff; border-radius: 999px;
  font-size: .82rem; font-weight: 800; line-height: 1;
}
.bd-cart-fab.has-items .bd-fab-count { display: inline-flex; }
@media (max-width: 600px) {
  /* Sit above the existing WhatsApp FAB. */
  .bd-cart-fab { right: 16px; bottom: 84px; padding: 12px 17px 12px 15px; font-size: .95rem; }
}

/* ---------- Overlay + panel ---------- */
.bd-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(22, 53, 40, .46); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .28s var(--ease), visibility .28s;
}
.bd-ov.open { opacity: 1; visibility: visible; }
body.bd-locked { overflow: hidden; }

.bd-panel {
  position: fixed; top: 0; right: 0; z-index: 201;
  width: min(460px, 100%); height: 100%;
  display: flex; flex-direction: column;
  background: var(--cream-soft);
  box-shadow: -30px 0 80px rgba(22, 53, 40, .28);
  transform: translateX(100%); transition: transform .34s var(--ease);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.bd-ov.open .bd-panel { transform: translateX(0); }

.bd-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; background: var(--green); color: var(--cream);
}
.bd-head .bd-logo { height: 30px; width: auto; }
.bd-head h2 {
  font-family: "Baloo 2", sans-serif; font-style: italic; font-weight: 800;
  font-size: 1.2rem; color: var(--cream); margin: 0; flex: 1;
}
.bd-head .bd-back {
  background: rgba(255,255,255,.12); color: var(--cream); border: 0;
  border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: .85rem;
  cursor: pointer; display: none; align-items: center; gap: 6px;
}
.bd-panel[data-view="checkout"] .bd-back { display: inline-flex; }
.bd-close {
  background: rgba(255,255,255,.12); color: var(--cream); border: 0;
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  font-size: 1.3rem; line-height: 1; display: grid; place-items: center;
}
.bd-close:hover, .bd-head .bd-back:hover { background: rgba(255,255,255,.22); }

.bd-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 8px; }

/* ---------- Menu list ---------- */
.bd-cat-head {
  font-family: "Anton", sans-serif; font-weight: 400; letter-spacing: .02em;
  font-size: 1.18rem; color: var(--green); text-transform: uppercase;
  margin: 18px 2px 4px;
}
.bd-cat-head:first-child { margin-top: 2px; }
.bd-cat-blurb { color: var(--muted); font-size: .86rem; margin: 0 2px 10px; }

.bd-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border-radius: 16px; padding: 11px 13px; margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
}
.bd-item-emoji { font-size: 1.7rem; flex: none; width: 34px; text-align: center; }
.bd-item-main { min-width: 0; flex: 1; }
.bd-item-name { font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 6px; }
.bd-item-name .bd-star { color: var(--gold); font-size: .8rem; }
.bd-item-price { font-size: .85rem; color: var(--ink); margin-top: 1px; }
.bd-item-price b { font-weight: 800; }
.bd-item-price .bd-member { color: var(--green-soft); font-size: .78rem; margin-left: 7px; }

.bd-add {
  flex: none; background: var(--green); color: #fff; border: 0; cursor: pointer;
  border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: .82rem;
  font-family: inherit; transition: background .2s, transform .15s;
}
.bd-add:hover { background: var(--green-700); }
.bd-add:active { transform: scale(.96); }

/* ---------- Stepper ---------- */
.bd-step { flex: none; display: inline-flex; align-items: center; gap: 2px;
  background: var(--cream-deep); border-radius: 999px; padding: 3px; }
.bd-step button {
  width: 30px; height: 30px; border: 0; cursor: pointer; border-radius: 999px;
  background: var(--paper); color: var(--green); font-size: 1.15rem; font-weight: 800;
  line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-sm);
  font-family: inherit;
}
.bd-step button:hover { background: #fff; }
.bd-step .bd-qty { min-width: 26px; text-align: center; font-weight: 800; color: var(--green); }

/* ---------- Sticky footer ---------- */
.bd-foot {
  flex: none; padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  background: var(--cream-soft); border-top: 1px solid rgba(31,74,55,.12);
}
.bd-foot.hidden { display: none; }
.bd-cta { width: 100%; }
.bd-foot-note { text-align: center; color: var(--muted); font-size: .76rem; margin-top: 8px; }

/* ---------- Checkout view ---------- */
.bd-section { background: var(--paper); border-radius: 16px; padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.bd-section h3 {
  font-family: "Anton", sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: 1.05rem; letter-spacing: .02em; color: var(--green); margin-bottom: 10px;
}
.bd-sum-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: .92rem; border-bottom: 1px solid rgba(31,74,55,.07); }
.bd-sum-row:last-child { border-bottom: 0; }
.bd-sum-row .bd-q { font-weight: 800; color: var(--green); margin-right: 4px; }

.bd-field { margin-bottom: 11px; }
.bd-field label { display: block; font-weight: 700; font-size: .8rem; color: var(--green); margin-bottom: 5px; }
.bd-field input, .bd-field textarea {
  width: 100%; border: 1.5px solid rgba(31,74,55,.18); border-radius: 12px;
  padding: 11px 13px; font-family: inherit; font-size: .95rem; color: var(--ink);
  background: var(--cream-soft); transition: border-color .2s;
}
.bd-field input:focus, .bd-field textarea:focus { outline: 0; border-color: var(--gold); }
.bd-field textarea { min-height: 64px; resize: vertical; }

.bd-totals { font-size: .92rem; }
.bd-totals .bd-trow { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.bd-totals .bd-trow.bd-free, .bd-totals .bd-trow.bd-disc { color: var(--wa-deep); font-weight: 700; }
.bd-totals .bd-total { display: flex; justify-content: space-between; align-items: center;
  border-top: 2px solid rgba(31,74,55,.12); margin-top: 8px; padding-top: 10px; }
.bd-totals .bd-total span { font-family: "Anton", sans-serif; font-size: 1.05rem; color: var(--green); text-transform: uppercase; }
.bd-totals .bd-total b { font-size: 1.45rem; font-weight: 800; color: var(--green); }
.bd-points { color: var(--gold-deep); font-weight: 700; font-size: .82rem; margin-top: 7px; }

.bd-pay-card {
  width: 100%; margin-top: 6px;
  background: linear-gradient(180deg, var(--green-700), var(--green)); color: #fff;
}
.bd-pay-wa { width: 100%; margin-top: 9px; }

.bd-note { font-size: .82rem; color: var(--muted); }
.bd-err { background: #fdecea; color: #9b1c0f; border-radius: 12px; padding: 11px 13px; font-size: .87rem; font-weight: 600; margin-bottom: 11px; }
.bd-info { background: rgba(200,144,47,.12); color: var(--gold-deep); border-radius: 12px; padding: 11px 13px; font-size: .85rem; margin-bottom: 12px; }

/* ---------- States ---------- */
.bd-state { text-align: center; padding: 40px 18px; color: var(--muted); }
.bd-state .bd-spin {
  width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid rgba(31,74,55,.15); border-top-color: var(--gold);
  animation: bd-spin .8s linear infinite;
}
@keyframes bd-spin { to { transform: rotate(360deg); } }
.bd-busy { position: relative; pointer-events: none; opacity: .7; }

/* Stack the two menu CTAs (online + WhatsApp). */
.menu-cta-actions { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 560px) { .menu-cta-actions { width: 100%; } .menu-cta-actions .btn { width: 100%; } }

/* ---------- Inline "+ Add" / stepper on the static menu cards ---------- */
.bagel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.bagel-foot .bagel-price { margin-top: 0; }
.bagel-add { display: inline-flex; }
.bagel-add-btn {
  flex: none; background: var(--green); color: #fff; border: 0; cursor: pointer;
  border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: .9rem;
  font-family: inherit; transition: background .2s, transform .15s;
}
.bagel-add-btn:hover { background: var(--green-700); }
.bagel-add-btn:active { transform: scale(.95); }
.bagel-step {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  background: var(--cream-deep); border-radius: 999px; padding: 4px;
}
.bagel-step button {
  width: 34px; height: 34px; border: 0; cursor: pointer; border-radius: 999px;
  background: var(--paper); color: var(--green); font-size: 1.2rem; font-weight: 800;
  line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-sm); font-family: inherit;
}
.bagel-step button:hover { background: #fff; }
.bagel-step .bagel-qty { min-width: 24px; text-align: center; font-weight: 800; color: var(--green); }
