/* ══════════════════════════════════════════════════════════════════════════
   구매자몰 BUY-001 ~ BUY-016
   ──────────────────────────────────────────────────────────────────────────
   진열 밀도는 대형 오픈마켓 수준으로 가되, 색과 타이포는 절제한다.
   장식은 정보를 밀어내지 않는 선까지만 쓴다.
   ══════════════════════════════════════════════════════════════════════════ */

/* ══ 상단 혜택 바 ═══════════════════════════════════════════════════════ */

.promo {
  background: var(--ink-900);
  color: var(--text-on-chrome);
  height: var(--promo-h);
  display: flex; align-items: center;
  position: relative; z-index: 12;
}
.promo__inner {
  max-width: var(--page-max); margin-inline: auto; width: 100%;
  padding-inline: var(--page-pad);
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-5);
  font-size: var(--fs-12); line-height: 1;
  overflow: hidden; white-space: nowrap;
}
.promo b { font-weight: 700; color: var(--yellow-300); }
.promo__tag {
  background: var(--yellow-500); color: var(--text-on-action);
  font-size: var(--fs-11); font-weight: 800;
  padding: 3px 7px; border-radius: var(--r-xs); margin-right: 7px;
}
.promo__sep { color: var(--ink-700); }
.promo__item { display: inline-flex; align-items: center; }

@media (max-width: 720px) {
  .promo__sep, .promo__item:nth-child(n+3) { display: none; }
}

/* ══ 헤더 ═══════════════════════════════════════════════════════════════ */

.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 11;
}
.app-header__inner {
  max-width: var(--page-max); margin-inline: auto;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: var(--space-6);
  padding-inline: var(--page-pad);
}

/* 로고 — 구포 거북이 마스코트 + 상호.
 *
 * 마스코트를 어두운 사각 배지 안에 가두지 않는다. 캐릭터의 외곽선이 이미
 * 검고 두꺼워서 흰 헤더 위에서 저절로 떨어진다. 배지를 두르면 34px 안에
 * 캐릭터를 다시 욱여넣게 되어 형태가 뭉갠다.
 */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.brand__mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
/* 워드마크는 Bagel Fat One 한 굵기(400)뿐이다. font-weight 를 800 으로 두면
   브라우저가 없는 굵기를 흉내 내(가짜 볼드) 획이 뭉갠다. 400 으로 맞춘다.
   자간도 되돌린다 — 이미 획이 두꺼워 더 좁히면 글자끼리 붙는다. */
.brand__word {
  font-family: var(--font-wordmark);
  font-size: var(--fs-28); font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink-900); white-space: nowrap;
}
/* '몰'을 노랑으로 빼지 않는다. 흰 바탕 위 노랑은 1.92:1 로 안 읽힌다
   (이전 호박색도 2.74:1 로 이미 미달이었다). 브랜드색은 마스코트가 이미
   충분히 들고 있으므로 글자는 먹 한 색으로 둔다. */
.brand__word em { font-style: normal; color: inherit; }

.search { flex: 1; max-width: 720px; position: relative; }
.search input {
  width: 100%; height: 46px; min-height: 46px;
  border: 2px solid var(--ink-900); border-radius: var(--r-full);
  padding: 0 52px 0 var(--space-5);
  font-size: var(--fs-14); font-weight: 500;
}
.search input:focus-visible {
  outline: none; border-color: var(--ink-900);
  box-shadow: 0 0 0 3px rgba(14, 36, 48, .12);
}
/* 세로 가운데. top 을 고정값으로 주면 입력칸 테두리가 2px 이라 위 4px ·
   아래 0px 로 내려앉는다 — 원이 바닥에 붙어 보이던 자리다. */
.search button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--ink-900); color: #fff;
  cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.search button:hover { background: var(--ink-700); }

/* 검색칸은 720px 에서 멈추므로, 남는 폭을 그냥 두면 로그인·장바구니가 화면
   오른쪽 끝에 닿지 못하고 200px 쯤 안쪽에 떠 버린다. 아래 네비(상점 전체 ·
   시장 이야기)는 끝까지 가 있어 두 줄의 오른쪽 끝이 어긋나 보인다.
   남는 폭을 왼쪽 여백으로 몰아 오른쪽 끝을 맞춘다. */
/* 남는 폭을 왼쪽 여백으로 몰아 오른쪽 끝을 맞춘다. 넓은 화면에서는 검색칸이
   720px 에서 멈춰 남은 폭이 그냥 뒤에 남는 바람에, 로그인·장바구니가 화면
   오른쪽 끝에 닿지 못하고 200px 쯤 안쪽에 떠 있었다.
   좁은 화면(≤860px)은 헤더가 줄바꿈해 로고와 아이콘만 한 줄에 남는데, 이때도
   오른쪽 정렬이 맞다 — 바로 아래 검색칸이 줄 전체를 쓰므로 오른쪽 끝이 맞는다.
   자리가 모자라면 flex 규칙상 auto 여백은 0 이 되므로 밖으로 밀리지 않는다. */
.header-util {
  display: flex; align-items: center; gap: var(--space-1);
  flex: none; margin-left: auto;
}

/* 아이콘 + 이름을 세로로 쌓는다. 누르는 자리를 44px 이상으로 잡아 손가락이
   닿게 하고, 이름이 있어 무엇인지 눌러 보지 않아도 안다. */
.util {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-1);
  min-width: 56px; min-height: 50px; padding: 6px var(--space-2);
  border-radius: var(--r-md);
  color: var(--ink-900);
  font-size: var(--fs-11); font-weight: 600; white-space: nowrap;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.util:hover { background: var(--bg-muted); }
.util svg { width: 23px; height: 23px; }
.util--wide { min-width: 64px; }

.util__count {
  position: absolute; top: 2px; right: 8px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--red-600); color: #fff;
  font-size: var(--fs-11); font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--bg-surface);
  font-variant-numeric: tabular-nums;
}

/* 좁아지면 이름을 접고 아이콘만 남긴다. 이때 장바구니 **개수 뱃지까지**
   접으면 안 된다 — span 을 통째로 숨기던 자리다. */
@media (max-width: 900px) {
  .util span:not(.util__count) { display: none; }
  .util, .util--wide { min-width: 44px; min-height: 44px; padding-inline: var(--space-1); }
  .util__count { right: 2px; }
}

/* 인기 검색어. 높이를 고정한다 — 헤더 안에 있으므로 이 높이가 sticky 기준
   (--stick-h)에 들어간다. 내용에 따라 들쭉날쭉하면 앵커 위치가 어긋난다. */
.hotwords {
  max-width: var(--page-max); margin-inline: auto;
  height: var(--hotwords-h);
  padding: 0 var(--page-pad) var(--space-3);
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-12); overflow-x: auto; scrollbar-width: none;
}
.hotwords::-webkit-scrollbar { display: none; }
.hotwords__label {
  color: var(--red-600); font-weight: 800; flex: none; margin-right: var(--space-2);
}
/* 알약은 눈에는 작아도 **누르는 자리는 30px 이상**으로 잡는다. 4px 상하
   패딩만 주면 24px 짜리가 되어 손가락으로는 옆 낱말이 눌린다. */
