/* Tư vấn & Báo giá v2.8 */
/* Mọi selector đều gắn với #tpe-chat-modal / #tpe-chat-launcher để theme (Flatsome) không đè lên */

#tpe-chat-launcher,
#tpe-chat-modal,
#tpe-page-box,
.tpe-cta-box,
.tpe-cta-wrap {
    --tpe-c: var(--tpe-primary-color, #0073aa);
    --tpe-c-soft: rgba(0, 115, 170, 0.08);
    --tpe-c-ring: rgba(0, 115, 170, 0.18);
    --tpe-ink: #1f2937;
    --tpe-muted: #6b7280;
    --tpe-line: #e5e7eb;
    --tpe-bg: #f6f8fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}
@supports (background: color-mix(in srgb, red 10%, white)) {
    #tpe-chat-launcher,
    #tpe-chat-modal,
    #tpe-page-box,
    .tpe-cta-box,
    .tpe-cta-wrap {
        --tpe-c-soft: color-mix(in srgb, var(--tpe-c) 8%, white);
        --tpe-c-ring: color-mix(in srgb, var(--tpe-c) 22%, transparent);
    }
}
#tpe-chat-modal *,
#tpe-chat-modal *::before,
#tpe-chat-modal *::after,
#tpe-page-box *,
#tpe-page-box *::before,
#tpe-page-box *::after { box-sizing: border-box; }

/* ========== NÚT MỞ CHAT ========== */
#tpe-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    height: 64px;
    padding: 0 28px 0 22px;
    background: var(--tpe-c);
    color: #fff;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    animation: tpeGlow 2.4s ease-out infinite;
    z-index: 9999999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}
#tpe-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
#tpe-chat-launcher svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    flex-shrink: 0;
}
#tpe-chat-launcher .tpe-launcher-text {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}
#tpe-chat-launcher .tpe-icon-close { display: none; }
#tpe-chat-launcher.tpe-open { padding: 0; width: 64px; justify-content: center; animation: none; }
/* Vòng sáng lan ra để khách dễ chú ý */
@keyframes tpeGlow {
    0%   { box-shadow: 0 10px 28px rgba(0,0,0,0.25), 0 0 0 0 var(--tpe-c-ring); }
    70%  { box-shadow: 0 10px 28px rgba(0,0,0,0.25), 0 0 0 14px rgba(0,0,0,0); }
    100% { box-shadow: 0 10px 28px rgba(0,0,0,0.25), 0 0 0 0 rgba(0,0,0,0); }
}
@media (prefers-reduced-motion: reduce) { #tpe-chat-launcher { animation: none; } }
#tpe-chat-launcher.tpe-open .tpe-launcher-text,
#tpe-chat-launcher.tpe-open .tpe-icon-chat { display: none; }
#tpe-chat-launcher.tpe-open .tpe-icon-close { display: block; }

#tpe-chat-launcher .tpe-badge-ping {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border: 2px solid #fff;
    border-radius: 50%;
}
#tpe-chat-launcher .tpe-badge-ping::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: #ef4444;
    animation: tpePing 1.8s ease-out infinite;
    z-index: -1;
}
@keyframes tpePing {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* ========== KHUNG CHAT ========== */
#tpe-chat-modal {
    display: none;
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 390px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.08);
    z-index: 9999999;
    overflow: hidden;
    flex-direction: column;
    animation: tpeSlideUp 0.25s ease-out;
    color: var(--tpe-ink);
    text-align: left;
}
@keyframes tpeSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-header {
    background: var(--tpe-c);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0) 60%);
    color: #fff;
    padding: 16px 16px 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-status-dot {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-header-text { min-width: 0; }
#tpe-chat-modal #tpe-modal-title {
    display: block;
    font-weight: 700;
    font-size: 15.5px;
    line-height: 1.25;
    color: #fff;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-header-sub {
    display: block;
    font-size: 12.5px;
    opacity: 0.88;
    margin-top: 2px;
    line-height: 1.3;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-btn-close {
    background: rgba(255,255,255,0.16);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    min-height: 0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    box-shadow: none;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-btn-close:hover { background: rgba(255,255,255,0.28); }

/* Nội dung */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-content {
    padding: 16px;
    overflow-y: auto;
    background: var(--tpe-bg);
    flex: 1 1 auto;
    min-height: 0;
    overscroll-behavior: contain;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-content::-webkit-scrollbar { width: 6px; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Bong bóng lời chào */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-bot-bubble {
    background: #fff;
    border: 1px solid var(--tpe-line);
    border-radius: 4px 16px 16px 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--tpe-ink);
    margin: 0 0 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Danh mục gợi ý */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-category-explorer { margin: 0 0 14px; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-explorer-head {
    font-size: 12px;
    font-weight: 600;
    color: var(--tpe-muted);
    margin: 0 0 8px 2px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-cat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--tpe-line);
    border-radius: 999px;
    color: var(--tpe-c);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-cat-link:hover {
    background: var(--tpe-c-soft);
    border-color: var(--tpe-c);
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-cat-link::after {
    content: "›";
    font-size: 15px;
    line-height: 1;
    opacity: 0.6;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-cat-bullet { display: none; }

/* Thẻ sản phẩm đang xem */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-badge {
    background: #fff;
    border: 1px solid var(--tpe-line);
    border-left: 4px solid var(--tpe-c);
    border-radius: 10px;
    padding: 11px 13px;
    margin: 0 0 14px;
    align-items: flex-start;
    gap: 10px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-badge[style*="block"],
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-badge.tpe-show { display: flex !important; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-badge-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--tpe-c-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-badge-info { min-width: 0; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-badge-info small {
    display: block;
    color: var(--tpe-muted);
    font-size: 11.5px;
    font-weight: 500;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tpe-ink);
    line-height: 1.35;
    margin-top: 2px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-sku {
    display: inline-block;
    font-size: 12px;
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    margin-top: 4px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-product-sku:empty { display: none; }

/* Form */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-quote-form {
    background: #fff;
    border: 1px solid var(--tpe-line);
    border-radius: 14px;
    padding: 14px;
    margin: 0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-form-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--tpe-ink);
    margin: 0 0 12px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap { margin: 0 0 11px; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-label-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 5px;
    line-height: 1.3;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-label-flex label { margin: 0; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap label .req { color: #ef4444; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-hint-text {
    font-size: 11.5px;
    color: #059669;
    font-weight: 500;
    white-space: nowrap;
}

:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap input,
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap textarea {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--tpe-ink);
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap textarea {
    resize: vertical;
    min-height: 92px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap input::placeholder,
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap textarea::placeholder { color: #9ca3af; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap input:focus,
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap textarea:focus {
    border-color: var(--tpe-c);
    box-shadow: 0 0 0 3px var(--tpe-c-ring);
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Gợi ý nhanh */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-quick-tags {
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-tag-title {
    display: block;
    width: 100%;
    font-size: 12px;
    color: var(--tpe-muted);
    margin: 0 0 2px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chip {
    display: inline-flex;
    align-items: center;
    background: var(--tpe-bg);
    border: 1px dashed #cbd5e1;
    border-radius: 999px;
    padding: 5px 11px;
    margin: 0;
    min-height: 0;
    height: auto;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: #374151;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.15s ease;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chip:hover {
    background: var(--tpe-c-soft);
    border-color: var(--tpe-c);
    border-style: solid;
    color: var(--tpe-c);
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-chip.tpe-chip-on {
    background: var(--tpe-c);
    border-color: var(--tpe-c);
    border-style: solid;
    color: #fff;
}

/* Nút gửi */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    min-height: 0;
    height: auto;
    background: var(--tpe-c);
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 16px var(--tpe-c-ring);
    transition: transform 0.15s, filter 0.15s;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-submit-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-submit-btn svg { width: 18px; height: 18px; fill: #fff; }

:is(#tpe-chat-modal, #tpe-page-box) .tpe-privacy-note {
    font-size: 11.5px;
    color: #9ca3af;
    text-align: center;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* Thông báo */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-feedback {
    display: none;
    margin-top: 10px;
    padding: 11px 12px;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 10px;
    text-align: center;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-feedback.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-feedback.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Liên hệ nhanh */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-extra-contact {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-extra-contact a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    transition: filter 0.15s;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-extra-contact a { white-space: nowrap; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-extra-contact a:hover { filter: brightness(0.96); }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-call-link { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-zalo-link { background: #eff6ff; color: #0068ff; border: 1px solid #bfdbfe; }

/* ========== ĐIỆN THOẠI ========== */
@media (max-width: 520px) {
    #tpe-chat-launcher {
        bottom: calc(max(84px, 14px + var(--tpe-offset, 0px)) + env(safe-area-inset-bottom, 0px)); /* nằm trên thanh Zalo/Gọi/Map ở đáy */
        right: 12px;
        height: 56px;
        padding: 0 22px 0 17px;
        gap: 10px;
        transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease, padding 0.3s ease, bottom 0.2s ease;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    }
    #tpe-chat-launcher svg { width: 26px; height: 26px; }
    #tpe-chat-launcher .tpe-launcher-text { font-size: 16.5px; }
    /* Thu gọn thành nút tròn nhỏ */
    /* (v2.6) Luôn hiện đầy đủ chữ, không thu gọn */
    #tpe-chat-launcher .tpe-badge-ping { width: 12px; height: 12px; }
        #tpe-chat-launcher:hover { transform: none; }
    #tpe-chat-launcher.tpe-open { display: none; }
    #tpe-chat-modal {
        inset: auto 0 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
        animation-name: tpeSheetUp;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-field-row { grid-template-columns: 1fr; gap: 0; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-header { padding: 12px 12px 12px 14px; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-avatar { width: 36px; height: 36px; font-size: 19px; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-chat-content { padding: 12px; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-bot-bubble { font-size: 13.5px; padding: 10px 12px; margin-bottom: 12px; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-quote-form { padding: 12px; }
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap input,
    :is(#tpe-chat-modal, #tpe-page-box) .tpe-field-wrap textarea { font-size: 16px; } /* tránh iPhone tự phóng to */
}
@keyframes tpeSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ========== NHÓM KHÁCH HÀNG (v2.5) ========== */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--tpe-ink);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt:hover { border-color: var(--tpe-c); }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt.tpe-on,
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt:has(input:checked) {
    border-color: var(--tpe-c);
    background: var(--tpe-c-soft);
    color: var(--tpe-c);
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--tpe-c-ring);
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-opt:has(input:focus-visible) { outline: 2px solid var(--tpe-c); outline-offset: 2px; }

/* Ô bẫy chống spam: ẩn khỏi người dùng */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ========== TRANG TƯ VẤN & BÁO GIÁ (v2.7) ========== */
#tpe-page-box {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tpe-ink);
    max-width: 760px;
    margin: 8px auto 32px;
    background: var(--tpe-bg);
    border: 1px solid var(--tpe-line);
    border-radius: 20px;
    overflow: hidden;
    text-align: left;
}
#tpe-page-box .tpe-page-head {
    background: var(--tpe-c);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 65%);
    color: #fff;
    padding: 26px 28px 22px;
}
#tpe-page-box .tpe-page-kicker {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 4px 11px;
    margin: 0 0 10px;
}
#tpe-page-box .tpe-page-title {
    color: #fff;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 800;
    margin: 0 0 12px;
    padding: 0;
    text-transform: none;
    letter-spacing: 0;
}
#tpe-page-box .tpe-page-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}
#tpe-page-box .tpe-page-points li {
    position: relative;
    margin: 0;
    padding: 0 0 0 26px;
    font-size: 14.5px;
    line-height: 1.45;
    color: rgba(255,255,255,0.95);
}
#tpe-page-box .tpe-page-points li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    color: var(--tpe-c);
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
#tpe-page-box .tpe-page-card { padding: 20px; }
#tpe-page-box .tpe-quote-form {
    background: #fff;
    border: 1px solid var(--tpe-line);
    border-radius: 14px;
    padding: 20px;
    margin: 0;
}
#tpe-page-box .tpe-field-wrap { margin-bottom: 14px; }
#tpe-page-box .tpe-field-wrap label { font-size: 14px; }
#tpe-page-box .tpe-field-wrap input,
#tpe-page-box .tpe-field-wrap textarea { font-size: 15px; padding: 12px 13px; }
#tpe-page-box .tpe-group-list { grid-template-columns: repeat(2, 1fr); }
#tpe-page-box .tpe-group-opt { font-size: 13.5px; padding: 10px 12px; }
#tpe-page-box .tpe-hint-text { color: var(--tpe-muted); }
#tpe-page-box .tpe-submit-btn { font-size: 16.5px; padding: 15px 18px; }
#tpe-page-box .tpe-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Hộp cảm ơn sau khi gửi */
#tpe-page-box .tpe-thanks[hidden] { display: none !important; }
#tpe-page-box .tpe-thanks {
    background: #fff;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    padding: 32px 22px 24px;
    text-align: center;
}
#tpe-page-box .tpe-thanks-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    line-height: 60px;
    box-shadow: 0 0 0 8px #d1fae5;
}
#tpe-page-box .tpe-thanks-msg {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    color: #065f46;
    max-width: 520px;
    margin: 0 auto 6px;
}
#tpe-page-box .tpe-thanks .tpe-extra-contact { max-width: 420px; margin: 18px auto 0; }
#tpe-page-box .tpe-thanks-again {
    margin: 16px 0 0;
    background: none;
    border: none;
    box-shadow: none;
    color: var(--tpe-muted);
    font-size: 13.5px;
    text-decoration: underline;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    min-height: 0;
    padding: 4px;
}

@media (max-width: 520px) {
    #tpe-page-box { border-radius: 16px; margin: 4px 0 24px; }
    #tpe-page-box .tpe-page-head { padding: 20px 18px 18px; }
    #tpe-page-box .tpe-page-title { font-size: 20px; }
    #tpe-page-box .tpe-page-points li { font-size: 14px; }
    #tpe-page-box .tpe-page-card { padding: 12px; }
    #tpe-page-box .tpe-quote-form { padding: 14px; }
    #tpe-page-box .tpe-group-list { grid-template-columns: 1fr 1fr; }
    #tpe-page-box .tpe-field-wrap input,
    #tpe-page-box .tpe-field-wrap textarea { font-size: 16px; }
    #tpe-page-box .tpe-thanks-msg { font-size: 16.5px; }
}

/* ========== KHUNG / NÚT KÊU GỌI TRONG BÀI VIẾT [tpe_nut_tu_van] ========== */
body .tpe-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 28px 0;
    padding: 18px 20px;
    background: var(--tpe-c-soft);
    border: 1px solid var(--tpe-c-ring);
    border-left: 5px solid var(--tpe-c);
    border-radius: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body .tpe-cta-box .tpe-cta-text { min-width: 0; }
body .tpe-cta-box .tpe-cta-text strong {
    display: block;
    font-size: 17px;
    line-height: 1.35;
    color: #1f2937;
    margin: 0 0 4px;
}
body .tpe-cta-box .tpe-cta-text span {
    display: block;
    font-size: 14.5px;
    line-height: 1.5;
    color: #4b5563;
}
body .tpe-cta-wrap { margin: 20px 0; }
body a.tpe-cta-btn,
body a.tpe-cta-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: var(--tpe-c);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.2;
    padding: 14px 22px;
    border-radius: 999px;
    box-shadow: 0 6px 16px var(--tpe-c-ring);
    white-space: nowrap;
    transition: transform 0.15s, filter 0.15s;
}
body a.tpe-cta-btn:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff !important; }
@media (max-width: 600px) {
    body .tpe-cta-box { flex-direction: column; align-items: stretch; text-align: left; padding: 16px; }
    body .tpe-cta-box a.tpe-cta-btn { justify-content: center; white-space: normal; }
}

/* ========== CÂU HỎI CHI TIẾT (v2.8): sản phẩm quan tâm, số lượng, thông tin thảm… ========== */
:is(#tpe-chat-modal, #tpe-page-box) .tpe-group-label small { font-weight: 400; color: var(--tpe-muted); }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-multi .tpe-group-opt { display: flex; align-items: center; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-multi .tpe-group-opt::before {
    content: "";
    display: inline-block;
    vertical-align: -2px;
    box-sizing: border-box;
    flex: none;
    width: 15px;
    height: 15px;
    margin-right: 7px;
    border: 1.5px solid #c0c4cc;
    border-radius: 4px;
    background: #fff center / 11px no-repeat;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-multi .tpe-group-opt.tpe-on::before,
:is(#tpe-chat-modal, #tpe-page-box) .tpe-multi .tpe-group-opt:has(input:checked)::before {
    border-color: var(--tpe-c);
    background-color: var(--tpe-c);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E");
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-special[hidden] { display: none !important; }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-special {
    margin: 2px 0 14px;
    padding: 12px 12px 2px;
    border: 1px dashed var(--tpe-c);
    border-radius: 12px;
    background: var(--tpe-c-soft);
    animation: tpeSlideUp 0.2s ease-out;
}
:is(#tpe-chat-modal, #tpe-page-box) .tpe-special-title { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: var(--tpe-c); }
:is(#tpe-chat-modal, #tpe-page-box) .tpe-special .tpe-group-opt { background: #fff; }
#tpe-page-box .tpe-detail:not([data-key="interest"]) .tpe-group-list { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
#tpe-page-box .tpe-special { padding: 16px 16px 4px; }
@media (max-width: 520px) {
    #tpe-page-box .tpe-detail:not([data-key="interest"]) .tpe-group-list { grid-template-columns: 1fr 1fr; }
}
