/**
 * SMART SALES AI — White Fullscreen Edition
 * Modern, clean, high-end white full-screen chat interface.
 * Opens full screen above all elements on Desktop, Laptop, and Mobile.
 * RTL-first layout with smooth micro-animations.
 */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ==========================================================================
   DESIGN TOKENS & VARIABLES
   ========================================================================== */
:root {
    /* Brand & Accent Colors */
    --wcsai-primary: #4f46e5;
    --wcsai-primary-hover: #4338ca;
    --wcsai-primary-soft: #eef2ff;
    --wcsai-primary-glow: rgba(79, 70, 229, 0.22);

    /* Backgrounds & Surfaces */
    --wcsai-canvas: #f8fafc;
    --wcsai-surface: #ffffff;
    --wcsai-surface-alt: #f1f5f9;
    --wcsai-header-bg: rgba(255, 255, 255, 0.96);

    /* Typography & Ink */
    --wcsai-ink: #0f172a;
    --wcsai-ink-soft: #475569;
    --wcsai-muted: #94a3b8;

    /* Borders & Lines */
    --wcsai-line: #e2e8f0;
    --wcsai-line-light: #f1f5f9;

    /* Status Colors */
    --wcsai-success: #10b981;
    --wcsai-danger: #ef4444;

    /* Shadows & Radii */
    --wcsai-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
    --wcsai-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --wcsai-shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
    --wcsai-shadow-trigger: 0 10px 30px rgba(79, 70, 229, 0.32);

    --wcsai-radius-xl: 24px;
    --wcsai-radius-lg: 18px;
    --wcsai-radius-md: 14px;
    --wcsai-radius-sm: 10px;

    /* Compatibility variables for JS dynamic insertion */
    --wcsai-navy: #0f172a;
    --wcsai-surface-soft: #f8fafc;
}

/* ==========================================================================
   RESET & ISOLATION
   ========================================================================== */
#wcsai-chat-root {
    position: fixed;
    z-index: 2147483647 !important;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    direction: rtl;
    color: var(--wcsai-ink);
}

#wcsai-chat-root *,
#wcsai-chat-root *::before,
#wcsai-chat-root *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Position rules for floating trigger */
.wcsai-widget-position-bottom-right {
    bottom: 26px;
    right: 26px;
}

.wcsai-widget-position-bottom-left {
    bottom: 26px;
    left: 26px;
}

/* Prevent body scrolling when fullscreen chat is open */
body.wcsai-chat-open {
    overflow: hidden !important;
}

/* ==========================================================================
   FLOATING TRIGGER & TOOLTIP
   ========================================================================== */
.wcsai-trigger-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wcsai-widget-position-bottom-left .wcsai-trigger-wrapper {
    align-items: flex-start;
}

/* Floating Trigger Button */
.wcsai-trigger-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 154px;
    height: 60px;
    padding: 0 22px;
    border: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--wcsai-primary) 0%, #6366f1 100%);
    color: #ffffff;
    box-shadow: var(--wcsai-shadow-trigger);
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.wcsai-trigger-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 38px rgba(79, 70, 229, 0.42);
}

.wcsai-trigger-btn:active {
    transform: translateY(-1px) scale(0.97);
}

.wcsai-trigger-btn:focus-visible {
    box-shadow: 0 0 0 4px var(--wcsai-primary-glow), var(--wcsai-shadow-trigger);
}

.wcsai-trigger-btn::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    pointer-events: none;
}

.wcsai-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.wcsai-trigger-icon svg {
    display: block;
}

.wcsai-trigger-label {
    position: relative;
    z-index: 1;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.1px;
}

.wcsai-trigger-live-dot {
    position: absolute;
    top: 9px;
    left: 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
    animation: wcsaiLivePulse 2s infinite ease-in-out;
}

@keyframes wcsaiLivePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.75);
        opacity: 0.6;
    }
}

.wcsai-trigger-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    z-index: 2;
    animation: wcsaiBadgePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes wcsaiBadgePop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.wcsai-dragging .wcsai-trigger-btn {
    cursor: grabbing !important;
    transform: scale(1.05);
    transition: none !important;
}

/* Tooltip Above Trigger */
.wcsai-trigger-tooltip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 18px);
    min-width: 220px;
    max-width: 280px;
    padding: 14px 18px;
    border: 1px solid var(--wcsai-line);
    border-radius: 18px 18px 4px 18px;
    background: var(--wcsai-surface);
    color: var(--wcsai-ink);
    box-shadow: var(--wcsai-shadow-lg);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transform: translateY(24px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.wcsai-widget-position-bottom-left .wcsai-trigger-tooltip {
    right: auto;
    left: 0;
    border-radius: 18px 18px 18px 4px;
    transform-origin: bottom left;
}

.wcsai-trigger-tooltip::after {
    content: '';
    position: absolute;
    right: 24px;
    bottom: -7px;
    width: 13px;
    height: 13px;
    background: var(--wcsai-surface);
    border-inline-end: 1px solid var(--wcsai-line);
    border-bottom: 1px solid var(--wcsai-line);
    transform: rotate(45deg);
}

.wcsai-widget-position-bottom-left .wcsai-trigger-tooltip::after {
    right: auto;
    left: 24px;
    transform: rotate(135deg);
}

.wcsai-trigger-wrapper.show-tooltip .wcsai-trigger-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.wcsai-tooltip-close {
    position: absolute;
    top: -9px;
    left: -9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--wcsai-line);
    border-radius: 50%;
    background: var(--wcsai-surface);
    color: var(--wcsai-muted);
    font: 700 14px/1 Arial, sans-serif;
    cursor: pointer;
    box-shadow: var(--wcsai-shadow-sm);
    transition: all 0.2s ease;
}

.wcsai-tooltip-close:hover {
    border-color: var(--wcsai-primary);
    color: var(--wcsai-primary);
    transform: rotate(90deg);
}

