/* ============================================================
   server-shop 디자인 시스템 v2 — 상용 장비몰 팔레트 (검토안)
   쿨 그레이 배경 + 네이비 블루 포인트 + 가격 레드, Noto Sans KR 단일
   토큰 → 베이스 → 컴포넌트 순. 페이지 CSS는 여기 컴포넌트만 조합.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800&display=swap');

:root {
  /* 컬러 토큰 */
  --bg:        #F3F4F6;   /* 쿨 그레이 배경 */
  --surface:   #FFFFFF;   /* 카드 표면 */
  --surface-2: #F7F8FA;   /* 표 줄무늬/입력 배경 */
  --ink:       #1A1F27;   /* 본문 */
  --ink-soft:  #4C5563;   /* 보조 텍스트 */
  --ink-faint: #8A93A2;   /* 캡션/플레이스홀더 */
  --line:      #E2E5EA;   /* 경계선 */
  --line-soft: #EDEFF3;
  --clay:      #2457C5;   /* 포인트 (네이비 블루) — 토큰명은 v1 호환 유지 */
  --clay-deep: #1A409A;
  --clay-tint: #E8EEFB;
  --price:     #D93A2B;   /* 가격 강조 (장비몰 관례) */
  --ok:        #1E8A5F;   /* 판매중/동작정상 */
  --ok-tint:   #E3F3EC;
  --warn:      #B07A10;   /* 예약중/부분동작 */
  --warn-tint: #F7EED7;
  --mute:      #79818E;   /* 판매완료 */
  --mute-tint: #EBEDF1;
  --danger:    #C23B2E;

  /* 타이포 — 세리프 없음, 산세리프 단일 */
  --font-body: 'Noto Sans KR', -apple-system, sans-serif;
  --font-disp: 'Noto Sans KR', -apple-system, sans-serif;

  /* 형태 — 각을 살려 도구적인 인상 */
  --radius:    8px;
  --radius-sm: 5px;
  --shadow:    0 1px 2px rgba(23,28,38,.05), 0 4px 14px rgba(23,28,38,.06);
  --shadow-lg: 0 2px 6px rgba(23,28,38,.08), 0 12px 28px rgba(23,28,38,.12);
  --maxw:      1120px;
}

