.sm-store { --sm-ink: #1f1f1f; --sm-muted: #5c5c5c; --sm-line: #e2ded6; --sm-accent: var(--accent, #8a1c1c); --sm-paper: #faf8f4;
  padding: clamp(40px, 6vw, 72px) 16px; background: var(--sm-paper); color: var(--sm-ink); }
body:not([data-view="cart"]) #cart, body:not([data-view="orderbook"]) #orderbook { display: none; }
body[data-view] main > section:not(.sm-store) { display: none; }
body[data-view] .sm-store { min-height: 70vh; }
.sm-store__inner { width: min(100%, 980px); margin: 0 auto; }
.sm-store h2 { margin: 0 0 16px; }
.sm-store h3 { margin: 28px 0 10px; font-size: 1.2rem; }
.sm-flash:not(:empty) { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--sm-accent); background: #fff; }
.sm-lines { margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--sm-line); border-radius: 8px; }
.sm-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--sm-line); }
.sm-line:last-child { border-bottom: 0; }
.sm-line > a { color: inherit; font-weight: 600; }
.sm-format { font-size: .9rem; color: var(--sm-muted); }
.sm-line__name { display: grid; gap: 2px; }
.sm-line__name a { color: inherit; font-weight: 600; }
.sm-line__price { min-width: 4.5em; font-weight: 600; text-align: right; }
.sm-summary { display: grid; gap: 12px; width: min(100%, 360px); margin: 20px 0 0 auto; }
.sm-summary .sm-totals { width: 100%; margin: 0; align-items: center; column-gap: 0; }
.sm-summary .sm-totals dd { padding-left: 24px; }
.sm-totals select { padding: 4px 6px; font: inherit; }
.sm-totals .sm-total { padding-top: 8px; border-top: 1px solid var(--sm-line); color: var(--sm-ink); font-weight: 700; font-size: 1.1rem; }
.sm-store .sm-pay { width: 100%; font-size: 1.05rem; }
.sm-summary .sm-note { margin: 0; text-align: center; }
.sm-store:not(.is-gift) .sm-donate { display: none; }
.sm-store.is-gift :is(#sm-cart-title, #sm-cart, .sm-owner-open) { display: none; }
.sm-store.is-gift .sm-donate { margin-top: 0; }
.sm-qty select { padding: 6px 8px; font: inherit; }
.sm-go { margin: 20px 0 8px; }
.sm-note { color: var(--sm-muted); font-size: .9rem; }
.sm-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; width: min(100%, 360px); margin: 16px 0 0 auto; }
.sm-totals dt { color: var(--sm-muted); }
.sm-totals dd { margin: 0; text-align: right; }
.sm-store .btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border: 2px solid var(--sm-accent);
  border-radius: 6px; background: var(--sm-accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.sm-link { padding: 0; border: 0; background: none; color: var(--sm-accent); font: inherit; text-decoration: underline; cursor: pointer; }
.sm-order { margin: 16px 0; padding: 16px 20px; border: 1px solid var(--sm-line); border-radius: 8px; background: #fff; }
.sm-order h4 { margin: 0 0 4px; }
.sm-order ul { margin: 8px 0; padding-left: 1.2em; }
.sm-ship { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sm-ship input { padding: 8px 10px; border: 1px solid var(--sm-line); border-radius: 6px; font: inherit; }
.sm-stock ul { columns: 2 320px; padding-left: 0; list-style: none; }
.sm-donate { margin: 40px 0 0; padding: 24px; border: 1px solid var(--sm-line); border-radius: 8px; background: #fff; scroll-margin-top: 96px; }
.sm-donate h2 { margin: 0 0 8px; font-size: 1.3rem; }
.sm-donate form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.sm-donate label { display: grid; gap: 4px; font-size: .9rem; color: var(--sm-muted); }
.sm-donate input { width: 10em; padding: 10px 12px; border: 1px solid var(--sm-line); border-radius: 6px; font: inherit; }
.sm-owner-open { margin-top: 32px; font-size: .85rem; }
.sm-count:not(:empty) { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; margin-left: .35em; padding: 0 .3em;
  border-radius: 999px; background: var(--sm-accent, #8a1c1c); color: #fff; font-size: .75em; font-weight: 700; line-height: 1; }
.sm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sm-book-fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 50;
  padding: 12px 20px; border: 0; border-radius: 999px; background: #ff0000; color: #fff; font: inherit; font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / .25); cursor: pointer; text-decoration: none; }
.sm-book-fab:hover, .sm-book-fab:focus-visible { background: #cc0000; }

/* Modern cart */
.sm-store { --sm-ink: var(--ink, #27242b); --sm-muted: var(--muted, #6a6f7b); --sm-line: var(--line, #e4dde6); --sm-accent: var(--accent, #802664); --sm-paper: var(--cream, #fbfafc); }
.sm-store__inner { width: min(100%, 1100px); }
#sm-cart-title, #sm-book-title { margin: 0 0 28px; color: var(--navy); font: 700 clamp(1.9rem, 3.6vw, 2.6rem)/1.15 var(--serif); }
#sm-cart-title::after, #sm-book-title::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 12px; background: var(--red); }
.sm-flash:not(:empty) { margin: 0 0 20px; padding: 14px 18px; border-left: 4px solid var(--red); border-radius: var(--radius); background: #fff; box-shadow: 0 6px 18px rgba(13, 42, 92, .06); }
.sm-cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.sm-lines { display: grid; gap: 14px; border: 0; border-radius: 0; background: none; }
.sm-line { grid-template-columns: 80px minmax(0, 1fr) auto auto auto; gap: 18px; padding: 16px; border: 0; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1px var(--sm-line), 0 6px 18px rgba(13, 42, 92, .06); }
.sm-line:last-child { border: 0; }
.sm-line__img { display: block; width: 80px; height: 80px; border-radius: 8px; background: var(--paper); overflow: hidden; }
.sm-line__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sm-line__info { display: grid; gap: 4px; min-width: 0; }
.sm-line__title { color: var(--navy); font: 700 1.05rem/1.3 var(--serif); text-decoration: none; }
.sm-line__title:hover { color: var(--accent); }
.sm-stepper { display: inline-flex; align-items: center; border: 1px solid var(--sm-line); border-radius: 999px; background: #fff; }
.sm-stepper button { width: 36px; height: 36px; border: 0; border-radius: 999px; background: none; color: var(--navy); font: 600 1.2rem/1 var(--sans); cursor: pointer; }
.sm-stepper button:hover:not(:disabled) { background: var(--paper); }
.sm-stepper button:disabled { opacity: .35; cursor: default; }
.sm-stepper output { min-width: 1.8em; font-weight: 700; text-align: center; }
.sm-line__price { min-width: 4.5em; color: var(--ink); font-weight: 700; text-align: right; }
.sm-line__remove { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sm-line__remove:hover { background: #fdecee; color: #cc0000; }
.sm-summary { position: sticky; top: 104px; display: grid; gap: 16px; width: auto; margin: 0; padding: 24px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1px var(--sm-line), 0 12px 30px rgba(13, 42, 92, .08); }
.sm-summary h3 { margin: 0; color: var(--navy); font: 700 1.25rem/1.2 var(--serif); }
.sm-summary .sm-totals { gap: 10px 0; }
.sm-summary .sm-totals dd { padding-left: 0; }
.sm-totals select { padding: 6px 10px; border: 1px solid var(--sm-line); border-radius: 8px; background: #fff; color: var(--ink); }
.sm-totals .sm-total { padding-top: 12px; color: var(--navy); font-size: 1.2rem; }
.sm-store .btn { padding: 14px 26px; border-radius: 999px; font-weight: 700; }
.sm-store .btn:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.sm-cart-empty { display: grid; justify-items: center; gap: 10px; max-width: 520px; margin: 8px auto 0; padding: 48px 32px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1px var(--sm-line); text-align: center; }
.sm-cart-empty p { margin: 0; color: var(--muted); }
.sm-cart-empty .sm-cart-empty__title { color: var(--navy); font: 700 1.5rem/1.2 var(--serif); }
.sm-cart-empty .sm-btn { margin-top: 10px; }
.sm-order, .sm-donate { border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--sm-line), 0 6px 18px rgba(13, 42, 92, .06); }
.sm-donate input, .sm-ship input { border-radius: 8px; }
.sm-owner-open { text-align: center; }
@media (max-width: 860px) {
  .sm-cart-grid { grid-template-columns: 1fr; }
  .sm-summary { position: static; }
}
@media (max-width: 560px) {
  .sm-line { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img info remove" "img step price"; gap: 10px 14px; padding: 14px; }
  .sm-line__img { grid-area: img; width: 64px; height: 64px; }
  .sm-line__info { grid-area: info; }
  .sm-stepper { grid-area: step; justify-self: start; }
  .sm-line__price { grid-area: price; align-self: center; }
  .sm-line__remove { grid-area: remove; align-self: start; }
}
