/* Dự toán chi phí trả góp — VinFast style */

.dtg-wrap {
    width: 100%;
    margin: 0;
    padding: 24px 0 48px;
    font-family: inherit;
    color: #3c3c3c;
    line-height: 1.5;
    box-sizing: border-box;
}

.dtg-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 0;
    align-items: stretch;
}
@media (min-width: 992px) {
    .dtg-layout {
        flex-direction: row;
        align-items: flex-start;
    }
}

.dtg-col-summary {
    flex: 0 0 100%;
    width: 100%;
    padding: 24px 16px;
}
.dtg-col-selection {
    flex: 0 0 100%;
    width: 100%;
}
@media (min-width: 992px) {
    .dtg-col-summary {
        flex: 0 0 58.333%;
        width: 58.333%;
        padding: 32px 24px 32px 16px;
    }
    .dtg-col-selection {
        flex: 0 0 41.667%;
        width: 41.667%;
    }
}

/* === Summary === */
.dtg-product-img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 24px;
    object-fit: contain;
}
.dtg-product-img.dtg-product-img-placeholder {
    width: 100%;
    max-height: 200px;
    opacity: .88;
}
.dtg-product-img[hidden] { display: none !important; }

.dtg-summary-details {
    width: 100%;
}
@media (min-width: 992px) {
    .dtg-summary-details {
        padding-right: 40px;
    }
}

.dtg-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 12px;
}
.dtg-summary-label {
    margin: 0;
    font-size: 15px;
    color: #3c3c3c;
}
.dtg-summary-label-main { font-weight: 600; }
.dtg-summary-value {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
}
.dtg-summary-total-row {
    align-items: center;
    margin-bottom: 20px;
}
.dtg-summary-total {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1464f4;
    white-space: nowrap;
}

.dtg-hr {
    border: none;
    border-top: 1px solid #e8ecef;
    margin: 14px 0;
}

.dtg-notice {
    font-size: 13px;
    color: #757575;
    line-height: 1.55;
    margin: 24px 0 0;
}
.dtg-notice a {
    color: #1464f4;
    text-decoration: none;
    font-weight: 500;
}
.dtg-notice a:hover { text-decoration: underline; }

/* === Selection panel === */
.dtg-selection-inner {
    background: #f4f6f8;
    padding: 24px 20px 28px;
}
@media (min-width: 992px) {
    .dtg-selection-inner { padding: 28px 24px 32px; }
}

/* Mẫu xe + Phiên bản cùng hàng */
.dtg-config-row {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}
.dtg-config-row .dtg-field {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.dtg-config-row .dtg-car-field:only-child,
.dtg-config-row:not(:has(.dtg-trim-field:not(.is-hidden))) .dtg-car-field {
    flex: 1 1 100%;
}
@media (max-width: 640px) {
    .dtg-config-row {
        flex-direction: column;
        gap: 20px;
    }
}
.dtg-trim-field.is-hidden {
    display: none !important;
}
.dtg-price-select-wrap.is-hidden {
    display: none !important;
}

.dtg-field { margin-bottom: 22px; }
.dtg-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #3c3c3c;
    margin-bottom: 10px;
}

.dtg-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1px solid #d9e1e2;
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
    color: #222;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23333' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    outline: none;
    transition: border-color .15s;
}
.dtg-select:focus {
    border-color: #1464f4;
    box-shadow: 0 0 0 2px rgba(20, 100, 244, .12);
}
.dtg-select:disabled {
    background-color: #eef1f2;
    color: #999;
    cursor: not-allowed;
}

