/* SYBO Menu — ordering and chat on the public menu (phase 5). Built only on
   the template's own variables, so it takes each template's colours. */

.sm [hidden] { display: none !important; }
.sm-add-row { margin: .5rem 0 0; }
.sm-add {
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); padding: .35rem .95rem; min-height: 36px;
  transition: transform .15s ease;
}
.sm-add-sm { min-width: 36px; padding: .2rem .6rem; margin-inline-start: .5rem; }
.sm-add.is-added { transform: scale(1.12); }
.sm-variants li { align-items: center; }

/* the bar at the bottom while something is in the cart */
.sm-cartbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.sm-cartbar-btn {
  width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  font: inherit; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink);
  padding: .85rem 1.1rem; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.sm-cartbar-btn b { font-size: 1.05rem; }
.sm-cartbar-count, .sm-cartbar-sum { font-size: .9rem; opacity: .92; }
body.sm-has-cart .sm-foot { padding-bottom: 6rem; }
.sm-mine-row { text-align: center; margin: 1rem 0 0; }

/* sheets (order and chat) */
.sm-sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); display: none; flex-direction: column;
}
.sm-sheet[open] { display: flex; }
@media (min-width: 640px) { .sm-sheet { margin: auto; border-radius: 20px; } }
.sm-sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sm-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem .5rem; border-bottom: 1px solid var(--line); }
.sm-sheet-head h2 { margin: 0; font-size: 1.15rem; }
.sm-x { font: inherit; font-size: 1.6rem; line-height: 1; border: 0; background: none; color: var(--muted); cursor: pointer; width: 44px; height: 44px; }
.sm-sheet-body { overflow-y: auto; padding: .75rem 1.1rem 1.25rem; }

.sm-lines { list-style: none; margin: 0; padding: 0; }
.sm-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.sm-line-name { font-weight: 600; }
.sm-line-total { min-width: 5.5rem; text-align: end; font-variant-numeric: tabular-nums; }
.sm-qty { display: inline-flex; align-items: center; gap: .35rem; }
.sm-qty button {
  font: inherit; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg);
  color: var(--ink); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.sm-qty b { min-width: 1.4rem; text-align: center; }
.sm-sum { display: flex; justify-content: space-between; margin: .75rem 0; font-size: 1.05rem; }
.sm-muted { color: var(--muted); }

