/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #bb162b;
  --dark:   #111827;
  --gray:   #6b7280;
  --light:  #f9fafb;
  --border: #e5e7eb;
  --radius: 10px;
  --max-w:  1200px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--dark);
  background: #fff;
  line-height: 1.65;
  font-size: 15px;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 2px solid var(--red);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}
.logo {
  text-decoration: none;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo span { color: var(--red); }
.top-nav a {
  text-decoration: none;
  color: #f3f4f6;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(150deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  color: #fff;
  padding: 44px 0 36px;
}
.hero h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.3;
}
.hero h1 em { color: var(--red); font-style: normal; }
.lead {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 700px;
  line-height: 1.7;
}
.lead strong { color: #fcd34d; }

/* ===== Badges ===== */
.badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255,255,255,.12);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.2);
}

/* ===== Price Table Section ===== */
.section { padding: 36px 0; }
.section-alt { background: var(--light); }
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 1.25em;
  background: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
thead th {
  background: var(--dark);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f0f9ff; }
.price-cell { color: var(--red); font-weight: 700; }

/* ===== Filters ===== */
.filters {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 56px;
  z-index: 100;
}
.filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filter-label { font-size: 0.85rem; font-weight: 600; color: var(--gray); }
.btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-filter {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: var(--dark);
  font-size: 0.85rem;
  background: #fff;
  transition: all .15s;
  white-space: nowrap;
}
.btn-filter:hover { border-color: var(--red); color: var(--red); }
.btn-filter.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.sort-wrap { margin-left: auto; }
.sort-wrap select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}

/* ===== Car Grid ===== */
.car-section { padding: 28px 0 40px; }
.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.total-badge {
  font-size: 0.9rem;
  color: var(--gray);
}
.total-badge strong { color: var(--dark); }

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
}

.car-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  background: #fff;
}
.car-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.card-link { text-decoration: none; color: inherit; display: block; }

.card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f1f5f9;
  position: relative;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.car-card:hover .card-img img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-hybrid { background: #059669; color: #fff; }
.badge-gas    { background: #1d4ed8; color: #fff; }

.card-body { padding: 12px 14px 14px; }
.card-model {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-trim {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 8px;
}
.card-meta {
  display: flex;
  gap: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--gray);
  flex-wrap: wrap;
}
.card-meta li { margin-right: 10px; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 32px 0 0;
  flex-wrap: wrap;
}
.page-btn {
  padding: 7px 13px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--dark);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all .15s;
}
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  font-weight: 700;
}

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.faq-item summary {
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: 'Q';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item summary h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: inline;
  line-height: 1.5;
}
.faq-answer {
  padding: 14px 18px 14px 50px;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.7;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--dark);
  color: #9ca3af;
  padding: 28px 0;
  font-size: 0.84rem;
}
.site-footer address {
  font-style: normal;
  margin-top: 8px;
  line-height: 1.8;
}
.site-footer a { color: #d1d5db; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ===== Detail Page ===== */
.breadcrumb {
  padding: 12px 0;
  background: var(--light);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}
.breadcrumb ol { display: flex; gap: 6px; list-style: none; flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; color: var(--gray); }
.breadcrumb li::after { content: '›'; }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--red); text-decoration: none; }

.detail-wrapper { padding: 28px 0 60px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* Gallery */
.gallery-main {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s;
}
.gallery-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 12px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.thumb-btn {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 6px;
  background: #f1f5f9;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 4/3;
  transition: border-color .15s;
}
.thumb-btn:hover { border-color: var(--red); }
.thumb-btn.active { border-color: var(--red); }
.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Detail Info */
.detail-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}
.detail-lead {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 20px;
  line-height: 1.7;
  padding: 14px;
  background: var(--light);
  border-left: 3px solid var(--red);
  border-radius: 0 6px 6px 0;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.spec-table th {
  width: 100px;
  padding: 10px 12px;
  background: var(--light);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  color: var(--gray);
  vertical-align: middle;
}
.spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: none; }
.price-big { font-size: 1.5rem; font-weight: 800; color: var(--red); }

.cta-box { background: var(--light); border-radius: var(--radius); padding: 20px; }
.btn-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: background .15s;
  margin-bottom: 10px;
}
.btn-call:hover { background: #9b1122; }
.cta-note { text-align: center; font-size: 0.83rem; color: var(--gray); }

/* No result */
.no-result {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .car-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb-grid { grid-template-columns: repeat(4, 1fr); }
  table { font-size: 0.8rem; }
  thead th, tbody td { padding: 8px 10px; }
  .filter-wrap { gap: 8px; }
  .sort-wrap { margin-left: 0; width: 100%; }
  .sort-wrap select { width: 100%; }
}
@media (max-width: 400px) {
  .car-grid { grid-template-columns: 1fr; }
}