.hotwords a {
  flex: none; display: inline-flex; align-items: center; min-height: 30px;
  color: var(--text-secondary); font-weight: 500;
  padding: 0 var(--space-3); border-radius: var(--r-full);
  background: var(--bg-muted);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.hotwords a:hover { background: var(--ink-900); color: #fff; }

/* ══ 카테고리 네비 ══════════════════════════════════════════════════════ */

/* position: relative 는 펼침 목록의 자리 기준이다. 아래 .catnav__panel 주석 참고 —
   기준을 스크롤 상자 안에 두면 메뉴가 통째로 잘려 안 보인다. */
.catnav {
  position: relative;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}
.catnav__inner {
  max-width: var(--page-max); margin-inline: auto;
  padding-inline: var(--page-pad);
  height: var(--catnav-h);
  display: flex; align-items: center; gap: var(--space-6);
  overflow-x: auto; scrollbar-width: none;
}
.catnav__inner::-webkit-scrollbar { display: none; }
/* 링크가 줄 높이를 꽉 채우게 한다. 글자 크기에만 맞춰 두면 현재 위치 밑줄이
   줄 한가운데에 떠서 어디에 걸린 표시인지 읽히지 않는다. 채워 두면 밑줄이
   네비 아래 경계선 자리에 앉고, 누르는 자리도 48px 로 커진다. */
.catnav a {
  flex: none; display: inline-flex; align-items: center; height: 100%;
  font-size: var(--fs-15); font-weight: 700;
  color: var(--text-primary); letter-spacing: var(--tracking-tight);
  position: relative;
}
/* bottom 은 0 이어야 한다. -1px 로 상자 밖에 걸치면 .catnav__inner 의
   overflow-x: auto (→ overflow-y 도 auto 가 된다)가 잘라서, 현재 위치 표시가
   경계선 아래에 동강난 조각으로 남는다. */
.catnav a::after {
  content: ""; position: absolute; bottom: 0;
  /* 글자 폭보다 조금 넓게 뺀다. 딱 맞추면 '홈' 같은 한 글자짜리에서 12px 짜리
     점처럼 보여 현재 위치 표시로 안 읽힌다. 레이아웃은 건드리지 않는다. */
  left: -8px; right: -8px;
  height: 3px; border-radius: 3px 3px 0 0; background: transparent;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.catnav a:hover::after { background: var(--line-strong); }
.catnav a[aria-current="page"]::after { background: var(--ink-900); }
/* 전체 카테고리 — 나머지 링크와 다른 무게로 둔다. 목록의 하나처럼 보이면
   여는 곳이라는 신호가 죽는다.
   선택자를 .catnav a 보다 무겁게 잡아 두면 !important 없이 이긴다. */
/* position 을 주지 않는다. 여기에 relative 를 주면 펼침 목록의 자리 기준이
   .catnav__inner 안쪽이 되어 잘린다 (아래 .catnav__panel 참고). */
.catnav__all { flex: none; margin-right: var(--space-3); }
.catnav a.catnav__all-btn {
  gap: var(--space-2);
  height: 36px; padding: 0 var(--space-4);
  border-radius: var(--r-sm);
  background: var(--ink-900); color: #fff;
  font-size: var(--fs-13); font-weight: 700;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.catnav a.catnav__all-btn::after { display: none; }
.catnav a.catnav__all-btn:hover { background: var(--ink-700); }

/* 전체 카테고리 펼침 목록.
 *
 * 자리 기준은 .catnav__all 이 아니라 **.catnav** 다. .catnav__inner 가 좁은
 * 화면에서 가로 스크롤을 하려고 overflow-x: auto 를 쓰는데, 그러면 CSS 규칙상
 * overflow-y 도 auto 가 되어 상자 밖으로 나가는 것을 전부 잘라 낸다. 목록은
 * 네비 줄(48px) **아래**에 떠야 하므로 기준이 그 안에 있으면 통째로 잘려
 * 메뉴가 열려도 아무것도 안 보인다. 기준을 스크롤 상자 바깥(.catnav)으로
 * 빼면 잘리지 않는다.
 *
 * 왼쪽 자리는 .catnav__inner 의 안쪽 여백에 맞춘다 — 가운데 정렬된 본문 폭
 * (--page-max)의 왼쪽 끝 + 좌우 여백. 화면이 좁아 본문이 꽉 차면 여백만 남는다. */
.catnav__panel {
  position: absolute; z-index: 20;
  left: max(var(--page-pad), calc((100% - var(--page-max)) / 2 + var(--page-pad)));
  top: calc(100% + 6px);
  min-width: 216px; padding: var(--space-2);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.catnav__panel[hidden] { display: none; }
/* 펼침 목록은 네비 줄 안이 아니라 그 아래 판이다. .catnav a 의 height:100%
   (=48px)를 반드시 풀어 준다. 안 풀면 항목 하나가 네비 높이만큼 부푼다. */
.catnav .catnav__panel a {
  display: flex; align-items: center; gap: var(--space-3);
  height: auto; min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-14); font-weight: 600;
  color: var(--text-primary);
}
.catnav .catnav__panel a::after { display: none; }
.catnav .catnav__panel a:hover { background: var(--bg-muted); }
.catnav__panel svg { color: var(--text-secondary); flex: none; }

.catnav__spacer { flex: 1; min-width: var(--space-4); }
/* 오른쪽 보조 링크. 주 카테고리와 같은 무게로 두면 어느 쪽이 본 줄기인지
   구분이 안 된다. 밑줄 표시도 현재 위치일 때만 쓴다. */
.catnav a.catnav__side {
  font-size: var(--fs-13); font-weight: 500; color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.catnav a.catnav__side:hover { color: var(--text-primary); }
/* :not() 을 빼면 지금 보고 있는 화면의 링크에 손을 올렸을 때 그 표시가
   지워진다 — 현재 위치 표시는 hover 보다 세다. */
.catnav a.catnav__side:hover:not([aria-current])::after { background: transparent; }

/* 앵커 서브 네비 — 홈에서만. 스크롤을 따라 붙는다.
 *
 * 붙는 위치는 --header-h 가 아니라 --stick-h 다. 인기 검색어 줄이 헤더
 * **안에** 있어 헤더 실제 높이가 --header-h 보다 크다. --header-h 로 두면
 * 스크롤할 때 이 줄이 헤더 뒤(z-index 11)로 들어가 통째로 사라진다. */
.quicknav {
  position: sticky; top: var(--stick-h); z-index: 10;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--quicknav-h);
}
.quicknav__inner {
  max-width: var(--page-max); margin-inline: auto;
  padding-inline: var(--page-pad); height: 100%;
  display: flex; align-items: center; gap: var(--space-5);
  overflow-x: auto; scrollbar-width: none;
}
.quicknav__inner::-webkit-scrollbar { display: none; }
.quicknav a {
  flex: none; font-size: var(--fs-13); font-weight: 700;
  color: var(--text-secondary); white-space: nowrap;
}
.quicknav a:hover { color: var(--text-primary); }
.quicknav a.is-deal { color: var(--red-600); }
.quicknav__sep { color: var(--line-strong); flex: none; }

/* ══ 본문 틀 ════════════════════════════════════════════════════════════ */

.app-main {
  max-width: var(--page-max); margin-inline: auto; width: 100%;
  padding: var(--space-6) var(--page-pad) var(--space-16);
}
.app-main--narrow { max-width: 760px; }
.app-main--wide { max-width: var(--page-max); }
.app-main--flush { padding-top: 0; }
/* 배너가 없는 상태(운영사가 아직 안 넣었거나 시드 직후)에서는 카테고리 줄이
   본문 첫 요소가 된다. flush 는 위 여백이 0 이라 그대로 두면 네비에 붙는다. */
.app-main--flush > .quick:first-child { margin-top: var(--space-8); }

/* 하단 고정 CTA 가 있는 화면은 본문 아래를 비워 준다. */
.has-cta { padding-bottom: calc(var(--cta-h) + var(--space-8)); }

.section { margin-top: var(--space-12); scroll-margin-top: calc(var(--stick-h) + var(--quicknav-h) + var(--space-3)); }
.section:first-child { margin-top: 0; }
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
}
.section__head h2 {
  font-size: var(--fs-24); letter-spacing: var(--tracking-tight);
}
.section__head p { font-size: var(--fs-13); color: var(--text-muted); margin-top: 4px; }
.section__more {
  font-size: var(--fs-13); font-weight: 600; color: var(--text-secondary);
  white-space: nowrap; flex: none;
}
.section__more:hover { color: var(--text-primary); }

/* ══ 히어로 배너 ════════════════════════════════════════════════════════ */

/* 홈은 app-main--flush 라 본문 위 여백이 0 이다. 그래서 히어로가 자기 위
   여백을 직접 갖는다. 없으면 고정된 서브 네비의 실선에 배너가 그대로 붙어,
   큼직하고 진한 덩어리가 얇은 선을 밀고 있는 것처럼 보인다. */
.hero { margin-top: var(--space-8); margin-bottom: var(--space-8); }
.hero__track {
  display: flex; gap: var(--space-4);
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: var(--space-3);
}
.hero__track::-webkit-scrollbar { display: none; }
.hero__slide {
  flex: 0 0 auto; width: min(76%, 620px);
  /* start 로 맞춘다. center 면 첫 장은 더 왼쪽으로 갈 곳이 없어 0 에 걸리는데,
     그 자리는 다른 장들의 정지 위치와 간격이 달라진다. 끝에서 처음으로 조용히
     돌아갈 때 그 차이만큼 화면이 튄다. 보이는 모습도 지금과 같다 — 첫 배너는
     원래 왼쪽 끝에 붙어 있다. */
  scroll-snap-align: start;
  border-radius: var(--r-xl); overflow: hidden;
  position: relative; isolation: isolate;
  /* 비율을 못박는다. min-height 만 두면 높이를 글자 길이가 정하므로 부제가
     한 줄 늘어난 배너만 길어져 옆과 어긋난다. 운영사도 그림을 몇 픽셀로
     만들어야 할지 알 수 없다. PC 12:5, 모바일 16:9 — 제작 규격은
     docs/CONTENT.md 에 적어 두었다. */
  aspect-ratio: 12 / 5;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--space-7);
  color: #fff;
  box-shadow: var(--shadow-md);
}
/* 배너 그림. 위에 흰 글씨를 얹으므로 아래쪽에 어두운 막을 깐다 — 운영사가
   어떤 사진을 올릴지 모르는데 막이 없으면 밝은 사진에서 글자가 사라진다. */
.hero__photo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.hero__slide--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    to top, rgba(8, 26, 36, .82) 0%, rgba(8, 26, 36, .45) 45%, rgba(8, 26, 36, .12) 100%);
}
.hero__slide::after {
  /* 아주 옅은 물결. 브랜드의 기억만 남기고 글자를 가리지 않는다. */
  content: ""; position: absolute; inset: auto 0 0 0; height: 62%;
  background: radial-gradient(120% 100% at 50% 100%, rgba(255,255,255,.14), transparent 70%);
  z-index: -1;
}
.hero__slide--naru    { background: linear-gradient(135deg, #0E2430 0%, #1B4A5E 100%); }
.hero__slide--market  { background: linear-gradient(135deg, #7A4A05 0%, #C8860E 100%); }
.hero__slide--sea     { background: linear-gradient(135deg, #063E4A 0%, #0B7A80 100%); }
.hero__slide--harvest { background: linear-gradient(135deg, #6A1710 0%, #A93726 100%); }
.hero__slide--dawn    { background: linear-gradient(135deg, #37204A 0%, #6A417F 100%); }

.hero__badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-size: var(--fs-11); font-weight: 700;
  letter-spacing: var(--tracking-wide);
  padding: 4px 10px; border-radius: var(--r-full);
  margin-bottom: var(--space-4);
  backdrop-filter: blur(4px);
}
.hero__title {
  font-size: var(--fs-28); font-weight: 800;
  letter-spacing: var(--tracking-tighter); line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .28);
}
.hero__sub {
  margin-top: var(--space-2); font-size: var(--fs-14);
  color: rgba(255, 255, 255, .9); line-height: 1.65;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}
.hero__cta {
  align-self: flex-start; margin-top: var(--space-5);
  background: #fff; color: var(--ink-900);
  font-size: var(--fs-13); font-weight: 700;
  padding: 10px var(--space-5); border-radius: var(--r-full);
  display: inline-flex; align-items: center; gap: 6px;
}
.hero__dots { display: flex; justify-content: center; align-items: center; gap: 2px; }

/* 점 자체는 작지만 **누르는 자리는 24px 이상**이어야 한다. 보이는 크기와
   손가락이 닿는 크기는 다른 문제다. 그래서 여백까지 버튼에 포함시킨다.
   (예전에는 활성 표시가 :first-child 에 박혀 있어 배너가 넘어가도 첫 점만
   계속 길쭉했다. 지금은 JS 가 붙이는 .is-on 이 정한다.) */
.hero__dot {
  width: 16px; height: 24px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.hero__dot::before {
  content: ""; display: block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
  transition: width .18s ease, background-color .18s ease;
}
.hero__dot.is-on::before { width: 20px; border-radius: var(--r-full); background: var(--ink-900); }
.hero__dot.is-on { width: 30px; }
.hero__dot:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 1px; border-radius: var(--r-sm); }

.hero__pause {
  margin-left: var(--space-2);
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  display: grid; place-items: center;
}
/* display 를 지정한 선택자는 브라우저 기본 [hidden] 규칙을 이긴다. 명시하지
   않으면 스크립트가 꺼진 환경에서 누를 수 없는 정지 버튼이 보인다. */
.hero__pause[hidden] { display: none; }
.hero__pause:hover { background: var(--bg-muted); color: var(--text-primary); }
.hero__pause:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 1px; }
.hero__pause .hero__pause-off { display: none; }
.hero__pause[aria-pressed="true"] .hero__pause-on  { display: none; }
.hero__pause[aria-pressed="true"] .hero__pause-off { display: block; }

@media (prefers-reduced-motion: reduce) {
  .hero__dot::before { transition: none; }
}

@media (max-width: 720px) {
  /* 모바일은 16:9 로 바꾼다. PC 비율(12:5)을 좁은 폭에 그대로 적용하면
     높이가 130px 남짓이라 제목·부제가 들어가지 않는다. 실제 커머스가
     PC 용과 모바일용 배너를 따로 받는 이유가 이것이다. */
  .hero__slide { width: 88%; aspect-ratio: 16 / 9; padding: var(--space-5); }
  .hero__title { font-size: var(--fs-20); }
}

/* ══ 기획전 (BUY-034 · BUY-035) ═════════════════════════════════════════ */

/* 배너를 눌러 들어온 자리다. 배너와 같은 색·같은 그림을 쓴다 — 색이 달라지면
   같은 곳으로 온 것인지 알 수 없다. 배경 그라디언트는 .hero__slide 와 값이
   같지만 선택자를 따로 둔다. 히어로는 가로 스크롤 판이라 크기·정렬 규칙이
   전혀 다르고, 한쪽을 고치면 다른 쪽이 조용히 깨진다. */
.expo-hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--r-xl);
  padding: var(--space-10) var(--space-7);
  margin-bottom: var(--space-7);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.expo-hero__photo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
/* 어떤 사진이 올라올지 모른다. 막이 없으면 밝은 사진에서 흰 글씨가 사라진다. */
.expo-hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    to top, rgba(8, 26, 36, .86) 0%, rgba(8, 26, 36, .58) 55%, rgba(8, 26, 36, .3) 100%);
}
.expo-hero--naru    { background: linear-gradient(135deg, #0E2430 0%, #1B4A5E 100%); }
.expo-hero--market  { background: linear-gradient(135deg, #7A4A05 0%, #C8860E 100%); }
.expo-hero--sea     { background: linear-gradient(135deg, #063E4A 0%, #0B7A80 100%); }
.expo-hero--harvest { background: linear-gradient(135deg, #6A1710 0%, #A93726 100%); }
.expo-hero--dawn    { background: linear-gradient(135deg, #37204A 0%, #6A417F 100%); }

.expo-hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: var(--fs-11); font-weight: 700;
  letter-spacing: var(--tracking-wide);
  padding: 4px 10px; border-radius: var(--r-full);
  margin-bottom: var(--space-4);
  backdrop-filter: blur(4px);
}
.expo-hero h1 {
  font-size: var(--fs-34); font-weight: 800;
  letter-spacing: var(--tracking-tighter); line-height: 1.25;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .28);
}
.expo-hero__sub {
  margin-top: var(--space-3); font-size: var(--fs-15);
  color: rgba(255, 255, 255, .92); line-height: 1.65;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}
/* 기간은 정보이지 장식이 아니다. 반투명을 더 내리면 대비가 무너진다. */
.expo-hero__period {
  margin-top: var(--space-4); font-size: var(--fs-13); font-weight: 600;
  color: rgba(255, 255, 255, .88);
}

/* 운영사가 쓴 안내글. 글줄 폭을 재지 않으면 한 줄이 1,240px 까지 늘어난다. */
.expo-body {
  max-width: 64ch; margin-bottom: var(--space-7);
  color: var(--text-secondary); font-size: var(--fs-14); line-height: 1.85;
}
.expo-body p + p { margin-top: var(--space-3); }

.expo-list {
  list-style: none;
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.expo-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  /* 배너와 같은 비율. 운영사가 그림 한 장으로 배너와 목록을 함께 쓴다. */
  aspect-ratio: 12 / 5;
  border-radius: var(--r-lg);
  padding: var(--space-6);
  color: #fff; box-shadow: var(--shadow-sm);
}
.expo-card:hover { box-shadow: var(--shadow-md); }
.expo-card__photo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.expo-card--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(
    to top, rgba(8, 26, 36, .84) 0%, rgba(8, 26, 36, .5) 55%, rgba(8, 26, 36, .18) 100%);
}
.expo-card--naru    { background: linear-gradient(135deg, #0E2430 0%, #1B4A5E 100%); }
.expo-card--market  { background: linear-gradient(135deg, #7A4A05 0%, #C8860E 100%); }
.expo-card--sea     { background: linear-gradient(135deg, #063E4A 0%, #0B7A80 100%); }
.expo-card--harvest { background: linear-gradient(135deg, #6A1710 0%, #A93726 100%); }
.expo-card--dawn    { background: linear-gradient(135deg, #37204A 0%, #6A417F 100%); }
.expo-card__badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: var(--fs-11); font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-full);
  margin-bottom: var(--space-3);
}
.expo-card__title {
  font-size: var(--fs-20); font-weight: 800;
  letter-spacing: var(--tracking-tighter);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}
.expo-card__sub {
  margin-top: var(--space-2); font-size: var(--fs-13);
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}
.expo-card__meta {
  margin-top: var(--space-3); font-size: var(--fs-12); font-weight: 600;
  color: rgba(255, 255, 255, .86);
}

@media (max-width: 720px) {
  .expo-hero { padding: var(--space-7) var(--space-5); }
  .expo-hero h1 { font-size: var(--fs-24); }
  /* 좁은 폭에서 12:5 는 높이가 130px 남짓이라 제목·부제가 들어가지 않는다.
     배너와 같은 이유로 16:9 로 바꾼다. */
  .expo-list { grid-template-columns: 1fr; }
  .expo-card { aspect-ratio: 16 / 9; padding: var(--space-5); }
}

/* ══ 카테고리 아이콘 ════════════════════════════════════════════════════ */

/* auto-fit 그리드는 칸이 하나뿐일 때 그 하나를 줄 전체 폭으로 늘린다. 그러면
   카테고리가 아직 없는 상점(시드 직후·신규 개설)에서 '상점 전체' 타일 하나가
   1,240px 짜리 칸 한가운데에 덩그러니 놓인다 — 실제로 그렇게 보였다.
   flex 로 두면 칸 폭이 max-width 에서 멈춰 하나여도 왼쪽에 제자리로 앉고,
   여덟 개면 기준 폭을 넘겨 자라 줄 전체를 고르게 채운다. */
.quick {
  display: flex; flex-wrap: wrap; justify-content: flex-start;
  gap: var(--space-4) var(--space-2);
  margin-bottom: var(--space-10);
}
.quick > li { flex: 1 1 96px; max-width: 160px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-3) 4px; border-radius: var(--r-lg);
}

/* 타일은 크게. 60px 에서는 그림이든 아이콘이든 무엇인지 알아보기 전에
   글자부터 읽게 된다 — 그러면 타일이 있을 이유가 없다.
   ─────────────────────────────────────────────────────────────────────
   면은 여덟 개 모두 같다. 카테고리마다 색을 달리 주던 때는 색이 아무 정보도
   전달하지 않는데 시선만 여덟 갈래로 찢겼고, 정작 브랜드색은 이 줄에서
   통째로 사라졌다. 노랑은 **손이 닿은 자리**에만 켠다 — 그래야 색이
   '지금 여기'라는 정보를 갖는다.
   면을 회색(--bg-muted)으로 두지 않는 이유: 페이지 배경이 --n-50 이라
   --n-100 타일은 대비 1.06:1 로 타일처럼 보이지 않는다. 흰 면에 실선
   테두리가 배경 위에서 훨씬 또렷하다. */
.quick__icon {
  width: 72px; height: 72px; border-radius: var(--r-xl);
  display: grid; place-items: center; flex: none;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--n-700);
  transition: transform var(--dur-base) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
/* :active 를 함께 거는 이유 — 이 줄은 대부분 손가락으로 눌린다. hover 만
   두면 모바일에서는 노랑이 한 번도 켜지지 않는다. */
.quick a:hover .quick__icon,
.quick a:focus-visible .quick__icon,
.quick a:active .quick__icon,
.quick a[aria-current] .quick__icon {
  background: var(--yellow-500); border-color: var(--yellow-600);
  color: var(--ink-900);           /* 노랑 위 먹 글씨 13.48:1 */
  transform: translateY(-2px);
}
.quick a[aria-current] .quick__label { font-weight: 700; }
/* 회전하는 부분이 타일 밖으로 조금 나가므로 자르지 않는다. 실사 타일은
   반대로 잘라야 하므로 .quick__icon 의 overflow 는 그대로 두고 svg 만 연다. */
.quick__icon svg { width: 34px; height: 34px; overflow: visible; }

/* ══ 아이콘 움직임 ══════════════════════════════════════════════════════
 *
 * 손이 닿을 때 **한 번** 움직인다. 정한 기준 셋:
 *
 *   1. 가만히 있을 때는 움직이지 않는다. 여덟 개가 계속 움직이면 장터가
 *      아니라 놀이공원이 된다
 *   2. 무한 반복하지 않는다. 눈이 쉬지 못하고 모바일 배터리를 계속 먹는다
 *   3. 물건이 실제로 하는 움직임을 준다 — 마른 생선은 줄에서 흔들리고,
 *      생선은 헤엄치고, 사과는 떨어져 눌린다
 *
 * 손잡이(ico-*)는 catalog_extras.py 가 SVG 안에 붙인다. 손잡이가 없는
 * 아이콘은 그냥 가만히 있는다 — 움직임이 없다고 깨지지 않는다.
 * ═══════════════════════════════════════════════════════════════════════ */

.quick__icon [class^="ico-"] { transform-box: fill-box; }

/* 건어물 — 줄에 걸린 채 흔들린다. 세 마리에 시차를 준다 */
.ico-dry { transform-origin: 50% 0%; }
.quick a:hover .ico-dry,
.quick a:focus-visible .ico-dry { animation: ico-sway .9s cubic-bezier(.36, .07, .19, .97) both; }
.quick a:hover .ico-dry2, .quick a:focus-visible .ico-dry2 { animation-delay: .07s; }
.quick a:hover .ico-dry3, .quick a:focus-visible .ico-dry3 { animation-delay: .14s; }
@keyframes ico-sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(7deg); }
  60% { transform: rotate(-5deg); }
  85% { transform: rotate(2deg); }
}

/* 농산물 — 떨어졌다 눌리고 되돌아온다. 꼭지가 뒤따라 튕긴다 */
.ico-apple { transform-origin: 50% 100%; }
.quick a:hover .ico-apple,
.quick a:focus-visible .ico-apple { animation: ico-squash .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-squash {
  0% { transform: translateY(-18%) scale(1, 1); }
  45% { transform: translateY(0) scale(1.14, .86); }
  70% { transform: translateY(-5%) scale(.96, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}
.ico-stem { transform-origin: 0% 100%; }
.quick a:hover .ico-stem,
.quick a:focus-visible .ico-stem { animation: ico-flick .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-flick {
  0% { transform: rotate(-12deg); }
  50% { transform: rotate(9deg); }
  100% { transform: rotate(0deg); }
}
/* 잎은 꼭지 반대쪽에 붙어 있으므로 반대로 흔들려야 한 몸으로 보인다 */
.ico-leaf { transform-origin: 100% 100%; }
.quick a:hover .ico-leaf,
.quick a:focus-visible .ico-leaf { animation: ico-flutter .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-flutter {
  0% { transform: rotate(11deg); }
  50% { transform: rotate(-7deg); }
  100% { transform: rotate(0deg); }
}

/* 먹거리 — 꼬치의 떡이 번갈아 밀린다 */
.quick a:hover .ico-cake1,
.quick a:focus-visible .ico-cake1 { animation: ico-nudge .6s ease-out both; }
.quick a:hover .ico-cake2,
.quick a:focus-visible .ico-cake2 { animation: ico-nudge .6s ease-out .08s both reverse; }
.quick a:hover .ico-cake3,
.quick a:focus-visible .ico-cake3 { animation: ico-nudge .6s ease-out .16s both; }
@keyframes ico-nudge {
  0% { transform: translateX(0); }
  40% { transform: translateX(2.2px); }
  100% { transform: translateX(0); }
}

/* 면류 — 젓가락이 면을 집어 올리고 김이 뒤따라 오른다 */
.ico-chopstick { transform-origin: 50% 100%; }
.quick a:hover .ico-chopstick,
.quick a:focus-visible .ico-chopstick { animation: ico-pick .75s cubic-bezier(.34, 1.4, .64, 1) both; }
@keyframes ico-pick {
  0% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-2.5px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(0); }
}
.ico-steam { transform-origin: 50% 100%; }
.quick a:hover .ico-steam,
.quick a:focus-visible .ico-steam { animation: ico-rise .9s ease-out .1s both; }
@keyframes ico-rise {
  0% { transform: translateY(2.5px) scaleY(.8); }
  60% { transform: translateY(-1.5px) scaleY(1.08); }
  100% { transform: translateY(0) scaleY(1); }
}

/* 곡물 — 내려놓은 쌀포대가 한 번 기운다 */
.ico-grain { transform-origin: 50% 100%; }
.quick a:hover .ico-grain,
.quick a:focus-visible .ico-grain { animation: ico-tilt .8s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes ico-tilt {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-8deg); }
  65% { transform: rotate(5deg); }
}

/* 수산물 — 앞으로 튀어나갔다 돌아오고 꼬리가 뒤따라 흔들린다 */
.quick a:hover .ico-fish,
.quick a:focus-visible .ico-fish { animation: ico-dart .8s cubic-bezier(.34, 1.4, .64, 1) both; }
@keyframes ico-dart {
  0% { transform: translateX(0); }
  35% { transform: translateX(-2.5px); }
  70% { transform: translateX(1.8px); }
  100% { transform: translateX(0); }
}
.ico-tail { transform-origin: 100% 50%; }
.quick a:hover .ico-tail,
.quick a:focus-visible .ico-tail { animation: ico-wag .8s ease-in-out both; }
@keyframes ico-wag {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(13deg); }
  65% { transform: rotate(-9deg); }
}

/* 정육 — 도마에 한 번 놓인다 */
.ico-meat { transform-origin: 50% 60%; }
.quick a:hover .ico-meat,
.quick a:focus-visible .ico-meat { animation: ico-plop .65s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-plop {
  0% { transform: rotate(-9deg) scale(.92); }
  55% { transform: rotate(3deg) scale(1.05); }
  100% { transform: rotate(0) scale(1); }
}

/* 상점 전체 — 가게 문을 여는 것처럼 차양이 펴지고 몸통이 자리를 잡는다 */
.ico-awning { transform-origin: 50% 0%; }
.quick a:hover .ico-awning,
.quick a:focus-visible .ico-awning { animation: ico-unfurl .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-unfurl {
  0% { transform: scaleY(.55); }
  55% { transform: scaleY(1.14); }
  100% { transform: scaleY(1); }
}
.ico-shop { transform-origin: 50% 100%; }
.quick a:hover .ico-shop,
.quick a:focus-visible .ico-shop { animation: ico-settle .7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes ico-settle {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.05, .94); }
}

/* 감속모션을 켠 사용자에게는 아예 움직이지 않는다. 어지럼증·전정기능 장애가
   있는 사용자에게 움직임은 불편이 아니라 증상이다. 정보는 아이콘 모양에
   이미 다 있으므로 움직임을 빼도 잃는 것이 없다. */
@media (prefers-reduced-motion: reduce) {
  .quick__icon [class^="ico-"] { animation: none !important; }
  .quick a:hover .quick__icon,
  .quick a:focus-visible .quick__icon,
  .quick a:active .quick__icon,
  .quick a[aria-current] .quick__icon { transform: none; }
}

/* 실사 타일. 여백 없이 꽉 채우면 둥근 모서리가 그림을 자르는 것처럼 보이므로
   안쪽으로 조금 물린다. */
.quick__img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.quick__label {
  font-size: var(--fs-12); font-weight: 600; color: var(--text-primary);
  text-align: center; letter-spacing: var(--tracking-tight);
  line-height: 1.35;
}

/* ══ 상품 카드 ══════════════════════════════════════════════════════════ */

.pgrid {
  display: grid; gap: var(--space-5) var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.pgrid--tight { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* 가로 진열대의 카드는 폭을 정해 준다. .rail 의 자식은 flex: none 이라 폭을
   안 주면 **사진 원본 크기가 카드 폭이 된다.** 플레이스홀더(400px)일 때는
   티가 안 나다가 실사진(800px)이 들어오자 카드 하나가 화면을 다 덮었다.
   특가·순위 진열대는 각자 폭을 갖고 있어 이 자리만 비어 있었다. */
.rail > .pcard { width: 200px; }

@media (max-width: 520px) {
  .rail > .pcard { width: 158px; }
}

.pcard { position: relative; display: flex; flex-direction: column; }
.pcard__link { display: flex; flex-direction: column; height: 100%; }

.pcard__thumb {
  position: relative; display: block;
  aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-muted);
  border: 1px solid var(--line-soft);
}
.pcard__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.pcard:hover .pcard__thumb img { transform: scale(1.045); }

/* 사진 위 뱃지는 하나만 얹는다. 여러 개를 쌓으면 둥근 모서리와 부딪히고
   사진을 가린다. 모서리 곡률(--r-lg)보다 안쪽으로 넣어야 깨끗하게 떨어진다. */
/* 사진 위 뱃지는 자리를 **고정으로 갈라 둔다.**
   왼쪽 위는 순위(BEST 진열대), 오른쪽 위는 타임딜. 같은 자리에 두면 BEST 에서
   1·2위 숫자가 타임딜 뱃지에 통째로 가려진다 — 실제로 그랬다.
   조건부로 자리를 옮기지 않는다. 진열대마다 뱃지가 다른 곳에 있으면 눈이 헤맨다. */
.pcard__flag {
  position: absolute; right: 10px; top: 10px;
  box-shadow: 0 1px 3px rgba(14, 36, 48, .18);
}
.pcard__rank {
  position: absolute; left: 0; top: 0;
  min-width: 34px; height: 34px; padding: 0 8px;
  background: var(--ink-900); color: #fff;
  font-size: var(--fs-13); font-weight: 800;
  display: grid; place-items: center;
  border-radius: var(--r-lg) 0 var(--r-md) 0;
  font-variant-numeric: tabular-nums;
}
.pcard__rank--top { background: var(--red-700); }

.pcard__soldout {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(14, 36, 48, .58); color: #fff;
  font-size: var(--fs-13); font-weight: 700; letter-spacing: var(--tracking-wide);
}

.pcard__store {
  display: block; margin-top: var(--space-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-top: 3px;
  font-size: var(--fs-14); font-weight: 600; line-height: 1.45;
  letter-spacing: var(--tracking-tight); color: var(--text-primary);
  min-height: calc(1.45em * 2);
}
.pcard__price { margin-top: var(--space-2); }
.pcard__meta {
  margin-top: var(--space-2);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.pcard__origin { font-size: var(--fs-11); color: var(--text-muted); }

/* 카드 안 타임딜 표시 */
/* 사진 위 남은시간. 흰 막을 깔아 어떤 사진 위에서도 숫자가 읽히게 한다.
   흐림(backdrop-filter)만 믿으면 지원하지 않는 브라우저에서 글자가 사라지므로
   불투명도로 먼저 확보하고 흐림은 덤으로 얹는다. */
.pcard__timer {
  position: absolute; left: 8px; top: 8px; z-index: 1;
  display: flex; flex-direction: column; gap: 1px;
  padding: 5px 9px 6px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(3px);
  box-shadow: 0 1px 3px rgba(14, 36, 48, .16);
}
.pcard__timer-label {
  font-size: var(--fs-11); font-weight: 700; color: var(--text-secondary);
  letter-spacing: var(--tracking-tight);
}
.pcard__timer b {
  font-size: var(--fs-13); font-weight: 800; color: var(--red-700);
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}

.pcard__freeship {
  color: var(--shell-700); font-weight: 700;
}

.pcard__deal { margin-top: var(--space-2); }
.pcard__deal-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); margin-bottom: 5px;
  font-size: var(--fs-11); font-weight: 700;
}
.pcard__deal-left { color: var(--red-600); font-variant-numeric: tabular-nums; }
.pcard__deal-right { color: var(--text-muted); }

/* ══ 타임딜 진열대 ══════════════════════════════════════════════════════ */

.dealboard {
  background: linear-gradient(160deg, #FFF6F4 0%, #FDEDEA 100%);
  border: 1px solid var(--red-100);
  border-radius: var(--r-xl);
  padding: var(--space-6);
}
.dealboard__head {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-5); flex-wrap: wrap;
}
.dealboard__head h2 {
  font-size: var(--fs-24); color: var(--red-700);
  letter-spacing: var(--tracking-tight);
}
.dealboard__timer {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--red-700); color: #fff;
  font-size: var(--fs-13); font-weight: 800;
  padding: 6px var(--space-3); border-radius: var(--r-sm);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.dealboard__note { font-size: var(--fs-12); color: var(--red-600); font-weight: 600; }
.dealboard .pcard__thumb { background: #fff; border-color: var(--red-100); }
.dealboard .rail > * { width: 190px; }

/* ══ 랭킹 진열대 ════════════════════════════════════════════════════════ */

.rankrail .rail > * { width: 200px; }

/* ══ 상점 진열 ══════════════════════════════════════════════════════════ */

.store-strip { display: flex; gap: var(--space-3); overflow-x: auto; scrollbar-width: none; }
.store-strip::-webkit-scrollbar { display: none; }
.store-strip li { flex: none; }
.store-strip a {
  display: flex; flex-direction: column; gap: 4px;
  width: 168px; padding: var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.store-strip a:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.store-strip__zone {
  font-size: var(--fs-11); font-weight: 800; color: var(--shell-700);
  letter-spacing: var(--tracking-wide);
}
.store-strip__name {
  font-size: var(--fs-14); font-weight: 700; color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.store-strip__meta { font-size: var(--fs-11); color: var(--text-muted); }

/* 구역 안내 (BUY-004 상점 모아보기). 안내도는 가로로 긴 그림이라 화면 폭에
   맞춰 줄이되, 좁은 화면에서 글자가 뭉개지면 아무 소용이 없으므로 가로
   스크롤을 허용한다 — 축소만 하면 점포 이름을 못 읽는다. */
/* ── 시장 안내도 (발주처 회신 §2-1-2, 최종 요청안) ──────────────────────
 *
 * 대비는 계산해서 골랐다 (과업지시서 §5.2.7 / WCAG AA 4.5:1).
 *   판매중 점포  #2D611D on #E8F7E4  6.64:1
 *   준비중 점포  #4E545C on #EDEFF2  6.64:1
 *   고른 점포    #FFFFFF on #2D611D  7.40:1
 * 브랜드 원색(--shell-500)은 흰 글씨를 얹기에 모자라 면에만 쓴다.
 */
.market-map-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(360px, 1.18fr);
  align-items: center;
  min-height: 360px;
  margin-bottom: var(--space-8);
  overflow: hidden;
  border: 1px solid #dfd1ba;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 12% 18%, rgb(255 255 255 / .72) 0 2px, transparent 3px),
    linear-gradient(135deg, #fffaf0 0%, #f7ecd7 100%);
  box-shadow: 0 18px 45px rgb(86 56 27 / .10);
  isolation: isolate;
}
.market-map-intro::before,
.market-map-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 180px;
  height: 180px;
  border: 1px solid rgb(143 107 61 / .14);
  border-radius: 50%;
}
.market-map-intro::before { left: -100px; top: -85px; }
.market-map-intro::after { left: -65px; top: -50px; }
.market-map-intro__copy { padding: clamp(28px, 5vw, 64px); padding-right: 12px; }
.market-map-intro__eyebrow {
  margin-bottom: var(--space-3);
  color: #8b5a2b;
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: .12em;
}
.market-map-intro h1 {
  max-width: 10.5em;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.14;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.market-map-intro__lead {
  max-width: 34em;
  margin-top: var(--space-4);
  color: var(--text-secondary);
  font-size: var(--fs-14);
  line-height: 1.75;
}
.market-map-intro__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  color: #76583a;
  font-size: var(--fs-12);
}
.market-map-intro__meta b { color: var(--ink-900); font-size: var(--fs-15); }
.market-map-intro__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: var(--space-5);
  padding: 0 18px;
  border-radius: var(--r-full);
  background: var(--ink-900);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 700;
  box-shadow: 0 8px 18px rgb(14 36 48 / .18);
}
.market-map-intro__cta:hover { background: var(--ink-700); }
.market-map-intro__cta span { transition: transform var(--dur-fast) var(--ease-out); }
.market-map-intro__cta:hover span { transform: translateY(3px); }
.market-map-intro__art { align-self: stretch; display: grid; place-items: center; padding: 18px 24px 12px 8px; }
.market-map-intro__art svg { display: block; width: 100%; height: auto; max-height: 390px; }
.mmi-paper { fill: #fbf1db; stroke: #d6c09f; stroke-width: 2; }
.mmi-grain { fill: url(#map-paper-grain); }
.mmi-road {
  fill: none;
  stroke: #e8d9bd;
  stroke-width: 26;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mmi-road--main { stroke: #ddc49c; stroke-width: 34; }
.mmi-stalls rect { stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.mmi-stalls--pink rect { fill: #f3c3bf; stroke: #cf867e; }
.mmi-stalls--yellow rect { fill: #f4d778; stroke: #c9a83e; }
.mmi-stalls--blue rect { fill: #b9dce6; stroke: #78adbd; }
.mmi-stalls--green rect { fill: #b9d994; stroke: #7da855; }
.mmi-tree circle { fill: #9cc95d; stroke: #648a37; stroke-width: 2; }
.mmi-tree path { stroke: #7b5b38; stroke-width: 4; stroke-linecap: round; }
.mmi-pin path { fill: #12746c; stroke: #fffaf0; stroke-width: 5; }
.mmi-pin circle { fill: #fffaf0; }
.mmi-entry { stroke: #8b5a2b; stroke-width: 3; stroke-linecap: round; }
.mmi-label { fill: #714a2d; font-size: 14px; font-weight: 800; }
.mmi-compass circle { fill: rgb(255 250 240 / .82); stroke: #b99d73; stroke-width: 2; }
.mmi-compass path { fill: #8b5a2b; }
.mmi-compass text { fill: #8b5a2b; font-size: 12px; font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  .mmi-stalls rect { animation: map-stall-arrive .55s var(--ease-out) both; }
  .mmi-stalls--yellow rect { animation-delay: .08s; }
  .mmi-stalls--blue rect { animation-delay: .16s; }
  .mmi-stalls--green rect { animation-delay: .24s; }
}
@keyframes map-stall-arrive {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 820px) {
  .market-map-intro { grid-template-columns: 1fr; }
  .market-map-intro__copy { padding: 32px 28px 0; }
  .market-map-intro h1 { max-width: 13em; }
  .market-map-intro__art { min-height: 250px; padding: 0 10px 4px; }
  .market-map-intro__art svg { max-height: 300px; }
}
@media (max-width: 480px) {
  .market-map-intro { min-height: 0; border-radius: var(--r-lg); }
  .market-map-intro__copy { padding: 26px 22px 0; }
  .market-map-intro h1 { font-size: 30px; }
  .market-map-intro__lead { margin-top: var(--space-3); }
  .market-map-intro__art { min-height: 205px; padding-inline: 2px; }
}

.market-map { margin-bottom: var(--space-8); --mm-scale: 1; scroll-margin-top: calc(var(--stick-h) + var(--space-4)); }

/* 실제 구포시장 거리지도 위 상점 마커 */
.market-map--photo {
  padding: clamp(18px, 2.2vw, 30px);
  border: 1px solid #dfd1ba;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #fffaf0 0%, #f6ecd9 100%);
  box-shadow: 0 18px 45px rgb(86 56 27 / .10);
}
.market-map-photo__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: min(100%, 1044px);
  margin: 0 auto var(--space-4);
}
.market-map-photo__eyebrow {
  margin-bottom: var(--space-2);
  color: #805326;
  font-size: var(--fs-12);
  font-weight: 800;
  letter-spacing: .1em;
}
.market-map-photo__head h1 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -.035em;
}
.market-map-photo__head h1 + p {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--fs-14);
}
.market-map-photo__tools {
  margin: 0;
}
.market-map--photo .market-map-photo__tools {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
}
.market-map-photo__tools .mm-tools__search { max-width: none; }
.market-map-photo__layout {
  display: grid;
  grid-template-columns: minmax(0, 700px) 320px;
  gap: var(--space-5);
  align-items: start;
  justify-content: center;
  width: min(100%, 1044px);
  margin-inline: auto;
}
.market-map-photo__canvas {
  position: relative;
  min-width: 0;
}
.market-map-photo__viewport {
  width: 100%;
  aspect-ratio: 300 / 417;
  overflow: auto;
  /* 세로 한 손가락 동작은 페이지 스크롤에 맡긴다. 지도 안에서 시작한
   * 스와이프가 모바일 페이지 전체를 붙잡지 않게 한다. */
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  border: 1px solid #cdbb9e;
  border-radius: var(--r-lg);
  background: #e9dfcd;
  box-shadow: 0 12px 28px rgb(71 48 27 / .14);
  scrollbar-width: thin;
  cursor: grab;
}
.market-map-photo__viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.market-map-photo__stage {
  position: relative;
  width: calc(100% * var(--mm-scale));
  aspect-ratio: 300 / 417;
  overflow: hidden;
  margin-inline: auto;
  background: #e9dfcd;
  transform-origin: top left;
}
.market-map-photo__zoom {
  position: absolute;
  z-index: 8;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgb(99 76 49 / .2);
  border-radius: 999px;
  background: rgb(255 255 255 / .92);
  box-shadow: 0 5px 16px rgb(56 37 18 / .18);
  backdrop-filter: blur(8px);
}
.market-map-photo__zoom button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--fs-13);
  font-weight: 800;
}
.market-map-photo__zoom button:hover,
.market-map-photo__zoom button:focus-visible { background: var(--shell-100); }
.market-map-photo__canvas.is-fullscreen {
  position: fixed;
  z-index: 1000;
  inset: 12px;
  padding: 0;
  border-radius: var(--r-lg);
  background: #e9dfcd;
  box-shadow: 0 20px 80px rgb(0 0 0 / .42);
}
.market-map-photo__canvas.is-fullscreen .market-map-photo__viewport {
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  overscroll-behavior: contain;
  touch-action: none;
}
body.mm-map-lock { overflow: hidden; }
}
.market-map-photo__stage > img,
.market-map-photo__stage > object {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  pointer-events: none;
}
.mm-map-marker {
  position: absolute;
  z-index: 2;
  left: var(--mm-x);
  top: var(--mm-y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 12%;
  background: #146f67;
  color: #fff;
  box-shadow: 0 3px 9px rgb(0 0 0 / .28);
  rotate: -45deg;
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.mm-map-marker__pin {
  rotate: 45deg;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.mm-map-marker__label {
  position: absolute;
  z-index: 3;
  left: var(--mm-label-x);
  top: var(--mm-label-y);
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 150px;
  padding: 6px 9px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-md);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
}
.mm-map-marker:hover,
.mm-map-marker:focus-visible,
.mm-map-marker.is-active {
  z-index: 4;
  transform: translate(-50%, -50%) scale(1.13);
  box-shadow: 0 5px 14px rgb(0 0 0 / .35);
}
.mm-map-marker:hover + .mm-map-marker__label,
.mm-map-marker:focus-visible + .mm-map-marker__label,
.mm-map-marker.is-active + .mm-map-marker__label { opacity: 1; }
.mm-map-marker:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mm-map-marker--preparing { background: #666; border-style: dashed; }
.mm-map-marker.is-dim { opacity: .16; pointer-events: none; }
.market-map-photo__unplaced {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--line-field);
  border-radius: var(--r-md);
  background: rgb(255 255 255 / .65);
  font-size: var(--fs-12);
}
.market-map-photo__unplaced > span { color: var(--text-muted); }
.mm-map-unplaced {
  padding: 5px 9px;
  border: 1px solid var(--shell-500);
  border-radius: var(--r-full);
  background: var(--shell-50);
  color: var(--shell-700);
}
.mm-map-unplaced.is-dim { opacity: .2; pointer-events: none; }
.mm-map-unplaced.is-active { background: var(--shell-700); color: #fff; }
.page-head--stores { margin-top: var(--space-8); }
@media (max-width: 960px) {
  .market-map-photo__head,
  .market-map-photo__layout { grid-template-columns: 1fr; }
  .market-map-photo__stage { width: 100%; }
  .market-map--photo .market-map__detail { position: static; }
}
@media (max-width: 560px) {
  .market-map--photo { padding: 18px 14px; border-radius: var(--r-lg); }
  .market-map-photo__head h1 { font-size: 28px; }
  .market-map-photo__tools .mm-tools__filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .market-map-photo__tools .mm-chip { flex: none; }
  .mm-map-marker { width: 28px; height: 28px; border-width: 2px; }
  .mm-map-marker__pin { font-size: 9px; }
  .mm-map-marker__label { display: none; }
  .market-map-photo__zoom { top: 8px; right: 8px; }
  .market-map-photo__zoom button { min-width: 32px; height: 32px; padding-inline: 8px; }
  .market-map-photo__zoom [data-mm-fullscreen] { display: none; }
}
.market-map__head { margin-bottom: var(--space-3); }

/* ── 조작부 (검색·필터·크기) ─────────────────────────────────────────
 * 스크립트가 hidden 을 걷어야 보인다. 눌러도 아무 일 없는 단추를 남겨 두는
 * 것이 없는 것보다 나쁘다. */
.market-map__tools {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  align-items: center; margin-bottom: var(--space-3);
}
/* 넓은 화면에서는 자리를 못박는다. flex 에 맡기면 분류 상자가 한 칸 모자라
   다음 줄로 떨어지고, 조작부만 두 줄이 되어 지도가 그만큼 아래로 밀린다. */
@media (min-width: 760px) {
  .market-map__tools {
    display: grid; grid-template-columns: minmax(200px, 320px) 1fr auto;
  }
}
/* 검색창이 남는 자리를 다 먹으면 거르개가 아래로 밀려 조작부가 두 줄이 된다.
   좁은 화면에서는 어차피 접히므로, 넓을 때만 폭을 묶어 둔다. */
.mm-tools__search {
  display: flex; align-items: center; gap: var(--space-2);
  flex: 1 1 200px; max-width: 340px;
}
.mm-tools__search input {
  flex: 1 1 auto; min-width: 0;
  /* 휴대폰에서 16px 미만이면 입력할 때 화면이 확대된다. 확대되면 지도가 밀려
     나가고 손님은 손으로 되돌려야 한다. */
  font-size: var(--fs-15); padding: 8px 12px;
  border: 1px solid var(--line-field); border-radius: var(--r-md);
  background: var(--bg-surface); color: var(--text-primary);
}
.mm-tools__search input:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 1px; }
.mm-tools__count { font-size: var(--fs-12); color: var(--text-secondary); white-space: nowrap; }

.mm-tools__filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mm-chip, .mm-zoombtn, .mm-select {
  font-size: var(--fs-12); font-weight: 600; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer;
  /* 손가락으로 누를 수 있는 최소 크기. 이보다 작으면 옆 단추가 눌린다. */
  min-height: 34px; padding: 0 14px;
}
.mm-chip:hover, .mm-zoombtn:hover { border-color: var(--line-strong); }
.mm-chip.is-on {
  background: var(--shell-700); border-color: var(--shell-700); color: var(--n-0);
}
/* select 는 기본 너비가 브라우저마다 다르고, 긴 분류 이름 하나에 조작부가
   통째로 늘어난다. 폭을 묶고 넘치는 이름은 자른다. */
.mm-select {
  border-radius: var(--r-md); padding: 0 10px;
  max-width: 150px; text-overflow: ellipsis;
}
/* 오른쪽 끝으로 미는 것은 자리가 있을 때만이다. 좁은 화면에서 밀면 단추가
   화면 밖으로 나가고, 페이지가 통째로 가로로 밀린다. */
.mm-tools__zoom { display: flex; gap: 4px; }
@media (min-width: 760px) { .mm-tools__zoom { margin-left: auto; } }
.mm-zoombtn { min-width: 34px; padding: 0 10px; font-size: var(--fs-14); }
.market-map__title { font-size: var(--fs-15); }
.market-map__hint { font-size: var(--fs-12); color: var(--text-muted); margin-top: 4px; }

/* 안내도와 상세칸을 나란히. 좁은 화면에서는 상세가 안내도 아래로 내려간다 —
   옆으로 밀면 점포 칸이 손가락보다 작아진다. */
.market-map__body { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 900px) {
  .market-map__body { grid-template-columns: minmax(0, 1fr) 280px; }
}

/* 시장 울타리. 구역 블록을 이 안에 넣어야 목록이 아니라 배치도로 읽힌다.
 *
 * ``min-width: 0`` 이 없으면 그리드 칸이 **내용보다 작아지지 못한다**(기본값이
 * auto 다). 안내도는 확대하면 화면보다 넓어지도록 만든 것이라, 그 넓이가 그대로
 * 울타리를 밀어 페이지 전체가 가로로 흔들린다. 좁은 화면에서 14px 넘쳤다.
 * 넘치는 것은 안쪽 viewport 안에서만 일어나야 한다. */
.market-map__frame {
  background: var(--bg-page); border: 2px solid var(--line-strong);
  border-radius: var(--r-lg); padding: var(--space-3);
  min-width: 0;
}
/* 확대하면 안내도가 화면보다 넓어진다. 그때 가로로 밀어 볼 수 있어야 한다.
   페이지 전체가 가로로 밀리는 것과 다르다 — 그쪽은 머리글까지 따라 나간다. */
.market-map__viewport { overflow-x: auto; overscroll-behavior-x: contain; }
/* 칸 수는 서버가 정해 준다 (--mm-cols). 구역 블록이 좁아질 수 있는 한계를
   두어, 그보다 좁아지면 칸을 줄이는 대신 안쪽에서 가로로 밀리게 한다 —
   칸 수가 바뀌면 정해 둔 자리가 어긋나기 때문이다. */
.market-map__plan {
  display: grid; gap: var(--space-3);
  grid-template-columns:
    repeat(var(--mm-cols, 2), minmax(calc(150px * var(--mm-scale)), 1fr));
}
/* 입구 — 울타리 아래쪽이 트여 있다는 표시. 배치도의 기준점 노릇을 한다. */
.market-map__entrance {
  margin: var(--space-3) auto 0; width: fit-content;
  padding: 4px 16px; border-radius: 999px;
  background: var(--bg-surface); border: 1px dashed var(--line-field);
  font-size: var(--fs-11); font-weight: 700; color: var(--text-secondary);
}

.mm-zone {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-3);
}
.mm-zone--unzoned { background: var(--bg-page); }
.mm-zone__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-2); margin-bottom: var(--space-2);
}
.mm-zone__code { font-size: var(--fs-13); font-weight: 700; color: var(--n-700); }
.mm-zone__count { font-size: var(--fs-11); color: var(--text-muted); }
.mm-zone__note {
  font-size: var(--fs-11); color: var(--text-secondary);
  margin: -4px 0 var(--space-2);
}

/* 걸러진 것. 지우지 않고 흐린다 — 지우면 지도의 모양이 바뀌어, 손님이 방금
   보던 배치를 다시 읽어야 한다. 지도는 모양이 그대로여야 지도다.
 *
 * **누를 수는 없게 한다.** 흐린 채로 눌리면 글자 대비가 모자란 링크가 되고
 * (WCAG AA 미달), 거른 결과가 아닌 것을 눌러 엉뚱한 상점으로 가게 된다.
 * 탭 순서에서 빼는 것은 스크립트가 함께 한다. */
.mm-booth.is-dim { opacity: 0.3; pointer-events: none; }
.mm-zone.is-dim { opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .mm-booth, .mm-zone { transition: opacity var(--dur-fast) var(--ease-out); }
}

/* 두 줄이 마주 보고 그 사이가 통로다.
 *
 * 처음에는 여백만 두었는데, 화면에서는 점포 칩이 그냥 줄바꿈된 것으로 보였다.
 * 통로에 선을 그어야 "마주 본다" 가 읽힌다 — 그것이 시장 골목의 생김새다. */
.mm-zone__alley { display: flex; flex-direction: column; }
.mm-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0; margin: 0;
}
.mm-row + .mm-row {
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px dashed var(--line-strong);
}

.mm-booth {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-width: calc(52px * var(--mm-scale)); min-height: calc(52px * var(--mm-scale));
  padding: 6px 8px; font-size: calc(1em * var(--mm-scale));
  background: var(--shell-50); border: 1px solid var(--shell-500);
  border-radius: var(--r-md); text-align: center;
  color: var(--shell-700); text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.mm-booth__no { font-size: var(--fs-13); font-weight: 700; line-height: 1.2; }
/* 상호는 칸 안에서 넘치지 않게 자른다. 전체 이름은 상세칸이 보여 준다. */
.mm-booth__name {
  font-size: var(--fs-11); line-height: 1.3; max-width: 88px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-booth:hover, .mm-booth:focus-visible {
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.mm-booth.is-active {
  background: var(--shell-700); border-color: var(--shell-700); color: var(--n-0);
}

/* 승인은 났지만 아직 상품이 없는 상점 (회신 §9-3). 색만으로 가르지 않는다 —
   점선 테두리를 함께 둬야 색을 구별하지 못하는 이용자도 알아본다. */
.mm-booth--preparing {
  background: var(--bg-muted); border-style: dashed; border-color: var(--line-field);
  color: var(--n-600);
}
.mm-booth--preparing .mm-booth__no { color: var(--text-muted); }
.mm-booth--preparing.is-active {
  background: var(--n-700); border-color: var(--n-700); color: var(--n-0);
}
.mm-booth--preparing.is-active .mm-booth__no { color: var(--n-0); }

.market-map__detail {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4);
  position: relative;
}
@media (min-width: 900px) { .market-map__detail { position: sticky; top: var(--space-4); } }

.mm-detail__close {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-surface);
  color: var(--text-secondary); font-size: var(--fs-17); line-height: 1;
  cursor: pointer;
}
.mm-detail__close:hover { border-color: var(--line-strong); }
/* 넓은 화면에서는 상세칸이 늘 떠 있어 닫을 이유가 없다. 닫기는 좁은 화면에서
   시트가 지도를 가릴 때 필요하다. */
@media (min-width: 900px) { .mm-detail__close { display: none; } }

/* ── 좁은 화면: 상세를 아래에서 올라오는 시트로 ──────────────────────
 *
 * 옆칸으로 두면 지도가 손가락보다 작아지고, 지도 아래에 두면 점포를 누를
 * 때마다 화면이 튄다. 시트는 지도를 그 자리에 두고 정보만 덮는다.
 *
 * 고른 것이 없을 때는 시트를 띄우지 않는다 (has-selection). 빈 시트가 화면
 * 아래를 늘 차지하면 상점 목록을 볼 자리가 그만큼 줄어든다. */
@media (max-width: 899px) {
  .market-map.has-selection .market-map__detail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0; box-shadow: 0 -8px 24px rgb(0 0 0 / 0.14);
    max-height: 62vh; overflow-y: auto;
    /* 홈 표시줄이 있는 기기에서 단추가 그 아래로 깔리지 않게. */
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
  .market-map.has-selection .mm-detail__empty { display: none; }
}

.mm-detail__empty-title { font-weight: 700; margin-bottom: 4px; }
.mm-detail__empty p { font-size: var(--fs-13); color: var(--text-muted); line-height: 1.7; }
.mm-legend {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  list-style: none; padding: 0; margin: var(--space-3) 0 0;
  font-size: var(--fs-12); color: var(--text-secondary);
}
.mm-legend li { display: flex; align-items: center; gap: 6px; }
.mm-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.mm-swatch--open { background: var(--shell-50); border: 1px solid var(--shell-500); }
.mm-swatch--preparing { background: var(--bg-muted); border: 1px dashed var(--line-field); }

.mm-detail__where { font-size: var(--fs-11); font-weight: 700; color: var(--shell-700); }
.mm-detail__name {
  font-size: var(--fs-17); font-weight: 700; letter-spacing: var(--tracking-tight);
  margin-top: 2px;
}
.mm-detail__intro {
  font-size: var(--fs-13); color: var(--text-secondary); line-height: 1.7;
  margin-top: var(--space-2);
}
.mm-detail__facts { margin: var(--space-3) 0 0; font-size: var(--fs-12); }
.mm-detail__facts > div {
  display: flex; gap: var(--space-2); padding: 4px 0;
  border-top: 1px solid var(--line-soft);
}
.mm-detail__facts dt { color: var(--text-muted); flex: none; min-width: 56px; }
.mm-detail__facts dd { margin: 0; color: var(--text-primary); }
.mm-detail__badges { margin-top: var(--space-2); font-size: var(--fs-11); color: var(--status-ok); }
.mm-detail__card .btn { margin-top: var(--space-3); width: 100%; }

.market-map__figure { margin: var(--space-4) 0 0; overflow-x: auto; }
.market-map__figure img {
  display: block; max-width: 100%; height: auto; min-width: 320px;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.market-map__figure figcaption {
  font-size: var(--fs-12); color: var(--text-muted); margin-top: var(--space-2);
}
.store-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.store-card {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.store-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.store-card__name { font-size: var(--fs-17); font-weight: 700; letter-spacing: var(--tracking-tight); }
.store-card__intro {
  font-size: var(--fs-13); color: var(--text-secondary); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.store-card__foot { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-2); }

/* 상점 헤더 (BUY-004) */
.store-hero {
  background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-700) 100%);
  color: #fff; border-radius: var(--r-xl);
  padding: var(--space-8); margin-bottom: var(--space-8);
}
.store-hero h1 { font-size: var(--fs-28); letter-spacing: var(--tracking-tighter); }
.store-hero__meta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); font-size: var(--fs-13); color: var(--ink-300); }
.store-hero__intro { margin-top: var(--space-4); color: rgba(255,255,255,.88); font-size: var(--fs-14); line-height: 1.75; max-width: 62ch; }

/* ══ 상품 상세 BUY-003 ══════════════════════════════════════════════════ */

.pdp { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 5fr) minmax(340px, 4fr); gap: var(--space-10); align-items: start; }
}
.pdp__gallery {
  --pdp-media-max: 820px;
  position: relative;
  display: grid;
  justify-items: center;
}
.pdp__figure {
  width: 100%;
  max-width: var(--pdp-media-max);
  aspect-ratio: 1 / 1; border-radius: var(--r-xl); overflow: hidden;
  background: var(--bg-muted); border: 1px solid var(--line);
}
.pdp__figure img { width: 100%; height: 100%; object-fit: cover; }

.pdp__aside { position: sticky; top: calc(var(--stick-h) + var(--space-4)); }
.pdp__store {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-13); font-weight: 600; color: var(--shell-700);
}
.pdp__title {
  font-size: var(--fs-28); margin-top: var(--space-2);
  letter-spacing: var(--tracking-tighter); line-height: 1.3;
}
.pdp__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-3); }
.pdp__price { margin-top: var(--space-5); }
.pdp__deal {
  margin-top: var(--space-4); padding: var(--space-4);
  background: #FFF6F4; border: 1px solid var(--red-100);
  border-radius: var(--r-md);
}
.pdp__deal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-2);
  font-size: var(--fs-13); font-weight: 800; color: var(--red-700);
}
.pdp__spec { margin-top: var(--space-5); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.pdp__spec > div { display: flex; gap: var(--space-4); padding: 7px 0; font-size: var(--fs-13); }
.pdp__spec dt { width: 88px; flex: none; color: var(--text-muted); }
.pdp__spec dd { margin: 0; color: var(--text-primary); font-weight: 500; }

.sku-list { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.sku {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  cursor: pointer; background: var(--bg-surface);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.sku:hover { border-color: var(--n-400); }
.sku input { flex: none; margin: 0; width: 18px; height: 18px; min-height: 0; accent-color: var(--ink-800); }
.sku:has(input:checked) { border-color: var(--ink-900); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--ink-900); }
.sku__name { flex: 1; font-size: var(--fs-14); font-weight: 600; }
.sku__price { font-weight: 700; font-variant-numeric: tabular-nums; }
.sku__before { font-size: var(--fs-12); color: var(--text-muted); text-decoration: line-through; margin-right: 5px; }
.sku--out { opacity: .5; cursor: not-allowed; }

/* 상세설명은 이제 서식이 붙은 HTML 이다 (발주처 회신 §9-1).
   pre-line 을 걷어냈다 — 문단이 <p> 로 오는데 pre-line 까지 걸면 태그
   사이의 줄바꿈이 빈 줄로 한 번 더 그려져 문단마다 간격이 두 배가 된다. */
.pdp__desc {
  margin-top: var(--space-10); padding-top: var(--space-8);
  border-top: 1px solid var(--line);
  font-size: var(--fs-15); line-height: 1.9; color: var(--text-secondary);
  max-width: 74ch;
}
.pdp__desc p { margin: 0 0 var(--space-4); }
.pdp__desc p:last-child { margin-bottom: 0; }
.pdp__desc ul, .pdp__desc ol { margin: 0 0 var(--space-4); padding-left: 1.4em; }
.pdp__desc li { margin-bottom: var(--space-1); }

/* 상인이 고른 서식. 크기를 px 로 받지 않고 이름으로 받는 이유는
   apps/catalog/richtext.py 의 ALLOWED_CLASSES 주석에 있다. */
.rt-lg { font-size: 1.25em; }
.rt-sm { font-size: .875em; }
.rt-left { text-align: left; }
.rt-center { text-align: center; }
.rt-right { text-align: right; }
.pdp__detail-images {
  display: grid;
  gap: var(--space-4);
  max-width: 820px;
  margin: var(--space-8) auto 0;
  justify-items: center;
}
.pdp__detail-images img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.pdp__detail-images + .spec-table { margin-top: var(--space-8); }

/* ══ 장바구니 BUY-005 ═══════════════════════════════════════════════════ */

.cart { display: grid; gap: var(--space-6); }
@media (min-width: 960px) {
  .cart { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
.cart-store {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--space-4);
}
.cart-store__head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-muted); border-bottom: 1px solid var(--line);
  font-size: var(--fs-13); font-weight: 700;
}
.cart-store__ship { margin-left: auto; font-weight: 600; color: var(--shell-700); font-size: var(--fs-12); }
.cart-line {
  display: grid; gap: var(--space-3);
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  padding: var(--space-4); border-bottom: 1px solid var(--line-soft);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line__thumb { width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden; background: var(--bg-muted); }
.cart-line__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__name { font-size: var(--fs-14); font-weight: 600; line-height: 1.45; }
.cart-line__opt { font-size: var(--fs-12); color: var(--text-muted); margin-top: 2px; }
.cart-line__ctrl { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.cart-line__side { text-align: right; display: grid; gap: var(--space-2); justify-items: end; }
.cart-line__total { font-size: var(--fs-15); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-tight); }
.cart-line__save { font-size: var(--fs-11); color: var(--red-600); font-weight: 700; }

@media (max-width: 560px) {
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); }
  .cart-line__thumb { width: 64px; height: 64px; }
  .cart-line__side { grid-column: 1 / -1; justify-items: stretch; text-align: left; }
}

.summary {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-5);
  position: sticky; top: calc(var(--stick-h) + var(--space-4));
}
.summary h2 { font-size: var(--fs-15); margin-bottom: var(--space-4); }

/* ══ 결제 BUY-006 ═══════════════════════════════════════════════════════ */

.checkout { display: grid; gap: var(--space-6); }
@media (min-width: 960px) {
  .checkout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}
.checkout__group { margin-bottom: var(--space-6); }
.checkout__group h2 {
  font-size: var(--fs-17); margin-bottom: var(--space-4);
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--line);
}
.method-picker { display: grid; gap: var(--space-2); grid-template-columns: 1fr 1fr; }
.method {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--space-4); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); cursor: pointer; background: var(--bg-surface);
}
.method:has(input:checked) { border-color: var(--ink-900); box-shadow: inset 0 0 0 1px var(--ink-900); }
.method__title { font-size: var(--fs-14); font-weight: 700; }
.method__desc { font-size: var(--fs-12); color: var(--text-muted); line-height: 1.6; }
.method input { position: absolute; opacity: 0; pointer-events: none; }

/* ══ 주문 완료 · 내역 BUY-007~009 ═══════════════════════════════════════ */

.done { text-align: center; padding: var(--space-16) 0; }
.done__mark {
  width: 72px; height: 72px; margin: 0 auto var(--space-5);
  border-radius: 50%; background: var(--green-50); color: var(--green-700);
  display: grid; place-items: center;
}
.done__mark svg { width: 34px; height: 34px; }
.done h1 { font-size: var(--fs-28); }
.done__no {
  display: inline-block; margin-top: var(--space-4);
  background: var(--bg-muted); border-radius: var(--r-sm);
  padding: 8px var(--space-4); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}

.order-card {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--space-4);
}
.order-card__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border-bottom: 1px solid var(--line-soft);
  background: var(--bg-raised); flex-wrap: wrap;
}
.order-card__no { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.order-card__date { font-size: var(--fs-12); color: var(--text-muted); }
.order-card__body { padding: var(--space-4); }
.order-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.sub-order {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4); margin-bottom: var(--space-3);
}
.sub-order__head {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-3); flex-wrap: wrap;
}
.sub-order__no { font-size: var(--fs-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.oline { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; }
.oline__thumb { width: 52px; height: 52px; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-muted); flex: none; }
.oline__thumb img { width: 100%; height: 100%; object-fit: cover; }
.oline__name { font-size: var(--fs-13); font-weight: 600; }
.oline__meta { font-size: var(--fs-12); color: var(--text-muted); }
.oline__amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.oline--canceled .oline__name { text-decoration: line-through; color: var(--text-muted); }

/* 진행 단계 */
.steps { display: flex; gap: 0; margin: var(--space-5) 0; }
.steps li { flex: 1; text-align: center; position: relative; font-size: var(--fs-12); color: var(--text-muted); }
.steps li::before {
  content: ""; display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--line-strong); margin: 0 auto var(--space-2); position: relative; z-index: 1;
}
.steps li::after {
  content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong);
}
.steps li:first-child::after { display: none; }
.steps li.is-done { color: var(--text-primary); font-weight: 600; }
.steps li.is-done::before { background: var(--ink-900); }
.steps li.is-done::after { background: var(--ink-900); }

/* ══ 픽업 · 배송 조회 BUY-011~012 ═══════════════════════════════════════ */

.pickup-code {
  text-align: center; padding: var(--space-8);
  background: var(--ink-900); color: #fff; border-radius: var(--r-xl);
}
.pickup-code__label { font-size: var(--fs-12); color: var(--ink-300); letter-spacing: var(--tracking-wide); }
.pickup-code__value {
  font-size: var(--fs-42); font-weight: 800; letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums; margin-top: var(--space-2);
}
.pickup-code__note { font-size: var(--fs-12); color: var(--ink-300); margin-top: var(--space-3); line-height: 1.7; }

/* ══ 로그인 · 가입 BUY-013~014 ══════════════════════════════════════════ */

.auth { max-width: 400px; margin: var(--space-12) auto; }
.auth__head { text-align: center; margin-bottom: var(--space-8); }
.auth__head h1 { font-size: var(--fs-24); }
.auth__head p { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--fs-13); }
.auth__foot {
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--line); text-align: center;
  font-size: var(--fs-13); color: var(--text-secondary);
}

/* ══ 마이페이지 BUY-015 ═════════════════════════════════════════════════ */

.my-head {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-6); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: var(--space-6);
}
.my-head__avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: var(--ink-900); color: var(--yellow-400);
  display: grid; place-items: center; font-size: var(--fs-20); font-weight: 800;
}
/* 역할 표시. 브랜드 노랑 위 검정 글씨다 — 흰 글씨는 노랑 위에서 대비가
   4.5:1 에 한참 못 미친다 (docs/BI.md 팔레트 대비표). */
.role-badge {
  display: inline-block; vertical-align: middle; margin-left: var(--space-2);
  padding: 3px 8px; border-radius: 999px;
  background: var(--yellow-400); color: var(--ink-900);
  font-size: var(--fs-12); font-weight: 700; line-height: 1.5;
  white-space: nowrap;
}

.my-menu { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.my-menu a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: var(--fs-14); font-weight: 600;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.my-menu a:hover { border-color: var(--line-strong); }

/* ══ 시장 이야기 BUY-016 ════════════════════════════════════════════════ */

.story__hero {
  background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
  color: #fff; border-radius: var(--r-xl);
  padding: var(--space-16) var(--space-8); text-align: center;
  margin-bottom: var(--space-10);
}
.story__hero h1 { font-size: var(--fs-34); letter-spacing: var(--tracking-tighter); }
.story__hero p { margin-top: var(--space-4); color: rgba(255,255,255,.85); font-size: var(--fs-15); line-height: 1.85; max-width: 56ch; margin-inline: auto; }
.story__body { max-width: 68ch; margin-inline: auto; font-size: var(--fs-15); line-height: 1.95; color: var(--text-secondary); }
.story__body h2 { font-size: var(--fs-20); color: var(--text-primary); margin: var(--space-10) 0 var(--space-4); }
.story__body p + p { margin-top: var(--space-4); }
.story__figures { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: var(--space-8) 0; }
.story__fig {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-5); text-align: center;
}
.story__fig b { display: block; font-size: var(--fs-28); font-weight: 800; letter-spacing: var(--tracking-tighter); color: var(--ink-900); }
.story__fig span { font-size: var(--fs-12); color: var(--text-muted); }

/* ══ 검색 BUY-002 ═══════════════════════════════════════════════════════ */

.searchbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5);
}
.searchbar__count { font-size: var(--fs-13); color: var(--text-secondary); }
.searchbar__count b { color: var(--text-primary); font-weight: 800; }
.filters { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }

/* ══ 푸터 ═══════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--ink-900); color: var(--ink-300);
  margin-top: var(--space-20);
  padding: var(--space-12) 0 calc(var(--space-10) + var(--bottom-nav-h));
  font-size: var(--fs-12); line-height: 1.9;
}
@media (min-width: 861px) {
  .site-footer { padding-bottom: var(--space-10); }
}
.site-footer__inner { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-pad); }
.site-footer__top {
  display: flex; gap: var(--space-8) var(--space-10); flex-wrap: wrap;
  padding-bottom: var(--space-8); border-bottom: 1px solid var(--ink-700);
}
.site-footer__brand { flex: 1 1 240px; }
.site-footer__brand .brand__word { color: #fff; }
.site-footer__brand p { margin-top: var(--space-3); color: var(--ink-300); max-width: 40ch; }
.site-footer nav { display: flex; gap: var(--space-10); flex-wrap: wrap; }
.site-footer nav h3 { font-size: var(--fs-12); color: #fff; margin-bottom: var(--space-3); letter-spacing: var(--tracking-wide); }
.site-footer nav a { display: block; color: var(--ink-300); padding: 2px 0; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.site-footer__legal { padding-top: var(--space-6); }
.site-footer__legal dl { display: flex; gap: var(--space-2) var(--space-5); flex-wrap: wrap; }
.site-footer__legal dt { color: var(--ink-300); opacity: .75; }
.site-footer__legal dd { margin: 0; color: var(--ink-300); }
.site-footer__copy { margin-top: var(--space-5); color: var(--ink-300); opacity: .7; }
.site-footer__note {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--ink-800); border-radius: var(--r-sm);
  color: var(--ink-300); font-size: var(--fs-11); line-height: 1.8;
}

/* ══ 떠 있는 버튼 ═══════════════════════════════════════════════════════ */

.fab {
  position: fixed; right: var(--space-5); z-index: 25;
  bottom: calc(var(--bottom-nav-h) + var(--space-4));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-surface); color: var(--text-secondary);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
  display: grid; place-items: center; cursor: pointer;
}
.fab:hover { color: var(--text-primary); border-color: var(--n-400); }
@media (min-width: 861px) { .fab { bottom: var(--space-6); } }

/* ══ 모바일 하단 네비 ═══════════════════════════════════════════════════ */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 28;
  display: none;
  background: var(--bg-surface); border-top: 1px solid var(--line);
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  letter-spacing: var(--tracking-tight);
}
.bottom-nav a[aria-current="page"] { color: var(--ink-900); }
.bottom-nav__icon { display: grid; place-items: center; height: 22px; position: relative; }
.bottom-nav__count {
  position: absolute; top: -3px; right: -8px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--red-600); color: #fff; border-radius: var(--r-full);
  font-size: 9px; font-weight: 800; display: grid; place-items: center;
}

@media (max-width: 860px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: var(--bottom-nav-h); }
  .cta-bar { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .has-cta { padding-bottom: calc(var(--cta-h) + var(--bottom-nav-h) + var(--space-6)); }
  .app-header__inner { gap: var(--space-3); flex-wrap: wrap; padding-block: var(--space-2); }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search input { height: 42px; min-height: 42px; }
  .search button { width: 34px; height: 34px; }
  .header-util__text { display: none; }
  .catnav a { font-size: var(--fs-14); }
  .section { margin-top: var(--space-10); }
  .section__head h2 { font-size: var(--fs-20); }
  .dealboard { padding: var(--space-4); border-radius: var(--r-lg); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-4) var(--space-3); }
  /* 좁은 화면은 한 줄에 넷. .quick 이 flex 라 grid-template-columns 는 듣지
     않으므로 칸 폭으로 지정한다. 열 사이 간격이 8px 씩 3 군데이므로
     한 칸은 25% - 6px 이다. max-width 를 같이 잠가야 타일이 하나뿐일 때
     그 하나가 줄 전체로 늘어나지 않는다. */
  .quick > li { flex-basis: calc(25% - 6px); max-width: calc(25% - 6px); }
  .quick__icon { width: 54px; height: 54px; }
}

/* ══ 페이지 머리 ════════════════════════════════════════════════════════ */

.page-head { margin-bottom: var(--space-6); }
.page-head h1 { font-size: var(--fs-28); letter-spacing: var(--tracking-tighter); }
.page-head__sub { margin-top: var(--space-2); color: var(--text-secondary); font-size: var(--fs-14); }
.page-head__sub b { color: var(--text-primary); font-weight: 800; }

.breadcrumb { display: flex; gap: 6px; font-size: var(--fs-12); color: var(--text-muted); margin-bottom: var(--space-3); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }

.empty-action { margin-top: var(--space-5); text-align: center; }
.text-success { color: var(--status-ok); font-weight: 700; }
.text-price { color: var(--text-price); font-weight: 700; }

/* 상품 상세의 담기 폼이 CTA 바에 걸쳐 있어 여백을 따로 준다. */
.buybox { margin-top: var(--space-6); }
.buybox__qty { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.buybox__qty > span { font-size: var(--fs-13); font-weight: 600; }
.buybox__total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.buybox__total > span { font-size: var(--fs-14); font-weight: 700; }
.buybox__total b { font-size: var(--fs-24); font-weight: 800; color: var(--text-price); letter-spacing: var(--tracking-tighter); }

/* ══ 시장 이야기 BUY-016 ════════════════════════════════════════════════ */

.story { max-width: 74ch; margin-inline: auto; }

.story__head {
  background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-700) 100%);
  color: #fff; border-radius: var(--r-xl);
  padding: var(--space-12) var(--space-8);
  margin-bottom: var(--space-12);
}
.story__eyebrow {
  font-size: var(--fs-12); font-weight: 700;
  letter-spacing: var(--tracking-wide); color: var(--yellow-300);
}
.story__head h1 {
  font-size: var(--fs-34); margin-top: var(--space-3);
  letter-spacing: var(--tracking-tighter);
}
.story__lead {
  margin-top: var(--space-5); font-size: var(--fs-15);
  line-height: 1.95; color: rgba(255, 255, 255, .88);
}

.story__figure {
  margin: calc(-1 * var(--space-5)) 0 var(--space-12);
}
.story__figure img {
  display: block; width: 100%;
  aspect-ratio: 16 / 8.5; object-fit: cover;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.story__figure figcaption {
  margin-top: var(--space-3);
  color: var(--text-muted); font-size: var(--fs-12);
  line-height: 1.7; text-align: center;
}

/* 연표 — 왼쪽 세로선에 연도를 걸어 둔다. */
.chron { position: relative; padding-left: var(--space-10); }
.chron::before {
  content: ""; position: absolute; left: 76px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.chron li {
  position: relative; display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-6); padding-bottom: var(--space-8);
}
.chron li::before {
  content: ""; position: absolute; left: -34px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--yellow-500); border: 2px solid var(--bg-page);
  z-index: 1;
}
.chron__year {
  font-size: var(--fs-13); font-weight: 800; color: var(--text-muted);
  text-align: right; font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight); padding-top: 2px;
}
.chron b { display: block; font-size: var(--fs-17); letter-spacing: var(--tracking-tight); }
.chron p { margin-top: 6px; color: var(--text-secondary); line-height: 1.85; }

@media (max-width: 640px) {
  .chron { padding-left: var(--space-6); }
  .chron::before { left: 46px; }
  .chron li { grid-template-columns: 42px minmax(0, 1fr); gap: var(--space-4); }
  .chron li::before { left: -20px; }
  .story__head { padding: var(--space-8) var(--space-5); }
  .story__head h1 { font-size: var(--fs-28); }
  .story__figure {
    margin-top: calc(-1 * var(--space-7));
    margin-bottom: var(--space-10);
  }
  .story__figure img { aspect-ratio: 4 / 3; }
}

.story__now, .story__why {
  margin-top: var(--space-12); padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}
.story__now h2, .story__why h2 {
  font-size: var(--fs-24); letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}
.story__now p, .story__why p { color: var(--text-secondary); line-height: 1.9; font-size: var(--fs-15); }
.story__why p + p { margin-top: var(--space-4); }

.story__stats {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: var(--space-6);
}
.story__stats li {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-5); text-align: center;
}
.story__stats b {
  display: block; font-size: var(--fs-28); font-weight: 800;
  color: var(--ink-900); letter-spacing: var(--tracking-tighter);
  font-variant-numeric: tabular-nums;
}
.story__stats span { font-size: var(--fs-12); color: var(--text-muted); }

/* 처리 흐름 — 나루가 하던 일을 그대로 옮겼다는 설명의 그림 */
.story__flow {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; margin-top: var(--space-6);
  color: var(--text-muted); font-size: var(--fs-12);
}
.story__flow span {
  background: var(--bg-surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-full); padding: 7px var(--space-4);
  font-size: var(--fs-13); font-weight: 700; color: var(--text-primary);
}

/* ══ 탐색 (검색·카테고리) BUY-002 ═══════════════════════════════════════
   대형 오픈마켓 수준의 밀도로 간다. 왼쪽에 필터를 고정하고 오른쪽은
   결과에만 쓴다. 필터가 접혀 있으면 아무도 안 쓴다 — 펼쳐 둔다.
   ══════════════════════════════════════════════════════════════════════ */

.browse { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 900px) {
  .browse { grid-template-columns: 212px minmax(0, 1fr); gap: var(--space-8); }
}

/* 그리드 칸은 min-width:0 이 없으면 내용이 넘칠 때 칸 자체가 늘어난다. */
.browse__results { min-width: 0; }

/* ── 필터 ─────────────────────────────────────────────────────────────── */

.filters-panel {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4);
}

/* 여는 손잡이. 넓은 화면에서는 필터가 늘 보이므로 손잡이가 필요 없다. */
.filters-panel__toggle {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 32px; cursor: pointer;
  font-size: var(--fs-14); font-weight: 700;
  list-style: none;                    /* 기본 삼각형 제거 (Firefox) */
}
.filters-panel__toggle::-webkit-details-marker { display: none; }
.filters-panel__toggle::after {
  content: ""; margin-left: auto;
  width: 9px; height: 9px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--dur-fast) var(--ease-out);
}
.filters-panel[open] .filters-panel__toggle::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.filters-panel[open] .filters-panel__toggle { margin-bottom: var(--space-4); }