/* Price select radios */
.dtg-price-select {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dtg-price-item {
    margin-bottom: 14px;
}
.dtg-radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.dtg-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1464f4;
    cursor: pointer;
    flex-shrink: 0;
}
.dtg-radio-group label {
    font-size: 14px;
    font-weight: 500;
    color: #3c3c3c;
    cursor: pointer;
    margin: 0;
}
.dtg-price-display {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    padding-left: 26px;
}
.dtg-price-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 26px;
    flex-wrap: wrap;
}
.dtg-price-input {
    flex: 1;
    min-width: 140px;
    padding: 10px 12px;
    border: 1px solid #d9e1e2;
    border-radius: 4px;
    font-size: 15px;
    background: #fff;
    font-family: inherit;
}
.dtg-price-input:focus {
    outline: none;
    border-color: #1464f4;
}
.dtg-price-input:disabled {
    background: #eef1f2;
    cursor: not-allowed;
}
.dtg-price-suffix {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.dtg-guide {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 12px 0 0;
}
.dtg-guide a {
    color: #1464f4;
    text-decoration: none;
    font-weight: 500;
}
.dtg-field.is-locked {
    opacity: .45;
    pointer-events: none;
    user-select: none;
}
.dtg-field.is-locked .dtg-guide { pointer-events: auto; }

.dtg-actions.is-hidden {
    display: none;
}

/* Pill buttons — term & down payment */
.dtg-pill-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}
@media (max-width: 640px) {
    .dtg-pill-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
.dtg-pill {
    width: 100%;
    min-width: 0;
    padding: 10px 6px;
    border: 1px solid #d9e1e2;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #3c3c3c;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
    box-sizing: border-box;
    line-height: 1.3;
}
.dtg-pill-unit {
    font-size: 12px;
    font-weight: 400;
    color: #757575;
}
.dtg-pill:hover { border-color: #90b4f8; }
.dtg-pill.is-active {
    border-color: #1464f4;
    background: #1464f4;
    color: #fff;
}
.dtg-pill.is-active .dtg-pill-unit {
    color: rgba(255, 255, 255, .85);
}

/* Interest rate stepper */
.dtg-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 200px;
}
.dtg-step-btn {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
    border-radius: 4px;
    transition: opacity .15s;
}
.dtg-step-btn:hover { opacity: .85; }
.dtg-rate-input {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    padding: 8px 4px;
    font-family: inherit;
    min-width: 60px;
}

/* Schedule button */
.dtg-actions { margin-top: 8px; }
.dtg-btn-schedule {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 4px;
    background: #b0b8bc;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: not-allowed;
    transition: background .2s;
    font-family: inherit;
}
.dtg-btn-schedule.is-ready {
    background: #1464f4;
    cursor: pointer;
}
.dtg-btn-schedule.is-ready:hover { background: #0d4ac0; }

/* Mobile notice hide on small - show on desktop only optional */
@media (max-width: 991px) {
    .dtg-notice { margin-top: 16px; }
}

/* Schedule modal */
.dtg-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.dtg-modal[hidden] {
    display: none !important;
}
body.dtg-modal-open {
    overflow: hidden;
}
.dtg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}
.dtg-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dtg-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    flex-shrink: 0;
}
.dtg-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}
.dtg-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.dtg-modal-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #1464f4;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.dtg-modal-download:hover { color: #0d4ac0; }
.dtg-modal-download svg { flex-shrink: 0; }
.dtg-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    padding: 0;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
}
.dtg-modal-close:hover {
    color: #222;
    background: #f0f0f0;
}
.dtg-modal-body {
    flex: 1;
    min-height: 0;
    padding: 0 24px 24px;
}
.dtg-schedule-scroll {
    overflow: auto;
    max-height: calc(100vh - 160px);
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}
.dtg-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.4;
}
.dtg-schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #1464f4;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 12px 10px;
    white-space: nowrap;
    border: none;
}
.dtg-schedule-table thead th:first-child {
    border-radius: 6px 0 0 0;
}
.dtg-schedule-table thead th:last-child {
    border-radius: 0 6px 0 0;
}
.dtg-schedule-table tbody td {
    padding: 10px;
    text-align: center;
    color: #333;
    border-bottom: 1px solid #eee;
}
.dtg-schedule-table tbody tr:nth-child(even) td {
    background: #f7f9fa;
}
.dtg-schedule-table tbody tr:hover td {
    background: #eef4ff;
}
.dtg-schedule-table tbody tr:last-child td {
    border-bottom: none;
}
@media (max-width: 640px) {
    .dtg-modal-header {
        flex-direction: column;
        padding: 16px 16px 12px;
    }
    .dtg-modal-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .dtg-modal-body { padding: 0 16px 16px; }
    .dtg-schedule-table { font-size: 11px; }
    .dtg-schedule-table thead th,
    .dtg-schedule-table tbody td {
        padding: 8px 6px;
    }
}
