/* ============================================================
   Chatbot Widget — All selectors scoped under #cb-widget
   ============================================================ */

/* --- Variables --- */
#cb-widget {
    --cb-primary: #E84B2A;
    --cb-primary-dark: #C93D1E;
    --cb-secondary: #DBA028;
    --cb-gradient: linear-gradient(135deg, #E84B2A 0%, #DBA028 100%);
    --cb-bg: #ffffff;
    --cb-bg-off: #f6f7f9;
    --cb-text: #111827;
    --cb-text-2: #6b7280;
    --cb-text-3: #9ca3af;
    --cb-border: #e5e7eb;
    --cb-font-d: 'Poppins', sans-serif;
    --cb-font-b: 'Poppins', sans-serif;
    --cb-radius: 16px;
    --cb-ease: cubic-bezier(0.65, 0.05, 0, 1);
    --cb-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --cb-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--cb-font-b);
    line-height: 1.5;
    color: var(--cb-text);
    -webkit-font-smoothing: antialiased;
}

/* --- Hard reset: override ALL host-page leaks --- */
#cb-widget *,
#cb-widget *::before,
#cb-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#cb-widget img {
    display: inline-block !important;
    max-width: none !important;
}

#cb-widget a {
    color: inherit;
    text-decoration: none;
}

#cb-widget ul, #cb-widget ol {
    list-style: none;
}

#cb-widget button {
    font-family: inherit;
    cursor: pointer;
}

#cb-widget input, #cb-widget textarea {
    font-family: inherit;
}

/* ======= TOGGLE BUTTON ======= */
#cb-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483647;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--cb-gradient);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(232, 75, 42, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s var(--cb-ease-spring), box-shadow 0.3s var(--cb-ease);
    animation: cb-pulse 2s ease-in-out 3;
    outline: none;
}

#cb-toggle:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 24px rgba(232, 75, 42, 0.45),
        0 3px 10px rgba(0, 0, 0, 0.12);
}

#cb-toggle:active { transform: scale(0.95); }

#cb-toggle .cb-icon-chat,
#cb-toggle .cb-icon-close {
    position: absolute;
    width: 28px;
    height: 28px;
    color: white;
    transition: opacity 0.25s ease, transform 0.35s var(--cb-ease-spring);
}

#cb-toggle .cb-icon-chat { opacity: 1; transform: scale(1) rotate(0deg); }
#cb-toggle .cb-icon-close { opacity: 0; transform: scale(0.5) rotate(-90deg); }
#cb-toggle.cb-open .cb-icon-chat { opacity: 0; transform: scale(0.5) rotate(90deg); }
#cb-toggle.cb-open .cb-icon-close { opacity: 1; transform: scale(1) rotate(0deg); }

@keyframes cb-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(232, 75, 42, 0.35), 0 2px 6px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 4px 24px rgba(232, 75, 42, 0.55), 0 2px 12px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(232, 75, 42, 0.1); }
}

/* ======= PANEL ======= */
#cb-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 2147483646;
    width: 400px;
    max-height: min(600px, calc(100vh - 120px));
    height: 600px;
    background: var(--cb-bg);
    border-radius: var(--cb-radius);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    transform-origin: bottom right;
    transition: opacity 0.3s var(--cb-ease), transform 0.35s var(--cb-ease-spring);
    opacity: 0;
    transform: scale(0.85) translateY(12px);
    pointer-events: none;
    visibility: hidden;
}

#cb-panel.cb-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* ======= HEADER ======= */
#cb-widget #cb-header {
    background: var(--cb-gradient);
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    flex-shrink: 0;
}

#cb-widget #cb-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    pointer-events: none;
}

#cb-widget #cb-header .cb-avatar {
    width: 38px;
    height: 38px;
    padding: 5px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

#cb-widget #cb-header .cb-header-text {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

#cb-widget #cb-header .cb-title {
    font-family: var(--cb-font-d);
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

#cb-widget #cb-header .cb-subtitle {
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.3;
    margin-top: 2px;
}