/* 접혀 있어도 필터가 걸려 있다는 것은 알아야 한다. */
.filters-panel__count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--ink-900); color: #fff;
  font-size: var(--fs-11); font-weight: 800;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .filters-panel { position: sticky; top: calc(var(--stick-h) + var(--space-4)); }
  /* 넓은 화면에서는 늘 펼쳐 둔다. 손잡이를 숨기되 details 는 열린 채로 두므로
     스크립트가 없어도 내용이 보인다. */
  .filters-panel__toggle { display: none; }
}

.fgroup { padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--line-soft); }
.fgroup:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.fgroup h2 {
  font-size: var(--fs-12); font-weight: 800; color: var(--text-muted);
  letter-spacing: var(--tracking-wide); margin-bottom: var(--space-3);
}
.fgroup--actions { display: grid; gap: var(--space-2); }

.flist { display: grid; gap: 2px; }

.fopt {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 8px; border-radius: var(--r-sm);
  font-size: var(--fs-13); color: var(--text-secondary);
  cursor: pointer; line-height: 1.5;
}
.fopt:hover { background: var(--bg-muted); color: var(--text-primary); }
.fopt input { width: 15px; height: 15px; min-height: 0; margin: 0; flex: none; accent-color: var(--ink-800); }
.fopt:has(input:checked) { color: var(--text-primary); font-weight: 700; }

