/* ─── tokens ───────────────────────────────────────────────────────
   Imflower design system. 색/서체는 여기서만 정의한다. */
:root {
  --bg:      #faf8f5;
  --surface: #ffffff;
  --fg:      #1c1a17;
  --muted:   #6c6862;
  --border:  #e7e2da;
  --accent:  #a03a4e;   /* deep rose — 화면당 최대 2회 */

  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --fg-soft:     color-mix(in oklch, var(--fg) 5%, transparent);

  /* 라틴은 세리프, 한글은 명조 계열로 자동 폴백 (웹폰트 없음) */
  --font-display: 'Iowan Old Style', 'Charter', Georgia, 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', Pretendard, 'Noto Sans KR', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-h1: clamp(32px, 3.6vw, 48px);
  --fs-h2: clamp(26px, 3vw, 40px);
  --fs-h3: 20px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-meta: 13px;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 96px;
  --container: 1180px;
  --gutter: 28px;

  --radius: 10px;
  --radius-lg: 16px;
}

/* ─── reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* height="…" 속성은 프레젠테이션 힌트로 들어와 aspect-ratio 를 무시하게 만든다 → height:auto 로 무력화 */
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--fg);
  padding: 10px 16px; border: 1px solid var(--border); z-index: 50;
}
.skip:focus { left: 12px; top: 12px; }

/* ─── layout primitives ─────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(52px, 7vw, var(--gap-2xl)); }
.section + .section { border-top: 1px solid var(--border); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── type ──────────────────────────────────────────────────────── */
h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.3; letter-spacing: -0.03em; margin: 0; font-weight: 700; word-break: keep-all; }
h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.35; letter-spacing: -0.03em; margin: 0; font-weight: 700; word-break: keep-all; }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; margin: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.62; color: var(--muted); max-width: 58ch; margin: 0; }
/* 한글은 mono 로 조판하면 자간이 벌어져 깨진다 → 본문 서체 + 트래킹으로 대체 */
.eyebrow {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 var(--gap-md);
}
.meta { font-size: var(--fs-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sec-head { max-width: 62ch; margin-bottom: var(--gap-xl); }
.sec-head p { margin: var(--gap-md) 0 0; }

/* ─── buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--radius);
  border: 1px solid transparent; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 86%, black); }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg); }
.btn-arrow::after { content: '→'; transition: transform 0.15s ease; }
.btn-arrow:hover::after { transform: translateX(3px); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ─── chrome ────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; gap: var(--gap-lg); padding-block: 13px; }
.logo { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.logo span { font-style: italic; letter-spacing: -0.03em; }
.topnav-inner .logo { font-size: 48px; }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-outline:hover { background: var(--fg); color: var(--surface); }
.topnav nav { display: flex; gap: 26px; margin-left: auto; }
.topnav nav a { font-size: 14.5px; color: var(--muted); }
.topnav nav a:hover { color: var(--fg); }
.nav-tel { font-family: var(--font-mono); font-size: 14px; letter-spacing: -0.01em; }
@media (max-width: 920px) {
  .topnav nav, .nav-tel { display: none; }
  .topnav-inner { justify-content: space-between; }
}

/* ─── hero ──────────────────────────────────────────────────────── */
.hero { padding-block: clamp(44px, 6vw, 92px); }
.hero .eyebrow { font-size: 25px; font-family: var(--font-display); text-transform: none; letter-spacing: -0.02em; }
.hero .eyebrow span { font-style: italic; letter-spacing: -0.03em; }
.hero-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: var(--gap-md); font-family: 'Pretendard Variable', Pretendard, var(--font-body); font-size: var(--fs-h1); font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.hero h1 .grad {
  background: linear-gradient(92deg, #e05c8a 0%, #a03a4e 55%, #7c4dd4 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero .lead { margin-bottom: var(--gap-lg); }
.hero-cta { display: flex; gap: var(--gap-sm); flex-wrap: wrap; }
.hero-figure { position: relative; }
.hero-figure img { width: 100%; height: auto; border-radius: var(--radius-lg); }
/* ─── 히어로 슬라이더 ───────────────────────────────────────────── */
.hero-slider { position: relative; aspect-ratio: 1402 / 1122; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.hero-slider .slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 0;
  opacity: 0; transition: opacity 0.9s ease;
}
.hero-slider .slide.fit { object-fit: contain; } /* 문구가 든 포스터는 잘리면 안 된다 */
.hero-slider .slide.on { opacity: 1; }
.slider-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.slider-dots button {
  width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: color-mix(in oklch, var(--fg) 30%, transparent);
}
.slider-dots button.on { background: var(--accent); transform: scale(1.25); }
.hero-figure figcaption {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px; color: var(--muted);
}
@media (max-width: 920px) { .hero-split { grid-template-columns: 1fr; } }

/* 마감 카운트다운 — 이 페이지의 유일한 실시간 요소 */
.cutoff {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 9px 18px 9px 14px; margin-bottom: var(--gap-lg);
}
.cutoff .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .cutoff .dot { animation: none; } }
.cutoff-text { font-size: 14.5px; }
.cutoff-text strong { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ─── occasion tiles ────────────────────────────────────────────── */
.occ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-md); }
.occ {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--surface);
}
.occ img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; transition: transform 0.4s ease; }
.occ:hover img { transform: scale(1.03); }
.occ-body { padding: 18px 20px 20px; }
.occ-body h3 { margin-bottom: 4px; }
.occ-body p { margin: 0; font-size: 14px; color: var(--muted); }
.occ-body .occ-price { margin-top: 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 920px) { .occ-grid { grid-template-columns: 1fr 1fr; gap: var(--gap-sm); } }
@media (max-width: 560px) { .occ-grid { gap: 10px; } .occ-body { padding: 14px 14px 16px; } .occ-body h3 { font-size: 16px; } }

