:root{
    --zl-ink:#0f1218;
    --zl-gold:#d8ad2f;
    --zl-gold-soft:#f4d875;
    --zl-cyan:#00bfe8;
    --zl-muted:#6b7280;
    --zl-line:#ece5d7;
    --zl-shadow:0 24px 70px rgba(0,0,0,.22);
}

.chat-container,
.chat-container *,
.chat-launcher,
.chat-launcher *{
    box-sizing:border-box;
}

.chat-container{
    position:fixed;
    right:24px;
    bottom:96px;
    z-index:999999;
    width:min(410px, calc(100vw - 32px));
    max-height:calc(100vh - 124px);
    max-height:calc(100dvh - 124px);
    display:flex;
    flex-direction:column;
    background:linear-gradient(180deg,#fffdf8 0%,#f7f2e8 100%);
    border:1px solid rgba(216,173,47,.36);
    border-radius:18px;
    overflow:hidden;
    box-shadow:var(--zl-shadow);
    font-family:"Inter","Segoe UI",Arial,sans-serif;
    color:var(--zl-ink);
    opacity:0;
    pointer-events:none;
    transform:translateY(18px) scale(.96);
    transform-origin:bottom right;
    transition:opacity .22s ease, transform .22s ease;
}

.chat-container.is-open{
    opacity:1;
    pointer-events:auto;
    transform:translateY(0) scale(1);
}

.chat-container .header{
    position:relative;
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
    background:linear-gradient(135deg,#0e0e10 0%,#1c1a16 55%,#2b2414 100%);
    color:#fff;
    padding:14px 14px 14px 16px;
    border-bottom:1px solid rgba(244,216,117,.22);
    box-shadow:0 6px 22px rgba(0,0,0,.28);
}

.chat-container .header-avatar{
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    flex:0 0 42px;
    border-radius:50%;
    background:radial-gradient(circle at 30% 25%,rgba(216,173,47,.35),rgba(216,173,47,.08) 70%);
    border:1px solid rgba(244,216,117,.85);
    box-shadow:0 0 0 4px rgba(216,173,47,.08), inset 0 0 16px rgba(216,173,47,.18);
}

.chat-container .header-text{
    display:flex;
    flex-direction:column;
    gap:2px;
    flex:1;
    min-width:0;
}

.chat-container .header-title{
    font-size:15px;
    font-weight:800;
    letter-spacing:.6px;
    line-height:1.2;
    text-transform:uppercase;
    background:linear-gradient(90deg,#fff,var(--zl-gold-soft));
    -webkit-background-clip:text;
    background-clip:text;
    -webkit-text-fill-color:transparent;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.chat-container .header-status{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:11px;
    font-weight:600;
    letter-spacing:.4px;
    color:rgba(255,255,255,.7);
    text-transform:uppercase;
}

.chat-container .status-dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:#36d27a;
    box-shadow:0 0 0 0 rgba(54,210,122,.7);
    animation:zlpulse 1.8s infinite;
}

@keyframes zlpulse{
    0%{ box-shadow:0 0 0 0 rgba(54,210,122,.6); }
    70%{ box-shadow:0 0 0 7px rgba(54,210,122,0); }
    100%{ box-shadow:0 0 0 0 rgba(54,210,122,0); }
}

.chat-container .chat-close{
    width:34px;
    height:34px;
    flex:0 0 34px;
    display:grid;
    place-items:center;
    border:1px solid rgba(244,216,117,.2);
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:24px;
    line-height:1;
	font-family: auto !important; 
    cursor:pointer;
    box-shadow:none;
    padding:0;
}

.chat-container .chat-close:hover{
    transform:translateY(-1px);
    background:rgba(216,173,47,.18);
    box-shadow:0 10px 22px rgba(0,0,0,.22);
}

.chat-launcher{
    position:fixed;
    right:24px;
    bottom:24px;
    z-index:999998;
    width:64px;
    height:64px;
    display:grid;
    place-items:center;
    border:1px solid rgba(244,216,117,.42);
    border-radius:50%;
    background:linear-gradient(145deg,#111 0%,#222 55%,#d8ad2f 140%);
    color:#fff;
    cursor:pointer;
    padding:0;
    box-shadow:0 18px 42px rgba(0,0,0,.28), 0 0 0 7px rgba(216,173,47,.08);
    transition:opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.chat-launcher:hover{
    transform:translateY(-2px) scale(1.03);
    box-shadow:0 22px 50px rgba(0,0,0,.32), 0 0 0 8px rgba(216,173,47,.12);
}

.chat-launcher.is-hidden{
    opacity:0;
    pointer-events:none;
    transform:translateY(10px) scale(.9);
}

.launcher-bubble{
    position:relative;
    width:34px;
    height:34px;
    background-repeat:no-repeat;
    background-position:center;
    background-size:contain;
    /* Robotic AI head icon (inline SVG, no external file needed) */
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3v3'/><circle cx='12' cy='2.4' r='1.1' fill='%23ffffff' stroke='none'/><rect x='4.5' y='6' width='15' height='12' rx='3.5'/><circle cx='9' cy='12' r='1.5'/><circle cx='15' cy='12' r='1.5'/><path d='M9.5 16h5'/></svg>");
}

.chat-container .messages{
    display:flex;
    flex:1 1 auto;
    flex-direction:column;
    gap:16px;
    min-height:320px;
    height:min(560px, calc(100vh - 250px));
    overflow-y:auto;
    padding:20px 18px 16px;
    background:
        linear-gradient(180deg,rgba(255,255,255,.72),rgba(250,246,237,.94)),
        radial-gradient(circle at top right,rgba(0,191,232,.08),transparent 32%);
    scrollbar-color:var(--zl-gold) #efe7d8;
}

.chat-container .user-message,
.chat-container .ai-message{
    width:fit-content;
    line-height:1.6;
    box-shadow:0 10px 28px rgba(17,17,17,.08);
}

.chat-container .user-message{
    max-width:78%;
    margin-left:auto;
    padding:13px 17px;
    border-radius:18px 18px 5px 18px;
    background:linear-gradient(135deg,#111,#252525);
    color:#fff;
    border:1px solid rgba(244,216,117,.3);
}

.chat-container .ai-message{
    max-width:84%;
    margin:0;
    padding:16px 17px;
    border-radius:18px 18px 18px 5px;
    background:rgba(255,255,255,.9);
    color:#2f3540;
    border:1px solid rgba(216,173,47,.18);
    position:relative;
}

.chat-container .results-header{
    margin:4px 0 -4px;
    color:#5c5140;
    font-size:14px;
    font-weight:700;
    letter-spacing:.15px;
}

.chat-container .product-card{
    padding:12px;
    background:rgba(255,255,255,.94);
    border:1px solid rgba(216,173,47,.26);
    border-radius:14px;
    box-shadow:0 18px 38px rgba(20,20,20,.12);
}

.chat-container .product-card img{
    display:block;
    width:100%;
    height:190px;
    object-fit:cover;
    border-radius:10px;
    border:1px solid rgba(216,173,47,.18);
    background:#f4efe4;
}

.chat-container .product-info h3{
    font-size:17px;
    font-weight:800;
    margin:14px 0 8px;
    color:#111;
    line-height:1.35;
}

.chat-container .rating-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0 0 10px;
    color:#6f634e;
    font-size:13px;
    font-weight:700;
}

.chat-container .rating-stars{
    display:inline-flex;
    align-items:center;
    gap:2px;
    line-height:1;
}

.chat-container .rating-star{
    color:#d8d3c8;
    font-size:15px;
    text-shadow:0 1px 0 rgba(255,255,255,.8);
}

.chat-container .rating-star.active{
    color:var(--zl-gold);
    text-shadow:0 4px 10px rgba(216,173,47,.28);
}

.chat-container .rating-text{
    color:#7b7162;
    white-space:nowrap;
}

.chat-container .price{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:28px;
    color:#0f8f5b;
    font-weight:900;
    margin:6px 0 12px;
}

.chat-container .badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:12px;
}

.chat-container .badge{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:6px 11px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}

.chat-container .stock{
    background:#ecf9ef;
    color:#14753b;
}

.chat-container .stock::before,
.chat-container .out::before{
    content:"";
    width:7px;
    height:7px;
    border-radius:50%;
}

.chat-container .stock::before{
    background:#22c55e;
    box-shadow:0 0 0 4px rgba(34,197,94,.12);
}

.chat-container .out{
    background:#fff0ee;
    color:#bd2c1f;
}

.chat-container .out::before{
    background:#ef4444;
    box-shadow:0 0 0 4px rgba(239,68,68,.12);
}

.chat-container .category{
    background:rgba(216,173,47,.12);
    color:#9a7415;
}

.chat-container .description{
    color:var(--zl-muted);
    font-size:13px;
    line-height:1.65;
    margin:14px 0;
}

.chat-container .description img,
.chat-container .description picture,
.chat-container .description figure,
.chat-container .description video,
.chat-container .description iframe{
    display:none !important;
}

.chat-container .view-btn,
.chat-container #send{
    background:linear-gradient(135deg,var(--zl-gold),#f0c642);
    color:#111;
    border:none;
    cursor:pointer;
    font-weight:900;
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.chat-container .view-btn{
    width:100%;
    display:block;
    text-align:center;
    padding:13px 15px;
    border-radius:9px;
    text-decoration:none;
    box-shadow:0 12px 22px rgba(216,173,47,.22);
}

.chat-container .view-btn:hover,
.chat-container #send:hover{
    transform:translateY(-1px);
    filter:saturate(1.08);
    box-shadow:0 14px 28px rgba(216,173,47,.3);
}

.chat-container .input-area{
    display:flex;
    position:sticky;
    bottom:0;
    flex:0 0 auto;
    background:#fff;
    border-top:1px solid var(--zl-line);
    box-shadow:0 -12px 28px rgba(17,17,17,.08);
}

.chat-container input{
    flex:1;
    min-width:0;
    padding:18px;
    border:none;
    outline:none;
    color:#111;
    font-size:15px;
    background:#fff;
}

.chat-container input::placeholder{
    color:#8b8f98;
}

.chat-container #send{
    width:112px;
    flex:0 0 112px;
    font-size:14px;
}

.chat-container .loading{
    display:inline-flex;
    align-items:center;
    gap:7px;
    min-width:70px;
    padding-block:15px;
}

.chat-container .loading span{
    width:8px;
    height:8px;
    border-radius:50%;
    background:linear-gradient(135deg,var(--zl-gold),var(--zl-gold-soft));
    box-shadow:0 4px 12px rgba(216,173,47,.32);
    animation:typingWave 1.05s ease-in-out infinite;
}

.chat-container .loading span:nth-child(2){
    animation-delay:.15s;
}

.chat-container .loading span:nth-child(3){
    animation-delay:.3s;
}

@keyframes typingWave{
    0%, 60%, 100%{
        opacity:.42;
        transform:translateY(0) scale(.86);
    }

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

@media (max-width:520px){
    .chat-container{
        /* Centered on screen for mobile */
        top:50%;
        left:50%;
        right:auto;
        bottom:auto;
        transform:translate(-50%,-50%) scale(.96);
        width:min(440px, calc(100vw - 24px));
        max-height:calc(100vh - 48px);
        max-height:calc(100dvh - 48px);
        border-radius:16px;
    }

    .chat-container.is-open{
        transform:translate(-50%,-50%) scale(1);
    }

    .chat-launcher{
        right:16px;
        bottom:16px;
        width:56px;
        height:56px;
    }

    .chat-container .messages{
        min-height:260px;
        height:calc(100vh - 240px);
        height:calc(100dvh - 240px);
        padding:18px 14px 16px;
    }

    .chat-container .header{
        padding:14px 12px 14px 16px;
        font-size:17px;
    }

    .chat-container .rating-row{
        flex-wrap:wrap;
    }

    /* Keep the text field usable on narrow phones */
    .chat-container input{
        padding:14px;
        font-size:16px; /* >=16px prevents iOS zoom-on-focus */
    }

    .chat-container #send{
        width:84px;
        flex:0 0 84px;
        font-size:13px;
    }

    .chat-container .product-card img{
        height:160px;
    }

    .chat-container .price{
        font-size:24px;
    }

    .chat-container .product-info h3{
        font-size:16px;
    }
}

@media (max-width:380px){
    .chat-container{
        top:50%;
        left:50%;
        right:auto;
        bottom:auto;
        transform:translate(-50%,-50%) scale(.96);
        width:calc(100vw - 16px);
        max-height:calc(100vh - 32px);
        max-height:calc(100dvh - 32px);
        border-radius:14px;
    }

    .chat-container.is-open{
        transform:translate(-50%,-50%) scale(1);
    }

    .chat-launcher{
        right:12px;
        bottom:12px;
        width:52px;
        height:52px;
    }

    .chat-container .messages{
        padding:14px 10px 14px;
        gap:14px;
    }

    .chat-container .header{
        font-size:16px;
    }

    .chat-container .user-message,
    .chat-container .ai-message{
        max-width:90%;
    }

    .chat-container .product-card img{
        height:140px;
    }

    .chat-container #send{
        width:74px;
        flex:0 0 74px;
    }
}

/* Short landscape phones: cap height so the panel never exceeds the screen */
@media (max-height:520px){
    .chat-container{
        top:12px;
        bottom:12px;
        right:12px;
        left:auto;
        max-height:none;
        height:calc(100vh - 24px);
        height:calc(100dvh - 24px);
    }

    .chat-container .messages{
        height:auto;
        min-height:0;
        flex:1 1 auto;
    }
}

.show-more-btn{
    display:block;
    width:100%;
    margin:10px 0 4px;
    padding:10px 14px;
    border:1px solid var(--zl-gold, #d8ad2f);
    border-radius:12px;
    background:transparent;
    color:var(--zl-gold, #d8ad2f);
    font:600 13px/1.2 inherit;
    cursor:pointer;
    transition:background .15s ease,color .15s ease;
}

.show-more-btn:hover{
    background:var(--zl-gold, #d8ad2f);
    color:#1b1b1b;
}

