/* ============================================
   AUTOMOTIVE OTO - Modern Calculator UI
   ============================================ */

/* Reset & Base - Override Flatsome theme defaults */
.automotive_longvietweb,
.automotive_longvietweb * {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

/* Flatsome sets "select { height: 2.507em }" which clips text.
   We use high-specificity selectors to guarantee override. */
.automotive_longvietweb select,
.automotive_longvietweb table select,
.automotive_longvietweb td select,
.automotive_longvietweb .text-input select,
.automotive_longvietweb .automotive_laivay select {
    height: auto !important;
    min-height: 46px !important;
    line-height: 1.6 !important;
    padding: 12px 36px 12px 16px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.automotive_longvietweb input[type="text"],
.automotive_longvietweb input[type="number"],
.automotive_longvietweb .text-input input[type="text"],
.automotive_longvietweb .text-input input[type="number"] {
    height: auto !important;
    min-height: 44px !important;
    line-height: 1.6 !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.automotive_longvietweb {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.automotive_longvietweb:after {
    content: "";
    display: table;
    clear: both;
}

.automotive_longvietweb table {
    border: 0;
    border-collapse: collapse;
    width: 100%;
}

.automotive_longvietweb table td {
    background: transparent !important;
    border: 0 !important;
    padding: 6px 0 !important;
    color: #334155;
    font-size: 14px;
}

/* ============================================
   Section Title
   ============================================ */
h4.tra-gop-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 14px 20px;
    margin: 0 0 24px 0;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* ============================================
   Two Column Layout
   ============================================ */
.automotive_muaoto_left {
    width: 48%;
    float: left;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.automotive_muaoto_left:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.automotive_muaoto_right {
    width: 48%;
    float: right;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
}

.automotive_muaoto_right:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Form Controls - Select & Input
   ============================================ */
.automotive_longvietweb select {
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 36px 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px;
    color: #334155;
    font-size: 14px !important;
    line-height: 1.6 !important;
    height: auto !important;
    min-height: 46px !important;
    background-color: #f8fafc;
    background-image: 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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.automotive_longvietweb select:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.automotive_longvietweb select:hover {
    border-color: #cbd5e1;
}

.automotive_longvietweb select optgroup {
    font-style: inherit;
    font-weight: 600;
    color: #64748b;
}

.automotive_longvietweb select optgroup option,
.automotive_longvietweb select option {
    color: #334155;
    padding: 8px;
}

/* ============================================
   Form Labels
   ============================================ */
.automotive_muaoto_left table tr td:nth-child(1) {
    width: 110px;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    vertical-align: middle;
}

/* ============================================
   Estimation Table (Right Panel)
   ============================================ */
.table_dutoanchiphi,
.show_dutoan p.mess_dutoanchiphi {
    display: none;
}

.show_dutoan table.table_dutoanchiphi {
    display: table;
}

p.mess_dutoanchiphi {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
    margin: 0;
}

table.table_dutoanchiphi {
    margin: 0;
}

table.table_dutoanchiphi tr td {
    padding: 10px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 14px;
}

table.table_dutoanchiphi tr:last-child td {
    border-bottom: none !important;
}

table.table_dutoanchiphi tr td:nth-child(1) {
    color: #64748b;
    font-weight: 500;
}

table.table_dutoanchiphi tr td:nth-child(2) {
    text-align: right;
    color: #334155;
    font-weight: 600;
}

table.table_dutoanchiphi tfoot {
    border-top: 2px solid #dc2626;
}

table.table_dutoanchiphi tfoot td {
    padding: 16px 0 !important;
    font-size: 17px;
    font-weight: 700 !important;
}

table.table_dutoanchiphi tfoot td:nth-child(1) {
    color: #1e293b !important;
    font-weight: 700 !important;
}

table.table_dutoanchiphi tfoot td:nth-child(2) {
    color: #dc2626 !important;
    font-weight: 800 !important;
    font-size: 20px;
}

/* ============================================
   Loan Calculator Section
   ============================================ */
.automotive_laivay {
    margin-top: 0;
}

.automotive_longvietweb .automotive_laivay select {
    margin: 0;
}

.index-value-interest-retes .item {
    margin-bottom: 16px;
}

.index-value-interest-retes .title {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
    padding: 0 0 6px 0;
    margin: 0;
    display: block;
    float: none;
    width: 100%;
}

.index-value-interest-retes .text-input {
    color: #334155;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    width: 100%;
    display: flex;
    align-items: center;
    float: none;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.index-value-interest-retes .text-input:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.index-value-interest-retes .text-input input.txt-input {
    width: calc(100% - 70px);
    border: 0 !important;
    background: transparent !important;
    outline: 0;
    padding: 12px 16px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 44px;
    margin: 0 !important;
    box-shadow: none !important;
}

.index-value-interest-retes .text-input span.quantitative {
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 12px;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
    background: #f1f5f9;
    height: 100%;
    min-height: 44px;
    border-left: 1px solid #e2e8f0;
}

.text-input select {
    width: 100%;
    border: 0;
    padding: 12px 16px;
    font-size: 14px;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    outline: 0;
    color: #334155;
    font-weight: 500;
}

/* ============================================
   Payment Summary
   ============================================ */
.total-payment {
    margin: 8px 0 0 0;
    width: 100%;
    border-radius: 12px;
    display: block;
    float: none;
    background: #fef2f2;
    padding: 20px;
}

.item-payment {
    margin-bottom: 0;
    padding: 10px 0;
    border-bottom: 1px solid #fecaca;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-payment:last-child,
.item-payment:nth-last-child(2) {
    border-bottom: none;
}

p.txt-payment {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    float: none;
    width: auto;
    font-weight: 500;
}

p.txt-index-payment {
    font-size: 14px;
    color: #dc2626;
    font-weight: 700;
    margin: 0;
    text-align: right;
}

/* ============================================
   Detail Payment Button
   ============================================ */
.detail-payment {
    padding-top: 12px;
}

.detail-payment button {
    border: 2px solid #dc2626;
    background: #fff;
    color: #dc2626;
    font-weight: 700;
    font-size: 13px;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    outline: 0;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-payment button ~ button {
    margin-left: 10px;
}

.detail-payment button:hover {
    color: #fff;
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

button.btn-calculator {
    display: none;
}

.devvn_laivay_muanha p {
    margin: 0 !important;
}

/* ============================================
   Detail Payment Table
   ============================================ */
.tbl-detail-payment {
    display: none;
    width: 100%;
    margin: 30px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.tbl-detail-payment table {
    border-collapse: collapse;
    width: 100%;
    margin: 0;
}

.tbl-detail-payment table thead {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.tbl-detail-payment table thead th {
    color: #fff;
    padding: 14px 12px;
    font-size: 13px;
    text-transform: none;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
}

.tbl-detail-payment table tbody tr td {
    border-right: 1px solid #f1f5f9;
    text-align: center;
    padding: 12px 8px;
    font-size: 13px;
    color: #475569;
}

.tbl-detail-payment table tbody tr:nth-child(2n+2) {
    background: #f8fafc;
}

.tbl-detail-payment table tbody tr:hover {
    background: #fef2f2;
}

.tbl-detail-payment table tbody tr td:last-child {
    border-right: 0;
}

.tbl-detail-payment table > tfoot > tr > td {
    color: #1e293b;
    font-weight: 700;
    padding: 16px 12px;
    font-size: 15px;
    text-align: center;
    background: #fef2f2;
    border-top: 2px solid #dc2626;
}

/* ============================================
   Email Form
   ============================================ */
.form-email {
    border: 2px solid #e2e8f0;
    margin: 16px 0;
    padding: 16px;
    border-radius: 12px;
    display: none;
    background: #f8fafc;
}

.email-input {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0;
}

.email_input_col_grow {
    flex: 1;
    max-height: 100%;
}

.email-input input {
    height: 42px;
    border: 2px solid #e2e8f0;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    outline: 0;
    padding: 0 14px;
    width: 100%;
    font-size: 14px;
    transition: border-color 0.2s;
}

.email-input input:focus {
    border-color: #dc2626;
}

.email-input button.btn-submit-sendmail {
    max-height: 100%;
    background: #dc2626;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    border: 0;
    border-radius: 0 10px 10px 0;
    height: 42px;
    outline: 0;
    white-space: nowrap;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.email-input button.btn-submit-sendmail:hover {
    background: #b91c1c;
}

button.btn-open-mailform {
    background: #dc2626;
    color: #fff;
    border: 0;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button.btn-open-mailform:hover {
    background: #b91c1c;
}

.form-email input {
    width: 100%;
    border: 2px solid #e2e8f0;
    outline: 0;
    margin: 0 0 8px;
    padding: 0 14px;
    height: 42px;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-email input:focus {
    border-color: #dc2626;
}

.form-email input.wpcf7-form-control.wpcf7-submit {
    background: #dc2626;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 13px;
    border: 0;
    width: auto;
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.form-email input.wpcf7-form-control.wpcf7-submit:hover {
    background: #b91c1c;
}

.form-email form {
    margin: 0;
}

.form-email div.wpcf7-response-output {
    margin: 8px 0;
}

.form-email span.wpcf7-not-valid-tip {
    font-size: 12px;
    color: #dc2626;
}

/* ============================================
   Color Picker (Mau Xe)
   ============================================ */
span.mau-xe-item-color {
    width: 48px;
    display: block;
    height: 32px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

#list-color {
    text-align: center;
    padding: 10px 0;
}

#list-color a {
    display: inline-block !important;
    margin: 0 4px 8px;
    vertical-align: middle;
    cursor: pointer;
    border-radius: 10px;
    padding: 2px;
    transition: all 0.2s ease;
}

#list-color a:hover span.mau-xe-item-color {
    border-color: #94a3b8;
    transform: scale(1.05);
}

#list-color a.active {
    padding: 2px;
    border: 2px solid #dc2626;
    border-radius: 10px;
}

#list-color a.active span.mau-xe-item-color {
    border-color: transparent;
}

/* ============================================
   Loading State
   ============================================ */
.muaoto_loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.muaoto_loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #e2e8f0;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: automotive-spin 0.6s linear infinite;
}

@keyframes automotive-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Clearfix
   ============================================ */
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

.clearfix {
    clear: both;
    width: 100%;
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (max-width: 992px) {
    .automotive_muaoto_left,
    .automotive_muaoto_right {
        width: 100%;
        float: none;
        margin-bottom: 20px;
    }

    .automotive_longvietweb {
        padding: 0;
    }
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 767px) {
    .automotive_muaoto_left,
    .automotive_muaoto_right {
        padding: 20px 16px;
        border-radius: 12px;
    }

    h4.tra-gop-title {
        font-size: 15px;
        padding: 12px 16px;
        border-radius: 10px;
    }

    .index-value-interest-retes,
    .content-value-interest-retes .payment {
        width: 100%;
        float: none;
    }

    .index-value-interest-retes {
        margin-bottom: 16px;
    }

    .index-value-interest-retes .title {
        font-size: 13px;
    }

    .total-payment {
        padding: 16px;
    }

    p.txt-payment {
        font-size: 12px;
    }

    p.txt-index-payment {
        font-size: 13px;
    }

    table.table_dutoanchiphi tr td {
        font-size: 13px;
    }

    table.table_dutoanchiphi tfoot td {
        font-size: 15px !important;
    }

    table.table_dutoanchiphi tfoot td:nth-child(2) {
        font-size: 17px !important;
    }

    .automotive_muaoto_left table tr td:nth-child(1) {
        width: 90px;
        font-size: 13px;
    }

    .automotive_longvietweb select {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ============================================
   Responsive - Small Mobile
   ============================================ */
@media (max-width: 560px) {
    .tbl-detail-payment {
        overflow-x: auto;
        border-radius: 12px;
    }

    .tbl-detail-payment table thead th {
        white-space: nowrap;
        font-size: 11px;
        font-weight: 600;
        padding: 10px 6px;
    }

    .tbl-detail-payment table tbody tr td {
        padding: 8px 4px;
        font-size: 11px;
    }

    .detail-payment button {
        width: 100%;
        margin: 0 0 10px !important;
        padding: 12px 16px;
    }

    .item-payment {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    p.txt-index-payment {
        text-align: left;
    }
}
