/* VinhXD - Báo Giá Ô Tô | vinhxd-oto.css | Version 2.0 */

/* ================================================================
   AUTOMOTIVE OTO - REDESIGN CSS
   Layout 1 cột, clean & modern
   Dán toàn bộ nội dung này vào:
   /automotive-oto/assets/frontend/automotive-oto.css
================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
.vinhxd-wrap *,
.vinhxd-wrap *::before,
.vinhxd-wrap *::after {
    box-sizing: border-box;
}

/* ── Wrapper chính: 1 cột ────────────────────────────────────── */
.vinhxd-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #2d2d2d;
}

/* ── Tiêu đề section ─────────────────────────────────────────── */
.vinhxd-section-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #1565c0;
    text-transform: uppercase;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #1565c0;
}

/* ── Card container (dùng cho cả 2 cột cũ) ───────────────────── */
.vinhxd-card,
.vinhxd-card {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    width: 100% !important;
    float: none !important;
}

/* ── Bảng chọn xe ────────────────────────────────────────────── */
.vinhxd-card table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.vinhxd-card table td {
    padding: 8px 0;
    vertical-align: middle;
    border: none;
}

.vinhxd-card table td:first-child {
    width: 110px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.vinhxd-card table select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d8e4;
    border-radius: 8px;
    font-size: 14px;
    color: #2d2d2d;
    background: #f8fafc;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.vinhxd-card table select:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,.12);
    background-color: #fff;
}

/* ── Message dự toán ─────────────────────────────────────────── */
.vinhxd-mess-dutoan {
    font-size: 13px;
    color: #888;
    margin: 12px 0 8px;
    font-style: italic;
}

/* ── Bảng dự toán chi phí ────────────────────────────────────── */
.vinhxd-table-dutoan {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

.vinhxd-table-dutoan tbody tr {
    border-bottom: 1px solid #f0f3f7;
    transition: background .15s;
}

.vinhxd-table-dutoan tbody tr:hover {
    background: #f8fafc;
}

.vinhxd-table-dutoan tbody tr:last-child {
    border-bottom: none;
}

.vinhxd-table-dutoan td {
    padding: 10px 4px;
    font-size: 14px;
    border: none;
}

.vinhxd-table-dutoan td:first-child {
    color: #555;
}

.vinhxd-table-dutoan td:last-child {
    text-align: right;
    font-weight: 600;
    color: #2d2d2d;
    white-space: nowrap;
}

/* ── Dòng tổng dự toán ───────────────────────────────────────── */
.vinhxd-table-dutoan tfoot tr {
    border-top: 2px solid #1565c0;
}

.vinhxd-table-dutoan tfoot td {
    padding: 14px 4px 4px;
    font-size: 15px;
    font-weight: 700;
    border: none;
}

.vinhxd-table-dutoan tfoot td:first-child {
    color: #1565c0;
}

.vinhxd-table-dutoan tfoot td:last-child {
    text-align: right;
    color: #e53935;
    font-size: 18px;
}

.tongdutoan_val,
.giaxe_val,
.phitruocba_val,
.phidangky_val,
.baohiemvatchat_val {
    font-weight: 600;
}

/* ── Section lãi vay ─────────────────────────────────────────── */
.vinhxd-laivay {
    width: 100%;
}

.vinhxd-laivay {
    width: 100%;
}

.vinhxd-laivay-inputs {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vinhxd-laivay-inputs .item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vinhxd-laivay-inputs .item .title {
    width: 140px;
    min-width: 140px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin: 0;
}

.vinhxd-laivay-inputs .item .text-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vinhxd-laivay-inputs .item .vinhxd-txt-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #d0d8e4;
    border-radius: 8px;
    font-size: 14px;
    color: #2d2d2d;
    background: #f8fafc;
    transition: border-color .2s, box-shadow .2s;
}

.vinhxd-laivay-inputs .item .vinhxd-txt-input:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,.12);
    background: #fff;
}

.vinhxd-laivay-inputs .item select.vinhxd-txt-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #f8fafc;
    cursor: pointer;
}

.vinhxd-laivay-inputs .item .vinhxd-unit {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.txt-type-interest {
    position: relative;
}

.txt-type-interest .drop {
    display: none;
}

/* ── Kết quả tổng lãi vay ────────────────────────────────────── */
/* Layout: hàng 1 = Số tiền vay + Số tiền hàng tháng (2 cột)
           hàng 2 = Tổng lãi + Tổng phải trả (2 cột) */
.vinhxd-payment-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8edf3;
}

