/* ── Braviton Chatbot – Resizable Chat Window ── */

@keyframes btchat-slide-up {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#btchat-widget {
    --btchat-primary: #182453;
    --btchat-accent: #D11520;
    --btchat-text: #1e293b;
    --btchat-text-muted: #64748b;
    --btchat-bg-bot: #f1f5f9;
    --btchat-bg-surface: #ffffff;
    --btchat-border: #e2e8f0;
    --btchat-radius: 8px;
    --btchat-bar-radius: 10px;

    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    font-family: var(--wd-text-font, inherit);
    font-size: 15px;
    line-height: 1.5;
}

#btchat-widget * {
    pointer-events: auto;
}

/* ══════════════════════════════════════
   CHAT WINDOW – container for everything
   ══════════════════════════════════════ */

#btchat-window {
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* ── Collapsed (default): only the bar visible as pill ── */
#btchat-messages {
    display: none;
}

/* ══════════════════════════════════════
   INPUT BAR – compact pill, center-bottom (collapsed)
   ══════════════════════════════════════ */

#btchat-bar {
    width: 480px;
    height: 54px;
    max-width: calc(100vw - 32px);
    transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 200ms ease;
}

#btchat-bar:hover {
    width: 520px;
    max-width: calc(100vw - 32px);
}

#btchat-form {
    height: 100%;
}

#btchat-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    border-radius: var(--btchat-bar-radius, 10px);
    padding: 10px 12px;
    background: #161a26;
    border: 1.5px solid #2d364d;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: text;
    transition: transform 300ms ease;
}

/* ── Bar avatar (closed state) ── */
#btchat-bar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--btchat-logo-url) center/cover no-repeat;
    flex-shrink: 0;
    animation: btchat-avatar-pulse 3s ease-in-out infinite;
}

@keyframes btchat-avatar-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(209, 21, 32, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(209, 21, 32, 0);
    }
}

/* Hide bar avatar in open state */
#btchat-widget.btchat-open #btchat-bar-avatar {
    display: none;
}

/* Breathing animation — subtle scale pulse */
@keyframes btchat-breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.025);
    }
}

#btchat-bar:not(.btchat-open #btchat-bar) #btchat-label {
    animation: btchat-breathe 3s ease-in-out infinite;
}

#btchat-label:hover {
    animation: none;
    transform: scale(1.03);
}

#btchat-input {
    flex: 1;
    height: 32px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: var(--btchat-text);
    padding: 0 8px 0 0;
    font-family: inherit;
    min-width: 0;
}

#btchat-input {
    color: #fff;
}

#btchat-input::placeholder {
    color: #fff;
    transition: opacity 200ms ease;
}

/* Typing animation text — shown when chat is closed */
#btchat-typing-text {
    position: absolute;
    left: 70px;
    right: 50px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btchat-open #btchat-typing-text {
    display: none;
}

/* Send button – square with subtle rounding */
#btchat-send {
    width: 36px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    aspect-ratio: 1;
    border-radius: 8px !important;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--btchat-accent);
    color: #fff;
    transition: opacity 0.25s ease, background 0.25s ease;
}

#btchat-send:hover {
    opacity: 0.8;
}

#btchat-send:disabled {
    background: var(--btchat-accent);
    color: #fff;
    cursor: default;
    opacity: 0.85;
}

#btchat-send:disabled:hover {
    opacity: 1;
}

/* ══════════════════════════════════════
   OPEN STATE (.btchat-open)
   ══════════════════════════════════════ */

#btchat-widget.btchat-open {
    bottom: 24px;
}

#btchat-widget.btchat-open #btchat-window {
    position: relative;
    width: 640px;
    max-width: 100vw;
    height: 680px;
    max-height: calc(100vh - 48px);
    background: var(--btchat-bg-surface);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
    resize: none;
    min-width: 0;
    min-height: 350px;
    overflow: hidden;
    animation: btchat-slide-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#btchat-widget.btchat-open #btchat-messages {
    display: block;
    flex: 1;
    min-height: 0;
}

/* AI disclaimer — visible only when chat is open */
#btchat-disclaimer {
    display: none;
}

#btchat-widget.btchat-open #btchat-disclaimer {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--btchat-text-muted);
    padding: 4px 16px;
    flex-shrink: 0;
    border-top: 1px solid var(--btchat-border);
}

/* Bar becomes flat bottom input when open */
#btchat-widget.btchat-open #btchat-bar {
    width: 100%;
    height: 56px;
    flex-shrink: 0;
    border-top: 1px solid var(--btchat-border);
}

#btchat-widget.btchat-open #btchat-bar:hover {
    width: 100%;
    transform: none;
}

