/* ═══════════════════════════════════════════════
   320i카 — 메인 스타일시트
   ═══════════════════════════════════════════════ */

/* ── 변수 ──────────────────────────────────────── */
:root {
  --accent:      #1c69d4;
  --accent-dark: #144e9e;
  --bg:        #0e0f12;
  --surface:   #17191e;
  --surface2:  #202329;
  --border:    #2a2d34;
  --text:      #eeeef0;
  --text2:     #a6a8ae;
  --text3:     #6c6f76;
  --white:     #ffffff;
  --max-w:     1400px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 2px 8px rgba(0,0,0,.5);
  --font:      'Noto Sans KR', 'Inter', sans-serif;
}

/* ── 리셋 ──────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:16px}
body{background:var(--bg);color:var(--text);font-family:var(--font);line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
a:hover{color:var(--accent)}
img{max-width:100%;height:auto;display:block}
button{cursor:pointer;border:none;background:none;font-family:inherit}
input,select{font-family:inherit}
ul{list-style:none}

/* ── 공통 레이아웃 ─────────────────────────────── */
.section-inner{max-width:var(--max-w);margin:0 auto;padding:0 1.25rem}

/* ── 헤더 ──────────────────────────────────────── */
.site-header{
  position:sticky;top:0;z-index:100;
  background:rgba(14,15,18,.95);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  max-width:var(--max-w);margin:0 auto;padding:0 1.25rem;
  display:flex;align-items:center;gap:1rem;height:60px;
}
.site-logo{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.logo-icon{width:32px;height:32px}
.logo-text{font-size:1.3rem;font-weight:700;letter-spacing:-.02em}
.logo-text strong{color:var(--accent)}
.header-search{
  flex:1;max-width:480px;
  display:flex;align-items:center;
  background:var(--surface);border:1px solid var(--border);
  border-radius:24px;overflow:hidden;
  transition:border-color .2s;
}
.header-search:focus-within{border-color:var(--accent)}
.header-search input{
  flex:1;padding:.5rem 1rem;
  background:none;border:none;outline:none;
  color:var(--text);font-size:.9rem;
}
.header-search button{
  padding:.5rem .9rem;color:var(--text2);
  transition:color .2s;
}
.header-search button svg{width:18px;height:18px}
.header-search button:hover{color:var(--accent)}
.header-tagline{font-size:.85rem;color:var(--text2);flex:1}
.header-nav{display:flex;gap:1.25rem;align-items:center}
.header-nav a{font-size:.9rem;font-weight:500;color:var(--text2);transition:color .2s;white-space:nowrap}
.header-nav a:hover{color:var(--white)}
.mobile-menu-btn{display:none;flex-direction:column;gap:5px;padding:.5rem}
.mobile-menu-btn span{display:block;width:22px;height:2px;background:var(--text);border-radius:2px;transition:.2s}

/* ── 모바일 메뉴 ───────────────────────────────── */
.mobile-nav{
  display:none;position:fixed;top:60px;left:0;right:0;z-index:99;
  background:var(--surface);border-bottom:1px solid var(--border);
  padding:1rem;flex-direction:column;gap:.75rem;
}
body.menu-open .mobile-nav{display:flex}
.mobile-search{display:flex;gap:.5rem}
.mobile-search input{
  flex:1;padding:.5rem .75rem;
  background:var(--surface2);border:1px solid var(--border);
  border-radius:6px;color:var(--text);outline:none;
}
.mobile-search button{padding:.5rem 1rem;background:var(--accent);color:#fff;border-radius:6px;font-size:.85rem;font-weight:700}
.mobile-nav a{padding:.4rem 0;color:var(--text2);font-size:.95rem;border-bottom:1px solid var(--border)}

/* ── 버튼 ──────────────────────────────────────── */
.btn-primary{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.65rem 1.5rem;
  background:var(--accent);color:#fff;
  border-radius:6px;font-weight:700;font-size:.9rem;
  transition:background .2s,transform .1s;
  cursor:pointer;
}
.btn-primary:hover{background:var(--accent-dark);color:#fff}
.btn-primary:active{transform:scale(.98)}
.btn-secondary{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.65rem 1.5rem;
  background:var(--surface2);color:var(--text);
  border:1px solid var(--border);border-radius:6px;
  font-weight:500;font-size:.9rem;
  transition:background .2s;
  cursor:pointer;
}
.btn-secondary:hover{background:var(--surface);color:var(--text)}
.btn-reset{
  display:block;text-align:center;margin-top:.5rem;
  padding:.5rem;font-size:.85rem;color:var(--text2);
  border:1px solid var(--border);border-radius:6px;
  transition:color .2s;
}
.btn-reset:hover{color:var(--text)}

/* ── 섹션 공통 ─────────────────────────────────── */
.section-title{font-size:1.4rem;font-weight:700;margin-bottom:1.25rem}
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.25rem}
.section-header .section-title{margin:0}
.view-all{font-size:.9rem;color:var(--text2);transition:color .2s}
.view-all:hover{color:var(--accent)}

/* ── 히어로 ────────────────────────────────────── */
.hero{
  background:linear-gradient(135deg,#0d0d0e 0%,#0f1a2e 50%,#0d0d0e 100%);
  padding:3.5rem 0 2.5rem;
  border-bottom:1px solid var(--border);
}
.hero-inner{max-width:820px;margin:0 auto;padding:0 1.25rem}
.hero-title{font-size:clamp(1.7rem,4.2vw,2.5rem);font-weight:900;line-height:1.3;margin-bottom:1rem;letter-spacing:-.02em}
.hero-title strong{color:var(--accent)}
.hero-lede{color:var(--text2);font-size:1.02rem;line-height:1.8;margin-bottom:1.5rem}
.hero-lede strong{color:var(--white)}
.hero-search{
  display:flex;border-radius:8px;overflow:hidden;
  background:var(--surface);border:2px solid var(--accent);
  max-width:520px;margin:0 0 1rem;
}
.hero-search input{
  flex:1;padding:.8rem 1.25rem;background:none;border:none;outline:none;
  color:var(--text);font-size:1rem;
}
.hero-search button{
  padding:.8rem 1.5rem;background:var(--accent);color:#fff;
  font-weight:700;font-size:.95rem;transition:background .2s;
  white-space:nowrap;
}
.hero-search button:hover{background:var(--accent-dark)}
.hero-quick{display:flex;flex-wrap:wrap;gap:.5rem;font-size:.85rem}
.hero-quick span{color:var(--text3)}
.hero-quick a{
  padding:.25rem .65rem;background:var(--surface);
  border:1px solid var(--border);border-radius:20px;
  color:var(--text2);transition:all .2s;
}
.hero-quick a:hover{border-color:var(--accent);color:var(--accent)}

/* ── 세대/트림 탭 섹션 ─────────────────────────── */
.gen-section{padding:2.5rem 0;border-bottom:1px solid var(--border)}
.gen-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem}
.gen-card{
  padding:1.25rem;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);transition:all .2s;
}
.gen-card:hover{border-color:var(--accent);background:var(--surface2)}
.gen-card strong{display:block;font-size:1.05rem;margin-bottom:.3rem}
.gen-card span{font-size:.8rem;color:var(--text2)}
.trim-tab-label{font-size:.85rem;font-weight:600;color:var(--text3);margin:1.5rem 0 .75rem;text-transform:uppercase;letter-spacing:.05em}
.trim-grid{display:flex;flex-wrap:wrap;gap:.5rem}
.trim-card{
  padding:.5rem 1rem;
  background:var(--surface);border:1px solid var(--border);
  border-radius:20px;font-size:.875rem;font-weight:500;
  color:var(--text2);transition:all .2s;white-space:nowrap;
}
.trim-card:hover{background:var(--accent);border-color:var(--accent);color:#fff}

/* ── 최신 매물 섹션 ────────────────────────────── */
.latest-section,.price-section,.faq-section,.similar-section{
  padding:2.5rem 0;border-bottom:1px solid var(--border);
}

/* ── 차량 카드 그리드 ──────────────────────────── */
.car-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:1rem;
}
.car-card{
  background:var(--surface);border-radius:var(--radius-lg);
  overflow:hidden;border:1px solid var(--border);
  transition:transform .2s,border-color .2s,box-shadow .2s;
}
.car-card:hover{transform:translateY(-3px);border-color:#444;box-shadow:var(--shadow)}
.card-img-wrap{
  display:block;position:relative;overflow:hidden;
  aspect-ratio:3/2;background:var(--surface2);
}
.card-img-wrap img{
  width:100%;height:100%;object-fit:cover;
  transition:transform .3s;
}
.car-card:hover .card-img-wrap img{transform:scale(1.04)}
.card-gen{
  position:absolute;top:.5rem;left:.5rem;
  padding:.2rem .5rem;border-radius:4px;
  font-size:.7rem;font-weight:700;
  background:rgba(20,23,28,.85);color:var(--accent);
  border:1px solid var(--accent);
}
.card-body{padding:.75rem}
.card-brand{font-size:.75rem;font-weight:600;color:var(--accent);margin-bottom:.2rem}
.card-model{font-size:.95rem;font-weight:700;margin-bottom:.2rem;line-height:1.3}
.card-model a:hover{color:var(--accent)}
.card-trim{font-size:.75rem;color:var(--text2);margin-bottom:.5rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-meta{
  display:flex;gap:.5rem;flex-wrap:wrap;
  font-size:.75rem;color:var(--text3);margin-bottom:.5rem;
}
.card-meta span::after{content:'·';margin-left:.5rem}
.card-meta span:last-child::after{content:none}
.card-price{font-size:1.1rem;font-weight:800;color:var(--white)}

/* ── 가격대 그리드 ─────────────────────────────── */
.price-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
  gap:.75rem;
}
.price-card{
  display:flex;flex-direction:column;gap:.3rem;
  padding:1.25rem;background:var(--surface);
  border:1px solid var(--border);border-radius:var(--radius);
  transition:all .2s;
}
.price-card:hover{border-color:var(--accent);background:var(--surface2)}
.price-card strong{font-size:.95rem;font-weight:700}
.price-card span{font-size:.8rem;color:var(--text2)}

/* ── FAQ ───────────────────────────────────────── */
.faq-list{display:flex;flex-direction:column;gap:.5rem}
.faq-item{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);overflow:hidden;
}
.faq-item summary{
  padding:1rem 1.25rem;cursor:pointer;
  display:flex;justify-content:space-between;align-items:center;
  list-style:none;
  transition:background .2s;
}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary:hover{background:var(--surface2)}
.faq-item summary h3{font-size:.95rem;font-weight:600;line-height:1.4}
.faq-item summary::after{
  content:'＋';font-size:1.1rem;color:var(--accent);
  flex-shrink:0;margin-left:.75rem;transition:transform .2s;
}
.faq-item[open] summary::after{content:'－'}
.faq-answer{
  padding:1rem 1.25rem;border-top:1px solid var(--border);
  font-size:.9rem;color:var(--text2);line-height:1.7;
}
.faq-answer p+p{margin-top:.75rem}
.faq-answer ul{margin:.75rem 0 0 1rem;display:flex;flex-direction:column;gap:.3rem}
.faq-answer ul li::before{content:'• ';color:var(--accent)}

/* ── 테이블 ────────────────────────────────────── */
.price-table,.spec-table{
  width:100%;border-collapse:collapse;
  font-size:.875rem;margin-top:.75rem;
}
.price-table caption,.spec-table caption{
  text-align:left;font-size:.8rem;color:var(--text3);margin-bottom:.4rem;
  caption-side:top;
}
.price-table th,.price-table td,
.spec-table th,.spec-table td{
  padding:.6rem .75rem;border:1px solid var(--border);text-align:left;
}
.price-table thead th,.spec-table thead th{
  background:var(--surface2);font-weight:600;
}
.spec-table th{
  background:var(--surface2);font-weight:600;
  width:35%;white-space:nowrap;
}
.price-table tr:nth-child(even){background:var(--surface2)}

/* ── 목록 페이지 ───────────────────────────────── */
.listing-header{
  background:var(--surface);border-bottom:1px solid var(--border);
  padding:1.5rem 0 0;
}
.listing-title{
  font-size:1.5rem;font-weight:800;margin-bottom:.75rem;
  display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
}
.result-count{
  font-size:1rem;font-weight:500;color:var(--text2);
  background:var(--surface2);padding:.2rem .6rem;border-radius:20px;
}
.gen-tabs{display:flex;gap:.25rem;padding-bottom:0}
.tab{
  padding:.6rem 1.25rem;border-radius:6px 6px 0 0;
  font-size:.875rem;font-weight:600;color:var(--text2);
  border:1px solid transparent;border-bottom:none;
  transition:all .2s;
}
.tab.active{background:var(--bg);border-color:var(--border);color:var(--white)}
.tab:hover:not(.active){color:var(--white)}

.listing-body{padding:1.5rem 0}
.listing-inner{
  display:grid;
  grid-template-columns:260px 1fr;
  gap:1.5rem;align-items:start;
}

/* ── 필터 사이드바 ─────────────────────────────── */
.filter-sidebar{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.25rem;
  position:sticky;top:80px;
}
.filter-group{margin-bottom:1.25rem}
.filter-group:last-of-type{margin-bottom:1rem}
.filter-label{
  font-size:.8rem;font-weight:700;color:var(--text3);
  text-transform:uppercase;letter-spacing:.05em;margin-bottom:.5rem;
}
.filter-group input[type=text],
.filter-group input[type=number]{
  width:100%;padding:.5rem .75rem;
  background:var(--surface2);border:1px solid var(--border);
  border-radius:6px;color:var(--text);font-size:.875rem;outline:none;
}
.filter-group input:focus{border-color:var(--accent)}
.gen-checkboxes,.trim-checkboxes,.body-checkboxes{display:flex;flex-direction:column;gap:.35rem;max-height:220px;overflow-y:auto}
.checkbox-label{display:flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--text2);cursor:pointer}
.checkbox-label input[type=checkbox]{accent-color:var(--accent)}
.range-inputs{display:flex;align-items:center;gap:.4rem}
.range-inputs span{color:var(--text3);flex-shrink:0}
.range-inputs input{width:100%}
.btn-filter{width:100%;justify-content:center;margin-top:.25rem}