/* 링크형 선택지 — 자바스크립트 없이 동작해야 한다. */
.fopt--link { text-decoration: none; }
.fopt--link[aria-current="true"] {
  background: var(--ink-900); color: #fff; font-weight: 700;
}

.frange {
  display: flex; align-items: center; gap: 6px; margin-top: var(--space-3);
}
.frange input { min-height: 36px; padding: 6px 8px; font-size: var(--fs-13); text-align: right; }
.frange span { color: var(--text-muted); flex: none; }

/* ── 정렬 바 ──────────────────────────────────────────────────────────── */

.sortbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  padding-bottom: var(--space-3); margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.sortbar__sorts { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.sortbar__sorts a {
  font-size: var(--fs-13); font-weight: 600; color: var(--text-muted);
  padding: 6px var(--space-3); border-radius: var(--r-full);
}
.sortbar__sorts a:hover { color: var(--text-primary); background: var(--bg-muted); }
.sortbar__sorts a[aria-current="true"] { color: #fff; background: var(--ink-900); }
.sortbar__count { font-size: var(--fs-12); color: var(--text-muted); font-weight: 600; }

/* ── 적용된 필터 ──────────────────────────────────────────────────────── */
/* 무엇이 걸려 있는지 안 보이면 "왜 결과가 이것뿐이지"를 알 수 없다. */

.applied {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; margin-bottom: var(--space-4);
}
.applied__label { font-size: var(--fs-12); color: var(--text-muted); font-weight: 700; }
.applied__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px var(--space-3); border-radius: var(--r-full);
  background: var(--bg-muted); border: 1px solid var(--line);
  font-size: var(--fs-12); font-weight: 600; color: var(--text-primary);
}
.applied__chip:hover { background: var(--red-50); border-color: var(--red-100); color: var(--text-price); }
.applied__chip span[aria-hidden] { font-size: 14px; line-height: 1; opacity: .55; }
.applied__reset { font-size: var(--fs-12); font-weight: 600; color: var(--text-link); }
.applied__reset:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── 고밀도 그리드 ────────────────────────────────────────────────────── */

.pgrid--dense { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: var(--space-5) var(--space-3); }

@media (max-width: 899px) {
  .filters-panel { padding: var(--space-3); }
  .fgroup { padding-bottom: var(--space-3); margin-bottom: var(--space-3); }
  .flist--bands { display: flex; flex-wrap: wrap; gap: 6px; }
  .flist--bands .fopt--link {
    border: 1px solid var(--line-strong); border-radius: var(--r-full);
    padding: 6px var(--space-3);
  }
  .pgrid--dense { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ══ 카드 밀도 보강 ═════════════════════════════════════════════════════
   별점·리뷰수는 과업 제외(SPEC §13)라 쓸 수 없다. 그 자리에 실제 데이터에서
   나오는 값을 넣는다 — 도착 예정일과 누적 판매량. 지어낸 신뢰 지표를 만드느니
   진짜 숫자를 보여주는 편이 낫다.
   ══════════════════════════════════════════════════════════════════════ */

.pcard__ship {
  margin-top: 5px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: var(--fs-11); line-height: 1.5;
}
.pcard__arrival { color: var(--shell-700); font-weight: 700; }
.pcard__pickup {
  color: var(--status-warn); font-weight: 700;
  padding-left: 6px; border-left: 1px solid var(--line);
}
.pcard__meta { align-items: center; }
.pcard__sold { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pcard__sold + .pcard__origin::before {
  content: "·"; margin: 0 4px; color: var(--line-strong);
}

/* ══ 상세페이지 보강 ════════════════════════════════════════════════════ */

/* 배송 약속 — 구매 판단의 핵심이라 가격 바로 아래 둔다. */
.pdp__ship {
  margin-top: var(--space-5);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4);
  display: grid; gap: var(--space-2);
}
.pdp__ship-row { display: flex; gap: var(--space-4); align-items: baseline; font-size: var(--fs-13); }
.pdp__ship-key { width: 52px; flex: none; color: var(--text-muted); }
.pdp__ship-val { color: var(--text-primary); }
.pdp__ship-val b { color: var(--shell-700); font-weight: 800; }
.pdp__ship-val em {
  font-style: normal; color: var(--text-muted); font-size: var(--fs-12);
  margin-left: 6px;
}

/* 탭 — 앵커 링크라 자바스크립트 없이도 동작한다. */
.pdp__tabs {
  position: sticky; top: var(--stick-h); z-index: 9;
  display: flex; gap: 0;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--line);
  margin-top: var(--space-12);
  overflow-x: auto; scrollbar-width: none;
}
.pdp__tabs::-webkit-scrollbar { display: none; }
.pdp__tabs a {
  flex: 1; min-width: 130px; text-align: center;
  padding: var(--space-4) var(--space-3);
  font-size: var(--fs-14); font-weight: 700; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap;
}
.pdp__tabs a:hover { color: var(--text-primary); }
.pdp__tabs a:target,
.pdp__tabs a:active { color: var(--ink-900); border-bottom-color: var(--ink-900); }

.pdp__panel {
  padding-top: var(--space-8);
  scroll-margin-top: calc(var(--stick-h) + 60px);
}
.pdp__panel h2 {
  font-size: var(--fs-20); letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}
.pdp__panel + .pdp__panel { border-top: 1px solid var(--line); margin-top: var(--space-8); }

/* 사양 표 — 오픈마켓의 상품고시정보 자리 */
.spec-table {
  border-top: 1px solid var(--line-strong);
  font-size: var(--fs-13);
}
.spec-table > div {
  display: grid; grid-template-columns: 132px minmax(0, 1fr);
  border-bottom: 1px solid var(--line-soft);
}
.spec-table dt {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-muted); color: var(--text-secondary); font-weight: 600;
}
.spec-table dd { margin: 0; padding: var(--space-3) var(--space-4); line-height: 1.7; }

/* 상품정보 제공 고시 (전자상거래법 §13②).
   항목 이름이 "제조연월일 · 소비기한 · 품질유지기한" 처럼 길다. 사양 표와 같은
   132px 로 두면 좁은 화면에서 이름이 서너 줄로 접히고 표가 무너진다. */
.spec-notice { margin-top: var(--space-8); }
.spec-notice h3 {
  font-size: var(--fs-15); margin-bottom: var(--space-3);
}
.spec-table--notice > div { grid-template-columns: 180px minmax(0, 1fr); }
.spec-notice__from {
  margin-top: var(--space-3);
  font-size: var(--fs-12); color: var(--text-muted); line-height: 1.8;
}

@media (max-width: 640px) {
  .spec-table > div { grid-template-columns: 92px minmax(0, 1fr); }
  /* 좁은 화면에서는 이름과 값을 위아래로 쌓는다. 옆으로 붙이면 값 칸이
     한 줄에 두세 글자만 들어가 읽을 수 없다. */
  .spec-table--notice > div { grid-template-columns: minmax(0, 1fr); }
  .spec-table--notice dt { padding-bottom: 0; background: none; }
  .spec-table--notice dd { padding-top: var(--space-1); }
  .pdp__tabs a { min-width: 108px; font-size: var(--fs-13); padding: var(--space-3) var(--space-2); }
}

/* ── 법정 고지 ─────────────────────────────────────────────────────────── */

/* 푸터의 법정 고지 링크. 다른 푸터 글자보다 또렷하게 둔다 — 전자상거래법 §3 이
   "쉽게 알 수 있도록" 게시하라고 한다. 회색 잔글씨로 묻으면 그 요건을 못 지킨다. */
.site-footer__legal-links {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  margin-bottom: var(--space-3);
  font-size: var(--fs-13);
}
.site-footer__legal-links a { color: #fff; }
.site-footer__legal-links a:hover { text-decoration: underline; text-underline-offset: 2px; }
.site-footer__legal-links .is-strong { font-weight: 800; }

.legal {
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-6);
  font-size: var(--fs-14); line-height: 1.9; color: var(--text-secondary);
}
.legal p { margin-bottom: var(--space-4); }
.legal p:last-child { margin-bottom: 0; }

/* 약관 본문은 관리자가 붙여 넣은 평문이다. 조문은 "제1조 / 1. / 가." 처럼
   들여쓰기로 항·호를 구분하는데, <br> 로 바꾸면 앞쪽 공백이 접혀 그 구조가
   통째로 사라진다. 공백과 줄바꿈을 살리되 좁은 화면에서는 줄을 접는다. */
.legal--plain {
  white-space: pre-wrap;
  word-break: keep-all; overflow-wrap: anywhere;
  font-family: inherit;
}

.legal__history { margin-top: var(--space-8); }
.legal__history h2 { font-size: var(--fs-15); margin-bottom: var(--space-2); }
.legal__history p { font-size: var(--fs-13); color: var(--text-muted); margin-bottom: var(--space-3); }
.legal__history ul {
  border-top: 1px solid var(--line);
  font-size: var(--fs-13); font-variant-numeric: tabular-nums;
}
.legal__history li {
  display: flex; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line-soft);
  color: var(--text-secondary);
}

