/* ==========================================================================
   피카스토어 — 디자인 시스템
   방향: Swiss 미니멀리즘 + KREAM풍 커머스
     · 모노크롬 지배 + 단일 액센트(인터랙션) + 세일 레드(숫자에만)
     · 그림자 없음. 경계는 1px 라인으로.
     · 전환 200~250ms. 모션은 의미가 있을 때만.
     · 라이트 모드 전용.
   ========================================================================== */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* --------------------------------------------------------------------------
   1. 토큰
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* 표면 */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --tile: #f5f5f5;
  --tile-2: #ededef;

  /* 잉크 (대비 확인 완료 — 본문 4.5:1 이상) */
  --ink: #111111;
  --ink-2: #3c3c41;
  --ink-3: #66666d;
  --muted: #8e8e96;

  /* 라인 */
  --line: #efeff1;
  --line-2: #e2e2e6;
  --line-3: #cfcfd6;

  /* 액센트 — 인터랙션에만. 장식으로 쓰지 않는다 */
  --accent: #1c4eff;
  --accent-ink: #163fd6;
  --accent-soft: #eef2ff;

  /* 상태 */
  --sale: #d42a16;
  --sale-soft: #fdeeeb;
  --ok: #0e8a4f;
  --ok-soft: #e9f7f0;
  --warn: #a96500;
  --warn-soft: #fff5e6;

  /* 타이포 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-num: "Pretendard Variable", Pretendard, system-ui, sans-serif;

  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-28: 28px;

  /* 간격 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-14: 56px;
  --s-18: 72px;

  /* 모양 */
  --r-xs: 3px;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-full: 999px;

  /* 레이아웃 */
  --gutter: 16px;
  --max: 1200px;
  --header-h: 52px;
  --tabs-h: 44px;
  --bottomnav-h: 56px;

  /* 모션 */
  --dur: 220ms;
  --dur-fast: 140ms;
  --ease: cubic-bezier(0.2, 0, 0.1, 1);
}

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
    --header-h: 64px;
    --bottomnav-h: 0px;
  }
}

/* --------------------------------------------------------------------------
   2. 리셋
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* 고정 헤더가 포커스를 가리지 않도록 (WCAG 2.2 Focus Not Obscured) */
  scroll-padding-top: calc(var(--header-h) + var(--tabs-h) + 8px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-15);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  /* 하단 고정 바 + iOS 홈 인디케이터 여백 */
  padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
}

/* 모바일 더블탭 확대 방지 + 탭 지연 제거 */
html,
body,
button,
a,
input,
label,
select,
summary {
  touch-action: manipulation;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  /* 로딩 중 레이아웃 흔들림 방지 */
  background: var(--tile);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* 포커스 — 절대 지우지 않는다 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--ink);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. 유틸
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hide {
  display: none !important;
}

.only-mobile {
  display: block;
}
.only-desk {
  display: none;
}
@media (min-width: 720px) {
  .only-mobile {
    display: none;
  }
  .only-desk {
    display: block;
  }
}

/* 가로 스크롤 레일 — 스크롤바 숨김, 스냅 없음
   (스냅은 잘린 카드 탭 시 튐 버그를 유발해 쓰지 않는다) */
