#bqc-chatbot-root {
    position: fixed;
    bottom: 18px;
    z-index: 99999;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#bqc-chatbot-root.right {
    right: 18px;
}

#bqc-chatbot-root.left {
    left: 18px;
}

.bqc-chatbot-btn {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bqc-chatbot-panel {
    min-width: min(360px, 92vw);
    height: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
    overflow: hidden;
    margin-bottom: 10px;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chế độ fullscreen */
.bqc-chatbot-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    z-index: 999999;
    display: flex !important;
    flex-direction: column;
}

.bqc-chatbot-panel.fullscreen .bqc-chatbot-messages {
    flex: 1;
    height: auto;
    max-height: none;
    min-height: 0;
}

.bqc-chatbot-panel.fullscreen .bqc-chatbot-quick {
    flex-shrink: 0;
}

.bqc-chatbot-panel.fullscreen .bqc-chatbot-input {
    flex-shrink: 0;
}

.bqc-chatbot-header {
    padding: 12px 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bqc-chatbot-title {
    font-weight: 800;
}

.bqc-chatbot-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bqc-chatbot-fullscreen,
.bqc-chatbot-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bqc-chatbot-fullscreen:hover,
.bqc-chatbot-close:hover {
    background: rgba(255, 255, 255, .3);
    transform: scale(1.05);
}

.bqc-chatbot-fullscreen:active,
.bqc-chatbot-close:active {
    transform: scale(0.95);
}

.bqc-chatbot-messages {
    padding: 12px;
    height: 349px;
    overflow: auto;
    background: #fafafa;
}

.bqc-msg {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.bqc-msg.user {
    background: #fff;
}

.bqc-chatbot-input {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.bqc-chatbot-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 10px;
    height: 44px;
    outline: none;
}

.bqc-chatbot-input button {
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 800;
    color: #fff;
}

.bqc-chatbot-quick {
    padding: 10px 10px 6px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

/* --- FIX: label + input không chồng nhau --- */
.bqc-q-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    /* quan trọng */
}

.bqc-q-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* tạo khoảng cách rõ ràng */
    min-width: 0;
}

.bqc-q-field label {
    display: block;
    position: static !important;
    /* chặn mọi absolute */
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.2;
    color: #6b7280;
}

.bqc-q-field input,
.bqc-q-field select {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 10px;
    outline: none;
    margin-bottom: 4%;
}

/* Hover nhẹ */
.bqc-q-field input:hover,
.bqc-q-field select:hover {
    border-color: #c7cbd6;
}

/* Focus / Active */
.bqc-q-field input:focus,
.bqc-q-field select:focus {
    outline: none;
    border-color: #2C365B;
    /* primary */
    background: #fbfcff;
    box-shadow: 0 0 0 3px rgba(44, 54, 91, .18);
}

/* Có giá trị (đã nhập) */
.bqc-q-field input:not(:placeholder-shown),
.bqc-q-field select:not([value=""]) {
    border-color: #2C365B;
}

/* Disabled (nếu sau này dùng) */
.bqc-q-field input:disabled,
.bqc-q-field select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Error state (dùng khi validate) */
.bqc-q-field.is-error input,
.bqc-q-field.is-error select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .18);
}


.bqc-q-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 2px;
}

.bqc-q-btn {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: #2C365B;
    transition: all 0.2s ease;
}

.bqc-q-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bqc-q-btn:active {
    transform: translateY(0);
}

.bqc-q-btn--secondary {
    background: #6b7280;
    color: #fff;
}

.bqc-q-btn--secondary:hover {
    background: #4b5563;
}

@media (max-width: 420px) {
    .bqc-q-row {
        grid-template-columns: 1fr;
    }
}

.bqc-q-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-top: none;
    background: #fff;
}

/* Button Lưu Quote */
.bqc-q-save {
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    border: 2px solid #DAA44F;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: #DAA44F;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bqc-q-save:hover {
    background: #DAA44F;
    color: #fff;
    box-shadow: 0 4px 12px rgba(218, 164, 79, 0.3);
    transform: translateY(-1px);
}

.bqc-q-save:active {
    transform: translateY(0);
}

/* Base */
.bqc-q-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;

    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    color: #2C365B;

    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        transform .15s ease;
}

/* Hover */
.bqc-q-toggle:hover {
    background: #f7f9ff;
    /* nền xanh rất nhẹ */
    border-color: #2C365B;
    /* primary */
    box-shadow: 0 6px 18px rgba(44, 54, 91, .15);
    transform: translateY(-1px);
}

/* Active (đang click) */
.bqc-q-toggle:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(44, 54, 91, .18);
}

/* Focus (keyboard / accessibility) */
.bqc-q-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 54, 91, .25);
}

/* Icon ⚡ */
.bqc-q-toggle .bqc-q-icon {
    font-size: 16px;
    color: #DAA44F;
    /* accent */
    transition: transform .2s ease;
}

/* Hover icon */
.bqc-q-toggle:hover .bqc-q-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* Caret */
.bqc-q-caret {
    font-size: 12px;
    color: #6b7280;
    transition: transform .2s ease;
}

/* Khi mở (add class .is-open bằng JS) */
.bqc-q-toggle.is-open .bqc-q-caret {
    transform: rotate(180deg);
}

/* ========================================
 * EMAIL MODAL
 * ======================================== */
.bqc-email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.bqc-email-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.bqc-email-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 420px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bqc-email-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bqc-email-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2C365B;
}

.bqc-email-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bqc-email-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.bqc-email-modal-body {
    padding: 24px;
}

.bqc-email-modal-body p {
    margin: 0 0 16px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.bqc-modal-field {
    margin-bottom: 16px;
}

.bqc-modal-field label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.bqc-name-input,
.bqc-phone-input,
.bqc-email-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.bqc-name-input:focus,
.bqc-phone-input:focus,
.bqc-email-input:focus {
    border-color: #2C365B;
    background: #fbfcff;
    box-shadow: 0 0 0 3px rgba(44, 54, 91, 0.1);
}

.bqc-email-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.bqc-email-modal-cancel,
.bqc-email-modal-save {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bqc-email-modal-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.bqc-email-modal-cancel:hover {
    background: #e5e7eb;
}

.bqc-email-modal-save {
    background: #2C365B;
    color: #fff;
}

.bqc-email-modal-save:hover {
    background: #1f2847;
    box-shadow: 0 4px 12px rgba(44, 54, 91, 0.3);
    transform: translateY(-1px);
}

.bqc-email-modal-save:active {
    transform: translateY(0);
}