/* Zopnexa website AI chat widget (views/front/partials/chat_widget.php + js/chat-widget.js) */
.zpx-chat {
    --zc-brand: #6d28d9; --zc-brand-dark: #4c1d95; --zc-accent: #f7811e;
    --zc-bg: #ffffff; --zc-soft: #f5f3ff; --zc-line: #ece9f5; --zc-text: #1f2937; --zc-muted: #6b7280;
    --zc-bot: #f3f4f6; --zc-user: #6d28d9; --zc-user-text: #fff; --zc-shadow: 0 18px 50px rgba(30, 10, 76, .22);
    font-family: 'Hind Siliguri', 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
    .zpx-chat { --zc-bg: #17151f; --zc-soft: #221d33; --zc-line: #2f2a40; --zc-text: #ececf1; --zc-muted: #a3a3b5; --zc-bot: #24212f; }
}

/* launcher: sits above the WhatsApp button (WhatsApp: bottom 86px desktop / 84px phone) */
.zpx-chat-launch {
    position: fixed; right: 23px; bottom: calc(152px + env(safe-area-inset-bottom, 0px)); z-index: 999;
    width: 54px; height: 54px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--zc-brand) 0%, var(--zc-brand-dark) 100%); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(109, 40, 217, .45);
    transition: transform .2s, box-shadow .2s;
}
.zpx-chat-launch:hover { transform: scale(1.07); }
.zpx-chat-launch:focus-visible { outline: 3px solid var(--zc-accent); outline-offset: 3px; }
.zpx-chat-launch svg { width: 26px; height: 26px; }
.zpx-chat-launch .zc-ai { position: absolute; top: -4px; right: -6px; background: var(--zc-accent); color: #fff; font: 700 10px/1 system-ui, sans-serif; padding: 3px 5px; border-radius: 8px; border: 2px solid #fff; }
.zpx-chat.is-open .zpx-chat-launch { transform: scale(.9); }
@media (max-width: 767px) { .zpx-chat-launch { width: 50px; height: 50px; right: 25px; bottom: calc(146px + env(safe-area-inset-bottom, 0px)); } }
/* landing pages: no WhatsApp float; phones have the sticky order bar (hidden from 992px) */
.lp-body .zpx-chat-launch { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 991px) { .lp-body .zpx-chat-launch { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); } }

/* panel */
.zpx-chat-panel {
    position: fixed; right: 24px; bottom: 24px; z-index: 10000; width: 380px; max-width: calc(100vw - 32px);
    height: min(640px, calc(100vh - 48px)); background: var(--zc-bg); color: var(--zc-text);
    border-radius: 18px; box-shadow: var(--zc-shadow); display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; transition: opacity .2s, transform .2s;
}
.zpx-chat.is-open .zpx-chat-panel { opacity: 1; transform: none; pointer-events: auto; }
.zpx-chat-panel[hidden] { display: none; }
@media (max-width: 575px) {
    .zpx-chat-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
    html.zpx-chat-lock, html.zpx-chat-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .zpx-chat-panel, .zpx-chat-launch { transition: none; } }