.rail {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.rail::-webkit-scrollbar {
  display: none;
}
.rail > * {
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   4. 타이포
   -------------------------------------------------------------------------- */
.t-hero {
  font-size: var(--fs-24);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.03em;
}
.t-sec {
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.t-title {
  font-size: var(--fs-17);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.t-body {
  font-size: var(--fs-15);
  line-height: 1.6;
}
.t-sm {
  font-size: var(--fs-13);
  line-height: 1.55;
}
.t-xs {
  font-size: var(--fs-12);
  line-height: 1.5;
}
.t-muted {
  color: var(--ink-3);
}
.t-faint {
  color: var(--muted);
}
.t-center {
  text-align: center;
}

@media (min-width: 720px) {
  .t-hero {
    font-size: var(--fs-28);
  }
  .t-sec {
    font-size: var(--fs-24);
  }
}

/* --------------------------------------------------------------------------
   5. 버튼
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  border-radius: var(--r);
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:active {
  background: #000;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--tile-2);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-outline {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-3);
}
.btn-outline:active {
  background: var(--bg-soft);
}
.btn-outline[disabled] {
  background: #fff;
  color: var(--muted);
  border-color: var(--line-2);
}

.btn-accent {
  background: var(--accent);
}
.btn-accent:active {
  background: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  min-height: 40px;
  padding: 0 var(--s-3);
  font-weight: 600;
}
.btn-ghost:active {
  background: var(--tile);
}

.btn-sm {
  min-height: 36px;
  padding: 0 var(--s-3);
  font-size: var(--fs-13);
  border-radius: var(--r-sm);
}
.btn-lg {
  min-height: 52px;
  font-size: var(--fs-17);
}
.btn-block {
  display: flex;
  width: 100%;
}

/* --------------------------------------------------------------------------
   6. 뱃지 / 태그
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-11);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  background: var(--tile-2);
  color: var(--ink-2);
}
.badge-new {
  background: var(--ink);
  color: #fff;
}
.badge-best {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.badge-sale {
  background: var(--sale-soft);
  color: var(--sale);
}
.badge-free {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-soldout {
  background: var(--ink-3);
  color: #fff;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   7. 폼
   -------------------------------------------------------------------------- */
.field {
  display: block;
  margin-bottom: var(--s-4);
}
.field > label,
.label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-2);
}
.label .req {
  color: var(--sale);
  margin-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: #fff;
  font-size: var(--fs-15);
  transition: border-color var(--dur-fast) var(--ease);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ink);
  outline: none;
}
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2366666d' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--sale);
}

.hint {
  margin-top: 6px;
  font-size: var(--fs-12);
  color: var(--ink-3);
}
.err {
  margin-top: 6px;
  font-size: var(--fs-12);
  color: var(--sale);
  font-weight: 600;
}

/* 체크박스 / 라디오 — 터치 44px 확보 */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: var(--fs-14);
  color: var(--ink-2);
}
.check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}
.check strong {
  font-weight: 700;
  color: var(--ink);
}

/* 수량 스테퍼 */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.qty button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
}
.qty button:active {
  background: var(--tile);
}
.qty button[disabled] {
  color: var(--line-3);
}
.qty input {
  width: 46px;
  height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-14);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   8. 카드 / 박스
   -------------------------------------------------------------------------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: var(--s-4);
}

.notice {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: var(--fs-13);
  color: var(--ink-2);
  line-height: 1.6;
}
.notice-warn {
  background: var(--warn-soft);
  border-color: #f0e0c4;
  color: #6b4200;
}

.empty {
  padding: var(--s-14) var(--s-4);
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-14);
}
.empty strong {
  display: block;
  margin-bottom: var(--s-2);
  font-size: var(--fs-15);
  color: var(--ink);
}

/* 스켈레톤 */
.sk {
  background: linear-gradient(90deg, var(--tile) 25%, #ededef 37%, var(--tile) 63%);
  background-size: 400% 100%;
  animation: skshine 1.2s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skshine {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* --------------------------------------------------------------------------
   9. 토스트
   -------------------------------------------------------------------------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--r-full);
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 600;
  text-align: center;
  animation: toastin var(--dur) var(--ease);
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --------------------------------------------------------------------------
   10. 시트 / 모달
   -------------------------------------------------------------------------- */
.sheet-ov {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.44);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-ov.on {
  display: flex;
}
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--s-5) var(--s-4)
    calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  animation: sheetup 260ms var(--ease);
}
@keyframes sheetup {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
@media (min-width: 720px) {
  .sheet-ov {
    align-items: center;
  }
  .sheet {
    border-radius: var(--r-lg);
    max-height: 80vh;
  }
}

/* --------------------------------------------------------------------------
   11. 아코디언
   -------------------------------------------------------------------------- */
.acc {
  border-top: 1px solid var(--line);
}
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: var(--s-3) 0;
  font-size: var(--fs-14);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker {
  display: none;
}
.acc summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--ink-3);
  border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}
.acc[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}
.acc .acc-body {
  padding: 0 0 var(--s-4);
  font-size: var(--fs-13);
  line-height: 1.7;
  color: var(--ink-2);
}
.acc .acc-body p + p {
  margin-top: var(--s-2);
}
