/* --- TGBH AI Chat Widget - Professional Stylesheet --- */

:root {
    /* Chiều cao thanh hành động cố định (Sticky Bottom Action Bar) trên mobile — dùng chung 1 biến CSS duy nhất
       cho CẢ chiều cao nút LẪN padding-bottom của body, để 2 giá trị này LUÔN khớp nhau tuyệt đối — tránh lặp lại
       lỗi "khoảng trống giữa footer và nút" do 2 nơi lỡ dùng 2 con số khác nhau (56px vs 35px trước đây). */
    --tgbh-mobile-action-bar-height: 40px;
}

/* Reset & Box Sizing */
#tam-qc-wrapper, #tam-qc-window, #tam-qc-backdrop {
    box-sizing: border-box;
}
#tam-qc-wrapper *, #tam-qc-window *, #tam-qc-backdrop * {
    box-sizing: border-box;
}

/* Floating Action Buttons (FABs) */
.tam-qc-wrapper {
    position: fixed;
    /* TASK 4: dịch xuống + sang phải 5px so với trước (25px -> 20px) để không còn cảm giác nổi quá cao/quá lệch
       trái, đồng thời vẫn chừa khoảng cách vừa đủ, đẹp mắt với mép màn hình. Chỉ ảnh hưởng desktop/tablet vì
       mobile (media query bên dưới) đã tự đặt lại bottom/right: auto và định vị riêng cho thanh nút full-width. */
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.tam-qc-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px !important; /* 2 button cách nhau 1-2px */
    align-items: flex-end;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tam-qc-toggles.hidden {
    display: none !important;
}

.tam-qc-toggle {
    color: #ffffff;
    border: none;
    height: 40px !important; /* Chiều cao 40px */
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.2px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
    text-align: center;
}

.tam-qc-toggle:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}

/* Button Báo giá nhanh: kích thước cố định 170x40px */
.tam-qc-toggle-orange,
#tam-qc-toggle-quote {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    padding: 0 10px !important;
    background: linear-gradient(135deg, #ff7a1a, #ea580c);
}

/* Button Đặt câu hỏi: chiều cao 40px */
.tam-qc-toggle-green,
#tam-qc-toggle-qa {
    padding: 0 18px !important;
    background: linear-gradient(135deg, #00b080, #00796b);
}

/* Backdrop Blur */
.tam-qc-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99998;
    transition: opacity 0.25s ease;
}

.tam-qc-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Chat Window Base */
.tam-qc-window {
    position: fixed;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tam-qc-window.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* MODE 1: BÁO GIÁ NHANH (Khung Rộng Căn Giữa Màn Hình - Hỗ trợ kéo di chuyển & co giãn) */
.tam-qc-window.mode-quote {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%);
    width: 92vw;
    max-width: 960px;
    min-width: 360px;
    height: 86vh;
    max-height: 880px;
    min-height: 480px;
    resize: both; /* Cho phép người dùng kéo giãn cửa sổ từ góc */
    overflow: hidden;
}
.tam-qc-window.mode-quote.hidden {
    transform: translate(-50%, -46%) scale(0.96);
}

/* KHI ĐƯỢC KÉO DI CHUYỂN (DRAGGING): Vô hiệu hoá translate(-50%, -50%) để vị trí chuột chính xác */
.tam-qc-window.is-dragged {
    transform: none !important;
    transition: none !important;
}

/* CHẾ ĐỘ TOÀN MÀN HÌNH (FULLSCREEN) */
.tam-qc-window.is-fullscreen {
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    transform: none !important;
    border-radius: 0 !important;
    resize: none !important;
}

/* MODE 2: ĐẶT CÂU HỎI (Khung Nhỏ Gọn Góc Dưới Phải - Ảnh Dat cau hoi 1) */
.tam-qc-window.mode-qa {
    bottom: 25px;
    right: 25px;
    top: auto;
    left: auto;
    width: 390px;
    max-width: 94vw;
    min-width: 320px;
    height: 620px;
    max-height: 86vh;
    min-height: 420px;
    transform-origin: bottom right;
    resize: both;
    overflow: hidden;
}
.tam-qc-window.mode-qa.hidden {
    transform: scale(0.92);
}

