/*
Theme Name: Countryman Used Cars
Theme URI: https://countryman.ahscar.com
Author: AhsCar
Description: 미니 컨트리맨 중고차 전문 사이트 - 전국 최다 매물
Version: 1.0
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f0;
    color: #1a1a1a;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }

/* ===== HEADER ===== */
.site-header {
    background: #10241a;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-badge {
    background: #1c6b45;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.logo-text {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.logo-text span { color: #4caf7d; }
.logo-img {
    height: 34px;
    width: auto;
    display: block;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
}
.header-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1c6b45;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.header-contact:hover { background: #154f34; }
.header-contact svg { width: 16px; height: 16px; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #0d1f16 0%, #1a3826 60%, #0d1f16 100%);
    color: #fff;
    padding: 56px 20px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.hero-eyebrow {
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #7fd9a8;
    font-weight: 700;
    margin-bottom: 12px;
}
.hero h1 {
    font-size: clamp(26px, 5vw, 42px);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
}
.hero h1 em {
    color: #7fd9a8;
    font-style: normal;
}
.hero-sub {
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    margin-bottom: 32px;
}
.hero-stats {
    display: inline-flex;
    gap: 32px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 16px 32px;
    border-radius: 12px;
}
.hero-stat-item { text-align: center; }
.hero-stat-num {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    display: block;
}
.hero-stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

/* ===== FILTER BAR ===== */
.filter-bar {
    background: #fff;
    border-bottom: 1px solid #e8eaea;
    padding: 16px 20px;
    position: sticky;
    top: 64px;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    background: #f8f9f8;
    color: #333;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.2s;
}
.filter-select:focus { outline: none; border-color: #1c6b45; }
.filter-count {
    margin-left: auto;
    font-size: 13px;
    color: #888;
}
.filter-count strong { color: #1c6b45; font-weight: 700; }

/* ===== CAR GRID ===== */
.cars-section { padding: 32px 20px 48px; }
.cars-grid-wrap { max-width: 1200px; margin: 0 auto; }
.cars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ===== CAR CARD ===== */
.car-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.car-card-img {
    position: relative;
    aspect-ratio: 4/3;
    background: #e8eaea;
    overflow: hidden;
}
.car-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.car-card:hover .car-card-img img { transform: scale(1.05); }
.car-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #10241a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}
.car-card-body { padding: 14px; }
.car-model {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.car-spec-name {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.car-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.car-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}
.car-price {
    font-size: 20px;
    font-weight: 800;
    color: #1c6b45;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: #555; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 20px;
}
.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid #ddd;
    transition: all 0.2s;
    text-decoration: none;
}
.page-btn:hover { background: #10241a; color: #fff; border-color: #10241a; }
.page-btn.active { background: #1c6b45; color: #fff; border-color: #1c6b45; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ===== DETAIL PAGE ===== */
.detail-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb a { color: #555; }
.breadcrumb a:hover { color: #1c6b45; }
.breadcrumb-sep { color: #ccc; }

.detail-top {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-bottom: 40px;
}

/* Gallery */
.gallery-wrap { position: relative; }
.gallery-main {
    aspect-ratio: 16/10;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}
.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.gallery-main img.active { display: block; }
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 5;
    font-size: 18px;
    border: none;
    backdrop-filter: blur(4px);
}
.gallery-nav:hover { background: rgba(28,107,69,0.8); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}
.gallery-thumb {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: #1c6b45; }
.gallery-thumb:hover { border-color: #1c6b45; }

/* Detail Info Box */
.detail-info {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 88px;
}
.detail-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}
.detail-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}
.detail-price {
    font-size: 32px;
    font-weight: 900;
    color: #1c6b45;
    margin-bottom: 20px;
    line-height: 1;
}
.detail-price-note {
    font-size: 13px;
    color: #999;
    font-weight: 400;
    display: block;
    margin-top: 4px;
}
.detail-specs {
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    margin-bottom: 20px;
}
.detail-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.detail-spec-row:last-child { border-bottom: none; }
.spec-key { color: #888; font-weight: 500; }
.spec-val { color: #1a1a1a; font-weight: 600; text-align: right; }
.detail-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #1c6b45;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-primary:hover { background: #154f34; }
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #10241a;
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-secondary:hover { background: #1a3826; }

/* Detail Table */
.detail-table-section {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1c6b45;
    display: inline-block;
}
.info-table {
    width: 100%;
    border-collapse: collapse;
}
.info-table th, .info-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
.info-table th {
    background: #f8f9f8;
    color: #666;
    font-weight: 600;
    width: 140px;
    white-space: nowrap;
}
.info-table td { color: #1a1a1a; font-weight: 500; }
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: none; }

/* ===== NOTICE BANNER ===== */
.notice-banner {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 14px 20px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #555;
    margin-bottom: 24px;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #10241a;
    color: rgba(255,255,255,0.6);
    padding: 40px 20px;
    margin-top: 60px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.footer-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}
.footer-brand span { color: #4caf7d; }
.footer-info {
    font-size: 13px;
    line-height: 2;
    margin-bottom: 20px;
}
.footer-copy {
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
}

/* ===== SEO CONTENT ===== */
.seo-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    max-width: 1200px;
    margin: 0 auto 48px;
}
.seo-content h2 { font-size: 20px; margin-bottom: 16px; color: #10241a; }
.seo-content p { font-size: 14px; color: #666; line-height: 1.8; margin-bottom: 12px; }
.seo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.seo-tag {
    padding: 4px 12px;
    background: #f0f2f0;
    border-radius: 20px;
    font-size: 12px;
    color: #555;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .cars-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .cars-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-top { grid-template-columns: 1fr; }
    .detail-info { position: static; }
    .gallery-thumbs { grid-template-columns: repeat(6, 1fr); }
    .hero-stats { gap: 20px; padding: 14px 20px; }
}
@media (max-width: 500px) {
    .cars-grid { grid-template-columns: 1fr; }
    .header-inner { padding: 0 16px; }
    .logo-text { font-size: 15px; }
    .header-contact span { display: none; }
    .gallery-thumbs { grid-template-columns: repeat(5, 1fr); }
    .hero h1 { font-size: 22px; }
}