.vinhxd-payment-item {
    background: #f4f7fb;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

/* Số tiền hàng tháng - nổi bật nhưng vẫn 1 cột */
.vinhxd-payment-item.highlight {
    grid-column: span 1;
    background: #e8f0fe;
    border: 1px solid #c5d8f8;
}

.vinhxd-payment-item.warning {
    background: #fff3f3;
    border: 1px solid #ffd6d6;
}

.vinhxd-payment-label {
    font-size: 12px;
    color: #777;
    margin: 0 0 6px;
    line-height: 1.4;
}

.vinhxd-payment-value {
    font-size: 16px;
    font-weight: 700;
    color: #1565c0;
    margin: 0;
}

.vinhxd-payment-item.highlight .vinhxd-payment-value {
    font-size: 18px;
    color: #e53935;
}

/* ── Nút Xem Chi Tiết ────────────────────────────────────────── */
.vinhxd-detail-btn {
    margin-top: 16px;
    text-align: center;
}

.vinhxd-btn-detail {
    display: inline-block;
    padding: 10px 28px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .5px;
    transition: background .2s, transform .15s;
}

.vinhxd-btn-detail:hover {
    background: #0d47a1;
    transform: translateY(-1px);
}

/* ── Bảng chi tiết kỳ trả ────────────────────────────────────── */
.vinhxd-table-detail {
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8edf3;
    display: none;
}

.vinhxd-table-detail table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vinhxd-table-detail thead tr {
    background: #1565c0;
    color: #fff;
}

.vinhxd-table-detail th {
    padding: 11px 10px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.vinhxd-table-detail th:first-child {
    text-align: center;
}

.vinhxd-table-detail tbody tr:nth-child(even) {
    background: #f8fafc;
}

.vinhxd-table-detail tbody tr:hover {
    background: #e8f0fe;
}

.vinhxd-table-detail td {
    padding: 9px 10px;
    text-align: right;
    border-bottom: 1px solid #f0f3f7;
}

.vinhxd-table-detail td:first-child {
    text-align: center;
    font-weight: 600;
    color: #1565c0;
}

.vinhxd-table-detail tfoot tr {
    background: #f0f4fb;
    font-weight: 700;
}

.vinhxd-table-detail tfoot td {
    padding: 11px 10px;
    border-top: 2px solid #1565c0;
    border-bottom: none;
    color: #1565c0;
}

/* ── Màu sắc xe ──────────────────────────────────────────────── */
.vinhxd-mausac-wrap {
    margin-bottom: 20px;
}

#anh-xe img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 12px;
}

#list-color {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.item-color {
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color .2s;
    display: inline-block;
}

.item-color:hover,
.item-color.active {
    border-color: #1565c0;
}

.vinhxd-swatch-inner {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.1);
}

/* ── Modal SĐT ───────────────────────────────────────────────── */
.vinhxd-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinhxd-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px 28px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 12px 48px rgba(0,0,0,.2);
    text-align: center;
}

.vinhxd-modal-icon {
    font-size: 2.8em;
    display: block;
    margin-bottom: 8px;
}

.vinhxd-modal-header h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: #1565c0;
    margin: 0 0 8px;
}

.vinhxd-modal-header p {
    font-size: .9em;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.vinhxd-modal-body {
    text-align: left;
}

.vinhxd-modal-skip {
    margin-top: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: .82em;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
    transition: color .2s;
}

.vinhxd-modal-skip:hover {
    color: #555;
}

/* ── Clearfix ────────────────────────────────────────────────── */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* ── Responsive mobile ───────────────────────────────────────── */
@media (max-width: 600px) {
    .vinhxd-card,
    .vinhxd-card {
        padding: 18px 16px;
    }

    .vinhxd-card table td:first-child {
        width: 90px;
        font-size: 12px;
    }

    .vinhxd-laivay-inputs .item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .vinhxd-laivay-inputs .item .title {
        width: 100%;
    }

    .vinhxd-laivay-inputs .item .text-input {
        width: 100%;
    }

    .vinhxd-payment-summary {
        grid-template-columns: 1fr;
    }

    .vinhxd-payment-item.highlight {
        grid-column: span 1;
    }

    .vinhxd-table-detail {
        overflow-x: auto;
    }

    .vinhxd-modal-box {
        padding: 28px 20px 20px;
    }
}

/* ── Label "Chọn dòng xe" ────────────────────────────────────── */
.vinhxd-select-label {
    font-size: 12px;
    font-weight: 700;
    color: #1565c0;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 5px;
}

/* ── Intro text trên "Tính lãi trả góp" ─────────────────────── */
.vinhxd-laivay-intro {
    font-size: 13px;
    color: #777;
    font-style: italic;
    margin: 0 0 10px;
    padding: 10px 14px;
    background: #f0f7ff;
    border-left: 3px solid #1565c0;
    border-radius: 0 6px 6px 0;
}

/* ================================================================
   MÀU XE - REDESIGN
================================================================ */

.vinhxd-mausac {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Ảnh xe ──────────────────────────────────────────────────── */
.vinhxd-mausac-img-wrap {
    position: relative;
    width: 100%;
    background: #f4f6f9;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.vinhxd-xe-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.18s ease;
    padding: 12px;
}

/* subtle inner shadow để ảnh không bị bay */
.vinhxd-mausac-overlay {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
    pointer-events: none;
}

/* ── Footer: tên màu + swatches ──────────────────────────────── */
.vinhxd-mausac-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 0 4px;
    flex-wrap: wrap;
}

/* ── Tên màu đang chọn ───────────────────────────────────────── */
.vinhxd-mausac-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2d2d2d;
    white-space: nowrap;
}

.vinhxd-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.15);
    flex-shrink: 0;
    transition: background .18s;
}

#mau-xe-active-name {
    transition: opacity .15s;
}

/* ── Swatches container ──────────────────────────────────────── */
.vinhxd-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ── Mỗi swatch ──────────────────────────────────────────────── */
.vinhxd-swatch {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: border-color .18s, transform .15s, box-shadow .18s;
    outline: none;
    flex-shrink: 0;
}

.vinhxd-swatch:hover {
    transform: scale(1.12);
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

.vinhxd-swatch.active {
    border-color: #1565c0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1565c0;
    transform: scale(1.08);
}

/* Vòng tròn màu bên trong */
.vinhxd-swatch-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--swatch-color, #ccc);
    border: 1.5px solid rgba(0,0,0,.1);
}

/* Dấu check khi active */
.vinhxd-swatch-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}

.vinhxd-swatch.active .vinhxd-swatch-check {
    opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .vinhxd-mausac-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .vinhxd-swatch {
        width: 32px;
        height: 32px;
    }
}