/* ─── product cards ─────────────────────────────────────────────── */
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.prod { display: block; }
.prod-thumb {
  display: block;   /* inline 이면 overflow/aspect-ratio 가 안 먹어 썸네일이 세로로 늘어난다 */
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.prod-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; transition: transform 0.4s ease; }
.prod:hover .prod-thumb img { transform: scale(1.04); }
.prod-cat { margin: 14px 0 3px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.prod-name { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.prod-price { margin: 6px 0 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 15px; }
.prod-code { font-size: 12px; color: var(--muted); margin-left: 8px; }
@media (max-width: 920px) { .prod-grid { grid-template-columns: 1fr 1fr; } }

/* ─── delivery photo wall ───────────────────────────────────────── */
.wall {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  max-width: 1560px; margin-inline: auto; padding-inline: var(--gutter);
}
.wall img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--fg-soft); }
.wall .wide { grid-column: span 2; grid-row: span 2; }
.wall .wide img { aspect-ratio: 1 / 1; height: 100%; }
@media (max-width: 920px) { .wall { grid-template-columns: repeat(3, 1fr); } .wall .wide { grid-column: span 2; grid-row: span 2; } }
.wall-note { margin: var(--gap-lg) auto 0; text-align: center; }

/* ─── feature cells ─────────────────────────────────────────────── */
.feature .feature-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--fg); margin-bottom: var(--gap-md); background: var(--surface);
}
.feature .feature-mark svg { width: 19px; height: 19px; }
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* ─── delivery / payment table ──────────────────────────────────── */
.ds-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ds-table th, .ds-table td { padding: 16px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.ds-table th {
  color: var(--muted); font-weight: 500; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; width: 200px;
}
.ds-table tbody tr:hover { background: var(--fg-soft); }
.ds-table td .sub { display: block; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
@media (max-width: 620px) {
  .ds-table th, .ds-table td { display: block; width: auto; border-bottom: 0; padding: 4px 0; }
  .ds-table tbody tr { display: block; padding-block: 16px; border-bottom: 1px solid var(--border); }
}

/* ─── pull quote ────────────────────────────────────────────────── */
.quote-band { background: var(--surface); }
.quote { font-family: var(--font-display); font-size: clamp(24px, 3vw, 38px); line-height: 1.36; letter-spacing: -0.015em; max-width: 22ch; margin: 0; font-weight: 600; }
.quote-author { color: var(--muted); font-size: 14px; margin-top: var(--gap-md); }

/* ─── closing CTA ───────────────────────────────────────────────── */
.cta-strip { text-align: center; }
.cta-strip h2 { margin-bottom: var(--gap-md); }
.cta-strip .lead { margin: 0 auto var(--gap-lg); }
.cta-strip .hero-cta { justify-content: center; }

/* ─── footer ────────────────────────────────────────────────────── */
.pagefoot { border-top: 1px solid var(--border); padding-block: var(--gap-xl) var(--gap-lg); color: var(--muted); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--gap-lg); }
.foot-grid h4 { margin: 0 0 12px; font-size: 13px; color: var(--fg); font-weight: 600; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a:hover { color: var(--fg); }
.foot-legal { margin-top: var(--gap-xl); padding-top: var(--gap-md); border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.7; }
@media (max-width: 920px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ─── mobile order bar (모바일 전용 고정 주문바) ────────────────── */
.orderbar { display: none; }
@media (max-width: 920px) {
  .orderbar {
    display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--bg) 94%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  }
  body { padding-bottom: 84px; }
}

/* ═══════════════════════════════════════════════════════════════════
   상품 목록 (shop.html) / 상품 상세 (item.html)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 페이지 헤더 ───────────────────────────────────────────────── */
.page-head { padding-block: clamp(32px, 4vw, 56px) 0; }
.page-head h1 { margin-bottom: 10px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 var(--gap-md); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb span { margin-inline: 6px; opacity: 0.5; }

/* ─── 필터 바 ───────────────────────────────────────────────────── */
.filters { padding-block: var(--gap-lg); border-bottom: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 14px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip-btn:hover { color: var(--fg); border-color: var(--fg); }
.chip-btn[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--surface); }
.filter-row { display: flex; align-items: center; gap: var(--gap-md); flex-wrap: wrap; margin-top: var(--gap-md); }
.filter-row .spacer { flex: 1; }
.search-box { position: relative; min-width: 240px; }
.search-box input {
  width: 100%; padding: 10px 14px 10px 36px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--fg); font: inherit; font-size: 14px;
}
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.sort-select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 14px;
}
.result-count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-count b { color: var(--fg); font-weight: 600; }

/* ─── 상품 그리드 ───────────────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md) var(--gap-md); padding-block: var(--gap-xl); }
@media (max-width: 1080px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .shop-grid { grid-template-columns: repeat(2, 1fr); gap: var(--gap-sm); } }
.badge-best {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px); border: 1px solid var(--border); color: var(--fg);
}
.prod-tags { margin: 6px 0 0; display: flex; gap: 5px; flex-wrap: wrap; }
.prod-tags span { font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.loadmore { display: flex; justify-content: center; padding-bottom: var(--gap-2xl); }
.empty { text-align: center; padding-block: var(--gap-2xl); color: var(--muted); }
.empty h3 { color: var(--fg); margin-bottom: 8px; }
.skeleton { border-radius: var(--radius); background: var(--fg-soft); aspect-ratio: 1/1; }

/* ─── 상세: 레이아웃 ────────────────────────────────────────────── */
.item-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 64px); align-items: start; padding-block: var(--gap-lg) var(--gap-2xl); }
@media (max-width: 920px) { .item-wrap { grid-template-columns: 1fr; } }
.item-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.item-media .shot-note { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.item-info h1 { font-size: clamp(26px, 2.6vw, 36px); margin-bottom: 10px; }
.item-poem { font-family: var(--font-display); font-size: 17px; color: var(--muted); margin: 0 0 var(--gap-md); }
.item-price { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 0; }
.item-price small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.item-meta { display: flex; gap: var(--gap-md); flex-wrap: wrap; margin: 0 0 var(--gap-lg); font-size: 13px; color: var(--muted); }
.item-form { border-top: 1px solid var(--border); padding-top: var(--gap-lg); display: grid; gap: var(--gap-md); }
.f-label { font-size: 13.5px; font-weight: 600; margin: 0 0 7px; display: flex; justify-content: space-between; align-items: baseline; }
.f-label .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.f-control, .f-control:is(select, input, textarea) {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: inherit; font-size: 15px;
}
textarea.f-control { min-height: 78px; resize: vertical; line-height: 1.55; }
.f-control:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.qty button { width: 42px; height: 44px; background: transparent; border: 0; color: var(--fg); font-size: 18px; line-height: 1; }
.qty button:hover { background: var(--fg-soft); }
.qty input { width: 54px; height: 44px; border: 0; text-align: center; background: transparent; color: var(--fg); font: inherit; font-variant-numeric: tabular-nums; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid var(--fg); padding-top: var(--gap-md); }
.total-row .total-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.buy-row { display: grid; grid-template-columns: 1fr auto; gap: var(--gap-sm); }
@media (max-width: 480px) { .buy-row { grid-template-columns: 1fr; } }

/* ─── 상세: 안내 박스 / 스펙 ────────────────────────────────────── */
.notice {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius); padding: 16px 18px; font-size: 14px; line-height: 1.6;
}
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice b { font-variant-numeric: tabular-nums; }
.spec { padding-block: var(--gap-xl); border-top: 1px solid var(--border); }
.spec h2 { font-size: 24px; margin-bottom: var(--gap-lg); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { width: 160px; color: var(--muted); font-weight: 500; font-size: 13.5px; }
@media (max-width: 620px) {
  .spec-table th, .spec-table td { display: block; width: auto; border-bottom: 0; padding: 3px 0; }
  .spec-table tbody tr { display: block; padding-block: 14px; border-bottom: 1px solid var(--border); }
}

/* ─── 주문 확인 모달 ────────────────────────────────────────────── */
.modal-wrap[hidden] { display: none; }   /* [hidden] 이 display:flex 에 지지 않도록 반드시 유지 */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: color-mix(in oklch, var(--fg) 45%, transparent);
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 440px; width: 100%; padding: 28px; max-height: 86vh; overflow: auto;
}
.modal h3 { margin-bottom: var(--gap-md); font-family: var(--font-display); font-size: 22px; }
.modal dl { margin: 0 0 var(--gap-md); display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.modal dt { color: var(--muted); }
.modal dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.modal .modal-cta { display: grid; gap: 8px; margin-top: var(--gap-md); }

/* ═══════════════════════════════════════════════════════════════════
   장바구니 / 주문서 / 주문조회
   ═══════════════════════════════════════════════════════════════════ */
.cart-badge {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
}
.cart-badge .cnt {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--fg); color: var(--surface);
  font-size: 11px; font-weight: 600; display: inline-grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.cart-badge .cnt[hidden] { display: none; }

.cart-line { display: grid; grid-template-columns: 92px 1fr auto; gap: var(--gap-md); padding: 20px 0; border-bottom: 1px solid var(--border); align-items: start; }
.cart-line img { width: 92px; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.cart-line h3 { font-size: 16px; margin-bottom: 4px; }
.cart-line .opt { font-size: 13.5px; color: var(--muted); margin: 0; }
.cart-line .right { text-align: right; display: grid; gap: 10px; justify-items: end; }
.cart-line .amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.link-del { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 0; }
.link-del:hover { color: var(--fg); }
@media (max-width: 620px) {
  .cart-line { grid-template-columns: 72px 1fr; }
  .cart-line img { width: 72px; }
  .cart-line .right { grid-column: 1 / -1; justify-items: start; text-align: left; }
}
.sum-box { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); padding: 24px; position: sticky; top: 90px; }
.sum-row { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 10px; }
.sum-row.total { border-top: 1px solid var(--fg); padding-top: 14px; margin-top: 16px; font-size: 20px; font-weight: 700; }
.sum-row .num { font-variant-numeric: tabular-nums; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--gap-xl); align-items: start; padding-block: var(--gap-lg) var(--gap-2xl); }
@media (max-width: 920px) { .cart-layout { grid-template-columns: 1fr; } .sum-box { position: static; } }

