/* ============================================================
   cShop_new — 모던 다크 테마
   ============================================================ */

:root {
  --bg:        #1a1d24;
  --bg2:       #232831;
  --bg3:       #2d3441;
  --line:      #3a4252;
  --text:      #e6e8eb;
  --muted:     #8a93a6;
  --accent:    #5b9eff;
  --accent2:   #4a86d8;
  --success:   #4ade80;
  --danger:    #ef4444;
  --warning:   #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', '맑은 고딕', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.huge  { font-size: 32px; color: var(--accent); }
.hidden { display: none !important; }

/* === 상단 헤더 === */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand a {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.nav { display: flex; gap: 16px; flex: 1; }
.nav a {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--muted);
}
.nav a:hover { background: var(--bg3); color: var(--text); }
.nav a.active { background: var(--accent); color: white; }

.user { font-size: 14px; color: var(--text); }

/* === 컨테이너 === */
.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 24px;
}

/* === 카드 === */
.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin-bottom: 12px; font-size: 18px; }
.card p { margin-bottom: 8px; }

/* === center (로그인) === */
body.center {
  display: flex;
  align-items: center;
  justify-content: center;
}
body.center .card {
  width: 360px;
  max-width: 90%;
}
body.center .card h2 { text-align: center; margin-bottom: 20px; }

/* === 인풋/버튼 === */
input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

button, .btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--accent2); color: white; }
button:disabled { background: var(--line); cursor: not-allowed; }

/* === 필터 === */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.filters input { flex: 1; margin-bottom: 0; }
.filters select { width: 180px; margin-bottom: 0; }

/* === 상품 그리드 === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.goods {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.goods:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.goods .name {
  font-weight: 500;
  font-size: 14px;
  min-height: 40px;
}

/* === 아이템 이미지 === */
.img-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  background: var(--bg3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 4px;
}
.item-img {
  max-width: 96px;
  max-height: 96px;
  image-rendering: pixelated;          /* 게임 아이콘은 픽셀아트 */
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.item-img.no-img {
  display: inline-block;
  width: 64px;
  height: 64px;
  background:
    repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,0.04) 6px 12px),
    var(--bg);
  border-radius: 6px;
}
.item-img.no-img::after {
  content: "?";
  display: block;
  text-align: center;
  line-height: 64px;
  color: var(--muted);
  font-size: 28px;
  font-weight: 600;
}
.item-count {
  position: absolute;
  right: 6px;
  bottom: 4px;
  background: rgba(0,0,0,0.7);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
}

/* 모달 안 큰 이미지 */
.modal-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 140px;
  background: var(--bg3);
  border-radius: 6px;
  margin-bottom: 14px;
}
.modal-item-img {
  max-width: 128px;
  max-height: 128px;
}
.goods .price {
  color: var(--accent);
  font-weight: 600;
  font-size: 16px;
}
.goods .meta {
  font-size: 11px;
  color: var(--muted);
}
.goods .badges {
  display: flex;
  gap: 4px;
}
.badge {
  background: var(--bg3);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
}
.badge.new { background: var(--accent); color: white; }
.badge.hot { background: var(--danger); color: white; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* === 모달 === */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal-content {
  background: var(--bg2);
  border-radius: 8px;
  padding: 24px;
  width: 400px;
  max-width: 90%;
  position: relative;
}
.modal .close {
  position: absolute; right: 12px; top: 8px;
  font-size: 24px; cursor: pointer; color: var(--muted);
}
.modal .close:hover { color: var(--text); }

/* === footer === */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
