/* ============================================================
   Denky — 디자인 시스템
   미니멀 / 에디토리얼 · 무채색 베이스 + 딥 바이올렛 포인트 1개
   ============================================================ */

:root {
  /* color — 스마트앱(tokens.dart)과 동일한 블루 브랜드로 통일 */
  --primary: #3E95EC;
  --primary-dark: #1E78EF;
  --accent-soft: rgba(62, 149, 236, .12);
  --ink: #111827;
  --sub: #6B7280;
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --surface-2: #F3F4F6;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --success: #16A34A;
  --warn: #F59E0B;
  --error: #DC2626;

  /* radius */
  --r-card: 16px;
  --r-btn: 10px;
  --r-input: 10px;
  --r-full: 999px;

  /* shadow */
  --sh-1: 0 1px 2px rgba(17, 24, 39, .06);
  --sh-2: 0 6px 20px rgba(17, 24, 39, .08);
  --sh-3: 0 18px 48px rgba(17, 24, 39, .14);

  /* layout */
  --maxw: 1280px;
  --pad: 32px;
  --header-h: 76px;

  /* type */
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { font-size: 16px; line-height: 1.6; }

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }

::selection { background: var(--accent-soft); }

/* ---- focus ring (a11y) ---- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.t-display { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -.02em; }
.t-h1 { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -.018em; word-break: keep-all; overflow-wrap: break-word; }
.t-h2 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.012em; }
.t-h3 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.t-body { font-size: 16px; line-height: 26px; font-weight: 400; }
.t-small { font-size: 14px; line-height: 22px; }
.t-caption { font-size: 12px; line-height: 18px; }
.t-sub { color: var(--sub); }
.t-mono { font-family: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; }

/* price */
.price { font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.price .unit { font-weight: 500; font-size: 13px; color: var(--sub); margin-left: 1px; }
.price-lg { font-size: 28px; }
.price-lg .unit { font-size: 16px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-btn);
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 0 20px; height: 46px; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease);
}
/* 버튼 라벨 — 상품명처럼 긴 글자는 버튼 밖으로 나가지 않고 말줄임(…)으로 자른다.
   (min-width:0 이 있어야 flex 안에서 글자가 줄어들 수 있다) */
.btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

