:root {
  --bg: #0b0b0d;
  --panel: #16161a;
  --border: #2a2a30;
  --text: #f5f5f7;
  --muted: #8a8a92;
  --red: #e11d2a;
  --green: #3fb950;
  --shadow: 0 6px 24px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh;
  font-family: "Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
  font-size: 15px; line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 공통 헤더 */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,11,13,0.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: 0.05em; }
.brand .dot { color: var(--red); }
nav.menu { display: flex; gap: 4px; flex: 1; }
nav.menu a {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted);
  transition: all 0.15s;
}
nav.menu a:hover { color: var(--text); background: var(--panel); }
nav.menu a.active { color: var(--text); background: var(--panel); }

/* 언어 스위처 */
.lang-switch { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang-switch .lang-btn {
  padding: 4px 10px; background: transparent; border: 0; border-radius: 999px;
  color: var(--muted); font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.lang-switch .lang-btn:hover { color: var(--text); }
.lang-switch .lang-btn.on { background: var(--red); color: #fff; }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 19px; margin: 28px 0 12px; }
h3 { font-size: 15px; color: var(--muted); margin: 16px 0 8px; font-weight: 600; }
.sub { color: var(--muted); margin-bottom: 18px; font-size: 14px; }

/* 카드 그리드 */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; cursor: pointer; transition: all 0.18s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); }
.card .thumb {
  width: 100%; aspect-ratio: 1.3; background: #0d0d0f; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  margin-bottom: 12px; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .name { font-weight: 700; font-size: 15px; line-height: 1.35; min-height: 2.7em; }
.card .summary { color: var(--muted); font-size: 12px; margin-top: 6px; min-height: 3em; }
.card .price { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card .price b { font-size: 16px; color: var(--red); }
.card .price small { color: var(--muted); font-size: 11px; }

/* 카테고리 필터 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  padding: 6px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.filters button.on { background: var(--red); border-color: var(--red); color: #fff; }
.filters button:hover { color: var(--text); }

/* 입력/검색 바 */
.searchbar { display: flex; gap: 8px; margin-bottom: 16px; }
.searchbar input {
  flex: 1; padding: 10px 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; outline: none; font-size: 14px;
}
.searchbar input:focus { border-color: var(--red); }
.searchbar button {
  padding: 10px 18px; background: var(--red); color: #fff; border: 0; border-radius: 10px;
  cursor: pointer; font-weight: 600;
}

/* 모달 */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  max-width: 800px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px;
}
.modal .close-btn {
  float: right; background: transparent; border: 0; color: var(--muted); font-size: 22px; cursor: pointer;
}
.modal h2 { margin-top: 0; }
.modal .modal-thumb { width: 100%; aspect-ratio: 1.4; background: #0d0d0f; border-radius: 10px; margin: 14px 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 70px; }
.modal .modal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.specs-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.specs-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.specs-table td:first-child { color: var(--muted); width: 28%; }
.use-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.use-tags span { padding: 4px 10px; background: #0d0d0f; border-radius: 6px; font-size: 12px; color: var(--muted); }

/* 견적 테이블 */
.quote-row {
  display: grid; grid-template-columns: 1fr 90px 110px 110px 40px; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.quote-row.head { color: var(--muted); font-size: 12px; border-bottom-color: var(--text); }
.quote-row select, .quote-row input {
  padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
}
.quote-row .qty { width: 70px; text-align: center; }
.quote-row .del-btn { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }
.quote-summary {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 22px; margin-top: 16px;
}
.quote-summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.quote-summary .row.total { font-size: 20px; font-weight: 700; color: var(--red); border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }

/* 챗봇 */
.chat-area { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-height: 480px; display: flex; flex-direction: column; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 6px; max-height: 60vh; }
.chat-bubble { padding: 10px 14px; border-radius: 12px; max-width: 85%; line-height: 1.5; font-size: 14px; white-space: pre-wrap; }
.chat-bubble.user { align-self: flex-end; background: var(--red); color: #fff; }
.chat-bubble.bot { align-self: flex-start; background: #0d0d0f; border: 1px solid var(--border); }
.chat-recos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chat-reco-card {
  background: #0d0d0f; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; cursor: pointer;
}
.chat-reco-card b { color: var(--red); font-size: 13px; }

/* CTA 버튼 (구매·문의) */
.cta-primary {
  padding: 11px 20px; background: var(--red); color: #fff; border: 0; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.cta-primary:hover { background: #c5141f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(225,29,42,0.3); }
.cta-secondary {
  padding: 11px 20px; background: var(--panel); color: var(--text); border: 1px solid var(--red); border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.cta-secondary:hover { background: var(--red); color: #fff; }

/* 카드의 빠른 견적담기 버튼 */
.card-cta {
  margin-top: 8px; padding: 8px 12px; background: rgba(225,29,42,0.1); color: var(--red); border: 1px solid var(--red);
  border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.card-cta:hover { background: var(--red); color: #fff; }

/* 주문 문의 모달 폼 */
.inq-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.inq-field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.inq-field input, .inq-field textarea {
  padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; font-family: inherit;
}
.inq-field input:focus, .inq-field textarea:focus { outline: 0; border-color: var(--red); }
.inq-field textarea { resize: vertical; min-height: 60px; }

/* 발송 옵션 버튼 (이메일/카톡/전화/복사) */
.share-btn {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: all 0.15s;
}
.share-btn:hover { border-color: var(--red); transform: translateX(2px); }
.share-btn small { color: var(--muted); font-size: 11px; font-weight: 400; }
.share-btn.share-btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.share-btn.share-btn-primary small { color: rgba(255,255,255,0.8); }

/* 토스트 애니메이션 */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 매뉴얼 뷰어 */
.manual-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.manual-sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-height: 80vh; overflow-y: auto; position: sticky; top: 80px; }
.manual-sidebar a {
  display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 13px;
  margin-bottom: 2px;
}
.manual-sidebar a:hover { background: #0d0d0f; color: var(--text); }
.manual-sidebar a.active { background: var(--red); color: #fff; }
.manual-content { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; }
.manual-content h1, .manual-content h2, .manual-content h3 { margin-top: 1.4em; }
.manual-content code { background: #0d0d0f; padding: 2px 6px; border-radius: 4px; font-family: "Consolas","Monaco",monospace; font-size: 13px; }
.manual-content pre { background: #0d0d0f; border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; }
.manual-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.manual-content th, .manual-content td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.manual-content blockquote { border-left: 3px solid var(--red); padding: 6px 14px; color: var(--muted); margin: 12px 0; }
.manual-content ul, .manual-content ol { padding-left: 22px; }

/* 메인 허브 */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.hub-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; cursor: pointer; transition: all 0.18s; }
.hub-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow); }
.hub-card .icon { font-size: 36px; margin-bottom: 8px; }
.hub-card h3 { color: var(--text); font-size: 17px; margin: 0 0 6px; }
.hub-card p { color: var(--muted); font-size: 13px; margin: 0; }

@media (max-width: 720px) {
  main { padding: 16px; }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-sidebar { position: static; max-height: 200px; }
  .quote-row { grid-template-columns: 1fr 70px 90px 32px; }
  .quote-row .price-col { display: none; }
}
