/* Customers' shop: one phone-width column. Header and order-form chips stay on top, the order button at the bottom,
   details and checkout slide up as bottom sheets. Colors come from base.css tokens; Kakao's button keeps Kakao's yellow. */
body { background: var(--bg); }
.shop { max-width: 600px; min-height: 100%; margin: 0 auto; background: var(--surface); display: flex; flex-direction: column; }
@media (min-width: 640px) { .shop { box-shadow: 0 0 0 1px var(--line); } }
.shop-main { flex: 1; }
.shop-main.pad { padding: 16px 16px 32px; }
.hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }

/* Header */
.topbar, .subbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar { justify-content: space-between; }
.subbar { padding-left: 6px; }
.subbar h1 { font-size: 18px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); text-decoration: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* Order-form chips */
.pills { position: sticky; top: 56px; z-index: 5; display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; background: var(--surface); scrollbar-width: none; border-bottom: 1px solid var(--line); }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* One order form */
.shelf { padding: 6px 16px 8px; }
.shelf + .shelf { border-top: 8px solid var(--bg); }
.shelf-head { display: flex; align-items: center; gap: 10px; padding: 12px 0 8px; }
.shelf-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.shelf-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.shelf-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.shelf-notice { margin: 0 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; }
details.shelf-notice summary { cursor: pointer; font-weight: 600; }
details.shelf-notice > div { margin-top: 6px; color: var(--muted); }
.prod-group { margin: 0; padding: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); border-top: 1px solid var(--line); }

/* Item row */
.prod { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.prod-group + .prod { border-top: 0; }
.prod.out .thumb, .prod.out .prod-name, .prod.out .prod-price { opacity: .45; }
.thumb { position: relative; overflow: hidden; width: 100px; height: 100px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 16px; background: var(--tile, var(--surface-2)); font-size: 46px; line-height: 1; cursor: pointer; }
.thumb.letter { font-size: 34px; font-weight: 800; color: var(--muted); }
.thumb.big { width: 100%; height: 180px; font-size: 88px; cursor: default; }
.thumb.big.letter { font-size: 64px; }
.thumb.big.photo { height: auto; aspect-ratio: 4 / 3; } /* phone photos are 4:3 */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prod-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod-name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.prod-name button { padding: 0; border: 0; background: none; text-align: left; font-weight: inherit; cursor: pointer; }
.prod-unit { font-size: 13px; color: var(--muted); }
.prod-price { margin-top: 2px; font-size: 17px; font-weight: 800; }
/* 할인: rate in red, then the sale price, the old price crossed out */
.sale-rate { color: var(--danger); font-weight: 800; }
.was { margin-left: 2px; font-size: .78em; font-weight: 500; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid currentColor; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag.low { color: var(--danger); }
.tag.urgent { color: var(--orange); }
.tag.out { color: var(--muted); }
.tag.sold { color: var(--info); background: var(--info-soft); border-color: transparent; }
.prod-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prod-note { font-size: 12px; color: var(--muted); min-width: 0; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty.has { border-color: var(--primary); }
.qty button { width: 38px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.qty button svg { width: 18px; height: 18px; }
.qty button:disabled { color: var(--line-strong); cursor: not-allowed; }
.qty output { min-width: 30px; text-align: center; font-weight: 800; }

/* Order button pinned to the bottom */
.dock { position: sticky; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--surface) 65%, transparent); }
.order-btn { width: 100%; height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 18px rgba(22, 121, 74, .28); }
.order-btn:hover { background: var(--primary-hover); }
.order-btn:disabled { opacity: .6; cursor: wait; }
.order-btn .count { min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .25); font-size: 14px; }

.shop-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px 28px; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; border-top: 8px solid var(--bg); }
.shop-foot b { font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.foot-links a, .shop-foot a { color: var(--muted); }
.foot-escrow { display: block; margin-top: 4px; }
.foot-escrow img { display: block; height: 44px; width: auto; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 72px 24px; text-align: center; color: var(--muted); }
.empty-state b { color: var(--text); font-size: 17px; }
.empty-state p { margin: 0 0 8px; }
.empty-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--primary-soft); color: var(--primary); }
.empty-mark svg { width: 32px; height: 32px; }

/* Bottom sheet */
dialog.sheet { width: 100%; max-width: 600px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(16, 24, 40, .45); }
dialog.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(32px); opacity: .5; } }
.sheet-in { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-body { overflow-y: auto; padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.sheet-foot .qty button { height: 50px; }
.detail-name { font-size: 20px; font-weight: 800; }
.detail-price { margin-top: 4px; font-size: 20px; font-weight: 800; }

.facts { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.facts div { display: flex; gap: 12px; font-size: 14px; }
.facts dt { flex: 0 0 76px; color: var(--muted); }
.facts dd { margin: 0; flex: 1; min-width: 0; }

/* Checkout */
.co-sec { display: flex; flex-direction: column; gap: 10px; }
.co-sec h3 { margin: 0; font-size: 15px; }
.co-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.co-lines li { display: flex; justify-content: space-between; gap: 12px; }
.co-box { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.addr-zip { display: flex; gap: 8px; }
.addr-zip .input { width: 120px; flex: 0 0 auto; }
.addr-find { height: 420px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lines { display: flex; flex-direction: column; gap: 6px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines .total { font-size: 18px; font-weight: 800; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }

/* My orders, my info */
.ocard { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ocard-head { display: flex; align-items: flex-start; gap: 10px; }
.ocard-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.ocard-meta .ok { color: var(--primary); font-weight: 700; }
.ocard-meta .warn { color: var(--warn); font-weight: 700; }
.ocard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ocard-total b { font-size: 17px; }
.perk { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.perk span { font-size: 13px; color: var(--muted); }
.perk strong { font-size: 19px; }
.doc p { margin: 0; }
.doc h2 { margin-top: 8px; }

/* Login and sign-up */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 40px 24px calc(32px + env(safe-area-inset-bottom, 0px)); }
.welcome.signup { justify-content: flex-start; }
.welcome-top { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-bottom: 12px; }
.welcome-top.left { align-items: flex-start; text-align: left; margin-bottom: 4px; }
.welcome-top h1 { font-size: 26px; font-weight: 800; }
.welcome-top p { margin: 0; color: var(--muted); }
.welcome-mark { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 26px; background: var(--primary-soft); font-size: 44px; }
.kakao-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border-radius: 12px; background: #FEE500; color: rgba(0, 0, 0, .85); font-size: 16px; font-weight: 700; text-decoration: none; }
.kakao-btn:hover { background: #F5DC00; }
.welcome-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.welcome-points li::before { content: '✓ '; color: var(--primary); font-weight: 800; }
.consent { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.consent summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.consent details .facts { margin-top: 10px; }
.consent details p { margin: 8px 0 0; }