/* 주요 버튼 — 스마트앱 DenkyButton(primary)과 같은 파란 그라데이션 */
.btn-primary { background: linear-gradient(135deg, #4AA6FF, #1E78EF); color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #3E95EC, #1565D8); }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }

/* 연블루 버튼 — 스마트앱 BtnVariant.soft 와 동일 (사진 등록 같은 보조 액션용) */
.btn-soft { background: var(--accent-soft); color: var(--primary-dark); }
.btn-soft:hover { background: rgba(62, 149, 236, .22); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

.btn[disabled] { opacity: .45; pointer-events: none; }

/* ============================================================
   CHIPS / BADGES
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.chip-soft { background: var(--accent-soft); color: var(--primary-dark); }
.chip-outline { background: #fff; border-color: var(--border); color: var(--sub); }
.chip button.x { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0; opacity: .6; }
.chip button.x:hover { opacity: 1; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
}

.tag { font-size: 12px; color: var(--sub); }

/* ============================================================
   FORM
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.input {
  height: 48px; padding: 0 16px; border: 1px solid var(--border-strong);
  border-radius: var(--r-input); background: #fff; font-size: 15px; color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  width: 100%;
}
.input::placeholder { color: #9CA3AF; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(109,40,217,.12); }

/* checkbox */
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 5px 0; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  background: #fff; display: grid; place-items: center; flex: none;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.check .box svg { opacity: 0; transform: scale(.6); transition: opacity .14s var(--ease), transform .14s var(--ease); }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { outline: 2px solid var(--primary); outline-offset: 2px; }
.check .lbl { font-size: 14px; color: var(--ink); }
.check:hover .lbl { color: var(--primary-dark); }
.check .cnt { margin-left: auto; font-size: 12px; color: var(--sub); }

/* color swatch checkbox */
.swatch-check { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.swatch-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-check .sw {
  width: 32px; height: 32px; border-radius: var(--r-full); border: 1px solid rgba(0,0,0,.12);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.swatch-check input:checked + .sw { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); transform: scale(1.04); }
.swatch-check .nm { font-size: 11px; color: var(--sub); }
.swatch-check input:checked ~ .nm { color: var(--primary-dark); font-weight: 600; }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--sh-1); overflow: hidden;
}

/* product card */
.pcard { cursor: pointer; }
.pcard .thumb {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-card);
  background: var(--surface-2);
}
.pcard .thumb .ph-img { width: 100%; height: 100%; transition: transform .5s var(--ease); }
.pcard:hover .thumb .ph-img { transform: scale(1.04); }
/* 상품 카드 찜(하트) 버튼 — 썸네일 오른쪽 위, 찜 상태면 붉게 */
.pcard .wish-btn {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--sub); box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: color .14s var(--ease), transform .14s var(--ease);
  z-index: 2;
}
.pcard .wish-btn:hover { transform: scale(1.1); color: #E11D48; }
.pcard .wish-btn.on { color: #E11D48; }

.pcard .tryon-pop {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.pcard:hover .tryon-pop { opacity: 1; transform: translateY(0); }
.pcard .meta { padding: 6px 4px 4px; }
/* 상품명 — 판매자(브랜드) 줄과 같은 글자체(12px·기본 굵기), 줄 간격 최소 */
.pcard .nm {
  font-size: 12px; font-weight: 400; color: var(--ink); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0 0 2px;
}
.pcard:hover .nm { color: var(--primary-dark); }
.pcard .brand { font-size: 12px; color: var(--sub); margin: 0 0 1px; }

/* image placeholder (striped) */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; position: relative; overflow: hidden;
}
.ph .ph-label {
  font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11px;
  color: rgba(17,24,39,.42); background: rgba(255,255,255,.55); padding: 3px 8px; border-radius: 6px;
  backdrop-filter: blur(2px); z-index: 1; letter-spacing: .02em;
}

/* ============================================================
   HEADER
   ============================================================ */
.hdr {
  /* 히어로 모델(z-index 100)보다 위여야 카테고리 드롭다운이 모델에 안 가림.
     모달(scrim 150)·토스트(200)보다는 아래로 유지. */
  position: sticky; top: 0; z-index: 120; background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.hdr.scrolled { border-color: var(--border); box-shadow: var(--sh-1); }
.hdr-inner { height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { font-weight: 800; font-size: 23px; letter-spacing: -.04em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.logo-lockup { height: 60px; width: auto; display: block; }
.hdr-search {
  flex: 1; max-width: 540px; height: 46px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full);
  padding: 0 8px 0 18px; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.hdr-search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(109,40,217,.1); }
.hdr-search input { flex: 1; border: 0; background: none; font-size: 14.5px; outline: none; color: var(--ink); }
.hdr-nav { display: flex; align-items: center; gap: 4px; }
.hdr-nav a, .hdr-nav button {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: var(--r-btn);
  font-size: 14px; font-weight: 500; color: var(--ink); background: none; border: 0;
  white-space: nowrap;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.hdr-nav a:hover, .hdr-nav button:hover { background: var(--surface-2); }
.hdr-nav .ic-btn { position: relative; padding: 9px; }
.hdr-nav .ic-btn .badge { position: absolute; top: 0; right: 0; transform: translate(25%,-25%); }

/* 스마트앱 하단 탭과 같은 모양의 헤더 탭 — 아이콘 위 + 라벨 아래, 활성 탭은 파란 알약 배경
   (.hdr-nav button 기본 규칙보다 우선하도록 .hdr-nav 를 붙여 적는다) */
.hdr-nav .hdr-tab {
  flex-direction: column; gap: 3px; padding: 4px 5px; cursor: pointer;
}
.hdr-nav .hdr-tab:hover { background: none; }
.hdr-nav .hdr-tab .tab-ic {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 30px; border-radius: 12px; color: var(--ink);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.hdr-nav .hdr-tab:hover .tab-ic { background: var(--surface-2); }
.hdr-nav .hdr-tab.on .tab-ic, .hdr-nav .hdr-tab.on:hover .tab-ic { background: var(--primary); color: #fff; }
.hdr-nav .hdr-tab .tab-lb { font-size: 11px; font-weight: 500; color: var(--sub); line-height: 1; }
.hdr-nav .hdr-tab.on .tab-lb { color: var(--primary); font-weight: 700; }
.hdr-nav .hdr-tab .tab-ic .badge { position: absolute; top: -5px; right: -7px; }

/* ============================================================
   FOOTER
   ============================================================ */
.ftr { border-top: 1px solid var(--border); background: var(--surface); margin-top: 96px; }
.ftr-inner { padding: 56px 0 48px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.ftr h4 { font-size: 13px; font-weight: 700; margin: 0 0 16px; color: var(--ink); }
.ftr ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ftr a { font-size: 13.5px; color: var(--sub); }
.ftr a:hover { color: var(--ink); }
.ftr-bottom { border-top: 1px solid var(--border); padding: 22px 0; font-size: 12.5px; color: var(--sub); display: flex; justify-content: space-between; }

/* ============================================================
   SECTIONS / MISC
   ============================================================ */
.section { padding: 72px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin: 0 0 10px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* 카탈로그(상품 목록) 전용 — 항상 5열, 카드가 창 크기에 맞춰 균등 스케일(1fr).
   권장 최소 창폭 ~1100px (그 아래는 카드가 좁아져 4→3→2열로 자연스럽게 줄인다). */
.grid-catalog { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .grid-catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .grid-catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 600px)  { .grid-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

/* 2단 레이아웃(상세/히어로) — 인라인 대신 클래스로 빼 반응형 처리 */
/* minmax(0,1fr) — 그냥 1fr(=minmax(auto,1fr))이면 우측(사이즈 카드)의 넓은 내용이 좌측 칼럼을
   최소폭까지 밀어 한글 제목이 한 글자씩 세로로 깨진다. 0 하한으로 진짜 균등 분할을 강제한다. */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.detail-sticky { position: sticky; top: 96px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.catalog-flex { display: flex; gap: 36px; align-items: flex-start; }

/* ===== 반응형 (태블릿/모바일) ===== */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .ftr-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .detail-sticky { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .catalog-flex { flex-direction: column; gap: 16px; }
  .catalog-flex aside { width: 100% !important; }
  .section { padding: 40px 0; }
  .section-head { margin-bottom: 20px; }
  .hdr-search { display: none; }      /* 모바일 헤더 정리 (검색 아이콘화는 후속) */
  .hdr-inner { gap: 12px; }
  .ftr { margin-top: 56px; }
  .ftr-inner { grid-template-columns: 1fr 1fr; gap: 24px; padding: 36px 0 32px; }
  .ftr-bottom { flex-direction: column; gap: 6px; align-items: flex-start; }
}

/* ===== 넓은 화면(풀스크린) — 컨테이너를 넓히고 열을 늘려 한 화면에 더 많은 타일 ===== */
@media (min-width: 1440px) {
  :root { --maxw: 1600px; }
  .grid-4 { grid-template-columns: repeat(5, 1fr); }
  .grid-3 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1800px) {
  :root { --maxw: 1840px; }
  .grid-4 { grid-template-columns: repeat(6, 1fr); gap: 20px; }
  .grid-3 { grid-template-columns: repeat(5, 1fr); gap: 20px; }
}

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* skeleton */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, #eceef1 37%, var(--surface-2) 63%);
  background-size: 800px 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px;
}

/* toast */
.toast-wrap { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--r-btn);
  font-size: 14px; font-weight: 500; box-shadow: var(--sh-3); display: flex; align-items: center; gap: 10px;
  animation: toastIn .28s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(17,24,39,.55); backdrop-filter: blur(2px); z-index: 150; display: grid; place-items: center; animation: fadeIn .2s var(--ease); padding: 40px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* page fade */
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page { animation: pageIn .26s var(--ease); }

@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* empty state */
.empty { text-align: center; padding: 80px 20px; }
.empty .ill {
  width: 120px; height: 120px; margin: 0 auto 24px; border-radius: 50%;
  background: var(--surface-2); display: grid; place-items: center; color: var(--border-strong);
}

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner-dark { border-color: var(--border); border-top-color: var(--primary); }

/* layout-variant: top filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 0;
}

/* ====== 카테고리 메가메뉴 (네이버식 2단 호버 플라이아웃) ====== */
.cat-menu { position: relative; display: inline-flex; align-items: center; }
.cat-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--ink); font-family: inherit;
  transition: color .15s;
}
.cat-trigger:hover, .cat-trigger.on { color: var(--primary); }

.cat-flyout {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 60;
  display: flex; min-width: 540px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--sh-2); overflow: hidden;
  animation: catpop .16s ease;
}
@keyframes catpop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* 트리거와 패널 사이 빈틈에서도 호버가 끊기지 않도록 다리(bridge) */
.cat-flyout::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }

.cat-groups {
  width: 156px; flex: none; margin: 0; padding: 8px; list-style: none;
  background: var(--surface); border-right: 1px solid var(--border);
}
.cat-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
  white-space: nowrap; transition: background .12s, color .12s;
}
.cat-group svg { color: var(--sub); opacity: .6; }
.cat-group.on { background: #fff; color: var(--primary); box-shadow: var(--sh-1, 0 1px 2px rgba(17,24,39,.06)); }
.cat-group.on svg { color: var(--primary); opacity: 1; }

.cat-panel { flex: 1; min-width: 360px; padding: 16px 18px 14px; display: flex; flex-direction: column; }
.cat-panel-head { font-size: 12.5px; font-weight: 700; color: var(--sub); letter-spacing: .02em; margin-bottom: 12px; }
.cat-values { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-value {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
  font-family: inherit; transition: border-color .12s, color .12s, background .12s;
}
.cat-value:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }
.cat-sw { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
.cat-all {
  margin-top: 16px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--primary); font-family: inherit;
}
.cat-all:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .cat-flyout { min-width: 0; width: 92vw; right: -40px; }
  .cat-panel { min-width: 0; }
}

/* ============================================================
   CATEGORY RAIL (가로 스크롤)
   ============================================================ */
.cat-rail-wrap { position: relative; }
.cat-rail {
  display: flex; gap: 9px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 8px;
  -ms-overflow-style: none; scrollbar-width: none;
  /* 15개가 다 들어가면 중앙 정렬, 넘치면 100%로 캡되어 좌측정렬+가로스크롤 유지
     (여성/남성/전체 탭처럼 창 크기가 변해도 그 줄에서 중앙에 배치) */
  width: fit-content; max-width: 100%; margin-inline: auto;
}
.cat-rail::-webkit-scrollbar { display: none; height: 0; }
.cat-tile {
  flex: none; width: 57px;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: center;
}
.cat-thumb {
  width: 57px; height: 71px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--sh-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.cat-tile:hover .cat-thumb { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--primary); }
.cat-label {
  display: block; margin-top: 5px; font-size: 10px; font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.cat-tile:hover .cat-label { color: var(--primary-dark); }

/* edge-reveal arrows (세로 막대형) */
.rail-arrow {
  position: absolute; top: 4px; height: 71px; width: 30px;
  border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  display: grid; place-items: center; color: var(--ink); cursor: pointer; z-index: 5;
  box-shadow: var(--sh-2);
  pointer-events: none;
  transition: opacity .18s var(--ease), background .15s var(--ease);
}
.rail-arrow:hover { background: #fff; }
.rail-arrow-l { left: 0; }
.rail-arrow-r { right: 0; }