#cb-widget #cb-header .cb-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background 0.25s ease, transform 0.25s var(--cb-ease-spring);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    outline: none;
}

#cb-widget #cb-header .cb-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

/* ======= TAB BAR ======= */
#cb-widget #cb-tabs {
    display: flex;
    border-bottom: 1px solid var(--cb-border);
    position: relative;
    flex-shrink: 0;
    background: var(--cb-bg);
}

#cb-widget #cb-tabs .cb-tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    font-family: var(--cb-font-b);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cb-text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color 0.25s ease;
    outline: none;
    position: relative;
}

#cb-widget #cb-tabs .cb-tab:hover { color: var(--cb-text-2); }
#cb-widget #cb-tabs .cb-tab.cb-active { color: var(--cb-primary); }
#cb-widget #cb-tabs .cb-tab i { font-size: 0.85rem; }

#cb-widget #cb-tabs .cb-tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 33.333%;
    height: 3px;
    background: var(--cb-gradient);
    border-radius: 3px 3px 0 0;
    transition: left 0.35s var(--cb-ease-out);
}

/* ======= CONTENT AREA ======= */
#cb-widget #cb-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#cb-widget .cb-tab-content {
    display: none !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#cb-widget .cb-tab-content.cb-active { display: flex !important; }

/* --- Custom scrollbar --- */
#cb-widget ::-webkit-scrollbar { width: 6px; }
#cb-widget ::-webkit-scrollbar-track { background: transparent; }
#cb-widget ::-webkit-scrollbar-thumb { background: rgba(232, 75, 42, 0.2); border-radius: 3px; }
#cb-widget ::-webkit-scrollbar-thumb:hover { background: rgba(232, 75, 42, 0.35); }

/* ======= HOME TAB ======= */
#cb-widget .cb-home-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 18px;
}

#cb-widget .cb-greeting {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 0 16px;
}

#cb-widget .cb-greeting-avatar {
    width: 46px;
    height: 46px;
    padding: 7px;
    border-radius: 12px;
    border: 3px solid var(--cb-bg-off);
    background: white;
    object-fit: contain;
    margin-bottom: 10px;
}

#cb-widget .cb-greeting h3 {
    font-family: var(--cb-font-d);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cb-text);
    margin-bottom: 3px;
}

#cb-widget .cb-greeting p {
    font-size: 0.82rem;
    color: var(--cb-text-2);
}

/* Search input */
#cb-widget .cb-search-wrap {
    position: relative;
    margin-bottom: 14px;
}

#cb-widget .cb-search-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cb-text-3);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

#cb-widget .cb-search-wrap input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--cb-border);
    border-radius: 60px;
    font-family: var(--cb-font-b);
    font-size: 0.85rem;
    color: var(--cb-text);
    background: var(--cb-bg);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    line-height: 40px;
}

#cb-widget .cb-search-wrap input::placeholder { color: var(--cb-text-3); }

#cb-widget .cb-search-wrap input:focus {
    border-color: var(--cb-primary);
    box-shadow: 0 0 0 3px rgba(232, 75, 42, 0.12);
}

/* Section headings */
#cb-widget .cb-section-title {
    font-family: var(--cb-font-d);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cb-text-3);
    margin-bottom: 6px;
}

/* Popular articles list */
#cb-widget .cb-article-list {
    list-style: none;
}

#cb-widget .cb-article-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#cb-widget .cb-article-item:hover {
    background: var(--cb-bg-off);
    transform: translateX(2px);
}

#cb-widget .cb-article-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(232, 75, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#cb-widget .cb-article-icon i {
    color: var(--cb-primary) !important;
    font-size: 0.75rem !important;
}

#cb-widget .cb-article-text {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cb-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cb-widget .cb-article-chevron {
    color: var(--cb-text-3);
    font-size: 0.65rem;
    transition: transform 0.25s var(--cb-ease);
    flex-shrink: 0;
}

#cb-widget .cb-article-item:hover .cb-article-chevron {
    transform: translateX(4px);
    color: var(--cb-primary);
}