/* ── 가입 동의 ─────────────────────────────────────────────────────────── */

/* 필수와 선택을 눈으로 갈라 둔다. 개인정보보호법 §22 는 선택 항목에 동의하지
   않았다고 서비스를 거부하지 못하게 하는데, 화면에서 구분이 안 되면 사용자는
   전부 필수라고 여기고 누른다. 그건 받은 동의라고 보기 어렵다. */
.agree {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4); margin-bottom: var(--space-5);
}
.agree__title {
  font-size: var(--fs-12); font-weight: 800; color: var(--text-muted);
  letter-spacing: var(--tracking-wide); padding: 0 var(--space-1);
}
.agree__row {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 40px; cursor: pointer;
  font-size: var(--fs-14);
}
.agree__row input { width: 18px; height: 18px; flex: none; accent-color: var(--ink-900); }
.agree__row span { flex: 1; }
.agree__req { color: var(--status-danger); font-weight: 700; }
.agree__opt { color: var(--text-muted); font-weight: 700; }
.agree__more {
  flex: none; font-size: var(--fs-12); color: var(--text-secondary);
  text-decoration: underline; text-underline-offset: 2px;
}
.agree__more:hover { color: var(--text-primary); }
.agree__note {
  margin-top: var(--space-2); padding-top: var(--space-2);
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-12); color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   리뷰 · 찜 · 반품 · 문의 · 주소록
   (SPEC §13 예외 승인분 포함 — 경위는 docs/PENDING.md F 절)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 별점 ────────────────────────────────────────────────────────────────
   빈 별 줄 위에 채운 별 줄을 겹치고 너비만 자른다. 문자를 개수만큼 반복해
   그리면 화면낭독기가 "블랙 스타" 를 다섯 번 읽는다. 값은 aria-label 이 한 번
   말하고, 여기 글자는 전부 aria-hidden 이다. */
