/* ===== category.css — 카테고리 페이지(비교·카탈로그) + 카테고리 인덱스 전용. 세션 #17 =====
   .catpage / .catindex 로 스코프해 전역(components/pages.css) 클래스와 충돌 방지.
   색·폰트는 tokens.css 변수 사용(흰 바탕·녹색·NanumSquare Neo). 프로토타입(scripts/*_prototype.py) 이식. */

.catpage { --off: #c0392b; }

/* 카테고리 바 (이름 + 서브탭) */
.catbar { border-bottom: 1px solid var(--border); background: var(--card-bg); }
.catbar-in { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px 0; }
.catbar .catname { font-size: 18px; font-weight: 800; color: var(--text); }
.catbar .tabs { display: flex; gap: 22px; margin-top: 12px; }
.catbar .tabs a { font-size: 14px; color: var(--meta); font-weight: 600; padding-bottom: 11px; border-bottom: 2px solid transparent; }
.catbar .tabs a.on { color: var(--accent); border-color: var(--accent); }

/* 본문 — 좌우 여백은 .wrap(24px)에 위임. padding shorthand는 .wrap 좌우를 0으로 덮어 헤더와 어긋남(세션 #18) */
.catpage { padding-top: 24px; padding-bottom: 70px; }
.catpage .crumb { font-size: 14px; color: var(--meta); margin-bottom: 12px; }
.catpage .disc { display: flex; gap: 9px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; font-size: 12.5px; color: var(--sub); margin-bottom: 16px; }
.catpage .disc b { color: var(--text); }
.catpage h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; margin: 6px 0 10px; color: var(--text); }
.catpage .byline { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--meta); margin-bottom: 10px; }
.catpage .byline .av { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.catpage .byline .au { color: var(--text); font-weight: 700; }
.catpage .lead { font-size: 16px; color: var(--sub); margin: 12px 0 16px; line-height: 1.8; }
.catpage .lead b { color: var(--text); }
.catpage .soon { border: 1px dashed #cfd4da; border-radius: 10px; padding: 16px; margin: 18px 0; font-size: 14px; color: var(--meta); background: var(--card-bg); line-height: 1.7; }
.catpage .soon b { color: var(--text); }
.catpage .sechead { margin: 34px 0 14px; padding-left: 14px; border-left: 4px solid var(--accent); }
.catpage .sechead .eb { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
.catpage .sechead h2 { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.3; margin-top: 3px; }

/* 정렬·필터 (정적 칩 — 인터랙션 JS는 후속) */
.catpage .sortbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.catpage .sortbar .lbl { font-size: 14px; color: var(--meta); font-weight: 700; margin-right: 2px; }
.catpage .sort { font-size: 14px; font-weight: 700; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff; color: var(--sub); cursor: pointer; user-select: none; }
.catpage .sort:hover { border-color: var(--accent); color: var(--accent-ink); }
.catpage .sort.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.catpage .sort.on:hover { color: #fff; }
.catpage .filters { display: flex; flex-direction: column; gap: 9px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin-bottom: 16px; }
.catpage .frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.catpage .frow .fl { font-size: 14px; color: var(--meta); font-weight: 800; flex: 0 0 54px; }
.catpage .chip { font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 16px; border: 1px solid var(--border); background: #fff; color: var(--sub); cursor: pointer; user-select: none; }
.catpage .chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.catpage .chip.on { background: #eaf5f0; border-color: var(--accent); color: var(--accent-ink); font-weight: 800; }
.catpage .countbar { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--meta); margin-bottom: 12px; }
.catpage .countbar b { color: var(--text); }

/* 카탈로그 그리드 (점수 없음 — 가격·할인·티어) */
.catpage .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.catpage .card { border: 1px solid var(--border); border-radius: 12px; padding: 13px; background: #fff; display: flex; flex-direction: column; }
.catpage .badges { display: flex; gap: 6px; margin-bottom: 9px; }
.catpage .tier { font-size: 11px; font-weight: 800; color: #fff; border-radius: 5px; padding: 2px 8px; }
.catpage .tier.t-budget { background: var(--accent); }
.catpage .tier.t-premium { background: #7a6a4d; }
.catpage .typ { font-size: 11.5px; font-weight: 700; color: var(--meta); background: var(--card-bg); border-radius: 5px; padding: 2px 8px; }
.catpage .card .img { height: 160px; background: var(--wood-3); border: 1px solid var(--border); border-radius: 9px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.catpage .card .img img { width: 100%; height: 100%; object-fit: contain; }
.catpage .nm { font-size: 14px; font-weight: 700; line-height: 1.4; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.catpage .price { font-size: 19px; font-weight: 800; color: var(--text); margin: 7px 0 3px; }
.catpage .sig { font-size: 14px; color: var(--sub); display: inline-block; margin-bottom: 11px; }
.catpage .sig s { color: var(--meta); }
.catpage .sig .off { color: var(--off); font-weight: 800; }
.catpage .sig.nodisc { color: var(--meta); }
/* 판매량 정직 표기 (알리 기준 — 세션 #19) */
.catpage .vol { font-size: 12.5px; color: var(--sub); margin: 2px 0 9px; }
.catpage .vol b { color: var(--text); }
.catpage .vol .dim, .catpage .tvol .dim { color: var(--meta); font-weight: 400; }
.catpage .tvol { font-size: 13px; color: var(--accent-ink); font-weight: 700; margin: 3px 0 8px; }
.catpage .tvol b { color: var(--accent); }
.catpage .btns { display: flex; gap: 6px; margin-top: auto; }
.catpage .btn { font-size: 14px; font-weight: 700; padding: 10px 12px; border-radius: 8px; text-align: center; }
.catpage .btn.primary { background: var(--accent); color: #fff; flex: 1; font-size: 14px; }
.catpage .btn.ghost { background: #fff; color: var(--accent-ink); border: 1px solid var(--border); font-size: 14px; }
.catpage .honest { margin-top: 18px; font-size: 14px; color: var(--meta); background: var(--card-bg); border: 1px dashed #cfd4da; border-radius: 9px; padding: 12px 15px; line-height: 1.7; }
.catpage .honest b { color: var(--text); }

@media (max-width: 760px) {
  .catpage .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .catpage .card .img { height: 120px; }
  .catpage h1 { font-size: 21px; }
  .catpage .nm { min-height: 36px; font-size: 14px; }
}

/* ===== 카테고리 인덱스 ===== */
.catindex { padding-top: 40px; padding-bottom: 70px; } /* 좌우는 .wrap(24px)에 위임 — 헤더 정렬(세션 #18) */
.catindex h1 { font-size: var(--fs-h1); font-weight: 800; margin: 6px 0 10px; color: var(--text); }
.catindex .grp { font-size: 14px; font-weight: 800; color: var(--accent); margin: 26px 0 4px; letter-spacing: .04em; }
.catindex .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.catindex .ccard { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: #fff; display: block; }
.catindex a.ccard:hover { border-color: var(--accent); }
.catindex .ccard .cn { font-size: 17px; font-weight: 800; color: var(--text); }
.catindex .ccard .ci { font-size: 14px; color: var(--sub); margin-top: 6px; line-height: 1.6; }
.catindex .ccard .cmeta { font-size: 14px; color: var(--meta); margin-top: 10px; }
.catindex .soon-badge { display: inline-block; font-size: 10.5px; font-weight: 800; color: var(--meta); background: var(--card-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
@media (max-width: 760px) { .catindex .grid { grid-template-columns: 1fr; } }

/* ===== 구매가이드 prose (마크다운 변환 본문) ===== */
.catpage .cat-guide { font-size: 16px; color: var(--sub); line-height: 1.85; }
.catpage .cat-guide h2 { font-size: 17px; font-weight: 800; color: var(--text); margin: 24px 0 10px; }
.catpage .cat-guide h3 { font-size: 15px; font-weight: 800; color: var(--text); margin: 18px 0 8px; }
.catpage .cat-guide p { margin: 10px 0; }
.catpage .cat-guide strong, .catpage .cat-guide b { color: var(--text); }
.catpage .cat-guide ul, .catpage .cat-guide ol { margin: 10px 0; padding-left: 20px; }
.catpage .cat-guide li { margin: 5px 0; }

/* ===== 추천 6선 2티어 비교 ===== */
.catpage .tier-intro { font-size: 14px; color: var(--sub); margin: 2px 0 14px; line-height: 1.7; }
.catpage .tier-intro b { color: var(--text); }
.catpage .tier-intro .dim { color: var(--meta); }
/* 카드마다 grid-area(행/열) 지정 → 같은 행끼리 stretch로 높이가 맞아 아래단 정렬(세션 #19) */
.catpage .picks { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 12px; align-items: stretch; }
.catpage .tier-label { font-size: 14.5px; font-weight: 800; color: var(--text); margin: 0; padding: 7px 13px; background: var(--card-bg); border-left: 3px solid var(--accent); border-radius: 6px; }
.catpage .tier-label.premium { border-left-color: #7a6a4d; }
.catpage .pcard { border: 1px solid var(--border); border-radius: 12px; padding: 13px; margin-bottom: 12px; background: #fff; }
.catpage .pimg { display: flex; height: 150px; background: var(--wood-3); border: 1px solid var(--border); border-radius: 9px; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.catpage .pimg img { width: 100%; height: 100%; object-fit: contain; }
.catpage .pnm { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--text); }
.catpage .pprice { font-size: 18px; font-weight: 800; color: var(--text); margin: 5px 0 2px; }
.catpage .psig { font-size: 11.5px; color: var(--sub); display: inline-block; margin-bottom: 8px; }
.catpage .psig s { color: var(--meta); }
.catpage .psig .off { color: var(--off); font-weight: 800; }
.catpage ul.pc { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.catpage ul.pc li { font-size: 12.5px; padding-left: 17px; position: relative; color: var(--sub); line-height: 1.5; }
.catpage ul.pc li.pro:before { content: "＋"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.catpage ul.pc li.con:before { content: "－"; position: absolute; left: 0; color: var(--off); font-weight: 800; }
.catpage .pfor { font-size: 12px; color: var(--sub); background: var(--card-bg); border-radius: 6px; padding: 8px 11px; margin-bottom: 10px; }
.catpage .pfor b { color: var(--accent-ink); }
.catpage .pcard .btn.primary { display: block; }

/* ===== FAQ ===== */
.catpage .faq details { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 9px; }
/* 질문 — 회색 배경 + 녹색 'Q' 마커 */
.catpage .faq summary { display: flex; gap: 9px; align-items: center; font-weight: 700; cursor: pointer; list-style: none; font-size: 15.5px; color: var(--text); background: var(--card-bg); padding: 12px 15px; }
.catpage .faq summary::-webkit-details-marker { display: none; }
.catpage .faq summary::before { content: "Q"; flex: 0 0 auto; width: 23px; height: 23px; background: var(--accent); color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
/* 답변 — 흰 배경 + 회색 'A' 마커 */
.catpage .faq p { display: flex; gap: 9px; align-items: flex-start; font-size: 15.5px; color: var(--sub); line-height: 1.7; padding: 13px 15px; margin: 0; background: #fff; }
.catpage .faq p::before { content: "A"; flex: 0 0 auto; width: 23px; height: 23px; background: var(--meta); color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; margin-top: 1px; }

@media (max-width: 760px) {
  /* 그리드 해제 → grid-area 무시되고 DOM 순서(실속 묶음→고급 묶음)대로 1열 흐름 */
  .catpage .picks { display: block; }
  .catpage .picks .tcard { margin-bottom: 12px; }
  .catpage .picks .tier-label.premium { margin-top: 22px; }
}

/* ===== 타입 선택기 ===== */
.catpage .typesel { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin: 8px 0 18px; }
.catpage .tsel { flex: 0 0 auto; width: 118px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.catpage .tsel:hover { border-color: var(--accent); }
.catpage .tsel .ti { height: 80px; background: var(--wood-3); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 22px; color: var(--meta); }
.catpage .tsel .ti img { width: 100%; height: 100%; object-fit: contain; }
.catpage .tsel .tl { font-size: 13px; font-weight: 700; text-align: center; padding: 7px 5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catpage .tsel.more .ti { font-size: 26px; color: var(--accent); }
.catpage .tsel.more .tl { color: var(--accent-ink); }

/* ===== 신뢰 박스 ===== */
.catpage .box { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.catpage .box .bt { font-size: 14px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.catpage .box p { font-size: 15px; color: var(--sub); line-height: 1.7; }
.catpage .box .dim { color: var(--meta); }

/* ===== 본문 소제목·문단 ===== */
.catpage .sub-h { font-size: 16px; font-weight: 800; margin: 22px 0 8px; color: var(--text); }
.catpage .p { font-size: 16px; color: var(--sub); margin: 9px 0; line-height: 1.8; }
.catpage .p b { color: var(--text); }

/* ===== 타입 비교표 ===== */
.catpage table.ttable { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.catpage table.ttable th, .catpage table.ttable td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.catpage table.ttable thead th { background: var(--card-bg); font-weight: 700; color: var(--text); font-size: 14px; }
.catpage table.ttable td { color: var(--sub); }
.catpage table.ttable td b { color: var(--text); }

/* ===== 체크리스트 (2열 카드 — 제목·설명 분리, 가독성) =====
   클래스명 'checklist' — 전역 .chk(pages.css 필터 칩, display:flex)와 충돌 회피. */
.catpage ul.checklist { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catpage ul.checklist li { background: var(--card-bg); border: 1px solid var(--border); border-radius: 9px; padding: 13px 15px 13px 38px; position: relative; }
.catpage ul.checklist li:before { content: "✓"; position: absolute; left: 15px; top: 13px; color: var(--accent); font-weight: 800; }
.catpage ul.checklist .ck-t { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.catpage ul.checklist .ck-w { font-size: 14.5px; color: var(--sub); line-height: 1.65; }
@media (max-width: 760px) { .catpage ul.checklist { grid-template-columns: 1fr; } }

/* ===== 추천 카드 (tcard) — flex 칼럼 + 버튼 하단 고정으로 같은 행 카드끼리 아래단 정렬 ===== */
.catpage .tcard { border: 1px solid var(--border); border-radius: 12px; padding: 13px; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.catpage .trank { font-size: 14px; color: var(--meta); font-weight: 600; min-height: 14px; }
.catpage .trank b { color: var(--accent); }
.catpage .timg { display: flex; height: 150px; background: var(--wood-3); border: 1px solid var(--border); border-radius: 9px; align-items: center; justify-content: center; overflow: hidden; margin: 7px 0; }
.catpage .timg img { width: 100%; height: 100%; object-fit: contain; }
.catpage .tnm { font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--text); }
.catpage .tpriceline { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 5px 0 8px; }
.catpage .tprice { font-size: 18px; font-weight: 800; color: var(--text); }
.catpage .tsig { font-size: 14px; color: var(--sub); display: inline-block; }
.catpage .tsig s { color: var(--meta); }
.catpage .tsig .off { color: var(--off); font-weight: 800; }
.catpage .pc-group { margin: 9px 0; }
.catpage .pc-label { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.catpage .pc-label.pros { color: var(--accent); }
.catpage .pc-label.cons { color: var(--off); }
.catpage ul.tpc { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.catpage ul.tpc li { font-size: 14px; padding-left: 17px; position: relative; color: var(--sub); line-height: 1.55; }
.catpage ul.tpc li.pro:before { content: "＋"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.catpage ul.tpc li.con:before { content: "－"; position: absolute; left: 0; color: var(--off); font-weight: 800; }
.catpage .tfor { font-size: 14px; color: var(--sub); background: var(--card-bg); border-radius: 6px; padding: 9px 12px; margin-bottom: 9px; }
.catpage .tfor b { color: var(--accent-ink); }
.catpage .tbtns { margin-top: auto; }  /* 카드 높이가 늘어도 버튼은 항상 바닥에 — 좌우 카드 아래단 정렬 */
.catpage .tbtns .btn { display: block; }

/* ===== 한눈에 비교표 ===== */
.catpage .cmp-wrap { overflow-x: auto; margin: 10px 0; }
.catpage table.cmp { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.catpage table.cmp th, .catpage table.cmp td { padding: 9px 11px; text-align: center; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.catpage table.cmp thead th { background: var(--card-bg); font-weight: 700; color: var(--text); font-size: 14px; line-height: 1.4; }
.catpage table.cmp thead th b { color: var(--accent); font-size: 14px; }
.catpage table.cmp tbody th { background: var(--card-bg); text-align: left; font-weight: 700; color: var(--text); white-space: nowrap; }
.catpage table.cmp td { color: var(--sub); }
.catpage table.cmp .ctier { font-size: 14px; }

/* ===== 배너형 개념 이미지 (Imagen 배경 + CSS 텍스트/CTA 오버레이) ===== */
.catpage .cat-hero { position: relative; border-radius: 14px; overflow: hidden; margin: 16px 0; min-height: 250px; background-size: cover; background-position: center; display: flex; align-items: center; }
.catpage .cat-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,28,22,.74) 0%, rgba(18,28,22,.40) 52%, rgba(18,28,22,.05) 100%); }
.catpage .cat-hero-in { position: relative; padding: 30px 32px; max-width: 600px; color: #fff; }
.catpage .ch-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .1em; opacity: .92; }
.catpage .ch-title { font-size: 25px; font-weight: 800; line-height: 1.32; margin: 9px 0 18px; color: #fff; letter-spacing: -.01em; }
.catpage .ch-cta { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; padding: 11px 22px; border-radius: 9px; }
.catpage .ch-cta:hover { background: var(--accent-ink); color: #fff; }
@media (max-width: 620px) { .catpage .cat-hero { min-height: 210px; } .catpage .cat-hero-in { padding: 22px 20px; } .catpage .ch-title { font-size: 20px; } }

/* ===== 연관 카테고리 크로스링크 ===== */
.catpage .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 12px 0; }
.catpage .rel-card { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--card-bg); }
.catpage a.rel-card:hover { border-color: var(--accent); }
.catpage .rel-name { font-size: 15px; font-weight: 800; color: var(--text); }
.catpage .rel-intro { font-size: 14px; color: var(--sub); margin-top: 5px; line-height: 1.5; }
.catpage .rel-go { font-size: 14px; color: var(--accent); font-weight: 700; margin-top: 10px; }
.catpage .rel-card.soon { opacity: .65; }
.catpage .rel-card .soon-badge { display: inline-block; font-size: 10.5px; font-weight: 800; color: var(--meta); background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