/* Start chat CTA on home */
#cb-widget .cb-home-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 14px;
    border-radius: 12px;
    background: var(--cb-bg-off);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--cb-border);
}

#cb-widget .cb-home-cta:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

#cb-widget .cb-cta-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cb-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    flex-shrink: 0;
}

#cb-widget .cb-cta-text { flex: 1; }

#cb-widget .cb-cta-text strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cb-text);
    margin-bottom: 1px;
}

#cb-widget .cb-cta-text span {
    font-size: 0.75rem;
    color: var(--cb-text-2);
}

#cb-widget .cb-cta-chevron {
    color: var(--cb-text-3);
    font-size: 0.7rem;
    transition: transform 0.25s var(--cb-ease);
}

#cb-widget .cb-home-cta:hover .cb-cta-chevron {
    transform: translateX(4px);
    color: var(--cb-primary);
}

/* ======= MESSAGES TAB ======= */
#cb-widget #cb-messages.cb-active {
    flex-direction: column;
    height: 100%;
}

#cb-widget #cb-message-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Welcome state */
#cb-widget .cb-msg-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px 20px;
    gap: 12px;
}

#cb-widget .cb-welcome-avatar {
    width: 56px;
    height: 56px;
    padding: 9px;
    border-radius: 14px;
    border: 3px solid var(--cb-bg-off);
    background: white;
    object-fit: contain;
}

#cb-widget .cb-welcome-dots {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

#cb-widget .cb-welcome-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cb-primary);
    opacity: 0.3;
}

#cb-widget .cb-welcome-dots span:nth-child(2) { opacity: 0.5; }
#cb-widget .cb-welcome-dots span:nth-child(3) { opacity: 0.3; }

#cb-widget .cb-msg-welcome h4 {
    font-family: var(--cb-font-d);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cb-text);
}

#cb-widget .cb-msg-welcome p {
    font-size: 0.85rem;
    color: var(--cb-text-2);
    max-width: 260px;
}

/* Message bubbles */
#cb-widget .cb-message {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 0.86rem;
    line-height: 1.55;
    word-break: break-word;
    animation: cb-fade-in 0.3s ease both;
}

#cb-widget .cb-message-bot {
    align-self: flex-start;
    background: var(--cb-bg-off);
    border: 1px solid var(--cb-border);
    border-radius: 16px 16px 16px 4px;
    color: var(--cb-text);
}

#cb-widget .cb-message-user {
    align-self: flex-end;
    background: var(--cb-gradient);
    border-radius: 16px 16px 4px 16px;
    color: white;
}

#cb-widget .cb-message-time {
    font-size: 0.68rem;
    color: var(--cb-text-3);
    margin-top: 3px;
    margin-bottom: 6px;
    padding: 0 4px;
}

#cb-widget .cb-message-time.cb-time-right { text-align: right; }

/* Bot message content */
#cb-widget .cb-message-bot strong { font-weight: 600; }
#cb-widget .cb-message-bot ul { margin: 6px 0; padding-left: 18px; list-style: disc; }
#cb-widget .cb-message-bot ul li { margin-bottom: 3px; }
#cb-widget .cb-message-bot a { color: var(--cb-primary) !important; text-decoration: underline; text-underline-offset: 2px; }
#cb-widget .cb-message-bot a:hover { color: var(--cb-primary-dark) !important; }
#cb-widget .cb-message-bot p { margin-bottom: 8px; }
#cb-widget .cb-message-bot p:last-child { margin-bottom: 0; }

@keyframes cb-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
#cb-widget .cb-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    background: var(--cb-bg-off);
    border: 1px solid var(--cb-border);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 18px;
    animation: cb-fade-in 0.2s ease both;
}

#cb-widget .cb-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cb-text-3);
    animation: cb-bounce 0.6s ease-in-out infinite;
}

#cb-widget .cb-typing-dot:nth-child(2) { animation-delay: 0.15s; }
#cb-widget .cb-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes cb-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
#cb-widget #cb-input-area {
    padding: 12px 14px;
    border-top: 1px solid var(--cb-border);
    background: var(--cb-bg);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