#btchat-widget.btchat-open #btchat-label {
    border-radius: 0 0 12px 12px;
    background: var(--btchat-bg-surface);
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 8px 12px;
    animation: none;
}

#btchat-widget.btchat-open #btchat-label::before {
    display: none;
}

#btchat-widget.btchat-open #btchat-label:hover {
    box-shadow: none;
    transform: none;
}

#btchat-widget.btchat-open #btchat-input {
    color: var(--btchat-text);
}

#btchat-widget.btchat-open #btchat-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    opacity: 1;
}

#btchat-widget.btchat-open #btchat-send:disabled {
    background: var(--btchat-accent);
    color: #fff;
    opacity: 0.5;
}

#btchat-widget.btchat-open #btchat-send {
    margin-right: 4px;
}

/* ══════════════════════════════════════
   FULLSCREEN STATE (.btchat-fullscreen)
   ══════════════════════════════════════ */

#btchat-widget.btchat-open.btchat-fullscreen {
    inset: 0;
    bottom: 0;
    justify-content: center;
}

#btchat-widget.btchat-open.btchat-fullscreen #btchat-window {
    width: 700px !important;
    height: 85vh !important;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: var(--btchat-radius);
    resize: none;
}

/* ══════════════════════════════════════
   MESSAGES AREA
   ══════════════════════════════════════ */

#btchat-messages {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 18px;
    flex: 1;
    min-height: 0;
    scroll-behavior: smooth;
}

#btchat-messages::-webkit-scrollbar {
    width: 3px;
}

#btchat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

/* ══════════════════════════════════════
   MESSAGE BUBBLES
   ══════════════════════════════════════ */

.btchat-msg {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    animation: btchat-fade-in 0.25s ease-out;
}

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

.btchat-msg.user {
    align-items: flex-end;
}

.btchat-msg.bot {
    align-items: flex-start;
    padding-left: 40px;
    position: relative;
}

.btchat-msg.bot::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    background-image: var(--btchat-logo-url);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.btchat-msg-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
}