.stars {
  position: relative; display: inline-block; flex: none;
  font-size: var(--fs-13); line-height: 1; letter-spacing: 1px;
  white-space: nowrap;
}
.stars__off { color: var(--n-200); }
.stars__on {
  position: absolute; inset: 0; overflow: hidden;
  color: var(--star);
}

/* ── 카드의 별점 ────────────────────────────────────────────────────────── */
.pcard__rating {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; font-size: var(--fs-12);
}
.pcard__rating-n { font-weight: 700; color: var(--text-primary); }
.pcard__rating-c { color: var(--text-muted); }

/* ── 상세의 별점 요약 ───────────────────────────────────────────────────── */
.pdp__rating {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--fs-13); color: var(--text-secondary);
  text-decoration: underline; text-underline-offset: 3px;
}
.pdp__rating b { color: var(--text-primary); font-size: var(--fs-15); }

/* ── 평점 분포 ──────────────────────────────────────────────────────────
   평균 하나보다 분포가 많은 것을 말해 준다. 4.0 이 "대체로 4점" 인지
   "5점과 1점이 반반" 인지는 구매 판단이 갈리는 차이다. */
.rating-summary {
  display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
  gap: var(--space-6); align-items: center;
  padding: var(--space-5); margin-bottom: var(--space-5);
  background: var(--bg-muted); border-radius: var(--r-md);
}
.rating-summary__score { text-align: center; }
.rating-summary__score b {
  display: block; font-size: 2.4rem; line-height: 1.1; font-weight: 800;
  color: var(--text-primary);
}
.rating-bars { display: grid; gap: 6px; }
.rating-bars li {
  display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) 2.6rem;
  align-items: center; gap: var(--space-2);
  font-size: var(--fs-12); color: var(--text-muted);
}
.rating-bars__track {
  height: 8px; border-radius: 4px; background: var(--n-200); overflow: hidden;
}
.rating-bars__fill { display: block; height: 100%; background: var(--star); }
.rating-bars__count { text-align: right; }

