/* 상점(shop.html) — css/book.css 위에 얹는 상점 전용 스타일. 색은 book.css 의 토큰(--paper · --line · --ink · --muted · --brand)을 그대로 쓴다. */
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sp-nav { color: var(--brand); font-weight: 700; text-decoration: none; padding: 8px 4px; min-height: 40px; display: inline-flex; align-items: center; }
.sp-nav:hover { text-decoration: underline; }

.bk-main h1 { margin-bottom: 4px; }
.sp-crumb { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.sp-crumb a { color: inherit; }
.sp-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 14px 0 6px; }
.sp-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 10px; align-content: start; }
.sp-card h2 { margin: 0; font-size: 1.2rem; }
.sp-card h3 { margin: 4px 0 0; font-size: 1rem; }
.sp-card p { margin: 0; }
.sp-card ul { margin: 0; padding-left: 1.2em; }
.sp-card li { margin: 2px 0; }
.sp-price { font: 700 1.6rem/1.1 var(--f-head, inherit); }
.sp-price small { font: 400 .85rem/1 var(--f-body, inherit); color: var(--muted); margin-left: 6px; }
.sp-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; justify-self: start; }
.sp-tag.free { background: #2f6b3a; } .sp-tag.paid { background: #a3150c; } .sp-tag.wait { background: #6a5a2a; }
.sp-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sp-btn { min-height: 48px; padding: 8px 18px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 700 15px/1 var(--f-body); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.sp-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-btn[disabled], .sp-btn.off { opacity: .45; cursor: not-allowed; pointer-events: none; }
.sp-note { font-size: 14px; color: var(--muted); }
.sp-warn { border-left: 4px solid #a3150c; background: var(--soft); border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 15px; }
.sp-ok { border-left: 4px solid #2f6b3a; background: var(--soft); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.sp-error { color: #a3150c; font-weight: 700; }

/* 주문서 */
.sp-form { display: grid; gap: 14px; }
.sp-form label.fld { display: grid; gap: 4px; font-weight: 700; }
.sp-form input[type="email"], .sp-form select { min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--field-border, var(--line)); background: var(--field-bg, #fff); color: var(--ink); font: inherit; width: 100%; min-width: 0; }
.sp-who { background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.sp-who b { font-size: 1.05rem; }
.sp-agree { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.sp-agree label { display: flex; gap: 10px; align-items: flex-start; min-height: 32px; font-weight: 400; }
.sp-agree input { margin-top: 5px; flex: 0 0 auto; width: 18px; height: 18px; }
.sp-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sp-sum b { font-size: 1.3rem; }
.sp-pay { display: grid; gap: 10px; margin-top: 8px; }
.sp-pay [id^="toss-"] { min-height: 40px; }
.sp-timer { font-variant-numeric: tabular-nums; font-weight: 700; }

/* 결과 · 보관함 */
.sp-ordno { font: 700 1.15rem/1.4 ui-monospace, Consolas, monospace; word-break: break-all; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.sp-list { display: grid; gap: 10px; margin: 12px 0; }
.sp-item { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; }
.sp-item h3 { margin: 0; font-size: 1.05rem; }
.sp-item .sp-meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* 맛보기 */
.sp-sample { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; margin: 12px 0; }
.sp-sample h3 { margin: 0; }
.sp-sample .chips span { display: inline-block; padding: 2px 10px; margin: 2px 4px 2px 0; border-radius: 999px; background: var(--soft); font-size: 14px; }
.sp-bar { display: inline-block; vertical-align: middle; width: 90px; height: 8px; border-radius: 4px; background: var(--line); margin: 0 6px; overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: var(--brand); }
.sp-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sp-table th, .sp-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.sp-blur { position: relative; overflow: hidden; max-height: 7.5em; }
.sp-blur::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 20%, var(--paper) 100%); }
#sampleBook { margin-top: 16px; transform-origin: top center; }
#sampleBook > section { padding: 14mm 14mm; }

/* 바닥글 · 약관 */
.sp-foot { max-width: 900px; margin: 0 auto; padding: 18px 16px 40px; font-size: 13px; color: var(--muted); line-height: 1.8; border-top: 1px solid var(--line); }
.sp-foot a { color: inherit; }
.sp-foot .sp-links { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; font-weight: 700; }
.sp-legal h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.sp-legal p, .sp-legal li { font-size: 15px; }
.sp-legal ol, .sp-legal ul { padding-left: 1.3em; }
.sp-legal table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.sp-legal th, .sp-legal td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }

:root[data-theme="dark"] .sp-btn:not(.primary) { background: #3a3126; color: #efe6d4; border-color: #5c4f3d; }
:root[data-theme="dark"] .sp-card, :root[data-theme="dark"] .sp-item, :root[data-theme="dark"] .sp-sample, :root[data-theme="dark"] .sp-agree { background: #2c251c; border-color: #4a3f31; }
:root[data-theme="dark"] .sp-warn, :root[data-theme="dark"] .sp-ok, :root[data-theme="dark"] .sp-who, :root[data-theme="dark"] .sp-ordno { background: #2c251c; }
:root[data-theme="dark"] .sp-form select, :root[data-theme="dark"] .sp-form input[type="email"] { background: #17120c; color: #efe6d4; }
:root[data-theme="dark"] .sp-blur::after { background: linear-gradient(to bottom, transparent 20%, #2c251c 100%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sp-btn:not(.primary) { background: #3a3126; color: #efe6d4; border-color: #5c4f3d; }
  :root:not([data-theme="light"]) .sp-card, :root:not([data-theme="light"]) .sp-item, :root:not([data-theme="light"]) .sp-sample, :root:not([data-theme="light"]) .sp-agree { background: #2c251c; border-color: #4a3f31; }
  :root:not([data-theme="light"]) .sp-warn, :root:not([data-theme="light"]) .sp-ok, :root:not([data-theme="light"]) .sp-who, :root:not([data-theme="light"]) .sp-ordno { background: #2c251c; }
  :root:not([data-theme="light"]) .sp-form select, :root:not([data-theme="light"]) .sp-form input[type="email"] { background: #17120c; color: #efe6d4; }
  :root:not([data-theme="light"]) .sp-blur::after { background: linear-gradient(to bottom, transparent 20%, #2c251c 100%); }
}
@media (max-width: 520px) {
  .sp-nav { font-size: 14px; }
  .sp-price { font-size: 1.4rem; }
  .sp-table { font-size: 14px; }
}