/* ── 정렬 바 ───────────────────────────────────── */
.sort-bar{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:1rem;flex-wrap:wrap;gap:.5rem;
}
.sort-count{font-size:.875rem;color:var(--text2)}
.sort-count strong{color:var(--white)}
.sort-options{display:flex;gap:.25rem;flex-wrap:wrap}
.sort-btn{
  padding:.35rem .75rem;border-radius:20px;
  font-size:.8rem;font-weight:500;color:var(--text2);
  background:var(--surface);border:1px solid var(--border);
  transition:all .2s;
}
.sort-btn.active,.sort-btn:hover{background:var(--accent);border-color:var(--accent);color:#fff}

/* ── 페이지네이션 ──────────────────────────────── */
.pagination{
  display:flex;flex-wrap:wrap;gap:.4rem;
  justify-content:center;margin-top:2rem;
}
.page-btn{
  padding:.45rem .9rem;background:var(--surface);
  border:1px solid var(--border);border-radius:6px;
  font-size:.875rem;color:var(--text2);transition:all .2s;
}
.page-btn.active,.page-btn:hover{background:var(--accent);border-color:var(--accent);color:#fff}

/* ── 빈 결과 ───────────────────────────────────── */
.no-results{
  text-align:center;padding:4rem 2rem;
  color:var(--text2);
}
.no-results p{margin-bottom:1rem}

/* ── 상세 페이지 ───────────────────────────────── */
.breadcrumb{padding:.75rem 0;border-bottom:1px solid var(--border);font-size:.8rem}
.breadcrumb .section-inner{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;color:var(--text2)}
.breadcrumb a:hover{color:var(--accent)}
.breadcrumb span[aria-hidden]{color:var(--text3)}

.car-detail{padding:2rem 0}
.detail-layout{
  display:grid;
  grid-template-columns:1fr 420px;
  gap:2rem;align-items:start;
}

/* ── 갤러리 ────────────────────────────────────── */
.gallery-main{
  position:relative;border-radius:var(--radius-lg);
  overflow:hidden;background:var(--surface2);aspect-ratio:3/2;
}
.gallery-main img{width:100%;height:100%;object-fit:cover}
.gallery-arrow{
  position:absolute;top:50%;transform:translateY(-50%);
  background:rgba(0,0,0,.6);color:#fff;
  width:40px;height:60px;font-size:1.8rem;
  display:flex;align-items:center;justify-content:center;
  border-radius:4px;transition:background .2s;z-index:2;
}
.gallery-arrow:hover{background:rgba(28,105,212,.85);color:#fff}
.gallery-arrow.prev{left:.5rem}
.gallery-arrow.next{right:.5rem}
.gallery-counter{
  position:absolute;bottom:.75rem;right:.75rem;
  background:rgba(0,0,0,.7);color:#fff;
  padding:.2rem .6rem;border-radius:20px;font-size:.8rem;
}
.gallery-thumbs{
  display:flex;gap:.5rem;margin-top:.5rem;
  overflow-x:auto;padding-bottom:.25rem;
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;
}
.thumb-item{
  width:72px;height:48px;object-fit:cover;
  border-radius:4px;cursor:pointer;flex-shrink:0;
  border:2px solid transparent;opacity:.6;
  transition:all .2s;
}
.thumb-item.active,.thumb-item:hover{border-color:var(--accent);opacity:1}

/* ── 차량 정보 패널 ────────────────────────────── */
.detail-badge-row{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem;flex-wrap:wrap}
.badge-gen{padding:.25rem .6rem;border-radius:4px;font-size:.75rem;font-weight:700;background:var(--surface2);color:var(--accent);border:1px solid var(--accent)}
.badge-body{padding:.25rem .6rem;border-radius:4px;font-size:.75rem;font-weight:700;background:var(--surface2);color:var(--text2)}
.badge-carid{font-size:.75rem;color:var(--text3);background:var(--surface2);padding:.25rem .6rem;border-radius:4px}
.detail-brand{font-size:.85rem;font-weight:700;color:var(--accent);margin-bottom:.3rem}
.detail-title{font-size:1.6rem;font-weight:900;line-height:1.2;margin-bottom:.3rem}
.detail-trim{font-size:.9rem;color:var(--text2);margin-bottom:1rem}
.detail-price{
  font-size:2.2rem;font-weight:900;color:var(--white);
  margin-bottom:1.5rem;letter-spacing:-.02em;
}

.spec-table{margin-bottom:1.5rem}
.detail-cta{display:flex;gap:.75rem;flex-wrap:wrap;margin-bottom:1rem}
.btn-cta{flex:1;justify-content:center;min-width:120px}
.detail-note{font-size:.75rem;color:var(--text3);line-height:1.5}

.detail-faq{border-top:1px solid var(--border)}

/* ── 풋터 ──────────────────────────────────────── */
.site-footer{
  background:var(--surface);border-top:1px solid var(--border);
  padding:2.5rem 0 1.5rem;margin-top:2rem;
}
.footer-inner{max-width:var(--max-w);margin:0 auto;padding:0 1.25rem}
.footer-top{
  display:grid;grid-template-columns:220px 1fr;
  gap:2rem;margin-bottom:2rem;
}
.footer-logo .logo-text{font-size:1.15rem}
.footer-desc{font-size:.8rem;color:var(--text3);margin-top:.75rem;line-height:1.6}
.footer-links{display:grid;grid-template-columns:repeat(3,1fr);gap:1.5rem}
.footer-link-group{display:flex;flex-direction:column;gap:.4rem}
.footer-link-group strong{font-size:.8rem;font-weight:700;color:var(--text3);margin-bottom:.25rem}
.footer-link-group a{font-size:.85rem;color:var(--text2);transition:color .2s}
.footer-link-group a:hover{color:var(--accent)}
.footer-bottom{border-top:1px solid var(--border);padding-top:1rem}
.biz-info{font-size:.75rem;color:var(--text3);line-height:1.8;margin-bottom:.5rem}
.copyright{font-size:.75rem;color:var(--text3);line-height:1.7}
.footer-brand-name{font-weight:800;color:var(--white);margin-bottom:.7rem;font-size:1.05rem}
.footer-row{display:flex;font-size:.85rem;margin-bottom:.4rem}
.footer-row .footer-label{flex:0 0 92px;color:var(--text3)}
.badge-nation{padding:.25rem .6rem;border-radius:4px;font-size:.75rem;font-weight:700;background:var(--surface2);color:var(--accent);border:1px solid var(--accent)}

/* ── 반응형 ────────────────────────────────────── */
@media (max-width:1024px) {
  .listing-inner{grid-template-columns:220px 1fr}
  .detail-layout{grid-template-columns:1fr}
  .footer-top{grid-template-columns:1fr}
  .footer-links{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:768px) {
  .header-nav{display:none}
  .header-search{max-width:none;flex:1}
  .mobile-menu-btn{display:flex}
  .listing-inner{grid-template-columns:1fr}
  .filter-sidebar{position:static;display:none}
  .filter-sidebar.open{display:block}
  .car-grid{grid-template-columns:repeat(2,1fr)}
  .footer-top{grid-template-columns:1fr}
  .footer-links{grid-template-columns:repeat(2,1fr)}
  .hero-title{font-size:1.5rem}
  .detail-cta{flex-direction:column}
  .price-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:480px) {
  .car-grid{grid-template-columns:1fr}
  .footer-links{grid-template-columns:1fr}
  .detail-price{font-size:1.7rem}
  .sort-bar{flex-direction:column;align-items:flex-start}
}

/* ── 스크롤바 ──────────────────────────────────── */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:var(--surface)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:#444}

/* ── 접근성 포커스 ─────────────────────────────── */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ── 모바일 필터 토글 버튼 ─────────────────────── */
.filter-toggle-btn{
  display:none;width:100%;margin-bottom:1rem;
  padding:.65rem;text-align:center;
  background:var(--surface);border:1px solid var(--border);
  border-radius:6px;font-size:.875rem;color:var(--text2);
}
@media (max-width:768px) {
  .filter-toggle-btn{display:block}
}