.pay-opt { display: grid; gap: 10px; }
.pay-opt label {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.pay-opt label:has(input:checked) { border-color: var(--fg); }
.pay-opt input { margin-top: 3px; accent-color: var(--accent); }
.pay-opt .t { font-weight: 600; font-size: 15px; }
.pay-opt .d { font-size: 13.5px; color: var(--muted); margin: 3px 0 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-md); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.fieldset { border: 0; padding: 0; margin: 0 0 var(--gap-xl); }
.fieldset > legend { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: var(--gap-md); padding: 0; }
.err { color: var(--accent); font-size: 13.5px; margin: 6px 0 0; }

.done-box { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-lg); padding: 32px; max-width: 560px; margin-inline: auto; text-align: center; }
.done-box .no { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.bank-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: var(--gap-md) 0; text-align: left; font-size: 14.5px; line-height: 1.7; }
.status-pill { display: inline-flex; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--fg); color: var(--surface); padding: 12px 20px; border-radius: 999px;
  font-size: 14.5px; z-index: 70; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.18));
}
.toast[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   상품 상세페이지 본문
   ═══════════════════════════════════════════════════════════════════ */
.detail-wrap { border-top: 1px solid var(--border); }

/* 섹션 바로가기 — 스크롤이 길어 상단 고정 */
.detail-nav {
  position: sticky; top: 61px; z-index: 15;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; margin-bottom: 8px;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.detail-nav::-webkit-scrollbar { display: none; }
.detail-nav a {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
  font-size: 14px; color: var(--muted); border: 1px solid transparent; white-space: nowrap;
}
.detail-nav a:hover { color: var(--fg); border-color: var(--border); }

.detail-sec { padding-block: clamp(40px, 5vw, 72px); border-bottom: 1px solid var(--border); scroll-margin-top: 120px; }
.detail-sec:last-child { border-bottom: 0; }
.detail-sec > h2 { font-size: clamp(24px, 2.4vw, 32px); }

/* 어울리는 자리 */
.fit-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.fit-item {
  padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 14.5px;
}

/* 실제 배송 사진 */
.deliv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.deliv-grid figure { margin: 0; }
.deliv-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius); background: var(--fg-soft); }
@media (max-width: 620px) { .deliv-grid { grid-template-columns: 1fr 1fr; } .deliv-grid figure:last-child { display: none; } }