/* Tooltip Typing Dots Animation (3 points moving alternately) */
.wcsai-tooltip-typing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    padding: 8px 12px;
}

.wcsai-tooltip-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wcsai-primary);
    animation: wcsaiDotBounce 1.4s ease-in-out infinite both;
}

.wcsai-tooltip-typing span:nth-child(1) {
    animation-delay: 0s;
}

.wcsai-tooltip-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.wcsai-tooltip-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes wcsaiDotBounce {

    0%,
    80%,
    100% {
        opacity: 0.25;
        transform: scale(0.6) translateY(0);
    }

    40% {
        opacity: 1;
        transform: scale(1.1) translateY(-6px);
    }
}

/* Tooltip Greeting Text */
.wcsai-tooltip-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 8px;
}

.wcsai-tooltip-subtitle {
    font-size: 11px;
    color: var(--wcsai-muted);
    font-weight: 700;
}

.wcsai-tooltip-text-main {
    font-size: 14px;
    font-weight: 700;
    color: var(--wcsai-ink);
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcsai-tooltip-text-main::before {
    content: '👋';
    font-size: 16px;
    display: inline-block;
    animation: wcsaiWave 1.6s ease-in-out 1;
}

@keyframes wcsaiWave {
    0% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(14deg);
    }

    30% {
        transform: rotate(-8deg);
    }

    45% {
        transform: rotate(14deg);
    }

    60% {
        transform: rotate(-4deg);
    }

    75% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}


/* ==========================================================================
   PURE WHITE FULLSCREEN CHAT OVERLAY
   ========================================================================== */
.wcsai-chat-window {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: var(--wcsai-surface) !important;
    z-index: 2147483647 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none !important;
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fullscreen Slide-Up Active Class */
.wcsai-chat-window.wcsai-anim-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.wcsai-chat-window.wcsai-anim-out {
    opacity: 0 !important;
    transform: translateY(60px) !important;
    pointer-events: none !important;
}

/* --------------------------------------------------------------------------
   FULLSCREEN HEADER
   -------------------------------------------------------------------------- */
.wcsai-chat-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    height: 76px;
    padding: 0 32px;
    background: var(--wcsai-surface);
    border-bottom: 1px solid var(--wcsai-line);
    z-index: 10;
}

.wcsai-bot-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.wcsai-bot-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--wcsai-primary-soft);
    color: var(--wcsai-primary);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.wcsai-bot-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.wcsai-header-kicker {
    color: var(--wcsai-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.wcsai-bot-title {
    overflow: hidden;
    color: var(--wcsai-ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcsai-bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--wcsai-ink-soft);
    font-size: 12px;
    font-weight: 500;
}

.wcsai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--wcsai-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

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

.wcsai-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--wcsai-line);
    border-radius: 12px;
    background: var(--wcsai-surface);
    color: var(--wcsai-ink-soft);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wcsai-icon-btn:hover,
.wcsai-icon-btn:focus-visible {
    border-color: var(--wcsai-primary);
    background: var(--wcsai-primary-soft);
    color: var(--wcsai-primary);
    outline: none;
    transform: translateY(-1px);
}

/* Hide header gradient overlays if present */
.wcsai-chat-header::before,
.wcsai-chat-header::after {
    display: none !important;
}

/* --------------------------------------------------------------------------
   FULLSCREEN MESSAGES CONTAINER
   -------------------------------------------------------------------------- */
.wcsai-messages-container {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 32px 24px;
    background: var(--wcsai-canvas);
    scroll-behavior: smooth;
    width: 100%;
}

/* Centered Reading Column on Laptops & Desktops */
.wcsai-messages-container>* {
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
}

.wcsai-messages-container::-webkit-scrollbar {
    width: 6px;
}

.wcsai-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.wcsai-messages-container::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #cbd5e1;
}