@media (max-width: 640px) {
  .rating-summary { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* ── 리뷰 목록 ──────────────────────────────────────────────────────────── */
.review-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.review-toolbar__sorts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.review-list { display: grid; gap: var(--space-4); }

.review {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-soft);
}
.review:last-child { border-bottom: 0; padding-bottom: 0; }
.review__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  font-size: var(--fs-12); color: var(--text-muted);
}
.review__author { font-weight: 700; color: var(--text-secondary); }
.review__opt {
  margin-top: 4px; font-size: var(--fs-12); color: var(--text-muted);
}
.review__body {
  margin-top: var(--space-2); font-size: var(--fs-14); line-height: 1.8;
  color: var(--text-primary); overflow-wrap: anywhere;
}
.review__photos {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3);
}
.review__photos img {
  width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
}
.review__reply {
  margin-top: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--bg-muted); border-radius: var(--r-sm);
  border-left: 3px solid var(--line);
}
.review__reply-who {
  font-size: var(--fs-12); font-weight: 700; color: var(--text-secondary);
  display: flex; gap: var(--space-2); align-items: center;
}
.review__reply-body {
  margin-top: 4px; font-size: var(--fs-13); line-height: 1.75;
  color: var(--text-secondary); overflow-wrap: anywhere;
}
.review__foot {
  display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3);
}