.zc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: linear-gradient(135deg, var(--zc-brand) 0%, var(--zc-brand-dark) 100%); color: #fff; }
.zc-head img { width: 36px; height: 36px; border-radius: 50%; background: #fff; object-fit: contain; padding: 4px; flex: 0 0 36px; }
.zc-title { flex: 1; min-width: 0; line-height: 1.25; }
.zc-title b { display: block; font-size: 15px; font-weight: 700; color: #fff; }
.zc-title span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .92; }
.zc-title span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.zc-hbtn { width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.zc-hbtn:hover { background: rgba(255, 255, 255, .26); }
.zc-hbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.zc-hbtn svg { width: 18px; height: 18px; }
.zc-new { width: auto; padding: 0 10px; font-weight: 600; }

.zc-note { font-size: 11.5px; line-height: 1.45; color: var(--zc-muted); background: var(--zc-soft); padding: 7px 14px; border-bottom: 1px solid var(--zc-line); }
.zc-note a { color: var(--zc-brand); font-weight: 600; }

.zc-log { flex: 1; overflow-y: auto; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; scroll-behavior: smooth; }
/* nothing in the message list may shrink: the card row (overflow-x) would otherwise collapse to a thin line once the chat is long */
.zc-log > * { flex-shrink: 0; }
.zc-msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.zc-bot { align-self: flex-start; background: var(--zc-bot); color: var(--zc-text); border-bottom-left-radius: 5px; }
.zc-user { align-self: flex-end; background: var(--zc-user); color: var(--zc-user-text); border-bottom-right-radius: 5px; }
.zc-bot a { color: var(--zc-brand); font-weight: 600; text-decoration: underline; }
.zc-user.is-failed { opacity: .7; }
.zc-meta { align-self: flex-end; font-size: 11.5px; color: #b91c1c; margin-top: -4px; }
.zc-err { align-self: flex-start; max-width: 90%; font-size: 13.5px; line-height: 1.5; padding: 9px 13px; border-radius: 12px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.zc-err button { margin-top: 6px; display: inline-block; border: 0; border-radius: 8px; padding: 5px 12px; background: #b91c1c; color: #fff; font-weight: 600; cursor: pointer; }

.zc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--zc-bot); border-radius: 16px; border-bottom-left-radius: 5px; }
.zc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--zc-muted); animation: zcDot 1.2s infinite ease-in-out; }
.zc-typing i:nth-child(2) { animation-delay: .15s; } .zc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes zcDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.zc-cards { align-self: stretch; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.zc-card { flex: 0 0 168px; background: var(--zc-bg); border: 1px solid var(--zc-line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; color: var(--zc-text); }
.zc-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f4f4f5; display: block; }
.zc-card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.zc-card-name { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.zc-card-price { font-size: 14px; font-weight: 700; color: var(--zc-brand); }
.zc-card-price s { font-size: 12px; font-weight: 400; color: var(--zc-muted); margin-left: 4px; }
.zc-card-stock { font-size: 11.5px; color: #047857; } .zc-card-stock.is-out { color: #b91c1c; }
.zc-card a { margin-top: auto; display: block; text-align: center; padding: 7px 8px; border-radius: 8px; background: var(--zc-brand); color: #fff !important; font-size: 12.5px; font-weight: 600; text-decoration: none; }

.zc-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.zc-sug { border: 1px solid var(--zc-brand); background: var(--zc-bg); color: var(--zc-brand); border-radius: 18px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.zc-sug:hover, .zc-sug:focus-visible { background: var(--zc-soft); }

.zc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--zc-line); background: var(--zc-bg); }
.zc-input { flex: 1; min-width: 0; resize: none; max-height: 120px; min-height: 42px; border: 1px solid var(--zc-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.4; color: var(--zc-text); background: var(--zc-soft); }
.zc-input:focus { outline: none; border-color: var(--zc-brand); box-shadow: 0 0 0 3px rgba(109, 40, 217, .14); background: var(--zc-bg); }
.zc-send { width: 42px; height: 42px; flex: 0 0 42px; border: 0; border-radius: 12px; background: var(--zc-accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.zc-send:disabled { opacity: .45; cursor: default; }
.zc-send svg { width: 20px; height: 20px; }
.zc-count { font-size: 11px; color: var(--zc-muted); text-align: right; padding: 0 14px 6px; margin-top: -6px; }
.zc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* "before you chat" form: name + mobile */
.zc-profile { align-self: stretch; background: var(--zc-soft); border: 1px solid var(--zc-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.zc-profile-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--zc-text); }
.zc-field { width: 100%; height: 44px; border: 1px solid var(--zc-line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--zc-text); background: var(--zc-bg); }
.zc-field:focus { outline: none; border-color: var(--zc-brand); box-shadow: 0 0 0 3px rgba(109, 40, 217, .14); }
.zc-field-err { min-height: 0; font-size: 12px; color: #b91c1c; }
.zc-field-err:empty { display: none; }
.zc-start { margin-top: 4px; height: 44px; border: 0; border-radius: 10px; background: var(--zc-brand); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.zc-start:disabled { opacity: .6; cursor: default; }
.zc-profile-note { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--zc-muted); }
.zc-profile-note a { color: var(--zc-brand); font-weight: 600; }
.zc-form[hidden] { display: none; }
.zc-sugs[hidden] { display: none; }

/* ordering in the chat: "অর্ডার করুন" on cards, step panels (options → cart → details → summary → code → account) */
.zc-card .zc-card-order { margin-top: 5px; display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: var(--zc-accent); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.zc-card .zc-card-order:hover { filter: brightness(.95); }
.zc-card .zc-card-order:focus-visible { outline: 2px solid var(--zc-brand); outline-offset: 2px; }
.zc-cartbtn { position: relative; width: auto; padding: 0 8px; gap: 3px; }
.zc-cartbtn[hidden] { display: none; }
.zc-cart-n { font-size: 12px; font-weight: 700; }
.zc-panel { align-self: stretch; background: var(--zc-bg); border: 1px solid var(--zc-line); border-left: 3px solid var(--zc-brand); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--zc-text); }
.zc-panel form { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.zc-panel-title { font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.zc-panel-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--zc-muted); }
.zc-panel-err { font-size: 13px; color: #b91c1c; }
.zc-panel-err:empty { display: none; }
.zc-flabel { font-size: 12.5px; font-weight: 600; color: var(--zc-muted); margin-top: 2px; }
.zc-panel .zc-field { height: 40px; font-size: 14.5px; }
.zc-panel select.zc-field { padding: 0 8px; }
.zc-panel .zc-area { height: auto; min-height: 58px; padding: 8px 12px; resize: vertical; font: inherit; font-size: 14.5px; }
.zc-pick-head { display: flex; gap: 10px; align-items: center; }
.zc-pick-head img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #f4f4f5; flex: 0 0 56px; }
.zc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-chip { border: 1px solid var(--zc-line); background: var(--zc-soft); color: var(--zc-text); border-radius: 18px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.zc-chip.is-on { border-color: var(--zc-brand); background: var(--zc-brand); color: #fff; }
.zc-chip.is-out, .zc-chip:disabled { opacity: .45; text-decoration: line-through; cursor: default; }
.zc-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.zc-qty-row .zc-flabel { margin: 0 auto 0 0; }
.zc-qbtn { min-width: 32px; height: 32px; border: 1px solid var(--zc-line); border-radius: 8px; background: var(--zc-soft); color: var(--zc-text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.zc-qbtn:disabled { opacity: .4; cursor: default; }
.zc-qn { min-width: 24px; text-align: center; font-weight: 700; }
.zc-pactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.zc-pbtn { min-height: 38px; border-radius: 10px; padding: 0 14px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.zc-pbtn:disabled { opacity: .55; cursor: default; }
.zc-primary { border: 0; background: var(--zc-brand); color: #fff; }
.zc-ghost { border: 1px solid var(--zc-line); background: var(--zc-bg); color: var(--zc-text); }
.zc-pbtn:focus-visible, .zc-chip:focus-visible, .zc-qbtn:focus-visible { outline: 2px solid var(--zc-accent); outline-offset: 2px; }
.zc-line { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--zc-line); }
.zc-line-info { flex: 1; min-width: 0; }
.zc-line-name { font-weight: 600; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.zc-line-sub { font-size: 12.5px; color: var(--zc-muted); }
.zc-line-bad { font-size: 12px; color: #b91c1c; font-weight: 600; }
.zc-line-q { display: flex; gap: 4px; flex: 0 0 auto; }
.zc-line-q .zc-qbtn { min-width: 28px; height: 28px; font-size: 13px; }
.zc-total { text-align: right; font-weight: 700; font-size: 13.5px; }
.zc-sum-row { font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.zc-sum-money { background: var(--zc-soft); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.zc-sum-money div { display: flex; justify-content: space-between; gap: 8px; }
.zc-sum-money .is-total { border-top: 1px solid var(--zc-line); padding-top: 4px; margin-top: 2px; font-size: 15px; color: var(--zc-brand); }
.zc-otp-in { letter-spacing: .35em; text-align: center; font-size: 20px !important; font-weight: 700; }