.wcsai-messages-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Message Rows */
.wcsai-message {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 80%;
    margin-bottom: 18px;
    animation: wcsaiMsgFadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wcsai-message:last-child {
    margin-bottom: 0;
}

[dir="rtl"] .wcsai-message.user {
    align-items: flex-end;
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .wcsai-message.assistant {
    align-items: flex-start;
    margin-right: 0;
    margin-left: auto;
}

@keyframes wcsaiMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bubbles */
.wcsai-message-bubble {
    position: relative;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.8;
    word-break: break-word;
}

/* User Message Bubble */
.wcsai-message.user .wcsai-message-bubble {
    border-bottom-left-radius: 6px;
    background: var(--wcsai-primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
    font-weight: 500;
}

/* Assistant Message Bubble */
.wcsai-message.assistant .wcsai-message-bubble {
    border: 1px solid var(--wcsai-line);
    border-bottom-right-radius: 6px;
    background: var(--wcsai-surface);
    color: var(--wcsai-ink);
    box-shadow: var(--wcsai-shadow-sm);
}

/* Assistant AI Badge */
.wcsai-message.assistant .wcsai-message-bubble::before {
    content: 'AI';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: right;
    width: 26px;
    height: 26px;
    margin: 0 0 4px 10px;
    border-radius: 8px;
    background: var(--wcsai-primary-soft);
    color: var(--wcsai-primary);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.3px;
}

.wcsai-message-bubble p {
    margin-bottom: 10px;
}

.wcsai-message-bubble p:last-child {
    margin-bottom: 0;
}

.wcsai-message-bubble strong {
    font-weight: 800;
}

.wcsai-message.assistant .wcsai-message-bubble strong {
    color: var(--wcsai-primary-hover);
}

.wcsai-message.user .wcsai-message-bubble strong {
    color: #ffffff;
}

.wcsai-message-bubble ul {
    margin: 10px 0;
    padding-inline-start: 22px;
}

/* --------------------------------------------------------------------------
   RECOMMENDED PRODUCTS CARDS
   -------------------------------------------------------------------------- */
.wcsai-products-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 480px;
    margin-top: 14px;
}

.wcsai-product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wcsai-product-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.wcsai-product-card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.wcsai-product-card-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.wcsai-product-card-img {
    display: block;
    width: 85%;
    height: 85%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.wcsai-product-card:hover .wcsai-product-card-img {
    /* Kept empty to remove scale effect */
}

.wcsai-product-card-details {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.wcsai-product-card-title {
    display: -webkit-box;
    overflow: hidden;
    color: #1e293b;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.wcsai-product-card-price {
    color: var(--wcsai-primary);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

.wcsai-product-card-price del {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    margin-right: 6px;
}

.wcsai-product-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.wcsai-spec-badge {
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.wcsai-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 800;
}

.wcsai-stock-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.wcsai-stock-badge.in-stock {
    color: #10b981;
}

.wcsai-stock-badge.out-of-stock {
    color: #ef4444;
}

.wcsai-product-card-actions {
    display: flex;
    padding: 0 16px 16px;
    gap: 10px;
}

.wcsai-btn-add-to-cart,
.wcsai-btn-view-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    font: 800 13px/1.2 'Tajawal', sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wcsai-btn-add-to-cart {
    background: var(--wcsai-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(109, 93, 252, 0.2);
}

.wcsai-btn-add-to-cart:hover {
    background: var(--wcsai-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(109, 93, 252, 0.3);
}

.wcsai-btn-add-to-cart.added {
    background: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.wcsai-btn-add-to-cart.loading {
    opacity: 0.7;
    cursor: wait;
    box-shadow: none;
    transform: none;
}

.wcsai-btn-view-details {
    background: #f1f5f9;
    color: #475569;
}

.wcsai-btn-view-details:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.wcsai-product-card-actions .added_to_cart {
    display: none !important;
}

/* --------------------------------------------------------------------------
   SUGGESTION CHIPS BAR
   -------------------------------------------------------------------------- */
.wcsai-chips-container {
    flex: 0 0 auto;
    padding: 14px 32px 10px;
    border-top: 1px solid var(--wcsai-line);
    background: var(--wcsai-surface);
}

.wcsai-chips-container-inner {
    max-width: 840px;
    margin: 0 auto;
}

.wcsai-chips-label {
    display: block;
    margin-bottom: 8px;
    color: var(--wcsai-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.wcsai-chips-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.wcsai-chips-list::-webkit-scrollbar {
    display: none;
}

.wcsai-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--wcsai-line);
    border-radius: 50px;
    background: var(--wcsai-surface);
    color: var(--wcsai-ink-soft);
    font: 700 12px/1.2 'Tajawal', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wcsai-chip:hover {
    border-color: var(--wcsai-primary);
    background: var(--wcsai-primary-soft);
    color: var(--wcsai-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--wcsai-shadow-sm);
}

.wcsai-chip-icon {
    display: inline-flex;
    color: var(--wcsai-primary);
}

/* --------------------------------------------------------------------------
   TYPING INDICATOR (IN CHAT)
   -------------------------------------------------------------------------- */
.wcsai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 32px 14px;
    background: var(--wcsai-canvas);
}

.wcsai-typing-indicator-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 840px;
    margin: 0 auto;
    width: 100%;
}

.wcsai-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--wcsai-primary-soft);
    color: var(--wcsai-primary);
}

.wcsai-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border: 1px solid var(--wcsai-line);
    border-radius: 16px 16px 16px 4px;
    background: var(--wcsai-surface);
    box-shadow: var(--wcsai-shadow-sm);
}

.wcsai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wcsai-muted);
    animation: wcsaiDeepThinking 1.4s infinite ease-in-out both;
}

.wcsai-dot:nth-child(1) {
    animation-delay: 0s;
}

.wcsai-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wcsai-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wcsaiDeepThinking {

    0%,
    100% {
        opacity: 0.2;
        transform: translateY(0) scale(0.8);
    }

    50% {
        opacity: 1;
        transform: translateY(-4px) scale(1.1);
        background-color: var(--wcsai-primary);
    }
}

/* --------------------------------------------------------------------------
   FULLSCREEN CHAT FOOTER & COMPOSER
   -------------------------------------------------------------------------- */
.wcsai-chat-footer {
    flex: 0 0 auto;
    padding: 16px 32px 20px;
    border-top: 1px solid var(--wcsai-line);
    background: var(--wcsai-surface);
}

.wcsai-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 840px;
    margin: 0 auto;
    padding: 8px 10px 8px 14px;
    border: 1.5px solid var(--wcsai-line);
    border-radius: 18px;
    background: var(--wcsai-surface);
    transition: all 0.25s ease;
}

.wcsai-chat-form:focus-within {
    border-color: var(--wcsai-primary);
    box-shadow: 0 0 0 4px var(--wcsai-primary-glow);
}

.wcsai-chat-input {
    display: block !important;
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 120px !important;
    overflow-y: auto;
    padding: 10px 4px !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    color: var(--wcsai-ink);
    font: 500 15px/1.55 'Tajawal', sans-serif !important;
    resize: none;
}

.wcsai-chat-input::placeholder {
    color: var(--wcsai-muted);
}

.wcsai-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: var(--wcsai-primary);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease;
}

.wcsai-send-btn:hover {
    background: var(--wcsai-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.wcsai-send-btn:active {
    transform: translateY(0);
}

.wcsai-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.wcsai-input-hint {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 840px;
    margin: 0 auto;
    padding-top: 8px;
    color: var(--wcsai-muted);
    font-size: 11px;
    font-weight: 500;
}

.wcsai-hint-separator {
    color: #cbd5e1;
}

.wcsai-powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 8px;
    color: var(--wcsai-muted);
    font-size: 10px;
    font-weight: 700;
}

.wcsai-powered-mark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wcsai-primary);
    box-shadow: 0 0 0 3px var(--wcsai-primary-soft);
}

/* ==========================================================================
   RESPONSIVE (MOBILE & TABLET STYLING)
   ========================================================================== */