.btchat-msg.user .btchat-msg-content {
    background: var(--btchat-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.btchat-msg.bot .btchat-msg-content {
    background: var(--btchat-bg-bot);
    color: var(--btchat-text);
    border-bottom-left-radius: 4px;
}

/* ── Message timestamps ── */
.btchat-time {
    display: block;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.35);
    margin-top: 3px;
    padding: 0 4px;
}

.btchat-msg.user .btchat-time {
    text-align: right;
}

.btchat-msg.bot .btchat-time {
    text-align: left;
}

.btchat-msg.bot .btchat-msg-content ul {
    margin: 6px 0;
    padding-left: 18px;
    list-style-type: disc;
}

.btchat-msg.bot .btchat-msg-content li {
    margin: 4px 0;
    line-height: 1.5;
}

.btchat-msg.bot .btchat-msg-content li strong {
    display: inline;
}

.btchat-msg.bot .btchat-msg-content .btchat-heading {
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 2px;
    font-size: 0.95em;
}

.btchat-msg.bot .btchat-msg-content .btchat-heading:first-child {
    margin-top: 0;
}

/* ── Loading dots ── */
.btchat-loading {
    display: flex;
    gap: 5px;
    padding: 14px 18px !important;
    background: var(--btchat-bg-bot) !important;
}

.btchat-loading span {
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    animation: btchat-dot 1.4s infinite ease-in-out;
}

.btchat-loading span:nth-child(2) { animation-delay: 0.15s; }
.btchat-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes btchat-dot {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════
   PRODUCT CARDS (inside messages)
   ══════════════════════════════════════ */

/* Carousel wrapper */
.btchat-products-carousel {
    position: relative;
    margin-top: 10px;
}

.btchat-products {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.btchat-products::-webkit-scrollbar {
    display: none;
}

.btchat-products-carousel {
    position: relative !important;
}

.btchat-carousel-prev,
.btchat-carousel-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid var(--btchat-border) !important;
    background: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #333 !important;
    z-index: 2;
    transition: box-shadow 0.25s ease, opacity 0.25s ease;
    padding: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

.btchat-carousel-next {
    right: -6px !important;
    left: auto !important;
}

.btchat-carousel-prev {
    left: -6px !important;
    right: auto !important;
}

.btchat-carousel-prev:hover,
.btchat-carousel-next:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.btchat-carousel-prev.btchat-hidden,
.btchat-carousel-next.btchat-hidden {
    display: none !important;
}

.btchat-product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--btchat-bg-surface);
    border: 1px solid var(--btchat-border);
    border-radius: var(--btchat-radius);
    padding: 0;
    margin-bottom: 0;
    min-width: 150px;
    max-width: 170px;
    flex-shrink: 0;
    align-items: stretch;
    transition: box-shadow 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.btchat-product-card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.btchat-product-img {
    width: 100%;
    height: 120px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.btchat-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btchat-product-info {
    min-width: 0;
    padding: 8px 10px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btchat-product-name {
    font-family: var(--wd-title-font, inherit);
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
}

.btchat-product-name a {
    color: var(--btchat-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btchat-product-name a:hover {
    text-decoration: underline;
}

.btchat-product-price {
    font-size: 11px;
    font-weight: 700;
    color: var(--btchat-text);
    margin-bottom: 4px;
}

.btchat-product-price del {
    color: #aaa;
    font-weight: 400;
    font-size: 9.5px;
}

.btchat-product-desc {
    font-size: 10px;
    color: var(--btchat-text-muted);
    line-height: 1.35;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btchat-msg-extras {
    width: 100%;
    margin-top: 6px;
}

.btchat-stock-badge {
    display: inline-block;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: var(--btchat-radius);
    font-weight: 600;
    letter-spacing: 0.02em;
    position: absolute;
    bottom: 4px;
    left: 4px;
}

.btchat-stock-badge.in-stock {
    background: #ecfdf5;
    color: #047857;
}

.btchat-stock-badge.out-of-stock {
    background: #fef2f2;
    color: #b91c1c;
}

.btchat-sale-badge {
    display: inline-block;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: var(--btchat-radius);
    font-weight: 600;
    letter-spacing: 0.02em;
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--btchat-accent);
    color: #fff;
    text-transform: uppercase;
}

.btchat-cart-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 6px;
}

.btchat-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: var(--btchat-radius);
    overflow: hidden;
    height: 22px;
    max-width: 74px;
}

.btchat-qty-btn {
    width: 18px !important;
    height: 22px !important;
    border: none !important;
    background: #f5f5f5 !important;
    color: var(--btchat-text) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1;
    transition: background 0.25s ease;
    flex-shrink: 0;
    border-radius: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

.btchat-qty-btn:hover {
    background: #e8e8e8 !important;
}

.btchat-qty-btn:active {
    background: #ddd !important;
}

.btchat-qty {
    width: 32px !important;
    flex: 0 0 32px !important;
    min-width: 32px !important;
    height: 22px !important;
    display: inline-block !important;
    visibility: visible !important;
    text-align: center !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    color: var(--btchat-text) !important;
    padding: 0 2px !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
    -webkit-appearance: textfield !important;
    outline: none !important;
    background: #fff !important;
    box-sizing: border-box !important;
    line-height: 22px !important;
    opacity: 1 !important;
}

.btchat-qty::-webkit-outer-spin-button,
.btchat-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btchat-add-to-cart {
    font-size: 10px;
    padding: 4px 8px;
    background: var(--btchat-accent) !important;
    color: #fff !important;
    border-radius: var(--btchat-radius);
    text-decoration: none !important;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.25s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    line-height: 1;
}

.btchat-add-to-cart:hover {
    opacity: 0.8;
}

.btchat-add-to-cart.loading {
    background: #999;
    pointer-events: none;
}

.btchat-add-to-cart.added {
    background: #059669 !important;
}

.btchat-add-to-cart.error {
    background: #dc2626 !important;
}

.btchat-pdf-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 6px;
    background: rgba(39, 77, 120, 0.08);
    color: #274d78 !important;
    border: 1px solid #274d78;
    border-radius: var(--btchat-radius);
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
    min-height: 22px;
    line-height: 1;
    font-size: 9px;
    font-weight: 600;
}

.btchat-pdf-inline:hover {
    opacity: 0.8;
}

/* Contact Us button (catalog-only products) */
.btchat-contact-us-btn {
    font-size: 10px;
    padding: 4px 8px;
    background: var(--btchat-primary);
    color: #fff;
    border-radius: var(--btchat-radius);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.25s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    line-height: 1;
    border: none;
    width: 100%;
    gap: 4px;
}

.btchat-contact-us-btn:hover {
    opacity: 0.85;
}

/* Cart buttons */
.btchat-cart-actions {
    margin-top: 8px;
}

.btchat-btn-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btchat-btn-icon svg {
    width: 18px;
    height: 18px;
}

.btchat-btn-label {
    flex: 1;
    min-width: 0;
}

.btchat-cart-btn {
    padding: 12px 18px;
    background: #059669 !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    margin-bottom: 6px;
    font-size: 13px;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btchat-cart-btn:hover {
    background: #047857 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.btchat-cart-btn:active {
    transform: translateY(0);
}

.btchat-clear-cart-btn {
    padding: 12px 18px;
    background: #fff !important;
    color: var(--btchat-accent) !important;
    text-decoration: none !important;
    border: 1.5px solid var(--btchat-accent) !important;
    border-radius: 12px !important;
    cursor: pointer;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btchat-clear-cart-btn:hover {
    background: #fef2f2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(209, 21, 32, 0.15);
}

.btchat-clear-cart-btn:active {
    transform: translateY(0);
}

.btchat-clear-cart-btn.added {
    background: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}

.btchat-remove-cart-btn {
    padding: 12px 18px;
    background: #fff !important;
    color: var(--btchat-accent) !important;
    text-decoration: none !important;
    border: 1.5px solid var(--btchat-accent) !important;
    border-radius: 12px !important;
    cursor: pointer;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btchat-remove-cart-btn:hover {
    background: #fef2f2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(209, 21, 32, 0.15);
}

.btchat-remove-cart-btn:active {
    transform: translateY(0);
}

.btchat-remove-cart-btn.added {
    background: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}

/* Contact buttons */
.btchat-contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.btchat-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--btchat-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    color: #fff !important;
    transition: opacity 0.25s ease, transform 0.25s ease;
    line-height: 1;
}

.btchat-contact-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btchat-contact-icon {
    display: flex;
    align-items: center;
}

.btchat-contact-icon svg {
    width: 16px;
    height: 16px;
}

.btchat-contact-phone {
    background: #22c55e;
}

.btchat-contact-email {
    background: #3b82f6;
}

.btchat-contact-messenger {
    background: linear-gradient(135deg, #00b2ff, #006aff);
}

.btchat-contact-social[href*="facebook"] {
    background: #1877f2;
}

.btchat-contact-social[href*="instagram"] {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.btchat-contact-social[href*="tiktok"] {
    background: #010101;
}

.btchat-contact-social[href*="youtube"] {
    background: #ff0000;
}

.btchat-contact-social[href*="linkedin"] {
    background: #0a66c2;
}

/* ══════════════════════════════════════
   CATEGORY LINK BUTTONS
   ══════════════════════════════════════ */

.btchat-category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.btchat-category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--btchat-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    color: #374151 !important;
    background: #f3f4f6;
    border: 1px solid var(--btchat-border);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    line-height: 1;
}

.btchat-category-link:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.btchat-category-icon {
    display: flex;
    align-items: center;
    color: #6b7280;
}

.btchat-category-icon svg {
    width: 14px;
    height: 14px;
}

.btchat-category-count {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

/* ══════════════════════════════════════
   PDF DOCUMENT CARDS
   ══════════════════════════════════════ */

.btchat-pdf-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.btchat-pdf-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    max-width: 280px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--btchat-radius);
    color: var(--btchat-text);
    text-decoration: none !important;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btchat-pdf-card:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
}

.btchat-pdf-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btchat-accent);
    color: #fff;
    border-radius: 8px;
}

.btchat-pdf-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btchat-pdf-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--btchat-text);
}

.btchat-pdf-label {
    font-size: 11px;
    color: var(--btchat-text-muted);
}

/* ══════════════════════════════════════
   QUICK-ACTION SUGGESTION CARDS
   ══════════════════════════════════════ */

.btchat-quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btchat-has-messages .btchat-quick-actions {
    display: none;
}

.btchat-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--btchat-bg-surface) !important;
    border: 1.5px solid var(--btchat-border) !important;
    border-radius: 20px;
    padding: 7px 14px !important;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--btchat-text) !important;
    white-space: nowrap;
}