/* 리본 문구 복사 칩 */
.ribbon-list { display: flex; flex-wrap: wrap; gap: 10px; }
.ribbon-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font-size: 15px; text-align: left;
  transition: border-color 0.15s ease;
}
.ribbon-chip:hover { border-color: var(--fg); }
.ribbon-chip .c { font-size: 12px; color: var(--muted); border-left: 1px solid var(--border); padding-left: 10px; }
.ribbon-chip:hover .c { color: var(--fg); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  padding: 18px 0; cursor: pointer; font-size: 16.5px; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--muted); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0 0 20px; color: var(--muted); font-size: 15px; max-width: 70ch; }

/* 모바일 고정 구매바 (상세 전용) */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in oklch, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform 0.22s ease;
}
.buybar.on { transform: translateY(0); }
.buybar-info { display: grid; min-width: 0; }
.buybar-info .n { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buybar-info .p { font-size: 17px; font-weight: 700; }
@media (min-width: 921px) { .buybar { display: none; } }

/* ─── 배송 사진 갤러리 (photos.html) ────────────────────────────── */
.ph-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding-block: var(--gap-xl); }
@media (max-width: 1080px) { .ph-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px)  { .ph-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } }
@media (max-width: 460px)  { .ph-grid { grid-template-columns: repeat(2, 1fr); } }
.ph-item { margin: 0; }
.ph-item img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px;
  background: var(--fg-soft); transition: transform 0.3s ease;
}
.ph-item:hover img { transform: scale(1.02); }
.chip-btn .meta { font-size: 11.5px; opacity: 0.7; }
.chip-btn[aria-pressed="true"] .meta { color: inherit; opacity: 0.8; }