.sm-form { display: grid; gap: .8rem; margin-top: .5rem; }
.sm-field { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.sm-field input, .sm-field textarea, .sm-chatform input, .sm-chatform textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: .65rem .8rem; min-height: 46px; width: 100%; box-sizing: border-box;
}
.sm-field input:focus, .sm-field textarea:focus, .sm-chatform input:focus, .sm-chatform textarea:focus { outline: 2px solid var(--text-accent); outline-offset: 1px; }
.sm-choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.sm-choice legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: .35rem; width: 100%; }
.sm-choice label { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .45rem .9rem; cursor: pointer; }
.sm-choice label:has(input:checked) { border-color: var(--text-accent); box-shadow: inset 0 0 0 1px var(--text-accent); }
.sm-choice input { accent-color: var(--accent); }
.sm-err { color: #b3261e; background: #fdecea; border-radius: 10px; padding: .5rem .75rem; margin: 0; }
.sm-primary {
  font: inherit; font-weight: 700; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  padding: .8rem 1.2rem; min-height: 48px; cursor: pointer;
}
.sm-primary:disabled { opacity: .6; cursor: progress; }
.sm-linkbtn { font: inherit; border: 0; background: none; color: var(--text-accent); text-decoration: underline; cursor: pointer; padding: .3rem 0; }

/* an order after sending, and the tracking page */
.sm-order { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: var(--surface); }
.sm-order h2, .sm-order h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.sm-status { margin: 0 0 .5rem; font-weight: 700; color: var(--text-accent); }
.sm-order-cancelled .sm-status { color: var(--muted); }
.sm-order-lines { list-style: none; margin: 0; padding: 0; }
.sm-order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.sm-paycard { background: var(--bg); border-radius: 12px; padding: .75rem .9rem; margin: .5rem 0; }
.sm-paycard p { margin: 0 0 .4rem; }
.sm-cardno { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.sm-receiptform { margin-top: .6rem; display: grid; gap: .5rem; }
.sm-file { display: inline-flex; justify-content: center; position: relative; overflow: hidden; }
.sm-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sm-file.is-busy { opacity: .6; pointer-events: none; }
.sm-receipt { margin: .5rem 0; font-weight: 600; }
.sm-receipt-confirmed { color: #1d6b45; }
.sm-receipt-rejected { color: #b3261e; }
.sm-track { max-width: 560px; margin: 0 auto; padding: 1rem; }
.sm-back { text-align: center; }

/* chat */
.sm-chatbtn {
  position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom)); inset-inline-end: 1rem; z-index: 29;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(0, 0, 0, .22); display: grid; place-items: center;
}
body.sm-has-cart .sm-chatbtn { bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
.sm-badge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 20px; height: 20px; border-radius: 999px; background: #d93025; color: #fff; font-size: .75rem; display: grid; place-items: center; padding: 0 5px; }
.sm-chat { height: min(640px, 88dvh); }
.sm-msgs { list-style: none; margin: 0; padding: 1rem 1.1rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.sm-msg { max-width: 82%; padding: .55rem .85rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.sm-msg-cafe { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-start-start-radius: 4px; }
.sm-msg-you { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-start-end-radius: 4px; }
.sm-chatform { border-top: 1px solid var(--line); padding: .7rem 1.1rem calc(.7rem + env(safe-area-inset-bottom)); display: grid; gap: .5rem; }
.sm-chatrow { display: flex; gap: .5rem; align-items: flex-end; }
.sm-chatrow textarea { resize: none; max-height: 8rem; }

@media (prefers-reduced-motion: reduce) { .sm-add { transition: none; } }

/* phase 6: the club */
.sm-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.sm-check input { margin-top: .35rem; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; }
.sm-choice select { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: .55rem .7rem; min-height: 46px; }
.sm-ok { color: #1d6b45; background: #e3f2e9; border-radius: 10px; padding: .5rem .75rem; margin: 0; }
.sm-club-row { text-align: center; margin: 1.25rem 0 0; }
.sm-clubbtn { font-weight: 700; font-size: 1rem; }

/* template samples: what happens after "send" */
.sm-demo-done { display: grid; gap: .8rem; }
.sm-demo-sum { margin: 0; font-weight: 700; }
.sm-demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.sm-demo-steps li { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.sm-demo-steps li::before { content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line); }
.sm-demo-steps li.is-done { color: var(--ink); font-weight: 700; }
.sm-demo-steps li.is-done::before { background: #1f8a5b; border-color: #1f8a5b; box-shadow: inset 0 0 0 3px var(--surface, #fff); }
.sm-demo-cta { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }

/* «پیشنهاد امروز»: a small card that rises above the cart bar once */
.sm-picks { position: fixed; z-index: 40; inset-inline: .75rem; bottom: calc(5.2rem + env(safe-area-inset-bottom)); max-width: 420px; margin-inline: auto;
  padding: .8rem .9rem; border-radius: 20px; background: var(--surface, #fff); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28); transform: translateY(16px); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.sm-picks.is-on { transform: none; opacity: 1; }
.sm-picks-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.sm-picks-head b { font-size: .95rem; }
.sm-picks-head .sm-x { width: 36px; height: 36px; }
.sm-pick-row { display: grid; grid-template-columns: 46px 1fr auto; gap: .65rem; align-items: center; padding: .35rem 0; }
.sm-pick-pic { width: 46px; height: 46px; border-radius: 12px; background: var(--line) center / cover; }
.sm-pick-text b { display: block; font-size: .9rem; line-height: 1.5; }
.sm-pick-text small { color: var(--muted); font-size: .78rem; }
.sm-pick-add { font: inherit; font-weight: 700; font-size: .82rem; min-height: 38px; padding: .3rem .85rem; border-radius: 999px; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.sm-cart-picks { margin: .6rem 0; padding: .7rem .8rem; border-radius: 16px; background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.sm-cart-picks-title { margin: 0 0 .2rem; font-weight: 800; font-size: .88rem; }
@media (prefers-reduced-motion: reduce) { .sm-picks { transition: none; } }