@media (max-width: 640px) {
    .wcsai-chat-header {
        height: 68px;
        padding: 0 16px;
    }

    .wcsai-messages-container {
        padding: 20px 16px;
    }

    .wcsai-chips-container {
        padding: 10px 16px;
    }

    .wcsai-typing-indicator {
        padding: 0 16px 10px;
    }

    .wcsai-chat-footer {
        padding: 12px 16px 16px;
    }

    .wcsai-trigger-btn {
        min-width: 58px;
        width: 58px;
        height: 58px;
        padding: 0;
        border-radius: 50%;
    }

    .wcsai-trigger-label {
        display: none;
    }

    .wcsai-trigger-live-dot {
        top: 6px;
        left: 6px;
    }

    .wcsai-message {
        max-width: 90%;
    }

    .wcsai-input-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    #wcsai-chat-root *,
    #wcsai-chat-root *::before,
    #wcsai-chat-root *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ==========================================================================
   SMART SALES AI — ORBITAL GLASS REDESIGN
   Floating circular launcher + staged greeting + centered modal overlay.
   ========================================================================== */
#wcsai-chat-root {
    --wcsai-primary: #6d5dfc;
    --wcsai-primary-hover: #5142df;
    --wcsai-primary-soft: #efedff;
    --wcsai-ink: #17152b;
    --wcsai-ink-soft: #706d86;
    --wcsai-muted: #aaa7bd;
    --wcsai-line: #e9e7f2;
    --wcsai-canvas: #f7f6fb;
    --wcsai-surface: #ffffff;
    --wcsai-shadow-trigger: 0 18px 42px rgba(109, 93, 252, .35);
    inset: auto 28px 28px auto;
}

.wcsai-widget-position-bottom-left {
    left: 28px !important;
    right: auto !important;
}

.wcsai-trigger-wrapper {
    align-items: flex-end;
    gap: 14px;
}

.wcsai-widget-position-bottom-left .wcsai-trigger-wrapper {
    align-items: flex-start;
}

.wcsai-trigger-btn {
    width: 68px;
    min-width: 68px;
    height: 68px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #8275ff 0%, #5948e8 100%);
    box-shadow: var(--wcsai-shadow-trigger), inset 0 1px 0 rgba(255, 255, 255, .45);
    isolation: isolate;
}

.wcsai-trigger-btn::before {
    inset: 5px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
}

.wcsai-trigger-btn::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(109, 93, 252, .18);
    border-radius: 50%;
    animation: wcsaiOrbit 3s ease-out infinite;
    pointer-events: none;
}

.wcsai-trigger-btn:hover {
    transform: translateY(-5px) scale(1.06);
}

.wcsai-trigger-icon svg {
    width: 27px;
    height: 27px;
    stroke-width: 1.7;
}

.wcsai-trigger-label {
    display: none;
}

.wcsai-trigger-live-dot {
    top: 8px;
    left: 9px;
    width: 10px;
    height: 10px;
    border: 2px solid #6857ef;
    background: #63e6be;
    box-shadow: 0 0 0 3px rgba(99, 230, 190, .25);
}

@keyframes wcsaiOrbit {
    0% {
        opacity: .8;
        transform: scale(.9);
    }

    70%,
    100% {
        opacity: 0;
        transform: scale(1.32);
    }
}

.wcsai-trigger-tooltip {
    right: 0;
    bottom: calc(100% + 18px);
    min-width: 204px;
    max-width: 245px;
    padding: 14px 18px;
    border: 1px solid rgba(109, 93, 252, .13);
    border-radius: 18px 18px 5px 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 45px rgba(32, 25, 82, .14);
    backdrop-filter: blur(14px);
    color: var(--wcsai-ink);
    transform: translateY(16px) scale(.92);
    transform-origin: bottom right;
}

.wcsai-widget-position-bottom-left .wcsai-trigger-tooltip {
    right: auto;
    left: 0;
    border-radius: 18px 18px 18px 5px;
    transform-origin: bottom left;
}

.wcsai-trigger-tooltip::after {
    background: #fff;
    border-color: rgba(109, 93, 252, .13);
}

.wcsai-tooltip-typing {
    height: 22px;
    gap: 5px;
}

.wcsai-tooltip-typing span {
    width: 7px;
    height: 7px;
    background: var(--wcsai-primary);
}

.wcsai-tooltip-text {
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.wcsai-tooltip-text::before {
    content: '✦';
    color: var(--wcsai-primary);
    font-size: 15px;
}

.wcsai-chat-window {
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(20, 17, 42, .48) !important;
    backdrop-filter: blur(13px);
    opacity: 0;
    transform: none;
    transition: opacity .32s ease;
}

.wcsai-chat-window.wcsai-anim-in {
    opacity: 1 !important;
    transform: none !important;
}

.wcsai-chat-window.wcsai-anim-out {
    opacity: 0 !important;
    transform: none !important;
}

.wcsai-chat-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: min(920px, 100%);
    height: min(760px, calc(100vh - 56px));
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 30px;
    background: var(--wcsai-surface);
    box-shadow: 0 30px 90px rgba(15, 12, 45, .28);
    opacity: 0;
    transform: translateY(26px) scale(.97);
    transition: opacity .4s ease .05s, transform .48s cubic-bezier(.2, .8, .2, 1) .05s;
}

.wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.wcsai-chat-header {
    height: 88px;
    padding: 0 28px;
    border-bottom: 1px solid #f0eef6;
    background: linear-gradient(110deg, #fff 0%, #fbfaff 100%);
}

.wcsai-bot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 17px;
    background: linear-gradient(145deg, #8275ff, #5948e8);
    color: #fff;
    border: 0;
    box-shadow: 0 9px 20px rgba(109, 93, 252, .25);
}

.wcsai-header-kicker {
    color: var(--wcsai-primary);
    letter-spacing: 1.4px;
}

.wcsai-bot-title {
    font-size: 19px;
}

.wcsai-bot-status {
    color: #858199;
}

.wcsai-status-dot {
    background: #45d6a1;
    box-shadow: 0 0 0 4px rgba(69, 214, 161, .14);
}

.wcsai-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border-color: #ebe9f3;
    background: #fff;
}