/* ─── 원본 편집 상세 이미지 ──────────────────────────────────────── */
.desc-gallery { max-width: 900px; margin: 22px auto 0; }
.desc-gallery img { width: 100%; display: block; }

/* ═══════════════════════════════════════════════════════════════════
   모바일 상단 — 검색·전화·장바구니 아이콘 + 가로 스크롤 바로가기
   (데스크탑 내비는 모바일에서 숨겨져 있어 갈 곳이 없었다)
   ═══════════════════════════════════════════════════════════════════ */
.icon-btn {
  display: none; position: relative;
  width: 40px; height: 40px; padding: 0;
  align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--fg); border-radius: 10px;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:active { background: var(--fg-soft); }
.icon-btn .cnt {
  position: absolute; top: 2px; right: 1px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: var(--surface);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.icon-btn .cnt[hidden] { display: none; }

.searchbar { border-top: 1px solid var(--border); background: var(--surface); }
.searchbar[hidden] { display: none; }
.searchbar .container { display: flex; gap: 8px; padding-block: 10px; }
.searchbar input {
  flex: 1; min-width: 0; padding: 11px 14px; font: inherit; font-size: 15px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--fg);
}
.searchbar button {
  padding: 0 18px; border: 1px solid var(--fg); background: var(--fg); color: var(--surface);
  border-radius: 999px; font-size: 14px; font-weight: 500;
}

