/* ──────────────────────────────────────────────
   차량정보 — 변형 카드 목록 (list)
   1024 초과: 좌측 사이드바 필터
   1024 이하: 우측 슬라이드 모달 필터 (엔카 스타일)
   ────────────────────────────────────────────── */

/* ── 레이아웃 (전역 sub_aside 비활성을 차량 정보에서만 활성) ── */

.ci_main_inner {
    grid-template-columns: 260px 1fr;
}

.ci_aside {
    display: flex !important;
}

/* ── 필터 카드 ─────────────────────────────── */

.ci_filter {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ci_filter_head {
    padding: 16px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.ci_filter_head h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.01em;
}

.ci_filter_reset {
    height: 26px;
    padding: 0 8px;
    border: none;
    background: transparent;
    color: var(--text-color-light);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 4px;
    transition: all 0.15s;
}

.ci_filter_reset:hover {
    background: #F5F6F8;
    color: var(--main-color);
}

.ci_filter_reset i {
    font-size: 14px;
}

.ci_filter_body {
    padding: 4px 0px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    flex: 1;
}

.ci_filter_section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.ci_filter_section:last-child {
    border-bottom: none;
}

.ci_filter_label {
    width: 100%;
    padding: 14px 0px;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.15s;
}


.ci_filter_label>span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ci_filter_label i {
    font-size: 18px;
    color: var(--text-color-light);
    transition: transform 0.2s;
}

.ci_filter_section.open .ci_filter_label i {
    transform: rotate(180deg);
}

.ci_section_count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--main-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ci_section_dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--main-color);
    display: inline-block;
}

.ci_filter_section_body {
    display: none;
    padding: 0 0 14px;
}

.ci_filter_section.open .ci_filter_section_body {
    display: block;
}

.ci_chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px;
}

.ci_chip {
    height: 30px;
    padding: 0 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    color: var(--text-color-sub);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.ci_chip:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.ci_chip.active {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    font-weight: 600;
}

/* ── 브랜드 리스트 (PC: 1열 가로 행, 모바일은 미디어쿼리에서 카드형) ── */

.ci_brands {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ci_chip.ci_brand {
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 10px 10px;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 0;
    background: transparent;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    position: relative;
    text-align: left;
    overflow: visible;
    white-space: nowrap;
    box-shadow: none;
}

.ci_chip.ci_brand:last-child {
    border-bottom: none;
}

.ci_brand_logo {
    width: 38px;
    aspect-ratio: 60/40;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ci_brand_logo img {
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.15s;
}

.ci_chip.ci_brand:hover .ci_brand_logo img {
    transform: scale(1.08);
}


.ci_brand_name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ci_brand_check {
    display: none;
    position: static;
    margin-left: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--main-color);
    color: #fff;
    font-size: 12px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ci_chip.ci_brand:hover {
    background: #F8F9FB;
}

.ci_chip.ci_brand.active {
    background: #F0F4F8;
    border-bottom-color: var(--border-color);
    box-shadow: none;
}

.ci_chip.ci_brand.active .ci_brand_name {
    color: var(--main-color);
    font-weight: 700;
}

.ci_chip.ci_brand.active .ci_brand_check {
    display: inline-flex;
}

/* ── 가격대 영역 (토글 없이 항상 노출) ────── */

.ci_filter_price {
    padding: 14px 20px 4px;
}

.ci_filter_price_head {

    margin-bottom: 8px;
}

.ci_filter_label_static {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

/* ── 가격 듀얼 range 슬라이더 ──────────────── */

.ci_range_head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ci_range_summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-color-sub);
}

.ci_range_summary em {
    font-style: normal;
    font-weight: 600;
    color: var(--main-color);
}

.ci_range {
    position: relative;
    height: 32px;
    margin: 4px 10px 6px;
}

.ci_range_track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #E5E7E9;
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}

.ci_range_track_fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--main-color);
    border-radius: 2px;
}

.ci_range input[type="range"] {
    position: absolute;
    top: 0;
    left: -8px;
    right: -8px;
    width: calc(100% + 16px);
    height: 32px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
}

.ci_range input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
    height: 4px;
}

.ci_range input[type="range"]::-moz-range-track {
    background: transparent;
    height: 4px;
}

.ci_range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--main-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    pointer-events: auto;
    margin-top: -8px;
    transition: transform 0.1s;
}

.ci_range input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ci_range input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.25);
}

.ci_range input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--main-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    pointer-events: auto;
}

/* ── 모달 헤더/푸터/딤 (1024 이하에서만 노출) ── */

.ci_modal_head,
.ci_modal_foot,
.ci_modal_dim {
    display: none;
}

/* ── 상단 정보바 ─────────────────────────────── */

.ci_topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.ci_count {
    font-size: 14px;
    color: var(--text-color-sub);
}

.ci_count strong {
    color: var(--main-color);
    font-weight: 700;
    font-size: 16px;
    margin: 0 2px;
}

.ci_topbar_right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ci_filter_toggle {
    display: none;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    gap: 4px;
    position: relative;
}

.ci_filter_toggle i {
    font-size: 15px;
}