.wcsai-messages-container {
    padding: 32px clamp(18px, 5vw, 64px);
    background: linear-gradient(180deg, #fbfaff 0%, #f7f6fb 100%);
}

.wcsai-message {
    max-width: min(78%, 620px);
    margin-bottom: 20px;
}

.wcsai-message-bubble {
    padding: 15px 20px;
    border-radius: 22px;
    font-size: 15px;
    line-height: 1.85;
}

.wcsai-message.user .wcsai-message-bubble {
    border-bottom-left-radius: 7px;
    background: linear-gradient(135deg, #7566ff, #5747e5);
    box-shadow: 0 10px 24px rgba(93, 75, 231, .18);
}

.wcsai-message.assistant .wcsai-message-bubble {
    border-color: #ebe9f3;
    border-bottom-right-radius: 7px;
    box-shadow: 0 8px 24px rgba(43, 34, 95, .06);
}

.wcsai-message.assistant .wcsai-message-bubble::before {
    border-radius: 9px;
    background: #efedff;
    color: #6454ed;
}

.wcsai-products-grid {
    max-width: 480px;
}

.wcsai-product-card {
    border-radius: 19px;
    border-color: #ebe9f3;
    box-shadow: 0 8px 22px rgba(43, 34, 95, .06);
}

.wcsai-chips-container {
    padding: 16px 32px 12px;
    border-top-color: #f0eef6;
}

.wcsai-chip {
    border-color: #e6e3f0;
    background: #fbfaff;
}

.wcsai-chip:hover {
    border-color: #b9b1ff;
    background: #f0eeff;
}

.wcsai-chat-footer {
    padding: 16px 32px 20px;
    border-top-color: #f0eef6;
}

.wcsai-chat-form {
    border-color: #ded9f2;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(43, 34, 95, .05);
}

.wcsai-chat-form:focus-within {
    border-color: #9b91ff;
    box-shadow: 0 0 0 4px rgba(109, 93, 252, .10);
}

.wcsai-send-btn {
    width: 43px;
    height: 43px;
    border-radius: 15px;
    background: linear-gradient(145deg, #8275ff, #5948e8);
}

.wcsai-powered-by {
    color: #a7a3b7;
}

@media (max-width: 640px) {
    #wcsai-chat-root {
        inset: auto 18px 18px auto;
    }

    .wcsai-widget-position-bottom-left {
        left: 18px !important;
        right: auto !important;
    }

    .wcsai-trigger-btn {
        width: 62px;
        min-width: 62px;
        height: 62px;
    }

    .wcsai-chat-window {
        padding: 0;
    }

    .wcsai-chat-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .wcsai-chat-header {
        height: 76px;
        padding: 0 18px;
    }

    .wcsai-messages-container {
        padding: 24px 16px;
    }

    .wcsai-message {
        max-width: 88%;
    }

    .wcsai-chips-container,
    .wcsai-chat-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wcsai-input-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    #wcsai-chat-root *,
    #wcsai-chat-root *::before,
    #wcsai-chat-root *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}



/* LEGACY CHAT MATCH — compact floating box */
#wcsai-chat-root {
    inset: auto 24px 24px auto;
}

.wcsai-widget-position-bottom-left {
    left: 24px !important;
    right: auto !important;
}

.wcsai-chat-window {
    position: fixed !important;
    inset: auto 24px 24px auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    display: block;
    background: transparent !important;
    backdrop-filter: none !important;
    opacity: 0;
    transform: none !important;
    pointer-events: none;
    transition: opacity .18s ease;
}

.wcsai-widget-position-bottom-left .wcsai-chat-window {
    left: 24px !important;
    right: auto !important;
}

.wcsai-chat-window.wcsai-anim-in {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.wcsai-chat-window.wcsai-anim-out {
    opacity: 0 !important;
    pointer-events: none !important;
}

.wcsai-chat-panel,
.wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
    width: min(392px, calc(100vw - 48px));
    height: min(600px, calc(100dvh - 48px));
    border: 0;
    border-radius: 24px;
    box-shadow: 0 20px 52px rgba(0, 0, 0, .22), 0 3px 12px rgba(0, 0, 0, .08);
    opacity: 1;
    transform: none;
    transition: none;
    background: #fff;
    overflow: hidden;
}

.wcsai-chat-header {
    height: 74px;
    padding: 0 18px;
    border-bottom: 0;
    background: var(--wcsai-primary);
    color: #fff;
}

.wcsai-bot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .30);
    box-shadow: none;
}

.wcsai-header-kicker,
.wcsai-bot-title,
.wcsai-bot-status {
    color: #fff;
}

.wcsai-header-kicker {
    opacity: .72;
    font-size: 9px;
}

.wcsai-bot-title {
    font-size: 16px;
}

.wcsai-bot-status {
    opacity: .78;
    font-size: 11px;
}

.wcsai-status-dot {
    width: 7px;
    height: 7px;
    background: #9df0c8;
    box-shadow: 0 0 0 3px rgba(157, 240, 200, .18);
}

.wcsai-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.wcsai-icon-btn:hover,
.wcsai-icon-btn:focus-visible {
    border: 0;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    transform: none;
}

.wcsai-messages-container {
    padding: 20px 16px;
    background: #fff;
}

.wcsai-message {
    max-width: 86%;
    margin-bottom: 14px;
}

.wcsai-message-bubble {
    padding: 11px 14px;
    border-radius: 17px;
    font-size: 14px;
    line-height: 1.65;
}

.wcsai-message.user .wcsai-message-bubble {
    border-bottom-left-radius: 5px;
    background: var(--wcsai-primary);
    box-shadow: none;
}

.wcsai-message.assistant .wcsai-message-bubble {
    border: 1px solid #ededed;
    border-bottom-right-radius: 5px;
    background: #f5f5f5;
    box-shadow: none;
}

