/* ============================================================
   영양제 샵 (/shop/)

   껍데기(.md-shell · .md-bar · .md-gate)는 /doctor/ 것을 그대로 쓴다 (doctor.css).
   밀도는 /plan/ 을 따른다 — 본무대라 카드를 크게 잡는다.
   토큰(--brand-deep · --ink · --line …)은 main/index_style.css 가 정한다.
   샵 전용 클래스는 전부 sh- 로 시작한다. 검사가 «쓰는 클래스는 여기 규칙이 있다» 를 본다.
   ============================================================ */

.sh-main {
    flex: 1; width: 100%; max-width: 720px; margin: 0 auto;
    padding: 14px 14px 44px;
    padding-bottom: calc(44px + env(safe-area-inset-bottom));
}

/* 헤더 장바구니 (PC). 모바일은 앱바의 .sh-ab-count 가 대신한다 */
.sh-cart-link {
    position: relative; margin-left: auto; width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-2); text-decoration: none; background: #eef3f8;
}
.sh-cart-link em, .sh-ab-count {
    position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: #f0883e; color: #fff;
    font-style: normal; font-size: 0.66rem; font-weight: 800; line-height: 17px; text-align: center;
}
.sh-cart-link + .hd-bell { margin-left: 8px; }
.ab-btn .sh-ab-count { top: 2px; right: 2px; }
.sh-preview {
    margin: 0; padding: 8px 14px; background: #fff7e6; color: #8a5520;
    font-size: 0.78rem; font-weight: 700; text-align: center;
}

/* ── 공통 조각 ──────────────────────────────────────── */
.sh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand-deep);
    background: var(--brand-deep); color: #fff;
    font-family: inherit; font-size: 0.86rem; font-weight: 800; text-decoration: none; cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}