/* ---------- 베이스 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1,h2,h3 { font-family: var(--font-disp); font-weight: 800; line-height: 1.3; margin: 0; letter-spacing: -0.3px; }
.disp-xl { font-size: 32px; letter-spacing: -0.8px; }
.disp-lg { font-size: 23px; }
.disp-md { font-size: 18px; }
.t-soft  { color: var(--ink-soft); }
.t-faint { color: var(--ink-faint); font-size: 13px; }
.t-clay  { color: var(--clay); }
.price   { font-weight: 800; font-variant-numeric: tabular-nums; }
.price-lg{ font-size: 26px; font-weight: 800; color: var(--price); font-variant-numeric: tabular-nums; }

/* ---------- 헤더/푸터 ---------- */
.site-head {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-head .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 22px; height: 60px;
}
.brand { font-family: var(--font-disp); font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.brand em { color: var(--clay); font-style: normal; }
.gnb { display: flex; gap: 4px; flex: 1; }
.gnb a {
  padding: 7px 12px; border-radius: var(--radius-sm); font-weight: 500; color: var(--ink-soft);
}
.gnb a:hover { background: var(--surface-2); color: var(--ink); }
.gnb a.on { background: var(--clay-tint); color: var(--clay-deep); font-weight: 700; }
.site-foot {
  border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 44px;
  color: var(--ink-faint); font-size: 13px; background: var(--surface);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 700 15px var(--font-body); cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn-ghost:hover { border-color: var(--ink-faint); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2A3242; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 배지 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 4px; font-size: 12.5px; font-weight: 700;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active   { background: var(--ok-tint);   color: var(--ok); }
.badge-reserved { background: var(--warn-tint); color: var(--warn); }
.badge-sold     { background: var(--mute-tint); color: var(--mute); }
.badge-clay     { background: var(--clay-tint); color: var(--clay-deep); }
.badge-line     { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 500; }

/* 상태 등급 칩 (외관/동작) */
.grade { display: inline-flex; gap: 6px; align-items: center; }
.grade .g {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-faint);
}
.grade .g.on { background: var(--clay); border-color: var(--clay); color: #fff; }

/* ---------- 상품 카드 ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .15s, border-color .15s; position: relative;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: #C6CEDC; }
.card .thumb {
  aspect-ratio: 4/3; background: var(--surface-2); position: relative;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .badge { position: absolute; top: 10px; left: 10px; }
.card.is-sold .thumb::after {
  content: '판매완료'; position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(26,31,39,.55); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: 2px;
}
.card .body { padding: 14px 16px 16px; }
.card .title {
  font-weight: 700; font-size: 15px; line-height: 1.45; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.card .meta { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 10px; }
.card .foot { display: flex; align-items: baseline; justify-content: space-between; }
.card .price { font-size: 17px; color: var(--price); }
.card .qty { font-size: 12.5px; color: var(--ok); font-weight: 700; }

/* 카드 스펙 칩 — 목록에서 핵심 사양이 바로 보이게 */
.card .specs {
  list-style: none; margin: 0 0 12px; padding: 10px 0 0;
  border-top: 1px dashed var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.card .specs li { display: flex; gap: 8px; font-size: 12.5px; align-items: baseline; min-width: 0; }
.card .specs b {
  flex: 0 0 46px; color: var(--ink-faint); font-weight: 700;
  font-size: 11px; letter-spacing: .4px;
}
.card .specs span {
  color: var(--ink-soft); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 스펙 테이블 ---------- */
.spec { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec th, .spec td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec th { width: 130px; color: var(--ink-faint); font-weight: 500; white-space: nowrap; background: var(--surface-2); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }

/* ---------- 신뢰 패널 (상태등급/테스트/보증) ---------- */
.trust {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.trust > div { background: var(--surface); padding: 14px 16px; }
.trust .k { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.trust .v { font-weight: 700; font-size: 14.5px; }
@media (max-width: 720px) { .trust { grid-template-columns: 1fr; } }

/* ---------- 필터 바 ---------- */
.filters {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 20px;
}
.filters select, .filters input[type=search], .filters input[type=text] {
  font: 14px var(--font-body); color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; min-width: 0;
}
.filters select:focus, .filters input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--clay); outline-offset: 1px; border-color: var(--clay);
}
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fchips a {
  padding: 6px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; color: var(--ink-soft);
}
.fchips a.on { background: var(--clay); border-color: var(--clay); color: #fff; font-weight: 700; }

/* ---------- 폼 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%; font: 15px var(--font-body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }

/* ---------- 패널/섹션 ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
}
.section { margin: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head .more { font-size: 13.5px; color: var(--clay); font-weight: 700; }

/* ---------- 히어로 ---------- */
.hero { padding: 48px 0 8px; }
.hero .kicker { color: var(--clay); font-weight: 700; font-size: 13.5px; letter-spacing: 1px; margin-bottom: 10px; }
.hero p { color: var(--ink-soft); max-width: 560px; margin: 12px 0 0; }

/* 다크 히어로 패널 (홈) — 네이비 그라파이트 + 검색 일체형 */
.hero-panel {
  background: linear-gradient(135deg, #101623 0%, #16203A 55%, #1B2C55 100%);
  color: #E9EDF5; border-radius: 12px; padding: 52px 48px 44px; margin-top: 26px;
}
.hero-panel .kicker {
  color: #6E96E8; font-weight: 700; font-size: 13px; letter-spacing: 2px; margin-bottom: 12px;
}
.hero-panel h1 { color: #F5F8FE; font-size: 34px; letter-spacing: -0.8px; }
.hero-panel p { color: #99A5BD; margin: 14px 0 0; max-width: 560px; }
.hero-search { display: flex; gap: 10px; margin-top: 26px; max-width: 580px; }
.hero-search input {
  flex: 1; min-width: 0; font: 16px var(--font-body); color: #F5F8FE;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sm); padding: 12px 18px;
}
.hero-search input::placeholder { color: #7C8AA5; }
.hero-search input:focus { outline: 2px solid #4A79E8; border-color: #4A79E8; }
.hero-points {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px;
  padding: 0; margin: 24px 0 0; font-size: 13.5px; color: #99A5BD;
}
.hero-points li { display: flex; align-items: center; gap: 7px; }
.hero-points li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4A79E8; flex: 0 0 6px;
}
@media (max-width: 720px) {
  .hero-panel { padding: 34px 22px 30px; border-radius: var(--radius); }
  .hero-panel h1 { font-size: 25px; }
  .hero-search { flex-direction: column; }
}

/* 카테고리 타일 (홈) */
.cat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.cat-tiles a {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 5px;
  font: 800 17px var(--font-disp); letter-spacing: -0.3px;
  transition: box-shadow .15s, border-color .15s;
}
.cat-tiles a:hover { box-shadow: var(--shadow-lg); border-color: #C6CEDC; }
.cat-tiles a span { font: 500 13px var(--font-body); color: var(--ink-faint); }
.cat-tiles a.buy { background: var(--clay); border-color: var(--clay); color: #fff; }
.cat-tiles a.buy span { color: #C7D6F6; }
@media (max-width: 720px) { .cat-tiles { grid-template-columns: 1fr; } }

/* 안내 3카드 (홈) */
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; font-size: 14px; color: var(--ink-soft); }
.info-cards .k { font: 800 16px var(--font-disp); color: var(--ink); margin-bottom: 8px; }
@media (max-width: 720px) { .info-cards { grid-template-columns: 1fr; } }

/* ---------- 알림/빈 상태 ---------- */
.notice {
  border-left: 3px solid var(--clay); background: var(--clay-tint);
  padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px; color: var(--clay-deep);
}
.empty { text-align: center; color: var(--ink-faint); padding: 70px 0; }
.empty .big { font-family: var(--font-disp); font-weight: 800; font-size: 19px; color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- 상세 갤러리 ---------- */
.gallery .main {
  aspect-ratio: 4/3; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery .thumbs button {
  width: 64px; height: 52px; padding: 0; border: 2px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--surface-2);
}
.gallery .thumbs button.on { border-color: var(--clay); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 상세 레이아웃 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: start; }
.buybox { position: sticky; top: 76px; }
/* 모바일: 제목·가격·문의(buybox)를 갤러리보다 먼저 — 가격 보려고 스크롤 3번 금지 */
@media (max-width: 860px) {
  .detail { display: flex; flex-direction: column; }
  .buybox { order: -1; position: static; }
}
/* iOS 입력 포커스 자동 줌 방지 (16px 미만이면 강제 줌) */
@media (max-width: 720px) {
  .field input, .field textarea, .field select,
  .filters select, .filters input[type=search], .filters input[type=text] { font-size: 16px; }
}

/* ---------- 모바일 헤더 ---------- */
@media (max-width: 720px) {
  .site-head .inner { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .gnb { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .gnb::-webkit-scrollbar { display: none; }
  .gnb a { white-space: nowrap; }
  .disp-xl { font-size: 25px; }
}