.wcsai-message.assistant .wcsai-message-bubble::before {
    display: none;
}

.wcsai-products-grid {
    max-width: 100%;
}

.wcsai-product-card {
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.wcsai-chips-container {
    padding: 10px 14px 8px;
    border-top: 1px solid #ededed;
}

.wcsai-chips-label {
    margin-bottom: 6px;
    font-size: 10px;
}

.wcsai-chip {
    min-height: 31px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff;
    font-size: 11px;
}

.wcsai-chat-footer {
    padding: 10px 14px 12px;
    border-top: 1px solid #ededed;
}

.wcsai-chat-form {
    gap: 8px;
    padding: 5px 6px 5px 10px;
    border: 1px solid #dedede;
    border-radius: 13px;
    box-shadow: none;
}

.wcsai-chat-form:focus-within {
    border-color: var(--wcsai-primary);
    box-shadow: 0 0 0 2px var(--wcsai-primary-soft);
}

.wcsai-chat-input {
    height: 36px !important;
    min-height: 36px !important;
    padding: 8px 2px !important;
    font-size: 13px !important;
}

.wcsai-send-btn {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: none;
}

.wcsai-input-hint {
    display: none;
}

.wcsai-powered-by {
    padding-top: 6px;
    font-size: 9px;
}

.wcsai-trigger-btn::after {
    animation-duration: 3.5s;
}

@media (max-width: 640px) {
    #wcsai-chat-root {
        inset: auto 16px 16px auto;
    }

    .wcsai-widget-position-bottom-left {
        left: 16px !important;
        right: auto !important;
    }

    .wcsai-chat-window,
    .wcsai-widget-position-bottom-left .wcsai-chat-window {
        inset: auto 16px 16px 16px !important;
        width: auto !important;
    }

    .wcsai-chat-panel,
    .wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
        width: 100%;
        height: min(600px, calc(100dvh - 32px));
        border-radius: 22px;
    }
}

/* Exact legacy values from limb-chatbot-pro defaults */
#wcsai-chat-root {
    --wcsai-primary: #458cf5;
    --wcsai-primary-hover: #458cf5;
    --wcsai-primary-soft: rgba(69, 140, 245, .10);
    --wcsai-canvas: #ffffff;
    --wcsai-surface: #ffffff;
    --wcsai-ink: rgba(0, 0, 0, .90);
    --wcsai-ink-soft: rgba(0, 0, 0, .50);
    --wcsai-muted: rgba(0, 0, 0, .50);
    --wcsai-line: rgba(0, 0, 0, .08);
}

.wcsai-trigger-btn {
    width: 60px;
    min-width: 60px;
    height: 60px;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    isolation: isolate;
    transition: transform .15s cubic-bezier(.4, 0, .2, 1);
}

.wcsai-trigger-btn::before,
.wcsai-trigger-btn::after {
    display: none;
}

.wcsai-trigger-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    fill: #458cf5;
    transition: transform .15s cubic-bezier(.4, 0, .2, 1);
}

.wcsai-trigger-btn:hover .wcsai-trigger-bg {
    transform: scale(1.1);
}

.wcsai-trigger-btn:active .wcsai-trigger-bg {
    transform: scale(.9);
}

.wcsai-trigger-icon {
    position: relative;
    z-index: 1;
    color: #fff;
}

.wcsai-trigger-icon svg {
    width: 32px;
    height: 32px;
}

.wcsai-trigger-live-dot {
    display: none;
}

.wcsai-trigger-tooltip {
    min-width: 0;
    width: max-content;
    max-width: min(280px, calc(100vw - 48px));
    padding: 14px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    backdrop-filter: blur(24px);
    color: rgba(0, 0, 0, .60);
}

.wcsai-trigger-tooltip::after {
    display: none;
}

.wcsai-tooltip-text {
    color: rgba(0, 0, 0, .60);
    font-size: 12px;
    font-weight: 400;
}

.wcsai-tooltip-text::before {
    color: rgba(0, 0, 0, .40);
}

.wcsai-chat-window {
    inset: auto 24px 24px auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

.wcsai-chat-panel,
.wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
    position: relative;
    width: min(392px, calc(100vw - 48px));
    height: min(600px, calc(100dvh - 48px));
    border-radius: 24px;
    border: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
}

.wcsai-chat-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    z-index: 0;
    height: 240px;
    pointer-events: none;
    background: linear-gradient(to bottom,
            rgba(69, 140, 245, 1) 0%,
            rgba(69, 140, 245, .8) 20%,
            rgba(69, 140, 245, .5) 40%,
            rgba(69, 140, 245, .25) 60%,
            rgba(69, 140, 245, .1) 80%,
            rgba(255, 255, 255, 0) 100%);
}

.wcsai-chat-header {
    position: relative;
    z-index: 2;
    flex: 0 0 56px;
    height: 56px;
    padding: 0 12px;
    border-bottom: 0;
    background: transparent;
}

.wcsai-bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: #fff;
    border: 0;
    box-shadow: none;
}

.wcsai-bot-avatar svg {
    width: 19px;
    height: 19px;
}

.wcsai-bot-info {
    gap: 1px;
}

.wcsai-header-kicker {
    display: none;
}

.wcsai-bot-title {
    color: rgba(0, 0, 0, .90);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.wcsai-bot-status {
    color: rgba(0, 0, 0, .50);
    font-size: 10px;
    line-height: 1.25;
}

.wcsai-status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    box-shadow: none;
}

.wcsai-header-actions {
    gap: 8px;
}

.wcsai-icon-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .05);
    color: rgba(0, 0, 0, .70);
}

.wcsai-icon-btn:hover,
.wcsai-icon-btn:focus-visible {
    border: 0;
    background: rgba(0, 0, 0, .10);
    color: rgba(0, 0, 0, .70);
    transform: none;
}

.wcsai-messages-container {
    position: relative;
    z-index: 1;
    padding: 16px 24px 24px;
    background: transparent;
}