#cb-widget #cb-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--cb-border);
    border-radius: 20px;
    font-family: var(--cb-font-b);
    font-size: 0.88rem;
    color: var(--cb-text);
    background: var(--cb-bg-off);
    outline: none;
    resize: none;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#cb-widget #cb-input::placeholder { color: var(--cb-text-3); }

#cb-widget #cb-input:focus {
    border-color: var(--cb-primary);
    box-shadow: 0 0 0 3px rgba(232, 75, 42, 0.12);
    background: var(--cb-bg);
}

#cb-widget #cb-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--cb-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: transform 0.25s var(--cb-ease-spring), opacity 0.25s ease;
    outline: none;
}

#cb-widget #cb-send:hover { transform: scale(1.08); }
#cb-widget #cb-send:hover i { transform: rotate(15deg); }
#cb-widget #cb-send i { transition: transform 0.25s var(--cb-ease-spring); }
#cb-widget #cb-send:active { transform: scale(0.92); }
#cb-widget #cb-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ======= HELP TAB ======= */
#cb-widget .cb-help-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 18px;
}

/* Product filter tabs */
#cb-widget .cb-product-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

#cb-widget .cb-product-tab {
    padding: 7px 16px;
    border-radius: 50px;
    border: 1px solid var(--cb-border);
    background: none;
    font-family: var(--cb-font-b);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cb-text-2);
    transition: all 0.25s ease;
    outline: none;
}

#cb-widget .cb-product-tab:hover { border-color: var(--cb-primary); color: var(--cb-primary); }

#cb-widget .cb-product-tab.cb-active {
    background: var(--cb-gradient);
    color: white;
    border-color: transparent;
}

/* Category cards */
#cb-widget .cb-category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#cb-widget .cb-category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
}

#cb-widget .cb-category-card:hover {
    background: var(--cb-bg-off);
    border-color: var(--cb-border);
    transform: translateX(2px);
}

#cb-widget .cb-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(232, 75, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

#cb-widget .cb-cat-icon i {
    color: var(--cb-primary) !important;
    font-size: 0.85rem !important;
}

#cb-widget .cb-category-card:hover .cb-cat-icon { background: rgba(232, 75, 42, 0.14); }

#cb-widget .cb-cat-info { flex: 1; min-width: 0; }

#cb-widget .cb-cat-title {
    font-family: var(--cb-font-d);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cb-text);
}

#cb-widget .cb-cat-count {
    font-size: 0.73rem;
    color: var(--cb-text-3);
    margin-top: 1px;
}

#cb-widget .cb-cat-chevron {
    color: var(--cb-text-3);
    font-size: 0.65rem;
    transition: transform 0.25s var(--cb-ease), color 0.25s ease;
    flex-shrink: 0;
}

#cb-widget .cb-category-card:hover .cb-cat-chevron {
    transform: translateX(4px);
    color: var(--cb-primary);
}

/* Back button */
#cb-widget .cb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    background: none;
    border: none;
    font-family: var(--cb-font-b);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cb-primary);
    transition: opacity 0.2s ease, transform 0.2s ease;
    outline: none;
}

#cb-widget .cb-back-btn:hover { opacity: 0.7; transform: translateX(-3px); }
#cb-widget .cb-back-btn i { font-size: 0.75rem; }

/* Category header in article list */
#cb-widget .cb-cat-header {
    font-family: var(--cb-font-d);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cb-text);
    margin-bottom: 3px;
}

#cb-widget .cb-cat-headline {
    font-size: 0.8rem;
    color: var(--cb-text-2);
    margin-bottom: 14px;
}

/* FAQ accordion items */
#cb-widget .cb-faq-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#cb-widget .cb-faq-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--cb-border);
    transition: box-shadow 0.25s ease;
}

#cb-widget .cb-faq-item.cb-open { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }

