/* 구매자 화면: 휴대폰 한 손 사용 기준, 데스크톱에서는 가운데 480px 열 */
body { background: #E9EDF1; }
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(22,50,79,.08); } }

.top { position: sticky; top: 0; z-index: 50; height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line-2); }
.top .back { margin-left: -8px; }
.top .t { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.top .t img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.top .act { position: relative; }
.cart-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 60; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-3); position: relative; }
.tabbar a .ti { font-size: 22px; }
.tabbar a.on { color: var(--ink); }
.tabbar a .cart-dot { top: 6px; right: calc(50% - 22px); }

.view { padding: 0 0 24px; }
.sec { padding: 20px 16px; }
.sec + .sec { border-top: 8px solid var(--line-2); }
.sec-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* 상점 머리 */
.hero { position: relative; background: var(--ink); color: #fff; }
.hero .bn { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }
.hero .bn-none { aspect-ratio: 16 / 5; background: var(--ink); }
.shop-card { position: relative; margin: -36px 16px 0; background: #fff; border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); padding: 16px; display: flex; gap: 14px; align-items: center; }
.shop-card .lg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; color: var(--primary-hover); font-weight: 700; font-size: 20px; }
.shop-card h1 { font-size: 18px; }
.shop-card p { font-size: 13px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sns { display: flex; gap: 6px; margin-top: 8px; }
.sns a { width: 30px; height: 30px; border-radius: 50%; background: var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--ink); font-size: 16px; }
.notice-bar { margin: 12px 16px 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.notice-bar .ti { color: var(--primary-hover); margin-top: 2px; }
.closed { margin: 12px 16px 0; }

.searchbar { display: flex; gap: 8px; padding: 16px 16px 0; }
.searchbar .input { height: 42px; background: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 상품 격자 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding: 16px; }
.pcard { display: block; }
.pcard .im { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #EEF2F5; position: relative; }
.pcard .im img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.pcard:hover .im img { transform: scale(1.03); }
.pcard .so { position: absolute; inset: 0; background: rgba(15,30,45,.5); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.pcard .nm { margin-top: 8px; font-size: 14px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pr { margin-top: 4px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pcard .pr b { font-size: 16px; color: var(--ink); }
.pcard .pr .off { color: var(--err); font-weight: 700; font-size: 14px; }
.pcard .pr s { color: var(--text-3); font-size: 12px; }
.pcard .sh { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pcard .from { font-size: 12px; color: var(--text-2); margin-top: 6px; display: flex; gap: 4px; align-items: center; }

/* 상품 상세 */
.gallery { position: relative; background: #EEF2F5; }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .track img { flex: none; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: start; }
.gallery .count { position: absolute; right: 12px; bottom: 12px; background: rgba(15,30,45,.6); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.pd-h { padding: 18px 16px; background: #fff; }
.pd-h .shop-link { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
.pd-h h1 { font-size: 19px; margin-top: 6px; line-height: 1.4; }
.pd-h .summary { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.price-big { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-big .off { color: var(--err); font-weight: 700; font-size: 20px; }
.price-big b { font-size: 24px; color: var(--ink); }
.price-big s { color: var(--text-3); }
.pd-meta { background: #fff; padding: 4px 16px 16px; }
.pd-meta .row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.pd-meta .row dt { color: var(--text-2); }
.pd-meta .row dd { margin: 0; }
.detail-body { font-size: 15px; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.policy { font-size: 13px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; }
.seller-box .dl { grid-template-columns: 96px 1fr; font-size: 13px; }

.buybar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 70; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.buybar .btn { flex: 1; }
.buybar .btn.icon { flex: none; width: 52px; height: 52px; }
.has-buybar .tabbar { display: none; }
.has-buybar .app { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* 옵션 시트 */
.opt-group { margin-bottom: 14px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 18px; color: var(--ink); }
.qty button:disabled { color: #C9D2DB; }
.qty input { width: 52px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-weight: 600; }
.sheet-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 0; border-top: 1px solid var(--line-2); margin-top: 8px; }
.sheet-total b { font-size: 20px; color: var(--ink); }

/* 장바구니 */
.cart-shop { background: #fff; }
.cart-shop + .cart-shop { margin-top: 8px; }
.cart-shop-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); font-weight: 700; color: var(--ink); }
.cart-item { display: grid; grid-template-columns: 22px 72px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); align-items: start; }
.cart-item .im { width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; background: #EEF2F5; }
.cart-item .im img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.cart-item .op { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cart-item .ln { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cart-item .qty button { width: 32px; height: 32px; font-size: 15px; }
.cart-item .qty input { width: 40px; height: 32px; font-size: 14px; }
.cart-ship { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--text-2); background: #FAFBFC; }

/* 주문서 */
.co-box { background: #fff; padding: 18px 16px; }
.co-box + .co-box { margin-top: 8px; }
.co-box h2 { font-size: 16px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-m { height: 64px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 600; font-size: 14px; color: var(--text); }
.pay-m .ti { font-size: 22px; color: var(--text-2); }
.pay-m.on { border-color: var(--primary); background: var(--primary-soft); color: var(--ink); }
.pay-m.on .ti { color: var(--primary-hover); }
.pay-m:disabled { opacity: .4; }
.escrow-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--primary-soft); color: var(--ink); font-size: 13px; line-height: 1.6; }
.escrow-note .ti { color: var(--primary-hover); font-size: 20px; flex: none; }

/* 결제창(LIGHTPAY 모의) */
.pg { margin: -4px -20px -20px; }
.pg-h { background: var(--ink); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pg-h .pg-name { font-weight: 800; letter-spacing: .02em; font-size: 15px; }
.pg-h .pg-amt { text-align: right; }
.pg-h .pg-amt b { font-size: 22px; display: block; }
.pg-h small { opacity: .75; font-size: 12px; }
.pg-b { padding: 16px 20px 20px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card-grid button { height: 52px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 600; font-size: 14px; }
.card-grid button.on { border-color: var(--ink); background: #F2F5F8; }
.pg-foot { font-size: 11px; color: var(--text-3); line-height: 1.6; margin-top: 12px; }
.mock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; }

/* 주문 목록 */
.ord { background: #fff; padding: 16px; display: block; }
.ord + .ord { margin-top: 8px; }
.ord-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-2); }
.ord-b { display: grid; grid-template-columns: 64px 1fr; gap: 12px; margin-top: 10px; align-items: center; }
.ord-b .im { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: #EEF2F5; }
.ord-b .im img { width: 100%; height: 100%; object-fit: cover; }
.ord-b .nm { font-weight: 600; font-size: 14px; }
.ord-b .sm { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* 진행 단계(주문 상세) */
.track-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0 4px; }
.track-steps div { text-align: center; font-size: 11px; color: var(--text-3); font-weight: 600; }
.track-steps div i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
.track-steps div.on { color: var(--ink); }
.track-steps div.on i { background: var(--primary); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--text-3); font-size: 12px; }

.done-hero { text-align: center; padding: 36px 16px 24px; background: #fff; }
.done-hero .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hover); display: inline-flex; align-items: center; justify-content: center; font-size: 34px; margin-bottom: 12px; }
.foot { padding: 24px 16px 32px; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.foot b { color: var(--text-2); }
.foot a { text-decoration: underline; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; background: #fff; border: 0; border-bottom: 1px solid var(--line-2); font-size: 15px; text-align: left; }
.menu-list .ti { font-size: 20px; color: var(--text-2); }
.menu-list .ti-chevron-right { margin-left: auto; color: #B6C0CA; font-size: 18px; }
.link-pay { background: #fff; padding: 28px 20px; text-align: center; }
.link-pay .amt { font-size: 32px; font-weight: 800; color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.popup-img { width: 100%; border-radius: var(--radius); margin-bottom: 12px; }

/* 에스크로 인증마크(검토센터 #27) — 하단 사업자정보 아래 */
.escrow-mark { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 16px 18px; text-align: left; font-size: 12px; color: #777; line-height: 1.6; }
.escrow-mark a { flex: none; display: inline-flex; border-radius: 50%; }
.escrow-mark a:focus-visible { outline: 2px solid var(--primary, #0C7E81); outline-offset: 2px; }
.escrow-mark img { width: 64px; height: 64px; object-fit: contain; display: block; }
.escrow-mark span { max-width: 420px; }
.escrow-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #D5D9DE; border-radius: 999px; padding: 6px 10px; color: #333; font-weight: 600; white-space: nowrap; }
.foot .escrow-mark { justify-content: flex-start; padding: 12px 0 0; }
.cs-line { word-break: keep-all; }
.ft .escrow-mark { justify-content: flex-start; padding: 12px 0 0; }