.btchat-quick-action:hover {
    background: color-mix(in srgb, var(--btchat-primary) 6%, white) !important;
    border-color: color-mix(in srgb, var(--btchat-primary) 35%, transparent) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btchat-qa-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

.btchat-qa-label {
    font-weight: 500;
}

@media (max-width: 480px) {
    .btchat-quick-action {
        white-space: normal;
    }
}

/* ══════════════════════════════════════
   RESIZE HANDLE
   ══════════════════════════════════════ */

#btchat-resize-handle {
    display: none;
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    cursor: ne-resize;
    color: rgba(0, 0, 0, 0.35);
    transition: color 0.25s ease;
    z-index: 10;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#btchat-resize-handle:hover,
#btchat-resize-handle:active {
    color: rgba(0, 0, 0, 0.6);
}

#btchat-widget.btchat-open #btchat-resize-handle {
    display: flex;
}

#btchat-widget.btchat-open.btchat-fullscreen #btchat-resize-handle {
    display: none;
}

#btchat-widget.btchat-resizing #btchat-window {
    transition: none;
}

/* ── Branded header (top of open window) ── */
#btchat-header {
    display: none;
}

#btchat-widget.btchat-open #btchat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 14px 0 16px;
    background: var(--btchat-primary);
    color: #fff;
    border-radius: 12px 12px 0 0;
    cursor: grab;
    flex-shrink: 0;
}