.wcsai-messages-container>* {
    max-width: 448px;
}

.wcsai-message {
    max-width: 90%;
    margin-bottom: 4px;
    animation: wcsaiLegacyMessageIn .4s ease-out both;
}

@keyframes wcsaiLegacyMessageIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wcsai-message-bubble {
    padding: 10px 16px;
    border: 0;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none;
}

.wcsai-message.user .wcsai-message-bubble {
    border-bottom-left-radius: 4px;
    background: #458cf5;
    color: #fff;
    box-shadow: none;
}

.wcsai-message.assistant .wcsai-message-bubble {
    border: 0;
    border-bottom-right-radius: 4px;
    background: #f0f0f0;
    color: #1a1a1a;
    box-shadow: none;
}

.wcsai-message.assistant .wcsai-message-bubble::before {
    display: none;
}

.wcsai-message-bubble p {
    margin-bottom: 8px;
}

.wcsai-message-bubble strong {
    font-weight: 600;
}

.wcsai-message.assistant .wcsai-message-bubble strong {
    color: inherit;
}

.wcsai-message.user .wcsai-message-bubble strong {
    color: #fff;
}

.wcsai-products-grid {
    max-width: 100%;
    margin-top: 12px;
}

.wcsai-product-card {
    border-radius: 12px;
    border-color: rgba(0, 0, 0, .08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.wcsai-chips-container {
    position: relative;
    z-index: 2;
    padding: 10px 16px;
    border-top: 0;
    background: transparent;
}

.wcsai-chips-label {
    margin-bottom: 6px;
    color: rgba(0, 0, 0, .50);
    font-size: 10px;
    font-weight: 500;
}

.wcsai-chip {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11px;
}

.wcsai-typing-indicator {
    position: relative;
    z-index: 2;
    padding: 0 16px 10px;
    background: transparent;
}

.wcsai-typing-bubble {
    border: 0;
    border-radius: 16px;
    background: #f0f0f0;
    box-shadow: none;
}

.wcsai-chat-footer {
    position: relative;
    z-index: 2;
    padding: 12px 16px 16px;
    border-top: 0;
    background: transparent;
}

.wcsai-chat-form {
    max-width: none;
    padding: 5px 6px 5px 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .90);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.wcsai-chat-form:focus-within {
    border-color: #458cf5;
    box-shadow: 0 0 0 2px rgba(69, 140, 245, .15);
}

.wcsai-chat-input {
    height: 36px !important;
    min-height: 36px !important;
    padding: 8px 2px !important;
    font-size: 13px !important;
}

.wcsai-send-btn {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #458cf5;
    box-shadow: none;
}

.wcsai-send-btn:hover {
    background: #458cf5;
    transform: scale(1.05);
    box-shadow: none;
}

.wcsai-powered-by {
    color: rgba(0, 0, 0, .40);
    font-size: 9px;
}

.wcsai-powered-mark {
    background: #458cf5;
    box-shadow: 0 0 0 3px rgba(69, 140, 245, .10);
}

@media (max-width: 640px) {
    #wcsai-chat-root {
        inset: auto 24px 24px auto;
    }

    .wcsai-widget-position-bottom-left {
        left: 24px !important;
        right: auto !important;
    }

    .wcsai-chat-window,
    .wcsai-widget-position-bottom-left .wcsai-chat-window {
        inset: auto 16px 16px 16px !important;
        width: auto !important;
    }

    .wcsai-chat-panel,
    .wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
        width: 100%;
        height: min(600px, calc(100dvh - 32px));
        border-radius: 24px;
    }
}

/* Final legacy parity lock */
#wcsai-chat-root {
    --wcsai-primary: #458cf5 !important;
    --wcsai-primary-hover: #458cf5 !important;
    --wcsai-primary-soft: rgba(69, 140, 245, .10) !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wcsai-trigger-bg {
    fill: #458cf5;
}

.wcsai-chat-panel {
    isolation: isolate;
}

/* The legacy widget switches to a true fullscreen chat on phones. */
@media (max-width: 640px) {

    .wcsai-chat-window,
    .wcsai-widget-position-bottom-left .wcsai-chat-window {
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 0 !important;
    }

    .wcsai-chat-panel,
    .wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .wcsai-chat-panel::before {
        height: 240px;
    }
}

/* ==========================================================================
   GLASSMORPHISM REDESIGN & ENHANCED TOOLTIP
   ========================================================================== */

