/* Best POS - a storage kitchen's supplies website (restaurant/README.md section 12).
   Builds on site.css (tokens, buttons, dialogs, drawer, fields); every class here starts with `sp-`. The class names
   listed under "Parts" in the README are stable: Site Studio marks them as parts. Mobile first. */

/* ------------------------------------------------------------ page head */
.sp-head { padding-bottom: clamp(22px, 3.4vw, 32px); }
.sp-head-row { display: grid; gap: 18px; align-items: end; }
@media (min-width: 860px) { .sp-head-row { grid-template-columns: minmax(0, 1fr) auto; } }
.sp-title { margin-bottom: 8px; }
.sp-head .rs-lede { margin: 0; }
.sp-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-account-name { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: .92rem; max-width: 100%; }
.sp-account-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.sp-avatar { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--tint); color: var(--brand); font-size: .78rem; font-weight: 750; flex: none; }
.sp-account .rs-btn { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.sp-note { margin-top: 20px; margin-bottom: 0; }
.sp-note span { white-space: pre-line; }

/* ------------------------------------------------------------ toolbar */
.sp-layout { padding-top: 22px; padding-bottom: 120px; }
.sp-toolbar { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 860px) { .sp-toolbar { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: center; } }
.sp-search { position: relative; display: flex; align-items: center; }
.sp-search .rs-ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.sp-search input { width: 100%; min-height: 46px; padding: 10px 14px 10px 42px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 1rem; }
.sp-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.sp-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.sp-chips::-webkit-scrollbar { display: none; }
.sp-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.sp-chip span { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-chip:hover { border-color: var(--text); }
.sp-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.sp-chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.sp-count { font-size: .86rem; color: var(--muted); margin: 0 0 12px; }

/* ------------------------------------------------------------ catalogue */
.sp-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
.sp-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .2s var(--ease); }
.sp-card:hover { border-color: var(--line-strong); }
.sp-card.in-cart { border-color: color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent), var(--shadow-sm); }
.sp-media { width: 64px; height: 64px; border-radius: calc(var(--radius) * .7); overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.sp-media img { width: 100%; height: 100%; object-fit: cover; }
.sp-initial { font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; color: var(--brand); opacity: .8; }
.sp-body { min-width: 0; }
.sp-name { font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; margin: 0 0 2px; line-height: 1.25; overflow-wrap: anywhere; }
.sp-pack { margin: 0 0 6px; font-size: .88rem; color: var(--muted); }
.sp-desc { margin: -2px 0 6px; font-size: .86rem; color: color-mix(in srgb, var(--text) 74%, transparent); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sp-stock { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; padding: 3px 9px 3px 8px; border-radius: 999px; background: var(--ok-tint); color: var(--ok); }
.sp-stock::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.sp-stock.is-low { background: color-mix(in srgb, #9a5b00 12%, var(--surface)); color: var(--warn); }
.sp-stock.is-out { background: var(--faint); color: var(--muted); }
.sp-price { font-weight: 750; font-variant-numeric: tabular-nums; }
.sp-price.is-free { font-weight: 650; font-size: .86rem; color: var(--muted); }
.sp-action { display: flex; justify-content: flex-end; }
.sp-add { min-height: 42px; padding: 0 16px; gap: 6px; }
.sp-add .rs-ico { width: 1em; height: 1em; }
.sp-stepper { height: 42px; }
.sp-stepper button { width: 40px; height: 40px; }
.sp-stepper output { min-width: 26px; }
.sp-card.is-out .sp-media, .sp-card.is-out .sp-name, .sp-card.is-out .sp-pack { opacity: .55; }
.sp-unavailable { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sp-card .sp-unavailable { display: none; }
@media (min-width: 720px) { .sp-card .sp-unavailable { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px dashed var(--line-strong); border-radius: var(--btn-radius); } }
@media (min-width: 720px) {
  .sp-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
  .sp-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; align-items: stretch; padding: 0; overflow: hidden; }
  .sp-card:hover { box-shadow: 0 18px 36px -24px rgb(0 0 0 / .35); }
  .sp-media { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
  .sp-initial { font-size: 3rem; }
  .sp-body { padding: 14px 16px 0; }
  .sp-name { font-size: 1.05rem; }
  .sp-action { padding: 12px 16px 16px; justify-content: stretch; }
  .sp-action > * { flex: 1; }
  .sp-card .sp-add, .sp-card .sp-stepper { width: 100%; }
  .sp-card .sp-stepper { justify-content: space-between; }
  /* No photo: a small tile instead of an empty 4:3 band, so a catalogue without pictures stays compact. */
  .sp-card.no-media .sp-media { width: 52px; height: 52px; aspect-ratio: auto; border-radius: 14px; margin: 16px 16px 0; }
  .sp-card.no-media .sp-initial { font-size: 1.45rem; }
}
.sp-panel { max-width: 560px; margin: 28px auto; padding: 28px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: var(--surface); text-align: center; box-shadow: var(--shadow-sm); }
.sp-panel .sp-panel-ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 999px; display: grid; place-items: center; background: var(--tint); color: var(--brand); }
.sp-panel h2 { font-size: 1.35rem; }
.sp-panel p { color: var(--muted); }
.sp-panel .rs-btn { margin-top: 6px; }

/* ------------------------------------------------------------ cart bar and drawer */
.sp-cartbar .rs-orderbar-btn { gap: 12px; }
.sp-cartbar-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.sp-cartbar-label small { font-size: .78rem; font-weight: 600; opacity: .82; }
.sp-drawer .rs-drawer-body { padding-top: 4px; }
.sp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sp-line-name { font-weight: 650; }
.sp-line-pack { font-size: .84rem; color: var(--muted); }
.sp-line-tools { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.sp-line-tools .sp-stepper { width: auto; }
.sp-line-total { font-weight: 650; font-variant-numeric: tabular-nums; }
.sp-line-warn { grid-column: 1 / -1; font-size: .84rem; color: var(--stop); font-weight: 600; }
.sp-checkout { margin-top: 16px; }
.sp-who { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: calc(var(--radius) * .7); background: var(--surface); border: 1px solid var(--line); margin: 14px 0 18px; font-size: .92rem; }
.sp-who b { display: block; }
.sp-who small { color: var(--muted); }
.sp-free { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: calc(var(--radius) * .7); background: var(--ok-tint); color: var(--ok); font-weight: 650; font-size: .92rem; margin: 0 0 18px; }

/* ------------------------------------------------------------ sign-in sheet */
.sp-signin .sp-signin-body { padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 4px; }
.sp-signin h2 { font-size: 1.45rem; margin-bottom: 4px; padding-right: 44px; }
.sp-signin p { color: var(--muted); margin-bottom: 12px; }
.sp-signin .sp-signin-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--tint); color: var(--brand); margin-bottom: 12px; }
.sp-code { letter-spacing: .5em; font-size: 1.5rem !important; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700 !important; }
.sp-signin-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.sp-signin-links button { border: 0; background: transparent; padding: 6px 0; color: var(--brand); font-weight: 600; cursor: pointer; font-size: .9rem; }
.sp-signin-links button:disabled { color: var(--muted); cursor: default; }

/* ------------------------------------------------------------ order status and my orders */
.sp-status { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow-sm); }
.sp-status h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
@media (min-width: 600px) { .sp-status .rs-facts-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-status .rs-facts-list.has-total { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sp-steps { list-style: none; margin: 22px 0 26px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: step; }
.sp-steps li { position: relative; padding-top: 30px; font-size: .82rem; font-weight: 600; color: var(--muted); text-align: center; }
.sp-steps li::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); box-sizing: border-box; z-index: 1; }
.sp-steps li::after { content: ""; position: absolute; top: 10px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--line-strong); }
.sp-steps li:first-child::after { display: none; }
.sp-steps li.done { color: var(--text); }
.sp-steps li.done::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 4px var(--surface); }
.sp-steps li.done::after { background: var(--ok); }
.sp-steps li.current::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 18%, transparent), inset 0 0 0 4px var(--surface); }
.sp-steps.is-cancelled li::before { border-style: dashed; }
.sp-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sp-order { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .2s var(--ease); }
.sp-order:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.sp-order-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.sp-order-sub { font-size: .88rem; color: var(--muted); grid-column: 1 / 2; }
.sp-order-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sp-order-items { grid-column: 1 / -1; font-size: .88rem; color: color-mix(in srgb, var(--text) 78%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--faint); color: var(--muted); border: 1px solid var(--line); }
.sp-badge.is-new, .sp-badge.is-preparing { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.sp-badge.is-ready { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.sp-badge.is-cancelled { background: var(--stop-tint); color: var(--stop); border-color: color-mix(in srgb, var(--stop) 22%, transparent); }

/* ------------------------------------------------------------ storage home */
.sp-hero .rs-hero-inner { padding-block: clamp(48px, 9vw, 104px) clamp(40px, 7vw, 80px); }
.sp-hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .sp-hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.sp-hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: 22px; box-shadow: var(--shadow-lg); }
.sp-hero-card h2 { font-size: 1.15rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.sp-hero-card ul { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-hero-card li { padding: 6px 12px; border-radius: 999px; background: var(--faint); border: 1px solid var(--line); font-size: .86rem; font-weight: 600; }
.sp-hero-stat { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 0; }
.sp-hero-stat b { font-size: 2.4rem; font-family: var(--font-heading); line-height: 1; font-variant-numeric: tabular-nums; }
.sp-hero-stat span { color: var(--muted); font-weight: 600; }
.sp-how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: how; }
@media (min-width: 760px) { .sp-how { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.sp-how li { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 2px); background: var(--surface); counter-increment: how; }
.sp-how li::after { content: counter(how); position: absolute; top: 18px; right: 20px; font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; color: color-mix(in srgb, var(--text) 14%, transparent); }
.sp-how-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--brand); margin-bottom: 14px; }
.sp-how h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; letter-spacing: 0; margin-bottom: 6px; }
.sp-how p { margin: 0; color: var(--muted); font-size: .94rem; }

@media print {
  .rs-header, .rs-footer, .rs-orderbar, .sp-account, .rs-actions { display: none !important; }
}
