/* ================================================
   trang-tri.css v2 — Tính Điện Mặt Trời Plugin
   ================================================ */

.tdmt-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 0;
}

/* ── Slider ── */
.tdmt-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.tdmt-input-row label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}
.tdmt-input-row input[type="range"] {
    flex: 1;
    min-width: 160px;
    accent-color: #378ADD;
    cursor: pointer;
}
.tdmt-kwh-val {
    font-size: 16px;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* ── Cards tóm tắt ── */
.tdmt-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
@media (max-width: 540px) { .tdmt-cards { grid-template-columns: 1fr; } }

.tdmt-card {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 16px 18px;
}
.tdmt-card-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.tdmt-card-val   { font-size: 22px; font-weight: 600; }
.tdmt-card-sub   { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ── Section ── */
.tdmt-section { margin: 24px 0; }
.tdmt-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}

/* ── Bậc bars ── */
.tdmt-bac-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.tdmt-bac-label { font-size: 13px; color: #555; width: 155px; flex-shrink: 0; }
.tdmt-bac-bar-bg { flex: 1; min-width: 60px; height: 13px; background: #e8e8e8; border-radius: 4px; overflow: hidden; }
.tdmt-bac-bar   { height: 100%; border-radius: 4px; background: #378ADD; transition: width .3s ease; }
.tdmt-bac-amt   { font-size: 13px; color: #333; min-width: 190px; text-align: right; }
@media (max-width: 600px) {
    .tdmt-bac-label { width: 100%; }
    .tdmt-bac-amt   { min-width: 0; text-align: left; }
}

/* ── Divider ── */
.tdmt-divider { border: none; border-top: 1px solid #ebebeb; margin: 28px 0; }

/* ── Solar cards ── */
.tdmt-solar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
/* Wrapper gói — chứa badge + card */
.tdmt-goi-wrap {
    display: flex;
    flex-direction: column;
}
.tdmt-badge-slot { display: none; }
.tdmt-rec-wrap .tdmt-solar-card {
    border: 2px solid #378ADD;
}
@media (max-width: 768px) { .tdmt-solar-grid { grid-template-columns: 1fr; gap: 10px; } }

.tdmt-solar-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.tdmt-solar-card:hover { box-shadow: 0 2px 14px rgba(0,0,0,.07); }
.tdmt-solar-card.tdmt-rec { border: 2px solid #378ADD; }

.tdmt-badge {
    display: inline-block;
    background: #378ADD;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
    white-space: nowrap;
}
.tdmt-sc-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.tdmt-sc-sub   { font-size: 11px; color: #aaa; margin-bottom: 10px; }
.tdmt-sc-sep   { border: none; border-top: 1px solid #f0f0f0; margin: 8px 0; }

.tdmt-sc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    padding: 3px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 6px;
}
.tdmt-sc-row:last-child { border-bottom: none; }
.tdmt-sc-key  { color: #777; flex-shrink: 0; }
.tdmt-sc-val  { font-weight: 600; text-align: right; }
.tdmt-sc-val.tdmt-green { color: #2e7d32; }

/* Link sản phẩm trong gói */
.tdmt-sp-link {
    color: #555;
    text-decoration: none;
    border-bottom: 1px dashed #bbb;
}
.tdmt-sp-link:hover { color: #185FA5; border-color: #185FA5; }

/* ── Loading / Error ── */
.tdmt-loading, .tdmt-error {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: #888;
    background: #f8f8f8;
    border-radius: 10px;
}
.tdmt-error { color: #c62828; background: #fff5f5; }

/* ── Note ── */
.tdmt-note { font-size: 12px; color: #bbb; margin-top: 10px; line-height: 1.7; }


/* ── Danh sách sản phẩm trong gói ── */
.tdmt-goi-items {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    flex: 1;
}

.tdmt-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border-bottom: 1px solid #f5f5f5;
}
.tdmt-item-row:last-child { border-bottom: none; }
.tdmt-item-row.tdmt-item-missing {
    color: #ccc;
    font-size: 12px;
    font-style: italic;
}
.tdmt-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.tdmt-item-name {
    font-size: 12px;
    color: #185FA5;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 180px;
}
.tdmt-item-name:hover { text-decoration: underline; }
.tdmt-item-name.tdmt-item-dv {
    color: #444;
    cursor: default;
}
.tdmt-item-gia {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
    min-width: 55px;
}
.tdmt-item-gia.tdmt-free {
    color: #2e7d32;
}
/* Tổng chi phí trong card gói */
.tdmt-goi-tong {
    margin-top: auto;
    padding-top: 8px;
}
/* Dòng tổng chi phí nổi bật */
.tdmt-goi-tong .tdmt-sc-row:first-child {
    background: #e8f2fc;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-bottom: none;
}
.tdmt-goi-tong .tdmt-sc-row:first-child .tdmt-sc-key {
    color: #185FA5;
    font-weight: 700;
    font-size: 13px;
}
.tdmt-goi-tong .tdmt-sc-row:first-child .tdmt-sc-val strong {
    color: #185FA5;
    font-size: 16px;
}
/* ── Input group (kWh + tiền điện) ── */
.tdmt-input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 16px;
    margin-bottom: 28px;
    background: #f8fafd;
    border: 1.5px solid #e2ecf7;
    border-radius: 14px;
    padding: 20px 24px;
}
@media (max-width: 540px) {
    .tdmt-input-group { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
    .tdmt-input-sep   { display: none; }
}
.tdmt-input-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tdmt-input-block label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tdmt-hint-inline {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.tdmt-input-with-unit {
    display: flex;
    align-items: stretch;
    border: 2px solid #dde6f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.tdmt-input-with-unit:focus-within {
    border-color: #378ADD;
}
.tdmt-input-with-unit input[type="number"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #1a1a1a;
  background: transparent;
  min-width: 0;
  -moz-appearance: textfield;
  border-radius: 10px 0 0 10px;
  margin-bottom: 3px;
}
.tdmt-input-with-unit input[type="number"]:focus {
    outline: none;
    box-shadow: none;
}
.tdmt-input-with-unit input[type="number"]::placeholder {
    font-size: 11px;
    font-weight: 400;
    color: #ccc;
}
.tdmt-input-with-unit input[type="number"]::-webkit-outer-spin-button,
.tdmt-input-with-unit input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.tdmt-unit {
    padding: 0 14px;
    font-size: 11px;
    font-weight: 600;
    color: #378ADD;
    background: #eef5fd;
    border-left: 2px solid #dde6f0;
    display: flex;
    align-items: center;
    white-space: nowrap;
    user-select: none;
    letter-spacing: .03em;
    border-radius: 0 8px 8px 0;
}
.tdmt-input-sep {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #bbb;
    background: #e8eef5;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
    justify-self: center;
}

/* ── Input preview (số có dấu chấm) ── */
.tdmt-input-preview {
    margin-top: 2px;
    font-size: 12px;
    color: #378ADD;
    font-weight: 600;
    min-height: 18px;
    letter-spacing: .01em;
}

/* ── Nút xem gói ── */
.tdmt-btn-wrap {
    text-align: center;
    margin: 24px 0 8px;
}
.tdmt-btn-xem-goi {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #378ADD;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 10px rgba(55,138,221,.25);
}
.tdmt-btn-xem-goi:hover {
    background: #2570c0;
    box-shadow: 0 4px 16px rgba(55,138,221,.35);
    transform: translateY(-1px);
}
.tdmt-btn-xem-goi.tdmt-btn-active {
    background: #1a5fa8;
}
.tdmt-btn-arrow {
    font-size: 16px;
    transition: transform .25s;
}
.tdmt-btn-xem-goi.tdmt-btn-active .tdmt-btn-arrow {
    display: inline-block;
    transform: rotate(180deg);
}

/* ── 4 cards layout ── */
.tdmt-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .tdmt-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .tdmt-cards { grid-template-columns: 1fr; } }

/* Sub VAT trong card tiền tháng */
.tdmt-card-sub-vat {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}
.tdmt-card-sub-vat span {
    font-weight: 600;
    color: #888;
}

/* Co chữ khi có đơn vị kèm theo */
.tdmt-stat-kwh,
.tdmt-stat-kwp {
    font-size: 18px;
}

/* ── 4 màu card ── */
.tdmt-card-blue   { background: #e8f2fc; border-left: 4px solid #378ADD; }
.tdmt-card-teal   { background: #e6f7f4; border-left: 4px solid #1aaa8c; }
.tdmt-card-orange { background: #fff4e6; border-left: 4px solid #f59e0b; }
.tdmt-card-red    { background: #fff0f0; border-left: 4px solid #e53e3e; }

.tdmt-card-blue   .tdmt-card-val { color: #1a6abf; }
.tdmt-card-teal   .tdmt-card-val { color: #0e7a60; }
.tdmt-card-orange .tdmt-card-val { color: #b45309; }
.tdmt-card-red    .tdmt-card-val { color: #c53030; }

.tdmt-card-blue   .tdmt-card-label,
.tdmt-card-teal   .tdmt-card-label,
.tdmt-card-orange .tdmt-card-label,
.tdmt-card-red    .tdmt-card-label { color: #666; }

/* ── Form thông tin liên hệ ── */
.tdmt-form-wrap {
    background: #f8fafd;
    border: 1.5px solid #e2ecf7;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.tdmt-form-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
}
.tdmt-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tdmt-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tdmt-form-field--full {
    grid-column: 1 / -1;
}
.tdmt-form-field label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tdmt-input-text {
    border: 2px solid #dde6f0;
    border-radius: 5px;
    padding: 0 12px;
    height: 40px;
    line-height: 40px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    display: flex;
    align-items: center;
}
.tdmt-input-text:focus {
    border-color: #378ADD;
    outline: none;
    box-shadow: none;
}
.tdmt-input-text::placeholder {
    font-size: 13px;
    font-weight: 400;
    color: #ccc;
}
.tdmt-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    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='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
@media (max-width: 540px) {
    .tdmt-form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tdmt-form-field--full { grid-column: 1; }
    .tdmt-form-wrap { padding: 16px; }
}

/* ── Chọn công suất & pin lưu trữ ── */
.tdmt-chon-goi-wrap {
    background: #f8fafd;
    border: 1.5px solid #e2ecf7;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tdmt-chon-goi-title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.tdmt-kwp-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.tdmt-kwp-btn {
    border: 2px solid #dde6f0;
    background: #fff;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.tdmt-kwp-btn:hover {
    border-color: #378ADD;
    color: #378ADD;
}
.tdmt-kwp-btn.tdmt-kwp-active {
    border-color: #378ADD;
    background: #378ADD;
    color: #fff;
}
.tdmt-pin-luu-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.tdmt-pin-luu-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #378ADD;
    cursor: pointer;
    flex-shrink: 0;
}
.tdmt-pin-luu-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.tdmt-pin-luu-note {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    margin-left: 4px;
}
@media (max-width: 540px) {
    .tdmt-chon-goi-wrap { padding: 16px; }
}

/* ── Khung chi tiết tiền điện ── */
.tdmt-chitiet-wrap {
    border: 1.5px solid #e2ecf7;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    background: #fff;
}
.tdmt-chitiet-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}
@media (max-width: 540px) {
    .tdmt-chitiet-wrap { padding: 16px; }
}