/* Enhanced Tooltip for "الذكاء الاصطناعي" */
.wcsai-tooltip-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wcsai-tooltip-subtitle {
    font-size: 10px;
    font-weight: 700;
    color: var(--wcsai-primary);
    background: var(--wcsai-primary-soft);
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.wcsai-tooltip-text-main {
    font-size: 14px;
    font-weight: 800;
    color: var(--wcsai-ink);
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcsai-tooltip-text-main::before {
    content: '👋';
    font-size: 16px;
    display: inline-block;
    animation: wcsaiWave 1.6s ease-in-out 1;
}

/* Tooltip Typing Dots Reset for New Wrapper */
#wcsai-tooltip-text.wcsai-tooltip-text-wrapper {
    display: flex !important;
    opacity: 0;
    animation: wcsaiFadeIn 0.25s forwards;
}

@keyframes wcsaiFadeIn {
    to {
        opacity: 1;
    }
}

/* Glassmorphism Chat Panel */
.wcsai-chat-window,
.wcsai-widget-position-bottom-left .wcsai-chat-window {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.wcsai-chat-panel,
.wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
    background: rgba(255, 255, 255, var(--wcsai-glass-opacity, 0.95)) !important;
    backdrop-filter: blur(var(--wcsai-glass-blur, 25px)) !important;
    -webkit-backdrop-filter: blur(var(--wcsai-glass-blur, 25px)) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    border-radius: 28px !important;
}

.wcsai-chat-panel::before {
    display: none !important;
}

/* Header Glass */
.wcsai-chat-header {
    background: rgba(255, 255, 255, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
}

.wcsai-bot-title {
    color: #0f172a !important;
    font-size: 17px !important;
}

.wcsai-bot-status {
    color: #475569 !important;
}

.wcsai-icon-btn {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Messages Container - Padding away from edges */
.wcsai-messages-container {
    background: transparent !important;
    padding: 40px 30px !important;
}

/* Beautiful Chat Bubbles */
.wcsai-message-bubble {
    padding: 16px 22px !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04) !important;
}

/* User Bubble (Left in RTL) */
.wcsai-message.user .wcsai-message-bubble {
    background: linear-gradient(135deg, var(--wcsai-primary), #6366f1) !important;
    color: #ffffff !important;
    border-radius: 24px 24px 6px 24px !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25) !important;
}

/* Assistant Bubble (Right in RTL) */
.wcsai-message.assistant .wcsai-message-bubble {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #0f172a !important;
    border-radius: 24px 24px 24px 6px !important;
}

/* Footer & Chips Glass */
.wcsai-chips-container {
    background: rgba(255, 255, 255, 0.3) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
}

.wcsai-chip {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #0f172a !important;
}

.wcsai-chat-footer {
    background: rgba(255, 255, 255, 0.4) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(10px);
}

.wcsai-chat-form {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
}

.wcsai-chat-input {
    color: #0f172a !important;
}

.wcsai-chat-input::placeholder {
    color: #64748b !important;
}

/* Tooltip Background transparent remove */
.wcsai-trigger-tooltip {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

@media (max-width: 640px) {

    .wcsai-chat-panel,
    .wcsai-chat-window.wcsai-anim-in .wcsai-chat-panel {
        border-radius: 0 !important;
    }
}

/* Force Default Font & Alignments */
#wcsai-chat-root {
    font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Add Spacing Between Messages */
#wcsai-chat-root .wcsai-message {
    margin-bottom: 28px !important;
}

/* User Message (Aligned Left in RTL) */
[dir="rtl"] #wcsai-chat-root .wcsai-message.user {
    margin-right: auto !important;
    margin-left: 0 !important;
    float: left !important;
    clear: both !important;
}

[dir="rtl"] #wcsai-chat-root .wcsai-message.user .wcsai-message-bubble {
    text-align: left !important;
}

/* Assistant Message (Aligned Right in RTL) */
[dir="rtl"] #wcsai-chat-root .wcsai-message.assistant {
    margin-left: auto !important;
    margin-right: 0 !important;
    float: right !important;
    clear: both !important;
}

[dir="rtl"] #wcsai-chat-root .wcsai-message.assistant .wcsai-message-bubble {
    text-align: right !important;
}

/* Ensure container clears floats */
#wcsai-chat-root .wcsai-messages-container::after {
    content: "";
    display: table;
    clear: both;
}

/* AI Message Header (Avatar + Name) */
.wcsai-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.wcsai-message-avatar-wrap {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wcsai-primary-soft, #eef2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.wcsai-message-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcsai-message-avatar-icon {
    font-size: 16px;
}

.wcsai-message-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--wcsai-ink-soft, #475569);
}

/* Hide old AI badge since we now have a header */
.wcsai-message.assistant .wcsai-message-bubble::before {
    display: none !important;
}

.wcsai-messages-container {
    padding-bottom: 30px !important;
}

/* Shimmer Effect for Typing Text */
.wcsai-typing-text {
    background: linear-gradient(-60deg,
            var(--wcsai-primary) 30%,
            #a5b4fc 50%,
            var(--wcsai-primary) 70%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wcsaiShimmerText 2s infinite linear;
    font-weight: bold !important;
}

@keyframes wcsaiShimmerText {
    0% {
        background-position: 250% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* --- Fixes & Additions --- */
.wcsai-desktop-only {
    display: inline-flex !important;
}

@media (max-width: 768px) {
    .wcsai-desktop-only {
        display: none !important;
    }
}

.wcsai-chat-expanded .wcsai-chat-window {
    inset: 0 !important;
}

.wcsai-chat-expanded .wcsai-chat-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
}

.wcsai-chat-expanded .wcsai-messages-container,
.wcsai-chat-expanded .wcsai-chat-footer {
    max-width: 900px !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
}

.wcsai-chat-expanded .wcsai-chat-header {
    max-width: 900px !important;
    margin: 0 auto !important;
    width: 100% !important;
    border-bottom: none !important;
}

.wcsai-chat-panel {
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), height 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Confirm Dialog UI */
.wcsai-confirm-dialog {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcsai-confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-radius: inherit;
}

.wcsai-confirm-content {
    position: relative;
    z-index: 10;
    background: var(--wcsai-surface);
    padding: 32px 24px;
    border-radius: 20px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: wcsaiPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes wcsaiPopIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.wcsai-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fee2e2;
    color: #ef4444;
    margin-bottom: 16px;
}

.wcsai-confirm-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--wcsai-ink);
}

.wcsai-confirm-text {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--wcsai-ink-soft);
    line-height: 1.5;
}

.wcsai-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wcsai-confirm-actions button {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.wcsai-btn-confirm-yes {
    background: #ef4444;
    color: #fff;
}

.wcsai-btn-confirm-yes:hover {
    background: #dc2626;
}

.wcsai-btn-confirm-no {
    background: #f1f5f9;
    color: #475569;
}

.wcsai-btn-confirm-no:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Mobile Keyboard Fix */
@media (max-width: 640px) {
    .wcsai-chat-window.wcsai-anim-in {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100% !important;
        height: 100dvh !important;
    }

    .wcsai-chat-panel {
        height: 100% !important;
        border-radius: 0 !important;
    }
}

/* WooCommerce View Cart Button */
.wcsai-product-card-actions a.added_to_cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: #e2e8f0;
    color: #1e293b;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.wcsai-product-card-actions a.added_to_cart:hover {
    background: #cbd5e1;
    color: #0f172a;
}