/* 가로 스크롤 바로가기 — 모바일 전용.
   ⚠️ .qnav 는 .topnav 안의 <nav> 라서 `.topnav nav{display:none}`(0,1,1) 에 먹힌다.
      반드시 `.topnav .qnav`(0,2,0) 로 우선순위를 올려서 쓸 것. */
.topnav .qnav { display: none; border-top: 1px solid var(--border); }
.qnav-scroll {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter);
}
.qnav-scroll::-webkit-scrollbar { display: none; }
.qnav-scroll a {
  flex: 0 0 auto; padding: 13px 12px; font-size: 14.5px; color: var(--muted);
  white-space: nowrap; border-bottom: 2px solid transparent;
}
.qnav-scroll a.on { color: var(--fg); font-weight: 600; border-bottom-color: var(--fg); }

@media (max-width: 920px) {
  .icon-btn { display: inline-grid; }
  .topnav .qnav { display: block; }
  .topnav-inner { gap: 2px; padding-block: 9px; }
  .topnav-inner .logo { margin-right: auto; font-size: 44px; }
  .desk-cart { display: none; }
}

/* ─── 카테고리 원형 바로가기 ─────────────────────────────────────── */
.circles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px 10px; }
.circle { display: block; text-align: center; }
.circle .ph {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1/1; border-radius: 50%;
  overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  padding: 9%;
  transition: transform 0.25s ease, border-color 0.2s ease;
}
/* ⚠️ cover 로 자르면 세로로 긴 화환이 리본만 보여 무엇인지 알 수 없다 → contain 으로 전체를 보여준다 */
.circle .ph img { width: 100%; height: 100%; object-fit: contain; }
.circle:hover .ph { transform: translateY(-3px); border-color: var(--fg); }
.circle .lb { display: block; margin-top: 10px; font-size: 13.5px; letter-spacing: -0.01em; }
@media (max-width: 920px) {
  .circles { grid-template-columns: repeat(4, 1fr); gap: 18px 12px; }
  .circle .lb { font-size: 13px; }
}
@media (max-width: 380px) { .circles { gap: 14px 8px; } .circle .lb { font-size: 12px; } }

/* ═══════════════════════════════════════════════════════════════════
   모바일 상품 목록 — 필터가 화면을 다 먹어 상품이 안 보이던 것 정리
   (개편 전: 첫 상품이 776px 아래에서 시작 → 844px 화면에 상품이 안 보였다)
   ═══════════════════════════════════════════════════════════════════ */
.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex: 0 0 auto; }

@media (max-width: 920px) {
  .hide-m { display: none; }

  /* 페이지 머리말 축소 — 빵부스러기·설명은 접고 제목만 */
  .page-head { padding-top: 18px; }
  .page-head .breadcrumb { margin-bottom: 8px; font-size: 12.5px; }
  .page-head h1 { font-size: 26px; }

  /* 칩은 줄바꿈 대신 가로 스크롤 한 줄 (2줄씩 차지하던 것 → 1줄) */
  .filters { padding-block: 14px 12px; }
  .filters .chips { padding-block: 2px; }
  .filters .chips + .chips { margin-top: 8px; }
  .chip-btn { padding: 7px 14px; font-size: 13.5px; }

  /* 결과 수 + 정렬만 한 줄. 검색은 헤더 돋보기와 겹쳐서 숨긴다 */
  .filter-row { margin-top: 12px; gap: 10px; }
  .filter-row .search-box { display: none; }
  .sort-select { padding: 7px 12px; font-size: 13.5px; }

  /* 필터를 헤더 아래에 붙여 스크롤 중에도 카테고리를 바꿀 수 있게 */
  .filters {
    position: sticky; top: 110px; z-index: 12;
    background: color-mix(in oklch, var(--bg) 94%, transparent);
    backdrop-filter: blur(10px);
  }

  /* 카드: 여백 줄이고 가격을 키운다 */
  .shop-grid { padding-block: 16px 40px; gap: 18px 10px; }
  .prod-cat { margin: 10px 0 2px; font-size: 10.5px; }
  .prod-name { font-size: 14.5px; }
  .prod-price { font-size: 15px; font-weight: 600; }
  .prod-code { display: none; }
}