/* Prevent body scroll when chat modal is open on mobile */
body.tam-qc-modal-open {
    overflow: hidden !important;
    touch-action: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* ============================================================
       STICKY BOTTOM ACTION BAR (mobile only) — thay thế 2 nút pill nổi góc
       bằng 1 thanh cố định đáy màn hình, chia đều 50/50 (hoặc 100% nếu chỉ 1 nút bật).
       Đây là CÙNG MỘT phần tử #tam-qc-toggles đã render sẵn ở PHP — chỉ đổi CSS,
       KHÔNG tạo thêm DOM/nút bấm trùng lặp, nên toàn bộ click handler hiện có giữ nguyên.
       ============================================================ */
    .tam-qc-wrapper {
        /* Bỏ định vị góc dưới-phải cố định trên desktop; để #tam-qc-toggles tự định vị full-width riêng bên dưới */
        bottom: auto;
        right: auto;
    }

    .tam-qc-toggles {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 0 !important;
        margin: 0 !important;
        /* Dùng lại đúng z-index của .tam-qc-wrapper (99999) — thấp hơn z-index cửa sổ chat trên mobile (999999)
           để khi mở modal, modal luôn nổi lên trên thanh này, không chồng lấn sai lớp. */
        z-index: 99999;
        box-sizing: border-box;
        padding-bottom: env(safe-area-inset-bottom, 0px); /* Vùng an toàn iPhone home indicator */
        transition: transform 0.3s ease-in-out; /* Hiệu ứng trượt mượt khi ẩn/hiện theo hướng cuộn trang */
    }

    /* TASK 3: Ẩn thanh nút khi cuộn XUỐNG trang (đọc nội dung), hiện lại khi cuộn LÊN — do JS thêm/bỏ class này
       (xem script.js). Đặt CSS ở đây (trong media query mobile) để hiệu ứng CHỈ có tác dụng trên mobile — class
       này không có style gì trên desktop dù JS có gắn/gỡ (không cần lặp lại logic kiểm tra breakpoint trong JS). */
    .tam-qc-toggles.tam-qc-toggles-scroll-hide {
        transform: translateY(100%);
    }

    .tam-qc-toggles.hidden {
        display: none !important; /* Case D: cả 2 nút đều tắt -> ẩn hẳn thanh, không để lại thanh rỗng */
    }

    .tam-qc-toggle {
        flex: 1 1 0 !important; /* 2 nút bật -> tự động chia đều 50/50; chỉ 1 nút bật -> tự động chiếm 100% */
        width: auto !important;
        height: var(--tgbh-mobile-action-bar-height) !important;
        min-height: var(--tgbh-mobile-action-bar-height) !important;
        max-height: none !important;
        border-radius: 0 !important; /* Bỏ dáng pill, thành khối chữ nhật đặc */
        margin: 0 !important;
        box-shadow: none !important;
        font-size: 15px !important;
        padding: 0 8px !important;
        overflow: hidden !important;
        white-space: normal !important; /* Cho phép xuống dòng thay vì tràn ngang trên màn hình rất hẹp (320px) */
        line-height: 1.15 !important;
        word-break: break-word !important;
    }

    .tam-qc-toggle:hover {
        transform: none; /* Bỏ hiệu ứng hover phóng to (không phù hợp thao tác chạm trên mobile) */
    }

    /* Giữ nguyên đúng màu cam/xanh hiện có — chỉ bỏ chiều rộng cố định 170px để nút co giãn theo flex:1 */
    .tam-qc-toggle-orange,
    #tam-qc-toggle-quote,
    .tam-qc-toggle-green,
    #tam-qc-toggle-qa {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    /* Chừa khoảng trống đáy trang bằng đúng chiều cao thanh + safe-area, để footer/nội dung website
       không bao giờ bị thanh cố định che khuất. CHỈ áp dụng khi thanh thực sự đang hiển thị
       (dùng :has() để tự động bỏ qua khi cả 2 nút bị tắt — tránh chừa khoảng trống thừa vô ích). */
    body:has(#tam-qc-toggles:not(.hidden)) {
        padding-bottom: calc(var(--tgbh-mobile-action-bar-height) + env(safe-area-inset-bottom, 0px));
    }

    .tam-qc-window.mode-quote,
    .tam-qc-window.mode-qa {
        position: fixed !important;
        width: 100% !important;
        width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        height: -webkit-fill-available;
        max-width: 100vw !important;
        max-height: 100% !important;
        max-height: 100dvh !important;
        min-width: 0 !important;
        min-height: 0 !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        resize: none !important;
        box-shadow: none !important;
        z-index: 999999 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .tam-qc-window.mode-quote.hidden,
    .tam-qc-window.mode-qa.hidden {
        display: none !important;
        pointer-events: none !important;
    }

    .tam-qc-messages {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tam-qc-footer {
        flex-shrink: 0 !important;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
        background: #ffffff !important;
    }

    .tam-qc-contact-bar {
        padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
    }

    .tam-qc-resize-handle {
        display: none !important;
    }
}

/* Window Header - Hỗ trợ thanh kéo di chuyển chuột */
.tam-qc-header {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.tam-qc-header:active {
    cursor: grabbing;
}

.tam-qc-header-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.tam-qc-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tam-qc-icon-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    color: #ffffff !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.2s, transform 0.1s;
    box-shadow: none !important;
}
.tam-qc-icon-btn:hover {
    background: rgba(255, 255, 255, 0.24) !important;
}
.tam-qc-icon-btn svg {
    display: block !important;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    stroke: #ffffff !important;
    stroke-width: 2.3 !important;
    fill: none !important;
    color: #ffffff !important;
    margin: 0 !important;
}
.tam-qc-icon-btn .icon-restore {
    display: none !important;
}
.tam-qc-window.is-fullscreen .tam-qc-icon-btn .icon-maximize {
    display: none !important;
}
.tam-qc-window.is-fullscreen .tam-qc-icon-btn .icon-restore {
    display: block !important;
}

/* QA Header Details */
.tam-qc-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tam-qc-avatar {
    width: 38px;
    height: 38px;
    background: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.tam-qc-title {
    font-size: 15px;
    font-weight: 700;
    display: block;
    color: #ffffff;
}
.tam-qc-subtitle {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tam-qc-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

/* Messages Body */
.tam-qc-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

.tam-qc-messages::-webkit-scrollbar {
    width: 6px;
}
.tam-qc-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Wrappers & Bubbles */
.tam-qc-msg-row {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    clear: both !important;
    box-sizing: border-box !important;
    float: none !important;
}
.tam-qc-msg-row.user {
    justify-content: flex-end !important;
    scroll-margin-top: 20px; /* Auto-scroll UX: chừa khoảng đệm phía trên khi tin nhắn này được neo lên đầu khung chat */
}
.tam-qc-msg-row.bot {
    justify-content: flex-start !important;
}

.tam-qc-bubble {
    max-width: 85%;
    padding: 12px 18px;
    font-size: 14.5px;
    line-height: 1.6;
    word-break: break-word;
    border-radius: 16px;
}

/* Bot Greeting / Message Bubble (Ảnh 1) */
.tam-qc-bubble.bot {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* User Bubble in Quote Mode (Dark Navy - Ảnh 2, 7) */
.mode-quote .tam-qc-bubble.user {
    background: #0f172a;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* User Bubble in QA Mode (Teal - Ảnh Dat cau hoi 2, 14) */
.mode-qa .tam-qc-bubble.user {
    background: #00897b;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 137, 123, 0.18);
}

/* Suggestion Pills in QA Chat Flow */
.tam-qc-qa-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    width: 100%;
}
.tam-qc-qa-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 13.5px;
    color: #1e293b;
    cursor: pointer;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}
.tam-qc-qa-pill:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Footer Container */
.tam-qc-footer {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

/* Suggestions Chips Row (In Quote Mode above Input - Ảnh 1) */
.tam-qc-suggestions {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 10px 18px 8px 18px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tam-qc-suggestions::-webkit-scrollbar {
    height: 4px !important;
}
.tam-qc-suggestions::-webkit-scrollbar-thumb {
    background: #e2e8f0 !important;
    border-radius: 2px !important;
}
.tam-qc-suggestion-chip {
    flex: 0 0 auto !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 20px !important;
    padding: 7px 14px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
.tam-qc-suggestion-chip:hover {
    background: #f8fafc !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    transform: translateY(-1px) !important;
}

/* Input Area (Chung cho cả Báo giá nhanh và Đặt câu hỏi) */
.tam-qc-input-area {
    display: flex;
    padding: 12px 18px;
    background: #ffffff;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    border-top: 1px solid #edf2f7;
}

.tam-qc-input-area input {
    flex: 1;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 21px !important;
    padding: 0 18px !important;
    outline: none !important;
    font-size: 13.5px !important;
    line-height: 42px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
.tam-qc-input-area input:focus {
    background: #ffffff !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12) !important;
}
.mode-qa .tam-qc-input-area input:focus {
    background: #ffffff !important;
    border-color: #00796b !important;
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.12) !important;
}

/* Send Button: Luôn CÙNG CHIỀU CAO (42px) với thanh nhập tin nhắn */
.tam-qc-send-btn {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1 !important;
}

/* Mode Quote: Nút "GỬI" phẳng sang trọng, bo tròn 21px, cao chuẩn 42px */
.mode-quote .tam-qc-send-btn {
    background: #0f172a !important;
    color: #ffffff !important;
    border-radius: 21px !important;
    padding: 0 22px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
}
.mode-quote .tam-qc-send-btn:hover {
    background: #1e293b !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28) !important;
    transform: translateY(-1px) !important;
}
.mode-quote .tam-qc-send-icon {
    display: none !important;
}
.mode-quote .tam-qc-send-text {
    display: inline-block !important;
}

/* Mode QA: Nút tròn 42px (bằng chiều cao input), bo tròn hoàn hảo, icon phi thuyền căn giữa */
.mode-qa .tam-qc-send-btn {
    background: #0f172a !important;
    color: #ffffff !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
}
.mode-qa .tam-qc-send-btn:hover {
    background: #1e293b !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28) !important;
    transform: translateY(-1px) !important;
}
.mode-qa .tam-qc-send-text {
    display: none !important;
}
.mode-qa .tam-qc-send-icon {
    display: block !important;
}

/* Contact Bar (Cho mode QA: Zalo & Gọi) */
.tam-qc-contact-bar {
    display: flex;
    gap: 12px;
    padding: 0 20px 14px 20px;
    background: transparent;
}
.tam-qc-contact-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    border-radius: 21px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}
.tam-qc-contact-btn.zalo {
    background: #e0f2fe;
    color: #0284c7;
}
.tam-qc-contact-btn.zalo:hover {
    background: #bae6fd;
}
.tam-qc-contact-btn.call {
    background: #ecfdf5;
    color: #059669;
}
.tam-qc-contact-btn.call:hover {
    background: #d1fae5;
}

/* --- UI TABLES & CARDS (LEVEL 1, 2, 3, 4 - Ảnh 2, 3, 4, 5, 7, 9, 13) --- */
.tam-qc-card {
    background: #ffffff !important;
    border: 1.5px solid #a7f3d0 !important;
    border-radius: 16px !important;
    margin: 0 0 20px 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

.tam-qc-card-header,
.tam-qc-card-title {
    padding: 16px 20px 14px 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.5 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
    margin: 0 !important;
}

.tam-qc-table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Custom subtle scrollbar inside widget so it never uses theme red scrollbar */
#tam-qc-window ::-webkit-scrollbar,
.tam-qc-table-responsive::-webkit-scrollbar,
.tam-qc-messages::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
#tam-qc-window ::-webkit-scrollbar-track,
.tam-qc-table-responsive::-webkit-scrollbar-track,
.tam-qc-messages::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}
#tam-qc-window ::-webkit-scrollbar-thumb,
.tam-qc-table-responsive::-webkit-scrollbar-thumb,
.tam-qc-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 4px !important;
    border: none !important;
    box-shadow: none !important;
}

.tam-qc-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
    table-layout: auto !important;
    margin: 0 !important;
    border: none !important;
    background: #ffffff !important;
}

.tam-qc-table th, .tam-qc-table td {
    padding: 10px 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #f1f5f9 !important;
    border-left: none !important;
    border-top: none !important;
    text-align: left !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}
.tam-qc-table th {
    padding: 10px 14px !important;
    background: #f8fafc !important;
    font-weight: 700 !important;
    color: #475569 !important;
    font-size: 13px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
.tam-qc-table th:first-child, .tam-qc-table td:first-child {
    padding-left: 16px !important;
}
.tam-qc-table th:last-child, .tam-qc-table td:last-child {
    border-right: none !important;
    text-align: center !important;
    padding-right: 16px !important;
}
.tam-qc-table tr:last-child td {
    border-bottom: none !important;
}
.tam-qc-table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Column optimizations for Level 1 Table */
.tam-qc-table .col-name {
    width: 28% !important;
    min-width: 140px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 13.5px !important;
}
.tam-qc-table .col-summary {
    width: auto !important;
    color: #475569 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    padding-right: 16px !important;
}
.tam-qc-table .col-action {
    width: 1% !important;
    white-space: nowrap !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 8px 16px !important;
}

/* Column optimizations for Level 2 Table (Eliminating massive column gaps) */
.tam-qc-table .col-thumb {
    width: 68px;
    min-width: 68px;
    text-align: center;
    padding: 6px 8px !important;
    vertical-align: middle !important;
}
.tam-qc-table .col-size {
    width: 110px;
    min-width: 90px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    font-size: 13px;
    vertical-align: middle !important;
}
.tam-qc-table .col-price {
    width: 140px;
    min-width: 130px;
    font-weight: 700;
    color: #ea580c;
    white-space: nowrap;
    font-size: 13.5px;
    vertical-align: middle !important;
}
.tam-qc-table .col-desc {
    width: auto;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    padding-right: 16px;
    vertical-align: middle !important;
}
.tam-qc-table .col-btn {
    width: 1%;
    white-space: nowrap;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 8px 16px !important;
}

.tam-qc-table-group {
    background: #f8fafc !important;
    font-weight: 700 !important;
    text-align: center !important;
    font-size: 14px !important;
    color: #0f172a !important;
    padding: 9px 16px !important;
    border-top: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    letter-spacing: 0.3px;
}

.tam-qc-img-thumb {
    width: 68px;
    height: 46px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    display: inline-block;
}

/* Nút Xem chi tiết xanh nhạt dạng Pill (Ảnh 2, 3, 7) */
.tam-qc-btn-pill-blue {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    padding: 0 16px !important;
    background: #e0f2fe !important;
    color: #0284c7 !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    line-height: 1 !important;
    border-radius: 15px !important;
    border: 1px solid #bae6fd !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    text-transform: none !important;
    transition: all 0.2s ease !important;
    margin: 0 auto !important;
}
.tam-qc-btn-pill-blue:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.28) !important;
    transform: translateY(-1px) !important;
}

/* Level 3 Detail Card (Image aligned with Spec Table) */
.tam-qc-detail-body {
    padding: 16px;
    display: flex;
    gap: 18px;
    align-items: stretch;
}
@media (max-width: 768px) {
    .tam-qc-detail-body {
        flex-direction: column;
    }
}
.tam-qc-detail-media {
    flex: 0 0 240px;
    max-width: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
@media (max-width: 768px) {
    .tam-qc-detail-media {
        flex: auto;
        max-width: 100%;
    }
}
.tam-qc-detail-media img {
    width: 100%;
    height: 100%;
    min-height: 190px;
    max-height: 240px;
    object-fit: cover;
    display: block;
}
.tam-qc-detail-specs {
    flex: 1;
    min-width: 240px;
    display: flex;
}
.tam-qc-spec-table {
    width: 100%;
    height: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}
.tam-qc-spec-table td {
    padding: 7px 12px;
    font-size: 13px;
    line-height: 1.35;
    border-bottom: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
}
.tam-qc-spec-table td:last-child {
    border-right: none;
}
.tam-qc-spec-table tr:last-child td {
    border-bottom: none;
}
.tam-qc-spec-label {
    width: 115px;
    font-weight: 700;
    color: #334155;
    background: #f8fafc;
    white-space: nowrap;
}
.tam-qc-spec-val {
    color: #0f172a;
}
.tam-qc-spec-val.highlight {
    font-weight: 700;
    color: #ea580c;
    font-size: 14.5px;
}

.tam-qc-card-footer {
    padding: 16px 20px 20px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Card Action Buttons Group - Perfectly aligned on same baseline */
.tam-qc-card-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* Action Buttons: Identical height (40px), baseline alignment, matching padding */
.tam-qc-btn-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 120px;
    padding: 0 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    background: #ea580c;
    color: #ffffff;
    border: none;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tam-qc-btn-order:hover {
    background: #c2410c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

/* Zalo & Gọi Ngay buttons are sized identically and perfectly aligned */
.tam-qc-btn-zalo-solid,
.tam-qc-btn-call-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 120px;
    padding: 0 22px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tam-qc-btn-zalo-solid {
    background: #0084ff;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.25);
}
.tam-qc-btn-zalo-solid:hover {
    background: #0070d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.35);
}

.tam-qc-btn-call-solid {
    background: #00796b;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 121, 107, 0.25);
}
.tam-qc-btn-call-solid:hover {
    background: #006054;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 121, 107, 0.35);
}

/* Form Styles */
.tam-qc-order-box {
    padding: 20px;
}

/* Đơn vị đo (m/cm) trong form Đặt làm: Rõ chữ, có chevron mũi tên, không bị che chữ */
.tam-qc-unit-select {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 28px 0 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px 14px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    line-height: 40px !important;
}
.tam-qc-unit-select:focus {
    border-color: #0284c7 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
}

/* Đảm bảo ảnh sản phẩm tải từ Google Sheet (Drive / Imgur / URL ngoài) hiển thị đẹp, có khung bảo vệ lỗi */
.tam-qc-img-thumb,
.tam-qc-detail-img,
.tam-qc-order-thumb {
    object-fit: cover !important;
    background-color: #f8fafc !important;
}

/* ==========================================================================
   UTILITY CLASSES CHO UX BUILDER & GIAO DIỆN TÙY CHỌN (FLATSOME THEME)
   ========================================================================== */

/* Layout & Flexbox */
.u-flex { display: flex !important; }
.u-inline-flex { display: inline-flex !important; }
.u-flex-col { flex-direction: column !important; }
.u-flex-row { flex-direction: row !important; }
.u-flex-wrap { flex-wrap: wrap !important; }
.u-items-center { align-items: center !important; }
.u-items-start { align-items: flex-start !important; }
.u-items-stretch { align-items: stretch !important; }
.u-justify-between { justify-content: space-between !important; }
.u-justify-center { justify-content: center !important; }
.u-justify-start { justify-content: flex-start !important; }
.u-justify-end { justify-content: flex-end !important; }

/* Gap */
.u-gap-8 { gap: 8px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-16 { gap: 16px !important; }
.u-gap-20 { gap: 20px !important; }
.u-gap-24 { gap: 24px !important; }

/* Spacing Padding */
.u-p-12 { padding: 12px !important; }
.u-p-16 { padding: 16px !important; }
.u-p-20 { padding: 20px !important; }
.u-p-24 { padding: 24px !important; }
.u-py-8 { padding-top: 8px !important; padding-bottom: 8px !important; }
.u-py-12 { padding-top: 12px !important; padding-bottom: 12px !important; }
.u-py-16 { padding-top: 16px !important; padding-bottom: 16px !important; }
.u-px-16 { padding-left: 16px !important; padding-right: 16px !important; }
.u-px-20 { padding-left: 20px !important; padding-right: 20px !important; }
.u-px-24 { padding-left: 24px !important; padding-right: 24px !important; }

/* Spacing Margin */
.u-m-0 { margin: 0 !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mb-20 { margin-bottom: 20px !important; }
.u-mb-24 { margin-bottom: 24px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-20 { margin-top: 20px !important; }

/* Borders & Rounded */
.u-rounded-8 { border-radius: 8px !important; }
.u-rounded-12 { border-radius: 12px !important; }
.u-rounded-16 { border-radius: 16px !important; }
.u-rounded-full { border-radius: 9999px !important; }
.u-border-gray { border: 1px solid #e2e8f0 !important; }
.u-border-emerald { border: 1.5px solid #a7f3d0 !important; }
.u-border-orange { border: 1.5px solid #fdba74 !important; }

/* Shadows */
.u-shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important; }
.u-shadow-md { box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important; }
.u-shadow-lg { box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important; }

/* Typography & Colors */
.u-text-h2 { font-size: 22px !important; font-weight: 700 !important; line-height: 1.4 !important; color: #0f172a !important; }
.u-text-h3 { font-size: 17px !important; font-weight: 700 !important; line-height: 1.45 !important; color: #1e293b !important; }
.u-text-body { font-size: 14.5px !important; line-height: 1.6 !important; color: #334155 !important; }
.u-text-muted { font-size: 13.5px !important; line-height: 1.6 !important; color: #64748b !important; }
.u-text-bold { font-weight: 700 !important; }
.u-text-semibold { font-weight: 600 !important; }
.u-text-center { text-align: center !important; }
.u-text-left { text-align: left !important; }
.u-text-right { text-align: right !important; }
.u-color-navy { color: #0f172a !important; }
.u-color-slate { color: #475569 !important; }
.u-color-orange { color: #ea580c !important; }
.u-color-emerald { color: #00796b !important; }
.u-color-blue { color: #0284c7 !important; }

/* Custom Backgrounds */
.u-bg-white { background-color: #ffffff !important; }
.u-bg-slate-50 { background-color: #f8fafc !important; }
.u-bg-slate-100 { background-color: #f1f5f9 !important; }
.u-bg-blue-50 { background-color: #f0f9ff !important; }
.u-bg-orange-50 { background-color: #fff7ed !important; }
.u-bg-emerald-50 { background-color: #f0fdf4 !important; }

/* UX Builder Trigger Class */
.open-quote-modal,
.tam-qc-open-quote {
    cursor: pointer !important;
}

/* ==========================================================================
   TGBH UTILITY CLASSES - ĐỘC LẬP & ÉP CHUẨN UI/UX BÁO GIÁ NHANH
   Tuân thủ: Không đụng layout UX Builder, chỉ dùng gán class độc lập trong style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BẢNG DANH SÁCH: .u-table-list-fixed
   - Khắc phục triệt để khoảng trống khổng lồ ở cột giữa.
   - Cột cuối (Xem chi tiết) ôm sát nội dung (width: 1%; white-space: nowrap).
   - Cột "Hạng mục" cố định tỷ lệ 28% - 30%.
   - Cột giữa tự co giãn chiếm phần còn lại kèm padding-right thoáng mát.
   - Ép padding >= 12px - 14px cho tất cả th, td.
   -------------------------------------------------------------------------- */
table.u-table-list-fixed,
.u-table-list-fixed table,
.tam-qc-table.u-table-list-fixed {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.u-table-list-fixed th,
.u-table-list-fixed td,
table.u-table-list-fixed th,
table.u-table-list-fixed td {
    padding: 10px 14px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #edf2f7 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    text-align: left !important;
}

/* Cột 1: Hạng mục (Độ rộng 28%, chữ đậm rõ nét, padding trái thoải mái) */
.u-table-list-fixed th:first-child,
.u-table-list-fixed td:first-child,
.u-table-list-fixed .col-name {
    width: 28% !important;
    min-width: 140px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    padding-left: 16px !important;
}

/* Cột 2: Kích thước & Giá (Tự chiếm phần còn lại, đệm padding-right lớn tránh kéo dãn sát lề) */
.u-table-list-fixed th:nth-child(2),
.u-table-list-fixed td:nth-child(2),
.u-table-list-fixed .col-summary {
    width: auto !important;
    padding-right: 16px !important;
    color: #475569 !important;
}

/* Cột 3: Nút hành động (Ôm sát nội dung 1%, căn giữa cân bằng trên dưới trái phải) */
.u-table-list-fixed th:last-child,
.u-table-list-fixed td:last-child,
.u-table-list-fixed .col-action,
.u-table-list-fixed .col-btn {
    width: 1% !important;
    white-space: nowrap !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 8px 16px !important;
}


/* --------------------------------------------------------------------------
   2. BẢNG THÔNG SỐ CHI TIẾT: .u-table-detail
   - Ép cứng cột 1 (Kích thước, Giá, Mô tả...) khoảng 120px - 135px.
   - Cột thứ 2 chiếm phần còn lại (width: auto).
   - Padding gọn gàng, thoáng mắt, dễ đọc.
   -------------------------------------------------------------------------- */
table.u-table-detail,
.u-table-detail table,
.tam-qc-spec-table.u-table-detail,
.u-table-padded.u-table-detail {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    margin: 6px 0 14px 0 !important;
}

.u-table-detail th,
.u-table-detail td,
table.u-table-detail th,
table.u-table-detail td {
    padding: 7px 12px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
}

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

/* Cột 1: Nhãn thông số (Kích thước, Giá...) ép cứng 135px, nền xám nhạt, chữ đậm */
.u-table-detail th:first-child,
.u-table-detail td:first-child,
.u-table-detail .tam-qc-spec-label {
    width: 135px !important;
    min-width: 135px !important;
    max-width: 145px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    background-color: #f8fafc !important;
    border-right: 1px solid #e2e8f0 !important;
    white-space: nowrap !important;
}

/* Cột 2: Giá trị chi tiết (tự động mở rộng chiếm toàn bộ không gian còn lại) */
.u-table-detail th:nth-child(2),
.u-table-detail td:nth-child(2),
.u-table-detail .tam-qc-spec-val {
    width: auto !important;
    color: #0f172a !important;
}


/* --------------------------------------------------------------------------
   3. ÉP CHUẨN KÍCH THƯỚC NÚT BẤM (BUTTON STANDARDIZATION)
   - .u-btn-group-center: Wrapper Flexbox căn đều các nút thẳng hàng.
   - .u-btn-strict: Ép đồng nhất chiều cao 44px, min-width 130px, bo góc 22px,
     chữ căn chính giữa hoàn hảo.
   -------------------------------------------------------------------------- */
.u-btn-group-center,
.u-flex-btn-group.u-btn-group-center,
.tam-qc-card-actions.u-btn-group-center {
    display: flex !important;
    gap: 16px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    margin-top: 14px !important;
}

/* Nút bấm đơn lẻ chuẩn hóa nghiêm ngặt */
.u-btn-strict,
button.u-btn-strict,
a.u-btn-strict,
.u-btn-standard.u-btn-strict {
    min-width: 130px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px !important;
    border-radius: 22px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    line-height: 1 !important;
    margin: 0 !important;
    border: none !important;
    cursor: pointer !important;
    text-align: center !important;
    white-space: nowrap !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.u-btn-strict:hover {
    transform: translateY(-1px) !important;
}

/* Màu sắc chuẩn cho 3 nút hành động chính */
/* 1. Nút ĐẶT LÀM (Cam nổi bật) */
.u-btn-strict.is-order,
.u-btn-order.u-btn-strict,
button.tam-qc-btn-order.u-btn-strict {
    background: #ea580c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.28) !important;
}
.u-btn-strict.is-order:hover,
.u-btn-order.u-btn-strict:hover,
button.tam-qc-btn-order.u-btn-strict:hover {
    background: #c2410c !important;
    box-shadow: 0 5px 14px rgba(234, 88, 12, 0.38) !important;
}

/* 2. Nút ZALO (Xanh dương thương hiệu Zalo) */
.u-btn-strict.is-zalo,
.u-btn-zalo.u-btn-strict,
a.tam-qc-btn-zalo-solid.u-btn-strict {
    background: #0084ff !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 132, 255, 0.28) !important;
}
.u-btn-strict.is-zalo:hover,
.u-btn-zalo.u-btn-strict:hover,
a.tam-qc-btn-zalo-solid.u-btn-strict:hover {
    background: #0070d6 !important;
    box-shadow: 0 5px 14px rgba(0, 132, 255, 0.38) !important;
}

/* 3. Nút GỌI NGAY (Xanh ngọc / Teal chuyên nghiệp) */
.u-btn-strict.is-call,
.u-btn-call.u-btn-strict,
a.tam-qc-btn-call-solid.u-btn-strict {
    background: #00796b !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 121, 107, 0.28) !important;
}
.u-btn-strict.is-call:hover,
.u-btn-call.u-btn-strict:hover,
a.tam-qc-btn-call-solid.u-btn-strict:hover {
    background: #006054 !important;
    box-shadow: 0 5px 14px rgba(0, 121, 107, 0.38) !important;
}

/* ==========================================================================
   4. CHATBOT CLICKABLE LINK & SHORTCODE / WOOCOMMERCE BUTTONS
   ========================================================================== */

/* Clickable Link inside Chatbot bubble */
.tam-qc-open-quote-link,
a.tam-qc-open-quote-link {
    display: inline-inline-flex;
    align-items: center;
    background: #fff7ed;
    color: #ea580c !important;
    border: 1px solid #fdba74;
    padding: 3px 10px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none !important;
    margin: 0 3px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(234, 88, 12, 0.12);
    transition: all 0.2s ease;
}

.tam-qc-open-quote-link:hover,
a.tam-qc-open-quote-link:hover {
    background: #ea580c;
    color: #ffffff !important;
    border-color: #ea580c;
    box-shadow: 0 3px 8px rgba(234, 88, 12, 0.3);
    transform: translateY(-1px);
}

/* Action Box & Calculation Button in Chat QA */
.tam-qc-chat-action-box {
    margin: 12px 0 6px 0 !important;
    padding: 2px 0 !important;
}

.tam-qc-calc-btn,
a.tam-qc-calc-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ea580c !important;
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 9px 16px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.32) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.tam-qc-calc-btn:hover,
a.tam-qc-calc-btn:hover {
    background: #c2410c !important;
    color: #ffffff !important;
    box-shadow: 0 5px 14px rgba(234, 88, 12, 0.45) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

/* Shortcode Buttons Wrapper [tam_qc_buttons] */
.tam-qc-inline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
    align-items: center;
}

.tam-qc-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}

.tam-qc-btn-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.tam-qc-btn-inline-orange {
    background: linear-gradient(135deg, #ff7a1a, #ea580c);
    color: #ffffff !important;
}

.tam-qc-btn-inline-green {
    background: linear-gradient(135deg, #00b080, #00796b);
    color: #ffffff !important;
}

/* WooCommerce Single Product Page Buttons: Chỉ hiển thị nút Báo giá nhanh */
.tam-qc-woo-single-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
    clear: both;
}

.tam-qc-woo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px !important;
    min-height: 40px !important;
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    padding: 0 10px !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.tam-qc-woo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tam-qc-woo-quote-btn {
    background: #d32f2f !important; /* Đỏ chuyên nghiệp đồng bộ tone với nút Đọc tiếp */
    background: linear-gradient(135deg, #e53935, #c62828) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   WooCommerce Loop / Category: Nút Báo giá & Đọc tiếp
   Đồng bộ tuyệt đối:
   - Kích thước tương đồng: Chiều rộng 76.16px x Chiều cao 27.36px
   - Cách nhau: 4px
   - Căn chính giữa 100% của khung sản phẩm
   - Cùng font, font-size: 11px, font-weight: 600, text-transform: none, bo 4 góc 4px
   ========================================================================== */
.tam-qc-woo-loop-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important; /* Khoảng cách 3-5px giữa 2 nút */
    margin: 8px auto 6px auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
    float: none !important;
    text-align: center !important;
}

/* Nút Báo giá: Cam, chữ thường, kích thước 76.16px x 27.36px, bo góc 4px */
.tam-qc-woo-loop-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ea580c !important; /* Màu cam chuẩn */
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important; /* Bo 4 góc */
    font-family: inherit !important;
    font-size: 11px !important; /* Cỡ chữ 11px đồng bộ */
    font-weight: 600 !important;
    text-transform: none !important; /* Chữ thường */
    letter-spacing: normal !important;
    padding: 0 !important;
    width: 76.16px !important;
    min-width: 76.16px !important;
    max-width: 76.16px !important;
    height: 27.36px !important;
    min-height: 27.36px !important;
    max-height: 27.36px !important;
    line-height: 27.36px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    vertical-align: middle !important;
    float: none !important;
}

.tam-qc-woo-loop-btn:hover {
    background: #c2410c !important;
    color: #ffffff !important;
    box-shadow: 0 2px 5px rgba(234, 88, 12, 0.3) !important;
}

/* Nút Đọc tiếp / Add to cart kế bên: Kích thước 76.16px x 27.36px, font 11px, bo góc 4px */
.tam-qc-woo-loop-wrapper > a.button,
.tam-qc-woo-loop-wrapper > button.button,
.tam-qc-woo-loop-wrapper > a.add_to_cart_button,
.tam-qc-woo-loop-wrapper > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 76.16px !important;
    min-width: 76.16px !important;
    max-width: 76.16px !important;
    height: 27.36px !important;
    min-height: 27.36px !important;
    max-height: 27.36px !important;
    line-height: 27.36px !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 11px !important; /* Cỡ chữ 11px đồng bộ */
    font-weight: 600 !important;
    text-transform: none !important; /* Chữ thường */
    letter-spacing: normal !important;
    border-radius: 4px !important; /* Bo 4 góc đồng nhất */
    margin: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    float: none !important;
    box-shadow: none !important;
    top: 0 !important;
}



/* ============================================================
   UTILITY: Giới hạn chiều cao nút tối đa 50px — dùng cho 2 nút
   "Báo giá nhanh" và "Đặt câu hỏi". Áp dụng trực tiếp qua class
   trong HTML (không dùng inline style). Đặt cuối file + !important
   để đảm bảo thắng thế cả rule desktop (.tam-qc-toggle 40px) lẫn
   rule mobile sticky bar (.tam-qc-toggle theo biến --tgbh-mobile-action-bar-height).
   ============================================================ */
.h-50px {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    line-height: normal !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================================
   UTILITY: Giảm chiều cao 2 nút hành động RIÊNG trên mobile.
   Đặt SAU .h-50px trong file để thắng thế đúng trên mobile (cùng độ ưu tiên !important,
   thắng nhờ thứ tự sau trong CSS, chỉ áp dụng khi @media khớp điều kiện màn hình nhỏ).
   Áp dụng CÙNG LÚC với .h-50px trong HTML — trên desktop (>768px) media
   query không khớp nên .h-50px vẫn giữ nguyên hiệu lực 50px như cũ.
   QUAN TRỌNG: giá trị ở đây PHẢI luôn khớp với biến --tgbh-mobile-action-bar-height (khai báo ở :root, đầu file) —
   biến đó cũng được dùng để tính padding-bottom của <body> nhằm chừa đúng khoảng trống cho thanh nút.
   Để 2 giá trị lệch nhau (như trước đây: biến 56px nhưng class này 35px) sẽ tạo ra khoảng trống thừa/thiếu
   giữa nút và footer trang — đây chính là lỗi đã xảy ra, nên KHÔNG sửa giá trị 40px dưới đây mà không sửa luôn biến ở :root.
   ============================================================ */
@media (max-width: 768px) {
    .h-mob-35px {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        line-height: normal !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ============================================================
   TYPING DOTS ANIMATION — dùng cho tin nhắn loading "Đang truy xuất thông tin..."
   trong lúc chờ phản hồi AI, 3 dấu chấm xuất hiện tuần tự tạo cảm giác đang gõ.
   ============================================================ */
.typing-dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: typingDots 1.5s infinite steps(4, end);
}

@keyframes typingDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