/* ── 별점 입력 ──────────────────────────────────────────────────────────
   라디오 5개다. 마우스로 문지르는 위젯은 키보드로 쓸 수 없고 화면낭독기에는
   아무것도 읽히지 않는다. row-reverse 로 두면 "뒤에 오는 형제" 만 고를 수 있는
   CSS 로 왼쪽(= 더 낮은 점수) 별들을 함께 칠할 수 있다. */
.rating-input { border: 0; padding: 0; }
.rating-input__stars {
  display: inline-flex; flex-direction: row-reverse; gap: 2px;
  margin-top: var(--space-2);
}
.rating-input__stars label { cursor: pointer; }
.rating-input__stars input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.rating-input__stars span[aria-hidden] {
  font-size: 2rem; line-height: 1; color: var(--n-200);
  transition: color .12s ease;
}
.rating-input__stars label:hover span[aria-hidden],
.rating-input__stars label:hover ~ label span[aria-hidden],
.rating-input__stars label:has(input:checked) span[aria-hidden],
.rating-input__stars label:has(input:checked) ~ label span[aria-hidden] {
  color: var(--star);
}
/* 키보드 초점은 반드시 보여야 한다. 별만 칠하고 테두리를 지우면
   탭으로 이동하는 사람은 자기가 어디 있는지 알 수 없다. */
.rating-input__stars label:has(input:focus-visible) {
  outline: 2px solid var(--line-focus); outline-offset: 2px; border-radius: 4px;
}

/* ── 장바구니 선택 ──────────────────────────────────────────────────────── */
.cart-toolbar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3);
  background: var(--bg-surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.cart-line__pick { display: flex; align-items: center; padding-right: var(--space-1); }
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--ink-900); }

/* ── 주문서 · 주소록 ────────────────────────────────────────────────────── */
.addr-picker {
  display: grid; gap: var(--space-2); margin-bottom: var(--space-4);
}
.addr-chip {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer;
}
.addr-chip:has(input:checked) { border-color: var(--ink-900); background: var(--bg-muted); }
.addr-chip input { grid-row: 1 / span 2; align-self: center; accent-color: var(--ink-900); }
.addr-chip__label { font-size: var(--fs-14); font-weight: 700; }
.addr-chip__addr {
  grid-column: 2; font-size: var(--fs-12); color: var(--text-muted);
  overflow-wrap: anywhere;
}
.field__row { display: flex; align-items: center; gap: var(--space-2); }

.consent {
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--r-md);
}
.consent__detail { margin-top: var(--space-2); }
.consent__detail summary {
  cursor: pointer; font-size: var(--fs-12); color: var(--text-secondary);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ── 반품 사유 ──────────────────────────────────────────────────────────
   사유가 곧 회수 배송비 부담 주체를 정한다(전자상거래법 §18⑨). 고르는 순간
   누가 내는지 보여야 나중에 분쟁이 되지 않는다. */
.reason-list { display: grid; gap: var(--space-2); }
.reason {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer;
}
.reason:has(input:checked) { border-color: var(--ink-900); background: var(--bg-muted); }
.reason input { accent-color: var(--ink-900); }
.reason__label { font-size: var(--fs-14); }
.reason__bearer { font-size: var(--fs-12); color: var(--text-muted); white-space: nowrap; }

@media (max-width: 520px) {
  .reason { grid-template-columns: auto minmax(0, 1fr); }
  .reason__bearer { grid-column: 2; }
}

/* ── 주문내역 필터 ──────────────────────────────────────────────────────── */
.filterbar {
  display: grid; gap: var(--space-3); margin-bottom: var(--space-4);
  padding: var(--space-4); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.filterbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.filterbar__row input[type="search"] { flex: 1; min-width: 10rem; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px var(--space-3); border-radius: 999px;
  border: 1px solid var(--line); font-size: var(--fs-13);
  color: var(--text-secondary); cursor: pointer;
}
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked), .chip.is-on {
  border-color: var(--ink-900); background: var(--ink-900); color: #fff;
}
.chip:has(input:focus-visible) { outline: 2px solid var(--line-focus); outline-offset: 2px; }

/* ── 마이페이지 타일 ────────────────────────────────────────────────────
   메뉴를 링크 목록으로만 두면 답변이 온 문의도, 쓸 수 있는 리뷰도 묻힌다.
   숫자가 붙은 것만 눈에 들어오므로 0 은 배지를 그리지 않는다. */
.my-tiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2); margin-top: var(--space-5);
}
.my-tiles a {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  min-height: 72px; padding: var(--space-3);
  background: var(--bg-surface); border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: var(--fs-13);
  color: var(--text-primary); text-align: center;
}
.my-tiles a:hover { border-color: var(--ink-900); }
.my-tiles__count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--ink-900); color: #fff;
  font-size: var(--fs-11); font-weight: 800;
}

@media (max-width: 380px) {
  .my-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 상품 상세 썸네일 ──────────────────────────────────────────────────── */
.pdp__thumbs {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  width: 100%;
  max-width: var(--pdp-media-max);
  margin: var(--space-3) auto 0;
  justify-content: flex-start;
}
.pdp__thumbs a {
  display: block; width: 64px; height: 64px; border-radius: var(--r-sm);
  overflow: hidden; border: 1px solid var(--line-soft);
}
.pdp__thumbs a[aria-current="true"] { border-color: var(--ink-900); border-width: 2px; }
.pdp__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ── 담기 · 바로구매 ────────────────────────────────────────────────────── */
.buybox__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }

.bullets { padding-left: 1.1em; list-style: disc; }
.bullets li { margin-bottom: 4px; }
.flist--sub { margin-top: var(--space-2); padding-left: var(--space-4); }
.panel--accent { border-left: 3px solid var(--ink-900); }

/* ── 공지 목록 ─────────────────────────────────────────────────────────── */
/* 제목과 날짜를 양끝으로 벌린다. 목록에서 눈이 좇는 것은 두 가지뿐이라
   가운데를 비워 두는 편이 훑기 쉽다. */
.notice-list { list-style: none; }
.notice-list li + li { border-top: 1px solid var(--line-soft); }
.notice-list a {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  color: inherit;
}
.notice-list a:hover { background: var(--bg-raised); }
.notice-list__title { font-weight: 600; }
.notice-list time { color: var(--text-muted); font-size: var(--fs-12); white-space: nowrap; }

/* ══ 오류 화면 (404 · 403 · CSRF) ═══════════════════════════════════════
   장식 없는 오류 화면은 사이트가 통째로 고장 난 것처럼 보인다. 마스코트를
   앞세워 "여기는 구포몰이고 길만 잘못 들었을 뿐"임을 먼저 알리고, 그 다음에
   나갈 길을 준다.

   레이아웃을 못 물려받는 500·400 (templates/_error_base.html) 과 같은 얼굴로
   맞춘다 — 원반 위 마스코트 · 코드 알약 · 제목 · 안내 · 버튼 순서.
   저쪽은 토큰 파일을 부를 수 없어 값을 복제해 두었으니, 여기 크기를 바꾸면
   저기도 같이 바꾼다. */

.errpage { text-align: center; padding-block: var(--space-8) var(--space-4); }

/* 마스코트를 어두운 사각 배지에 가두지 않는다 — 캐릭터 외곽선이 이미 검고
   두꺼워 저절로 떨어진다. 옅은 노랑 원반으로 시선만 모은다. */
.errpage__mascot {
  width: 112px; height: 112px; margin: 0 auto var(--space-6);
  border-radius: 50%;
  background: var(--yellow-50);
  box-shadow: inset 0 0 0 1px var(--yellow-200);
  display: grid; place-items: center;
}
.errpage__mascot img { width: 80px; height: 80px; }

.errpage__code {
  display: inline-block; margin-bottom: var(--space-3);
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--bg-muted); color: var(--text-secondary);
  font-size: var(--fs-12); font-weight: 700; letter-spacing: .04em;
}

/* 한글은 어절 중간에서 끊기면 읽기 어렵다. */
.errpage h1 {
  font-size: var(--fs-28); font-weight: 800;
  letter-spacing: var(--tracking-tighter); word-break: keep-all;
}
.errpage__lead {
  margin: var(--space-3) auto 0; max-width: 34em;
  font-size: var(--fs-15); line-height: 1.8;
  color: var(--text-secondary); word-break: keep-all;
}

/* 판 안의 내용(검색칸)은 왼쪽 정렬로 되돌린다. 가운데 정렬한 폼은 입력칸
   시작점이 흔들려 읽는 순서가 무너진다. */
.errpage__panel { margin-top: var(--space-8); text-align: left; }

/* 색 있는 안내 상자는 흰 판 안에 다시 넣지 않는다 — 액자가 겹쳐 보인다.
   판 없이 그대로 놓고 글줄 폭만 잡는다. */
.errpage__note { margin: var(--space-8) auto 0; max-width: 46em; text-align: left; }

/* 버튼 뒤에 붙는 덧말. 본문과 같은 크기로 두면 무엇이 결론인지 흐려진다. */
.errpage__fine {
  margin: var(--space-6) auto 0; max-width: 40em;
  font-size: var(--fs-13); line-height: 1.7;
  color: var(--text-muted); word-break: keep-all;
}

.errpage .btn-group { justify-content: center; margin-top: var(--space-6); }

@media (max-width: 480px) {
  .errpage { padding-block: var(--space-6) var(--space-2); }
  .errpage__mascot { width: 92px; height: 92px; }
  .errpage__mascot img { width: 66px; height: 66px; }
  .errpage h1 { font-size: var(--fs-24); }
  .errpage .btn-group { flex-direction: column; }
  .errpage .btn-group .btn { width: 100%; }
}

/* ── 상점 홈 대표 사진 ─────────────────────────────────────────────────── */
/* 사진 위에 흰 글씨를 얹으므로 어두운 막을 반드시 깐다. 막이 없으면 밝은
   사진에서 상점명이 읽히지 않는다 (대비 4.5:1, 과업지시서 §5.2.7). */
.store-hero--photo {
  background-size: cover; background-position: center;
  position: relative; isolation: isolate;
}
.store-hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(14,36,48,.62), rgba(14,36,48,.86));
}
.store-hero__meta a { text-decoration: underline; text-underline-offset: 2px; }

.store-gallery {
  display: flex; gap: var(--space-2); overflow-x: auto;
  margin-top: var(--space-4); scrollbar-width: none;
}
.store-gallery::-webkit-scrollbar { display: none; }
.store-gallery img {
  flex: none; width: 200px; height: 130px; object-fit: cover;
  border-radius: var(--r-md); border: 1px solid var(--line-soft);
}