.ci_filter_toggle:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.ci_filter_badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 9px;
    background: var(--main-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ci_sort {
    height: 36px;
    padding: 0 30px 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 10px center;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* ── 카드 그리드 ─────────────────────────────── */

.ci_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ci_card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.ci_card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(16, 48, 80, 0.10);
    border-color: var(--main-color);
}

.ci_card_image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #F5F6F8;
    overflow: hidden;
}

.ci_card_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ci_card:hover .ci_card_image img {
    transform: scale(1.04);
}

.ci_card_noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D5D7DB;
    font-size: 56px;
}

.ci_card_count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(16, 48, 80, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.ci_card_body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.ci_card_brand {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color-sub);
    font-size: 12px;
    font-weight: 500;
}

.ci_card_brand .ci_img {
    display: flex;
    width: 20px;
    aspect-ratio: 60/40;
}

.ci_card_brand img {
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.ci_card_model {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
}

.ci_card_variant {
    font-size: 13px;
    color: var(--text-color-sub);
    margin: 0;
    line-height: 1.4;
    min-height: 18px;
}

.ci_card_chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.ci_tag {
    padding: 2px 8px;
    border-radius: 10px;
    background: #F0F3F7;
    color: var(--text-color-sub);
    font-size: 11px;
    font-weight: 500;
}

.ci_card_price {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

.ci_card_price strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--main-color);
    letter-spacing: -0.01em;
}

.ci_card_price .muted {
    color: var(--text-color-light);
    font-size: 13px;
}

/* ── 빈 상태 ─────────────────────────────────── */

.ci_empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-color-light);
}

.ci_empty i {
    font-size: 48px;
    color: var(--border-color);
    display: block;
    margin-bottom: 12px;
}

.ci_empty p {
    margin: 0 0 16px;
    font-size: 15px;
}

.ci_btn_reset {
    height: 38px;
    padding: 0 22px;
    border: 1px solid var(--main-color);
    border-radius: 6px;
    background: #fff;
    color: var(--main-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ci_btn_reset:hover {
    background: var(--main-color);
    color: #fff;
}

/* ── 페이지네이션 ────────────────────────────── */

.ci_pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ci_page {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-color-sub);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.15s;
}

.ci_page:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

.ci_page.active {
    background: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    font-weight: 700;
    cursor: default;
}

/* ──────────────────────────────────────────────
   1024 이하 — 사이드바를 우측 슬라이드 모달로 전환
   ────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .ci_main_inner {
        grid-template-columns: 1fr;
    }

    /* 사이드바 자체를 우측 슬라이드 모달로 */
    .ci_aside {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 420px;
        z-index: 1001;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: #fff;
        display: flex !important;
        gap: 0;
    }

    .ci_aside.open {
        transform: translateX(0);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    }

    .ci_filter {
        border: none;
        border-radius: 0;
        height: 100%;
        flex: 1;
    }

    /* 데스크탑 헤더 숨기고 모달 헤더 노출 */
    .ci_filter_head {
        display: none;
    }

    .ci_modal_head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .ci_modal_head h3 {
        font-size: 17px;
        font-weight: 700;
        color: var(--text-color);
        margin: 0;
    }

    .ci_modal_close {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        border: none;
        background: transparent;
        color: var(--text-color);
        font-size: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .ci_modal_close:hover {
        background: #F3F5F7;
    }

    /* 모달 푸터 */
    .ci_modal_foot {
        display: flex;
        gap: 8px;
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-color);
        background: #fff;
        flex-shrink: 0;
    }

    .ci_modal_btn {
        height: 48px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        transition: all 0.15s;
    }

    .ci_modal_btn.reset {
        flex: 0 0 35%;
        background: #F3F5F7;
        color: var(--text-color);
        border: 1px solid var(--border-color);
    }

    .ci_modal_btn.reset:hover {
        background: #E8EAEC;
    }

    .ci_modal_btn.apply {
        flex: 1;
        background: var(--main-color);
        color: #fff;
        border: none;
    }

    .ci_modal_btn.apply:hover {
        background: #0a213c;
    }

    /* 모달 딤 */
    .ci_modal_dim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .ci_modal_dim.open {
        opacity: 1;
        visibility: visible;
    }

    /* 본문 스크롤 잠금 */
    body.ci_modal_open {
        overflow: hidden;
    }

    /* 토픽바: 필터 버튼 노출 */
    .ci_filter_toggle {
        display: inline-flex;
    }

    /* 모바일 모달도 PC와 동일한 리스트형 — 행만 조금 더 크게 */
    .ci_chip.ci_brand {
        min-height: 54px;
        padding: 12px 12px;
        gap: 16px;
    }

    .ci_brand_logo {
        width: 42px;
    }

    .ci_brand_logo.placeholder {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .ci_brand_name {
        font-size: 14px;
    }

    /* 카드 그리드 */
    .ci_grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .ci_grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .ci_card_body {
        padding: 12px 14px 14px;
    }

    .ci_card_model {
        font-size: 15px;
    }

    .ci_card_price strong {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ci_grid {
        grid-template-columns: 1fr;
    }

    .ci_topbar {
        flex-wrap: wrap;
        gap: 8px;
    }
}