:root {
  --bg: #f6f7f9; --surface: #ffffff; --line: #eceef1; --text: #15171a; --sub: #6b7280; --faint: #a1a7b0;
  --red: #e0262f; --red-soft: #fdecec; --blue: #2563eb; --blue-soft: #e8efff; --gray-soft: #f1f2f4;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --brand-blue: #005DAA;
  --maxw: 1180px; --safe-top: max(8px, env(safe-area-inset-top));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1013; --surface: #171a1f; --line: #262a31; --text: #f2f4f7; --sub: #9aa3af; --faint: #6b7280;
    --red: #ff5a63; --red-soft: #3a1c1f; --blue: #6c9bff; --blue-soft: #1b2440; --gray-soft: #1f2329;
    --shadow: none; --brand-blue: #4D8FD6;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased; word-break: keep-all; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 폰은 꽉 차게, 폴드를 펼치거나 태블릿처럼 넓으면 최대 폭까지 넓게 쓴다 */
body { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
.view { display: none; } .view.on { display: block; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 상단바 */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: 8px 12px; padding-top: var(--safe-top);
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.top h1 { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.icon-btn:active { background: var(--gray-soft); }

/* 하단 탭바 */
/* 하단 탭: 떠 있는 유리 막대 + 손가락으로 끌어서 고르는 유리 렌즈 */
.nav { position: fixed; left: 0; right: 0; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; padding: 0 12px; pointer-events: none; }
.nav-in { pointer-events: auto; position: relative; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 5px; border-radius: 999px; background: rgba(255,255,255,.58); border: 1px solid rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8);
  box-shadow: 0 10px 30px rgba(16,24,40,.16), inset 0 1px 0 rgba(255,255,255,.9);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.nav a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px;
  font-size: 10.5px; color: var(--sub); text-decoration: none; font-weight: 700; white-space: nowrap; -webkit-user-drag: none; }
.nav a .i { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .55; transition: opacity .2s, filter .2s; }
.nav a.on { color: var(--text); }
.nav a.on .i { filter: none; opacity: 1; }
.nav .dot { position: absolute; top: 2px; left: 56%; background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 8px; padding: 0 5px; line-height: 15px; }
.lens { position: absolute; z-index: 2; top: 5px; bottom: 5px; left: 0; border-radius: 999px; pointer-events: none;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 1.5px rgba(255,255,255,.95), inset 0 -1px 1.5px rgba(0,0,0,.10), inset 0 0 12px rgba(255,255,255,.35),
    0 4px 14px rgba(16,24,40,.14);
  -webkit-backdrop-filter: blur(.6px) saturate(1.9); backdrop-filter: blur(.6px) saturate(1.9);
  transition: transform .45s cubic-bezier(.25, 1.45, .45, 1), width .3s, opacity .2s; will-change: transform; }
.lens.drag { transition: transform .08s linear; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-in { background: rgba(30,33,38,.6); border-color: rgba(255,255,255,.09);
    box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); }
  :root:not([data-theme="light"]) .lens { background: rgba(255,255,255,.08);
    box-shadow: inset 0 1px 1.5px rgba(255,255,255,.35), inset 0 -1px 1.5px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.35); }
}

/* 홈 */
/* 로고: Coco 빨강 + 정보통 파랑(앱 아이콘과 같은 색) */
.brand { flex: 1; font-size: 22px; font-weight: 900; letter-spacing: -.6px; color: var(--brand-blue); }
.brand b { color: var(--red); }
.hero { margin: 4px 16px 0; border-radius: 20px; padding: 22px 20px 18px; color: #fff;
  background: linear-gradient(140deg, #e0262f 0%, #b5121b 60%, #8e0d14 100%); box-shadow: 0 8px 24px rgba(224,38,47,.22); }
.sale-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hero-go { flex: 0 0 auto; background: #fff; color: #b5121b; border-radius: 999px; padding: 9px 14px;
  font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.hero .k { font-size: 12px; opacity: .8; text-align: right; margin-top: 8px; }
.hero .big { font-size: 30px; font-weight: 900; margin: 6px 0 4px; letter-spacing: -.5px; }
.hero .tot { font-size: 17px; font-weight: 700; opacity: .95; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sub); flex: 0 0 auto; white-space: nowrap; }
.sw { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.toggle.on { color: var(--red); } .toggle.on .sw { background: var(--red); } .toggle.on .sw::after { left: 23px; }
.sec-title { margin: 26px 16px 10px; font-size: 17px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; letter-spacing: -.3px; }
.sec-title button { font-size: 13px; color: var(--sub); font-weight: 600; }
.note { font-size: 12px; color: var(--faint); margin: 20px 16px 24px; line-height: 1.6; }

/* 목록 */
.tabs { position: sticky; top: calc(48px + var(--safe-top)); z-index: 9; background: var(--bg); display: flex; gap: 4px; overflow-x: auto;
  padding: 0 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 11px 8px 10px; font-size: 14px; color: var(--faint); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.tab small { font-size: 11px; margin-left: 3px; font-weight: 600; }
.search { margin: 10px 12px 0; display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px;
  padding: 10px 12px; box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 8px 12px; }
@media (max-width: 340px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.empty { padding: 60px 20px; text-align: center; color: var(--faint); grid-column: 1 / -1; line-height: 1.6; }

/* 상품 카드 */
/* 위: 흰 사진 영역 / 아래: 색이 다른 정보 영역으로 나눠 보이게 */
.card { background: var(--gray-soft); border-radius: 16px; overflow: hidden; text-align: left; display: flex; flex-direction: column;
  min-width: 0; border: 1px solid var(--text); box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.thumb { position: relative; aspect-ratio: 1; background: #fff; border-radius: 0 0 14px 14px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(16,24,40,.08); }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #c4c8cf; font-size: 28px; }
.fav-on { position: absolute; top: 6px; left: 6px; font-size: 14px; line-height: 1; }
.cbody { padding: 9px 9px 10px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.card .nm { font-size: 13px; line-height: 1.35; word-break: keep-all; overflow-wrap: normal; margin-bottom: 6px; }
.nw { white-space: nowrap; }
.card .nm.tight { overflow-wrap: anywhere; }
.pr { margin-top: auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pr .reg { font-size: 11.5px; color: var(--faint); text-decoration: line-through; }
.pr .off { font-size: 12.5px; color: var(--red); font-weight: 800; }
/* 할인율: 홈 TOP 10 사진 위 꼬리표와 같은 빨간 배지 모양 */
.pr .off { overflow: visible; white-space: nowrap; }
.pr .off .rtb { display: inline-block; margin-left: 3px; padding: 0 4px; border-radius: 5px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 900; line-height: 1.6; vertical-align: 1px; }
.pr .now { font-size: 16px; font-weight: 900; letter-spacing: -.3px; }
.pr .num { overflow: hidden; text-overflow: ellipsis; }
.sched { margin-top: 7px; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 4px 6px; line-height: 1.35; }
.sched span { display: inline-block; white-space: nowrap; }
.sched.on { background: var(--red-soft); color: var(--red); }
.sched.end { background: var(--gray-soft); color: var(--sub); }
.sched.next { background: var(--blue-soft); color: var(--blue); }

/* 상세 */
.detail-img { background: #fff; aspect-ratio: 1.15; display: grid; place-items: center; }
.detail-img img { max-width: 78%; max-height: 90%; object-fit: contain; }
.dbody { background: var(--surface); border-radius: 20px 20px 0 0; margin-top: -16px; position: relative; padding: 20px 18px 24px; }
.crumb { font-size: 12px; color: var(--sub); }
.dname { font-size: 21px; font-weight: 800; line-height: 1.35; margin: 6px 0 2px; letter-spacing: -.3px; word-break: keep-all; }
.code { font-size: 13px; color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; border-radius: 8px; padding: 6px 10px; margin-top: 14px; }
.pill.on { background: var(--red-soft); color: var(--red); }
.pill.end { background: var(--gray-soft); color: var(--sub); }
.pill.next { background: var(--blue-soft); color: var(--blue); }
.pbox { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }
.prow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; color: var(--sub); }
.prow b { color: var(--text); font-weight: 700; }
.prow.red b { color: var(--red); font-weight: 900; }
.prow.big { font-size: 15px; margin-top: 4px; }
.prow.big b { font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.ended-note { font-size: 12px; color: var(--sub); text-align: right; }
.hist-t { font-size: 16px; font-weight: 800; margin: 26px 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--sub); font-weight: 600; font-size: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: right; }
td.red { color: var(--red); font-weight: 700; }
/* 상세: 사진 위에 떠 있고 스크롤해도 따라오는 뒤로가기 */
.dtop { position: fixed; top: 0; left: 0; right: 0; margin: 0 auto; max-width: var(--maxw); background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; pointer-events: none; }
.dtop > * { pointer-events: auto; }
.dback { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: rgba(21,23,26,.72); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.dback:active { transform: scale(.94); }
/* 온라인몰 후기: 위아래 굵은 구분선(상세 화면 폭 끝까지) */
.rvbox { margin: 22px -18px 0; padding: 18px 18px 16px; border-top: 6px solid var(--line); border-bottom: 6px solid var(--line); }
.rvsum { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--gray-soft); }
.rvsum-t { font-size: 13px; font-weight: 800; color: var(--sub); margin-bottom: 8px; }
.rvsum-r { display: flex; gap: 10px; align-items: baseline; }
.rvsum-r + .rvsum-r { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.rvsum-r span { flex: 0 0 auto; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 7px; }
.rvsum-r .g { background: var(--blue-soft); color: var(--blue); }
.rvsum-r .b { background: var(--red-soft); color: var(--red); }
.rvsum-r p { margin: 0; font-size: 14px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.rvmorebtn { display: block; text-align: center; text-decoration: none; width: 100%; margin-top: 8px; padding: 11px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: var(--text); background: var(--surface); }
.rvh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rvh b { font-size: 15px; font-weight: 800; }
.rvh span { font-size: 13px; color: var(--sub); white-space: nowrap; }
.rvh i { font-style: normal; color: #f59e0b; }
.rvsrc { margin-top: 10px; font-size: 11.5px; color: var(--faint); }
.favbtn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 20px; padding: 8px 14px; font-size: 14px; font-weight: 700; flex: 0 0 auto; }
.favbtn.on { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* 관심상품 */
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.li img, .li .ph { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; flex: 0 0 auto; }
.li .tx { flex: 1; min-width: 0; text-align: left; }
.li .n { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li .p { font-size: 14px; font-weight: 800; margin-top: 3px; }
.li .p .red { color: var(--red); }
.li .x { color: var(--faint); font-size: 20px; width: 36px; height: 36px; flex: 0 0 auto; }

/* 휴무일 */
.cl-pick { margin: 6px 16px 0; }
.cl-pick select { width: 100%; font-size: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); }
.cl-card { margin: 12px 16px 0; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
/* 내 매장: 왼쪽 매장 사진 / 오른쪽 영업 정보, 월은 구분선으로 나눔 */
.cl-my { display: flex; gap: 14px; align-items: flex-start; }
.cl-photo { flex: 0 0 42%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--gray-soft); }
.cl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl-info { flex: 1; min-width: 0; }
.cl-card .st { font-size: 17px; font-weight: 900; line-height: 1.3; word-break: keep-all; }
.cl-card .st.off { color: var(--red); }
.cl-card .hr { color: var(--sub); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.cl-mrow { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.hr + .cl-mrow { margin-top: 10px; }
.cl-mrow b { flex: 0 0 auto; font-weight: 800; color: var(--sub); }
.cl-mrow .ds { min-width: 0; font-weight: 700; }
.cl-mrow .ds span { white-space: nowrap; }
.cl-mrow .ds .past { color: var(--faint); font-weight: 500; text-decoration: line-through; }
.cl-mrow .ds .today { color: var(--red); }
/* 월 탭: 화면 폭을 똑같이 나눈 글자 탭 + 선택된 탭 아래 굵은 밑줄 */
.mtabs { display: flex; margin: 18px 0 8px; border-bottom: 1px solid var(--line); }
.mtab { flex: 1; padding: 13px 0 11px; font-size: 16px; font-weight: 700; color: var(--faint);
  border-bottom: 3px solid transparent; margin-bottom: -1px; }
.mtab.on { color: var(--text); font-weight: 800; border-bottom-color: var(--text); }
.cl-list { margin: 0 16px; }
.cl-row { display: flex; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.cl-row:last-child { border-bottom: 0; }
.cl-row .d { flex: 0 0 74px; font-weight: 800; font-size: 15px; }
.cl-row .d.sun { color: var(--red); }
.cl-row .s { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; color: var(--text); }
.cl-row.past { opacity: .45; }
/* ---- 홈: 내 매장 · 카테고리 · 인기상품 · 신상품 · 할인 TOP 10 ---- */
.pv-store { display: flex; align-items: center; gap: 8px; width: calc(100% - 32px); margin: 0 16px 10px; padding: 10px 14px;
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; text-align: left; }
.pv-store .dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; flex: 0 0 auto; }
.pv-store .dot.off { background: var(--red); }
.pv-store .nx { margin-left: auto; color: var(--sub); font-size: 13px; white-space: nowrap; }
.pv-hero { padding: 18px 20px 14px; }
.pv-hero .big { font-size: 26px; margin: 2px 0 0; }
.pv-cats { display: flex; gap: 4px; overflow-x: auto; padding: 16px 12px 4px; scrollbar-width: none; }
.pv-cats::-webkit-scrollbar, .pv-hs::-webkit-scrollbar { display: none; }
.pv-cat { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pv-cat .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 25px; }
.pv-cat .t { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.25; word-break: keep-all; color: var(--sub); }
.pv-sub { font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 6px; margin-right: auto; }
.pv-rank { margin: 0 16px; }
/* 홈 섹션 사이 굵은 구분선(화면 끝까지) */
.pv-sep { height: 6px; background: var(--line); margin: 22px 0 0; }
.pv-sep + .sec-title { margin-top: 20px; }
.pv-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.pv-row:last-child { border-bottom: 0; }
.pv-row .no { display: block; flex: none; width: 24px; font-size: 18px; font-weight: 900; font-style: italic; text-align: center; }
.pv-row .no.hi { color: var(--red); }
.pv-row .ph { position: relative; flex: 0 0 64px; height: 64px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.pv-row .ph img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pv-row .tx { flex: 1; min-width: 0; }
.pv-row .n { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.pv-row .p { margin-top: 3px; font-size: 13px; white-space: nowrap; }
.pv-row .ph .rt { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 900;
  padding: 2px 5px; border-radius: 0 9px 0 7px; }
.pv-row .p s { color: var(--faint); font-size: 12px; margin-right: 6px; }
.pv-row .p .o { color: var(--red); font-weight: 800; margin-right: 6px; }
.pv-row .p b { font-size: 15px; font-weight: 900; }
.pv-hs { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-left: 16px; }
/* 버튼은 내용을 세로 가운데로 두므로 위에서부터 쌓이게 하고, 상품명은 항상 두 줄 높이로 맞춰 카드끼리 줄이 맞게 */
.pv-mc { flex: 0 0 122px; scroll-snap-align: start; text-align: left; min-width: 0;
  display: flex; flex-direction: column; justify-content: flex-start; align-self: flex-start; }
.pv-mc .ph { position: relative; aspect-ratio: 1; border-radius: 12px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.pv-mc .ph img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pv-mc .tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--blue); }
.pv-mc .tag.r { background: var(--red); }
.pv-mc .tag.sale { left: auto; right: 6px; background: #fff; color: var(--red); border: 1.5px solid var(--red); padding: 1px 5px; }
.pv-mc .n { font-size: 13px; line-height: 1.35; min-height: 2.7em; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.pv-mc .st { font-size: 12px; color: var(--sub); margin-top: 3px; white-space: nowrap; }
.pv-mc .st i { font-style: normal; color: #f59e0b; }
.pv-mc .p { font-size: 15px; font-weight: 900; margin-top: 2px; white-space: nowrap; }
.pv-mc .p .o { color: var(--red); font-size: 12px; font-weight: 800; margin-right: 4px; }

/* ---- 화면 크기별 배치 ----
   작은 화면(플립 바깥 화면, 가로로 눕힌 폰) / 일반 폰(기본) / 넓은 화면(폴드 펼침, 태블릿) */
@media (max-height: 520px) {
  .nav { bottom: calc(6px + env(safe-area-inset-bottom)); }
  .nav-in { padding: 3px; max-width: 400px; }
  .nav a { padding: 6px 0 5px; gap: 1px; font-size: 9.5px; }
  .nav a .i { font-size: 16px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .top { min-height: 48px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
  .tabs { top: calc(44px + max(4px, env(safe-area-inset-top))); }
  .pv-hero { padding: 12px 16px 10px; }
  .pv-hero .big { font-size: 22px; }
  /* 사진이 화면을 다 차지하지 않게: 가격이 첫 화면에 보이도록 */
  .detail-img { aspect-ratio: auto; height: 42vh; height: 42dvh; }
  .detail-img img { max-height: calc(42vh - 30px); max-height: calc(42dvh - 30px); }
  /* 아래 탭은 내려 볼 때 숨기고, 올릴 때 다시 보이게 */
  .nav { transition: transform .25s ease; }
  .nav.hide { transform: translateY(calc(100% + 20px + env(safe-area-inset-bottom))); }
}
@media (max-width: 380px) {
  .sec-title { margin-left: 12px; margin-right: 12px; }
  .pv-mc { flex-basis: 112px; }
  .prow.big b { font-size: 24px; }
  .dname { font-size: 19px; }
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 12px; }
  .pv-mc { flex-basis: 146px; }
  /* 넓으면 가운데로(넘칠 땐 왼쪽부터 보이게 auto 여백 사용) */
  .pv-cats > :first-child { margin-left: auto; }
  .pv-cats > :last-child { margin-right: auto; }
  .pv-cat { flex-basis: 76px; }
  /* 할인 TOP 10: 두 줄로 나란히 */
  .pv-rank { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .pv-row:last-child { border-bottom: 1px solid var(--line); }
  #fav-list { display: grid; grid-template-columns: 1fr 1fr; }
  #v-closed { max-width: 760px; margin: 0 auto; }
}
@media (min-width: 840px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* 상세: 넓은 화면에선 왼쪽 사진(고정) · 오른쪽 가격/후기 */
@media (min-width: 660px) {
  #d-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .detail-img { position: sticky; top: 0; aspect-ratio: auto; height: 100vh; height: 100dvh; }
  .detail-img img { max-width: 84%; max-height: 76vh; max-height: 76dvh; }
  .dbody { margin-top: 0; border-radius: 0; min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-top) + 64px) 28px 32px; }
  .rvbox { margin-left: -28px; margin-right: -28px; padding-left: 28px; padding-right: 28px; }
}
/* 폴드를 반쯤 접은 상태(접히는 선이 화면 가운데 세로로): 선을 경계로 왼쪽 사진 · 오른쪽 정보 */
@media (horizontal-viewport-segments: 2) {
  body { max-width: none; }
  .dtop { max-width: none; }
  #d-body { grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
    column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); }
}
/* 플립·폴드를 노트북처럼 반 접은 상태(접히는 선이 가로로): 위 화면에 사진, 아래 화면에서 정보 스크롤 */
@media (vertical-viewport-segments: 2) {
  #d-body { display: block; padding-top: env(viewport-segment-top 0 1); }
  .detail-img { position: fixed; top: 0; left: 0; right: 0; z-index: 5; aspect-ratio: auto; height: env(viewport-segment-height 0 0); }
  .dbody { margin-top: 0; border-radius: 0; min-height: 0; padding-top: 20px; }
}

/* ---- 관심상품 할인 알림 띠(홈) ---- */
.pv-alert { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 10px 16px 0; padding: 12px 14px;
  border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 800; text-align: left; }
.pv-alert[hidden] { display: none; }
.pv-alert .ic { font-size: 18px; }
.pv-alert .tx { flex: 1; min-width: 0; line-height: 1.4; }
.pv-alert .tx small { display: block; font-size: 12px; font-weight: 600; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 가격표로 찾기 ---- */
.sc-box { max-width: 420px; margin: 24px auto 0; padding: 0 20px; text-align: center; }
.sc-ill { font-size: 54px; }
.sc-t { font-size: 16px; line-height: 1.55; font-weight: 700; margin: 8px 0 18px; }
.sc-cam { width: 100%; padding: 15px; border-radius: 14px; background: var(--red); color: #fff; font-size: 17px; font-weight: 800; }
.sc-cam:disabled { opacity: .5; }
.sc-msg { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; color: var(--sub); line-height: 1.5; }
.sc-msg.err { color: var(--red); }
.sc-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; color: var(--faint); font-size: 13px; }
.sc-or::before, .sc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sc-num { display: flex; gap: 8px; }
.sc-num input { flex: 1; min-width: 0; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.sc-num button { padding: 0 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 800; }

/* ---- 처음 여는 동안: 빈 화면 대신 불러오는 중 표시 ---- */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 10px; text-align: center; background: var(--bg); }
.boot b { font-size: 24px; font-weight: 900; letter-spacing: -.6px; color: var(--brand-blue); }
.boot b i { font-style: normal; color: var(--red); }
.boot span { font-size: 13px; color: var(--sub); }
body.ready .boot { display: none; }
body:not(.ready) .nav { visibility: hidden; }

/* ---- 서버에 새 데이터가 왔을 때 위쪽 알림 띠 ---- */
.upd-bar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 52px);
  width: calc(100% - 32px); max-width: 520px; padding: 11px 14px; border-radius: 12px; background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.upd-bar[hidden] { display: none; }

/* ---- 운영자 모드 ---- */
.op-link { margin-top: 28px; font-size: 13px; color: var(--faint); text-decoration: underline; }
.op { padding: 12px 16px 24px; max-width: 560px; margin: 0 auto; }
.op .box { background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.op h3 { margin: 0 0 10px; font-size: 15px; }
.op label { display: block; font-size: 12px; color: var(--sub); font-weight: 700; margin: 10px 0 4px; }
.op input[type=text], .op input[type=number], .op input[type=date], .op input[type=password] { width: 100%; font-size: 17px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.op .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.op .btn { width: 100%; padding: 14px; border-radius: 12px; background: var(--red); color: #fff; font-size: 16px; font-weight: 800; margin-top: 12px; }
.op .btn.sub { background: var(--gray-soft); color: var(--text); }
.op .btn:disabled { opacity: .5; }
.op .chk { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; font-size: 14px; }
.op .chk input { width: 20px; height: 20px; }
.op .warn { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700; line-height: 1.45; }
.op .ok { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 700; line-height: 1.45; }
.op .cur { font-size: 13px; color: var(--sub); line-height: 1.5; margin-top: 6px; }
.op .done li { font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); list-style: none; }
.op .done ul { margin: 0; padding: 0; }
.op .thumbs { display: flex; gap: 8px; margin-top: 8px; }
.op .thumbs img { width: 84px; height: 84px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
