/* ═══════════════════════════════════════════════════════════════════════════
   JuliaBot — Floating Chat Widget
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --julia-primary: var(--fmi-julia-accent, #6d28d9);
    --julia-primary-dk: color-mix(in srgb, var(--julia-primary) 80%, #000);
    --julia-white: #ffffff;
    --julia-bg: #f4f4f8;
    --julia-user-bg: var(--julia-primary);
    --julia-bot-bg: #ffffff;
    --julia-text: #1f2937;
    --julia-subtext: #6b7280;
    --julia-border: #e5e7eb;
    --julia-radius: 18px;
    --julia-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    --julia-w: 370px;
    --julia-h: 520px;
    --julia-z: 99999;
}

#julia-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: var(--julia-z);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--julia-primary);
    box-shadow: 0 4px 18px rgba(109, 40, 217, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
}

#julia-bubblesvg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

#julia-bubble.julia-open .julia-icon-chat {
    display: none;
}

#julia-bubble.julia-open .julia-icon-close {
    display: block;
}

#julia-bubble .julia-icon-close {
    display: none;
}

#julia-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    display: none;
}

#julia-badge.visible {
    display: block;
}

#julia-window {
    position: fixed;
    bottom: 104px;
    right: 28px;
    z-index: var(--julia-z);
    width: var(--julia-w);
    max-width: calc(100vw - 24px);
    height: var(--julia-h);
    max-height: calc(100vh - 130px);
    background: var(--julia-white);
    border-radius: var(--julia-radius);
    box-shadow: var(--julia-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), opacity .2s;
}

#julia-window.julia-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

#julia-header {
    background: var(--julia-primary);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.julia-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.julia-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.julia-status {
    color: rgba(255, 255, 255, .75);
    font-size: 11.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.julia-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    animation: julia-pulse 2s infinite;
}

@keyframes julia-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

#julia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: var(--julia-bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.julia-msg {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: julia-msg-in .25s ease-out;
}

@keyframes julia-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

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

.julia-bubble-text {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.julia-user .julia-bubble-text {
    background: var(--julia-user-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.julia-bot .julia-bubble-text {
    background: var(--julia-bot-bg);
    color: var(--julia-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--julia-border);
}

.julia-time {
    font-size: 10.5px;
    color: var(--julia-subtext);
    margin-top: 3px;
}

.julia-dots {
    display: flex;
    gap: 4px;
    height: 16px;
    align-items: center;
}

.julia-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--julia-subtext);
    animation: julia-dot 1.2s infinite;
}

@keyframes julia-dot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Congestion Notice */
.julia-congestion-notice {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    margin: 4px 14px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: julia-msg-in .3s ease;
}

.julia-congestion-notice.active {
    display: flex;
}

#julia-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--julia-border);
    background: #fff;
}

#julia-input {
    flex: 1;
    border: 1px solid var(--julia-border);
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 13.5px;
    outline: none;
    resize: none;
    max-height: 120px;
}

#julia-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--julia-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#julia-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

#julia-footer {
    text-align: center;
    font-size: 10.5px;
    color: var(--julia-subtext);
    padding: 6px;
    background: #fafafa;
    border-top: 1px solid var(--julia-border);
}

#julia-footer a {
    color: var(--julia-primary);
    text-decoration: none;
}

@media (max-width: 480px) {
    :root {
        --julia-w: 100vw;
        --julia-h: 100svh;
    }

    #julia-window {
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100svh;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FoxMakers — Interactive Product Cards for Chat Widget
   ═══════════════════════════════════════════════════════════════════════════ */

.fxhub-products-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 8px 0;
    width: 100%;
}

.fxhub-product-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    border-radius: 14px;
    padding: 10px;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.fxhub-product-card:hover {
    border-color: #ff8800;
    box-shadow: 0 4px 14px rgba(255, 136, 0, 0.15);
    transform: translateY(-1px);
}

.fxhub-p-img-wrap {
    width: 68px;
    height: 68px;
    min-width: 68px;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.fxhub-p-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.fxhub-product-card:hover .fxhub-p-img {
    transform: scale(1.05);
}

.fxhub-p-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fxhub-p-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff8800;
}

.fxhub-p-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fxhub-p-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.fxhub-p-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.fxhub-p-price {
    font-size: 14px;
    font-weight: 900;
    color: #0f172a;
}

.fxhub-p-regular {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
}

.fxhub-p-stock {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.fxhub-p-stock.onbackorder {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.fxhub-p-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.fxhub-btn-view {
    background: #f1f5f9;
    color: #334155 !important;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}

.fxhub-btn-view:hover {
    background: #e2e8f0;
}

.fxhub-btn-cart {
    background: #ff8800;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, transform 0.1s;
    box-shadow: 0 2px 6px rgba(255, 136, 0, 0.25);
}

.fxhub-btn-cart:hover {
    background: #ea580c;
    transform: translateY(-1px);
}

.fxhub-shipping-banner {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 11px;
    color: #9a3412;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}


/* Clean Input Form & No Scrollbar Arrows */
#julia-input-area {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 20px 20px !important;
}

#julia-input {
    flex: 1 !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 24px !important;
    padding: 10px 16px !important;
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    outline: none !important;
    resize: none !important;
    overflow-y: hidden !important;
    max-height: 96px !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

#julia-input:focus {
    border-color: #ea580c !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15) !important;
}

#julia-send {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

#julia-send:hover {
    transform: scale(1.06) !important;
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.45) !important;
}

#julia-send:active {
    transform: scale(0.95) !important;
}

#julia-send svg {
    width: 17px !important;
    height: 17px !important;
    fill: #ffffff !important;
    margin-left: 2px !important;
}
