/*
 * market/vehicle_detail.css
 * - 차량 상세(vehicle_detail) 페이지 전용 스타일
 *
 * 스코프 규칙:
 * - 페이지 루트(.market-car-detail) 내부 스타일을 기본으로 함
 * - 팝업처럼 페이지 밖에 렌더되는 요소는 id 기반으로 별도 스코프를 둠
 */

.market-car-detail .code-badge {
    background: #eef2ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* 매물 유형 배지(신차/중고) */
.market-car-detail .vehicle-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--black);
}

.market-car-detail .vehicle-badge.badge-new {
    border-color: var(--lineSoftPrimary);
    background: var(--softPrimary);
    color: var(--primary);
}

.market-car-detail .vehicle-badge.badge-used {
    border-color: var(--border);
    background: var(--softgray2);
    color: var(--gray);
}

/* 기본 정보 스펙 그리드 */
.market-car-detail .spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
}

.market-car-detail .spec-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.market-car-detail .spec-label {
    color: #888;
    font-size: 14px;
}

.market-car-detail .spec-value {
    font-weight: 700;
    color: #111;
    font-size: 15px;
}

@media (max-width: 768px) {
    .market-car-detail .spec-grid {
        grid-template-columns: 1fr;
    }
}

/* 옵션 섹션 */
.market-car-detail .option-section {
    border-top: 1px solid var(--line);
    padding-top: 32px;
}

.market-car-detail .option-category {
    margin-top: 28px;
}

.market-car-detail .option-category:first-child {
    margin-top: 0;
}

.market-car-detail .option-category-title {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray);
}

.market-car-detail .option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.market-car-detail .option-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--white);
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    text-align: center;
    letter-spacing: -0.2px;
}

@media (max-width: 1024px) {
    .market-car-detail .option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 630px) {
    .market-car-detail .option-grid {
        grid-template-columns: 1fr;
    }
}

/* 상단 이미지 */
.market-car-detail .vehicle-photo-grid {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-car-detail .vehicle-photo-mobile {
    width: 100%;
    height: auto;
    display: block;
}

/* 우측 안내 박스(템플릿 클래스 기준) */
.market-car-detail-notice {
    padding: 16px;
    border-radius: 8px;
}

/* Vehicle image slide popup (scoped by id) */
#vehicle_image_slide_popup {
    background: rgba(0, 0, 0, 0.9);
}

#vehicle_image_slide_popup .lyr-body-area {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#vehicle_image_slide_popup .lyr-content-area {
    flex: 1;
    min-height: 0;
}

#vehicle_image_slide_popup .popup-slide-list {
    height: 100%;
}

#vehicle_image_slide_popup .popup-slide-list .swiper-wrapper {
    height: 100%;
}

#vehicle_image_slide_popup .popup-slide-list .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 이미지 잘림 방지: 컨테이너에 맞추되 확대는 하지 않음 */
#vehicle_image_slide_popup .popup-slide-list .swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* 상단 {현재}/{전체} */
#vehicle_image_slide_popup .swiper-pagination {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
    width: auto;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    z-index: 20;
}

/* 좌/우 버튼: 공통 반응형 hidden 영향 무시하고 강제 노출 */
#vehicle_image_slide_popup .swiper-button-next,
#vehicle_image_slide_popup .swiper-button-prev {
    display: flex !important;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 20;
}

#vehicle_image_slide_popup .swiper-button-next::after,
#vehicle_image_slide_popup .swiper-button-prev::after {
    display: none;
}

/* 버튼 위치 */
#vehicle_image_slide_popup .swiper-button-prev {
    left: 24px;
}

#vehicle_image_slide_popup .swiper-button-next {
    right: 24px;
}

@media (max-width: 768px) {
    #vehicle_image_slide_popup .swiper-button-prev {
        left: 12px;
    }

    #vehicle_image_slide_popup .swiper-button-next {
        right: 12px;
    }
}

/* inquiry popup validation UI (scoped) */
#inquiry_popup .inquiry-form .row {
    margin-bottom: 24px;
}

/* 마지막 row는 여백 과다 방지 */
#inquiry_popup .inquiry-form .row:last-of-type {
    margin-bottom: 0;
}

#inquiry_popup .inquiry-form .label {
    display: block;
    margin-bottom: 8px;
}

/* validation */
#inquiry_popup .inquiry-form .validation {
    margin-top: 8px;
}

#inquiry_popup .inquiry-form .validation .validation-txt {
    color: #ef4444;
    /* red text */
}

/* 기본 보더 */
#inquiry_popup .inquiry-form .input-text,
#inquiry_popup .inquiry-form .textarea {
    border: 1px solid var(--line);
    border-radius: 12px;
}

/* focus: navy border */
#inquiry_popup .inquiry-form .input-text:focus,
#inquiry_popup .inquiry-form .textarea:focus {
    outline: none;
    border-color: #1e3a8a;
    /* navy */
}

/* error: red border + text */
#inquiry_popup .inquiry-form .row.has-error .input-text,
#inquiry_popup .inquiry-form .row.has-error .textarea {
    border-color: #ef4444;
}

/* textarea */
#inquiry_popup .inquiry-form .textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    resize: none;
}