#btchat-widget.btchat-open #btchat-header:active {
    cursor: grabbing;
}

#btchat-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

#btchat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

#btchat-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#btchat-header-name {
    font-family: var(--wd-title-font, inherit);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btchat-header-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

.btchat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

#btchat-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

#btchat-header-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
}

#btchat-header-actions button:hover {
    background: transparent;
    color: #fff;
    opacity: 0.7;
}

/* Suppress animation during drag/resize/collapse */
#btchat-widget.btchat-collapsing #btchat-window,
#btchat-widget.btchat-dragging #btchat-window,
#btchat-widget.btchat-resizing #btchat-window {
    animation: none !important;
}

#btchat-widget.btchat-dragging,
#btchat-widget.btchat-dragging #btchat-window {
    transition: none !important;
}

#btchat-widget.btchat-collapsing,
#btchat-widget.btchat-collapsing * {
    transition: none !important;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet + mobile: lift bar above WoodMart sticky toolbar (~60px) */
@media (max-width: 1024px) {
    #btchat-widget {
        bottom: 70px;
    }
}

@media (max-width: 480px) {
    #btchat-widget {
        bottom: 70px;
    }

    #btchat-bar {
        width: calc(100vw - 32px);
        max-width: 420px;
    }

    #btchat-bar:focus-within {
        width: calc(100vw - 32px);
        max-width: 420px;
    }

    /* Open on mobile → near-fullscreen with slight padding */
    #btchat-widget.btchat-open {
        inset: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 8px !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    }

    #btchat-widget.btchat-open #btchat-window {
        width: 100% !important;
        height: 100% !important;
        height: calc(100dvh - 8px - env(safe-area-inset-bottom, 0px) - 12px) !important;
        max-height: calc(100dvh - 8px - env(safe-area-inset-bottom, 0px) - 12px);
        border-radius: 12px;
        resize: none;
        min-width: 0;
    }

    /* Safe-area padding for notched iPhones */
    #btchat-widget.btchat-open #btchat-bar {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Header: rounded top corners on mobile */
    #btchat-widget.btchat-open #btchat-header {
        border-radius: 12px 12px 0 0;
    }

    /* Header buttons: enlarge touch targets */
    #btchat-header-actions button {
        min-width: 36px;
        min-height: 36px;
        width: 36px;
        height: 36px;
    }

    /* Send button: enlarge touch target */
    #btchat-send {
        width: 36px;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
    }

    /* Messages area: reclaim horizontal space */
    #btchat-messages {
        padding: 16px 12px;
    }

    /* Bot avatar + bubble: tighter on mobile */
    .btchat-msg.bot {
        padding-left: 32px;
    }

    .btchat-msg.bot::before {
        width: 26px;
        height: 26px;
        background-size: 16px 16px;
    }

    .btchat-msg-content {
        max-width: 92%;
    }

    /* Product cards: slightly wider for readability */
    .btchat-product-card {
        min-width: 130px;
        max-width: 155px;
    }

    .btchat-product-name {
        font-size: 12px;
    }

    /* Quantity controls: larger touch targets */
    .btchat-qty-wrap {
        height: 30px;
    }

    .btchat-qty-btn {
        width: 28px !important;
        height: 30px !important;
        font-size: 13px !important;
    }

    .btchat-qty {
        height: 30px !important;
        width: 36px !important;
        flex: 0 0 36px !important;
        line-height: 30px !important;
    }

    /* Add-to-cart / contact buttons: larger touch targets */
    .btchat-add-to-cart,
    .btchat-contact-us-btn {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 11px;
    }

    /* PDF cards: don't overflow message area */
    .btchat-pdf-card {
        max-width: 100%;
    }

    #btchat-resize-handle {
        display: none !important;
    }

    .btchat-carousel-prev,
    .btchat-carousel-next {
        display: none !important;
    }
}

/* Hide on admin */
.wp-admin #btchat-widget {
    display: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #btchat-bar:not(.btchat-open #btchat-bar) #btchat-label { animation: none; }
    .btchat-msg { animation: none; }
    #btchat-widget.btchat-open #btchat-window { animation: none; }
    * { transition-duration: 0.01ms !important; }
}