#cb-widget .cb-faq-question {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: none;
    border: none;
    width: 100%;
    min-width: 0;
    text-align: left;
    font-family: var(--cb-font-b);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--cb-text);
    transition: background 0.2s ease, color 0.2s ease;
    outline: none;
}

#cb-widget .cb-faq-question:hover { background: var(--cb-bg-off); }
#cb-widget .cb-faq-item.cb-open .cb-faq-question { color: var(--cb-primary); }
#cb-widget .cb-faq-question > span:first-child { flex: 1 1 auto; min-width: 0; }

#cb-widget .cb-faq-chevron {
    font-size: 0.65rem;
    color: var(--cb-text-3);
    margin-top: 5px;
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    transition: transform 0.3s var(--cb-ease), color 0.3s ease;
}

#cb-widget .cb-faq-item.cb-open .cb-faq-chevron {
    transform: rotate(180deg);
    color: var(--cb-primary);
}

#cb-widget .cb-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--cb-ease-out), padding 0.25s ease;
    padding: 0 14px;
}

#cb-widget .cb-faq-item.cb-open .cb-faq-answer {
    max-height: 600px;
    padding: 0 14px 14px;
}

#cb-widget .cb-faq-answer-inner {
    font-size: 0.82rem;
    color: var(--cb-text-2);
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

#cb-widget .cb-faq-item.cb-open .cb-faq-answer-inner { opacity: 1; }

#cb-widget .cb-faq-answer-inner p { margin-bottom: 8px; }
#cb-widget .cb-faq-answer-inner p:last-child { margin-bottom: 0; }
#cb-widget .cb-faq-answer-inner ul { padding-left: 18px; margin: 6px 0; list-style: disc; }
#cb-widget .cb-faq-answer-inner li { margin-bottom: 3px; }
#cb-widget .cb-faq-answer-inner strong { color: var(--cb-text); font-weight: 600; }
#cb-widget .cb-faq-answer-inner a { color: var(--cb-primary) !important; text-decoration: underline; text-underline-offset: 2px; }
#cb-widget .cb-faq-answer-inner a:hover { color: var(--cb-primary-dark) !important; }

/* Search results in help */
#cb-widget .cb-search-results-count {
    font-size: 0.8rem;
    color: var(--cb-text-3);
    margin-bottom: 10px;
}

/* No results */
#cb-widget .cb-no-results {
    text-align: center;
    padding: 32px 16px;
    color: var(--cb-text-3);
}

#cb-widget .cb-no-results i { font-size: 2rem; margin-bottom: 10px; opacity: 0.4; display: block; }
#cb-widget .cb-no-results p { font-size: 0.88rem; }

/* ======= POWERED BY FOOTER ======= */
#cb-widget a.cb-powered-by,
#cb-widget .cb-powered-by {
    padding: 3px 10px;
    text-align: center;
    font-size: 9px;
    color: var(--cb-text-3) !important;
    opacity: 0.35;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    background: var(--cb-bg);
    user-select: none;
    text-decoration: none !important;
    cursor: pointer;
    line-height: 1;
}

#cb-widget a.cb-powered-by:hover,
#cb-widget .cb-powered-by:hover {
    opacity: 0.65;
    text-decoration: none !important;
}

#cb-widget .cb-powered-by img {
    height: 12px;
    width: auto;
}

/* ======= MOBILE RESPONSIVE ======= */
@media (max-width: 576px) {
    #cb-toggle {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }

    #cb-toggle .cb-icon-chat,
    #cb-toggle .cb-icon-close {
        width: 24px;
        height: 24px;
    }

    #cb-panel {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        transform-origin: bottom center;
        transform: translateY(100%);
        opacity: 1;
    }

    #cb-panel.cb-visible {
        transform: translateY(0);
        animation: cb-slide-up 0.4s var(--cb-ease-out) both;
    }

    @keyframes cb-slide-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    #cb-widget #cb-input { font-size: 16px; }
    #cb-widget .cb-search-wrap input { font-size: 16px; }
}

/* ======= UTILITY ======= */
#cb-widget .cb-hidden { display: none !important; }