.sh-btn:hover { filter: brightness(1.06); }
.sh-btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.sh-btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.sh-btn.ghost:hover { border-color: var(--brand-deep); color: var(--brand-deep); filter: none; }
.sh-btn.warn { background: #fff; color: #c0392b; border-color: #e3b0ab; }
.sh-btn.sm { padding: 7px 12px; font-size: 0.78rem; border-radius: 8px; }
.sh-btn.wide { width: 100%; padding: 13px 16px; font-size: 0.92rem; margin-top: 12px; }
.sh-btn.done { background: #e8f5ee; border-color: #e8f5ee; color: var(--brand-deep); }
.sh-x {
    width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent;
    color: var(--ink-3); cursor: pointer; font-size: 0.9rem;
}
.sh-x:hover { background: #f2f6f9; color: #c0392b; }

.sh-card {
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 17px 18px 18px; margin-bottom: 13px;
}
.sh-card h2 {
    display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
    font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
}
.sh-card h2 i { color: var(--brand-deep); font-size: 0.88rem; }

.sh-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 800; font-style: normal;
}
.sh-badge.out { background: #f1f3f5; color: var(--ink-3); }
.sh-badge.low { background: #fff1e4; color: #d9741f; }

.sh-empty {
    padding: 44px 10px; text-align: center; color: var(--ink-3); font-size: 0.86rem;
}
.sh-empty i { display: block; font-size: 30px; margin-bottom: 10px; color: #c3ccd6; }
.sh-empty p { margin: 0 0 14px; }

.sh-note { margin: 10px 0 0; font-size: 0.82rem; line-height: 1.6; color: var(--ink-2); }
.sh-small { font-size: 0.76rem; color: var(--ink-3); line-height: 1.6; }
.sh-warn {
    display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px;
    padding: 10px 13px; border-radius: 12px; background: #fff3f2; color: #8a2f2a;
    font-size: 0.82rem; line-height: 1.55;
}
.sh-warn i { margin-top: 3px; }
.sh-err { margin: 10px 0 0; font-size: 0.8rem; color: #c0392b; font-weight: 700; }
.sh-law { margin: 12px 0 0; font-size: 0.74rem; color: var(--ink-3); line-height: 1.6; }
.sh-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.sh-acts .sh-contact { margin-left: auto; }

/* ── 목록 ──────────────────────────────────────────── */
.sh-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.sh-tabs::-webkit-scrollbar { display: none; }
.sh-tab {
    flex: 0 0 auto; padding: 7px 13px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--ink-2);
    font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.sh-tab.on { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.sh-mine {
    display: flex; align-items: center; gap: 7px; margin: 0 0 12px;
    font-size: 0.8rem; font-weight: 700; color: var(--ink-2);
}
.sh-group { margin-bottom: 18px; }
.sh-group-h {
    display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px;
    font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
}
.sh-group-h em { font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--ink-3); }
.sh-group-sum { margin: 0 0 9px; font-size: 0.8rem; color: var(--ink-3); line-height: 1.55; }
.sh-items { display: flex; flex-direction: column; gap: 8px; }
.sh-item {
    display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px;
}
.sh-item.out { opacity: 0.6; }
.sh-item-img {
    width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #f2f6f9;
    display: flex; align-items: center; justify-content: center; color: #b9c4cf; font-size: 20px;
}
.sh-item-img img { width: 100%; height: 100%; object-fit: cover; }
.sh-item-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-item-meta em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--ink-3); }
.sh-item-name {
    font-size: 0.9rem; font-weight: 800; color: var(--ink); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sh-item-meta span { font-size: 0.74rem; color: var(--ink-3); }
.sh-item-meta strong { font-size: 0.9rem; font-weight: 800; color: var(--ink); }
.sh-item-acts { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 420px) {
    .sh-item { grid-template-columns: 56px 1fr; }
    .sh-item-acts { grid-column: 1 / -1; flex-direction: row; }
    .sh-item-acts .sh-btn { flex: 1; }
}

/* ── 상세 ──────────────────────────────────────────── */
.sh-detail { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.sh-hero { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
.sh-hero-img {
    width: 120px; height: 120px; border-radius: 14px; overflow: hidden; background: #f2f6f9;
    display: flex; align-items: center; justify-content: center; color: #b9c4cf; font-size: 34px;
}
.sh-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.sh-hero-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sh-hero-meta em { font-style: normal; font-size: 0.74rem; font-weight: 700; color: var(--ink-3); }
.sh-hero-meta h1 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.35; }
.sh-hero-meta span { font-size: 0.8rem; color: var(--ink-3); }
.sh-hero-meta strong { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin-top: 4px; }
.sh-hero-meta .sh-badge { align-self: flex-start; margin-top: 4px; }
.sh-buy { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.sh-buy .sh-btn { flex: 1 1 120px; }
.sh-qty {
    display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    flex: 0 0 auto;
}
.sh-qty button {
    width: 34px; height: 36px; border: 0; background: #f7f9fb; color: var(--ink-2);
    font-size: 1rem; font-weight: 800; cursor: pointer;
}
.sh-qty button:hover { background: #eef3f8; }
.sh-qty output { min-width: 36px; text-align: center; font-size: 0.9rem; font-weight: 800; color: var(--ink); }
.sh-qty.sm button { width: 28px; height: 28px; font-size: 0.9rem; }
.sh-qty.sm output { min-width: 28px; font-size: 0.82rem; }

.sh-reason {
    display: flex; gap: 10px; align-items: flex-start; margin-top: 14px;
    padding: 12px 13px; border-radius: 12px; background: #fff7f0; border: 1px solid #f7dcc4;
}
.sh-reason i { color: #d9741f; margin-top: 3px; }
.sh-reason b { display: block; font-size: 0.78rem; font-weight: 800; color: #8a5520; margin-bottom: 2px; }
.sh-reason p { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--ink); }
.sh-reason small { color: var(--ink-3); }

.sh-spec { margin: 16px 0 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line-soft); }
.sh-spec > div { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.84rem; line-height: 1.55; }
.sh-spec dt { flex: 0 0 74px; color: var(--ink-3); font-weight: 700; }
.sh-spec dd { margin: 0; flex: 1; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.sh-spec > div.miss dd { color: #b9636a; font-weight: 700; }
.sh-hf { margin: 12px 0 0; font-size: 0.76rem; font-weight: 800; color: var(--brand-deep); }
.sh-hf i { margin-right: 4px; }
.sh-others { margin-top: 18px; }
.sh-others h2 { margin: 0 0 8px; font-size: 0.86rem; font-weight: 800; color: var(--ink-2); }
.sh-other {
    display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; margin-bottom: 6px;
    border: 1px solid var(--line-soft); border-radius: 10px; text-decoration: none; font-size: 0.82rem;
}
.sh-other b { color: var(--ink); }
.sh-other span { color: var(--ink-3); white-space: nowrap; }

/* ── 장바구니 ──────────────────────────────────────── */
.sh-cart { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sh-cart-row {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px;
}
.sh-cart-row.out { opacity: 0.65; }
.sh-cart-row .sh-item-img { width: 56px; height: 56px; }
.sh-cart-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-cart-meta span { font-size: 0.74rem; color: var(--ink-3); }
.sh-cart-why { font-size: 0.74rem; color: #8a5520; line-height: 1.45; }
.sh-cart-why i { font-size: 0.66rem; transform: rotate(90deg); margin-right: 2px; }
.sh-cart-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sh-cart-side strong { font-size: 0.88rem; font-weight: 800; color: var(--ink); }
.sh-sum { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px 16px; }
.sh-sum > div { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; font-size: 0.86rem; color: var(--ink-2); }
.sh-sum > div b { margin-left: auto; font-weight: 800; color: var(--ink); }
.sh-sum > div small { font-size: 0.72rem; color: var(--ink-3); }
.sh-sum > div.total { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 10px; font-size: 0.95rem; }
.sh-sum > div.total b { font-size: 1.1rem; color: var(--brand-deep); }

/* ── 주문서 ────────────────────────────────────────── */
.sh-form .sh-card { padding-bottom: 14px; }
.sh-radio { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.84rem; color: var(--ink); cursor: pointer; }
.sh-radio input { margin-top: 3px; }
.sh-radio small { color: var(--ink-3); }
.sh-addr-new { padding-top: 10px; }
.sh-field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 0.76rem; font-weight: 700; color: var(--ink-3); }
.sh-field input {
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    font-family: inherit; font-size: 0.9rem; color: var(--ink); background: #fff;
}
.sh-field input:focus { outline: none; border-color: var(--brand-deep); box-shadow: 0 0 0 3px var(--brand-ring); }
.sh-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.sh-row2 .sh-btn { margin-bottom: 8px; }
.sh-check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 0.82rem; line-height: 1.5; color: var(--ink); cursor: pointer; }
.sh-check input { margin-top: 3px; }
.sh-lines { list-style: none; margin: 0; padding: 0; }
.sh-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 0.86rem; color: var(--ink-2); }
.sh-lines li b { font-weight: 800; color: var(--ink); white-space: nowrap; }
.sh-lines li.fee { color: var(--ink-3); }
.sh-lines li.total { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 10px; font-size: 0.95rem; color: var(--ink); }
.sh-lines li.total b { color: var(--brand-deep); font-size: 1.05rem; }
.sh-lines li.refund b { color: #c0392b; }
.sh-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sh-method { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.84rem; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.sh-method:has(input:checked) { border-color: var(--brand-deep); color: var(--brand-deep); background: #eef8f4; }
.sh-agree .sh-law { margin-top: 8px; }

/* ── 완료 · 주문 ───────────────────────────────────── */
.sh-done-no { margin: 0 0 10px; font-size: 0.86rem; color: var(--ink-2); }
.sh-done-no b { color: var(--ink); }
.sh-pick { border-color: #cfe9ee; }
.sh-pick p { margin: 0 0 10px; font-size: 0.84rem; color: var(--ink-2); }
.sh-orders { display: flex; flex-direction: column; gap: 8px; }
.sh-order-row {
    display: grid; grid-template-columns: 44px 1fr auto auto; gap: 10px; align-items: center;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; text-decoration: none;
}
.sh-order-date { font-size: 0.74rem; font-weight: 700; color: var(--ink-3); }
.sh-order-main { min-width: 0; display: flex; flex-direction: column; }
.sh-order-main b { font-size: 0.88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-order-main small { font-size: 0.7rem; color: var(--ink-3); }
.sh-order-amt { font-size: 0.86rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.sh-status {
    padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; white-space: nowrap;
    background: #eef3f8; color: var(--ink-2);
}
.sh-status.paid { background: #eef8f4; color: var(--brand-deep); }
.sh-status.shipping { background: #e8f1fd; color: #2c5aa0; }
.sh-status.done { background: #e8f5ee; color: #1e7a4f; }
.sh-status.cancelled, .sh-status.refunded { background: #fdecea; color: #c0392b; }
.sh-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 10px; }
.sh-timeline li { display: flex; align-items: baseline; gap: 10px; font-size: 0.84rem; color: var(--ink-2); }
.sh-timeline li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #c3ccd6; flex: 0 0 auto; }
.sh-timeline li.paid::before, .sh-timeline li.done::before { background: var(--brand-deep); }
.sh-timeline li.ship::before { background: #2c5aa0; }
.sh-timeline li.cancelled::before, .sh-timeline li.refunded::before { background: #c0392b; }
.sh-timeline li b { font-weight: 800; color: var(--ink); }
.sh-timeline li span { font-size: 0.76rem; color: var(--ink-3); }
.sh-addr { margin: 0; font-size: 0.86rem; line-height: 1.6; color: var(--ink); }

/* ── 배송지 관리 ───────────────────────────────────── */
.sh-addrs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sh-addr-row {
    display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px;
}
.sh-addr-row.def { border-color: #cfe9ee; }
.sh-addr-row b { font-size: 0.86rem; color: var(--ink); }
.sh-addr-row em { font-style: normal; font-size: 0.68rem; font-weight: 800; color: var(--brand-deep); margin-left: 4px; }
.sh-addr-row p { margin: 3px 0 0; font-size: 0.8rem; color: var(--ink-2); line-height: 1.55; }
.sh-addr-acts { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }

/* ── 약관 · 바닥글 ─────────────────────────────────── */
.sh-policy { font-size: 0.84rem; line-height: 1.7; color: var(--ink-2); white-space: normal; }
.sh-foot { max-width: 720px; margin: 0 auto; padding: 10px 14px 40px; }
.sh-foot .sh-law { margin: 0 0 6px; }
.sh-seller { margin: 0 0 6px; font-size: 0.7rem; color: var(--ink-3); line-height: 1.6; }
.sh-links { margin: 0; font-size: 0.72rem; }
.sh-links a { color: var(--ink-3); text-decoration: underline; }

/* ── 토스트 ────────────────────────────────────────── */
.sh-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 10px);
    padding: 10px 16px; border-radius: 999px; background: #1b2a3a; color: #fff;
    font-size: 0.82rem; font-weight: 700; opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: 90vw; text-align: center;
}
.sh-toast.on { opacity: 1; transform: translate(-50%, 0); }
.sh-toast.warn { background: #c0392b; }
