/* Live chat widget (partials/live-chat.blade.php, js/live-chat.js) -- replaces the plain floating
   WhatsApp button, ported from ilmcode-printing's own Live Chat. Themed with this product's own
   brand variables (site-chrome.css: --sc-navy, --shop-primary) instead of printing's teal/yellow. */
.lvc { --lvc-teal: var(--sc-navy, #0b1120); --lvc-teal-2: var(--sc-navy-2, #111a2e); --lvc-accent: var(--shop-primary, #4f46e5); --lvc-line: #e2e8f0; --lvc-soft: #f1f5f9; --lvc-text: #0f172a; --lvc-muted: #64748b; }
.lvc, .lvc * { box-sizing: border-box; }

/* The launcher: bottom-left (owner, 2026-10-09), a red box with the icon, "Live Chat" and a light (green = staff online, grey = away). */
.lvc { --lvc-red: #dc2626; --lvc-red-2: #b91c1c; }
.lvc-launcher {
    position: fixed; left: 40px; bottom: 20px; z-index: 1040;
    height: 42px; padding: 0 13px 0 11px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--lvc-red); color: #fff; box-shadow: 0 10px 28px rgba(220, 38, 38, .35);
    display: flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: .01em;
    transition: transform .2s ease, background .2s ease;
}
.lvc-launcher:hover { transform: translateY(-2px); background: var(--lvc-red-2); }
.lvc-launcher:focus-visible { outline: 3px solid var(--lvc-accent); outline-offset: 3px; }
.lvc-launcher-ico { position: relative; width: 17px; height: 17px; flex: none; }
.lvc-launcher-ico > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .2s ease, transform .2s ease; }
.lvc-launcher-ico svg, .lvc-launcher-ico i { width: 16px !important; height: 16px; font-size: 16px; }
.lvc-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.lvc.is-open .lvc-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.lvc.is-open .lvc-ico-close { opacity: 1; transform: none; }
.lvc-launcher-text { white-space: nowrap; }
.lvc-light { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #cbd5e1; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.lvc.is-online .lvc-light { background: #22c55e; box-shadow: 0 0 0 2px #fff; animation: lvc-pulse 2s ease-out infinite; }
@keyframes lvc-pulse { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgba(34, 197, 94, .7); } 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 10px rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .lvc.is-online .lvc-light { animation: none; } }
.lvc-badge {
    position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
    background: #ef4444; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 21px; text-align: center;
    border: 2px solid #fff;
}
.lvc-badge[hidden] { display: none; }

/* The one-time "we're online" nudge bubble, pointing down at the launcher. */
.lvc-nudge {
    position: fixed; left: 40px; bottom: 72px; z-index: 1039;
    max-width: 230px; padding: 12px 26px 12px 14px; border-radius: 14px;
    background: #fff; color: var(--lvc-text); box-shadow: 0 14px 34px rgba(15, 23, 42, .22), 0 0 0 1px rgba(15, 23, 42, .06);
    font-size: 13px; line-height: 1.4; cursor: pointer;
    animation: lvc-nudge-in .25s ease;
}
.lvc-nudge[hidden] { display: none; }
.lvc-nudge::after {
    content: ''; position: absolute; left: 22px; bottom: -7px; width: 14px; height: 14px;
    background: #fff; transform: rotate(45deg); box-shadow: 2px 2px 3px rgba(15, 23, 42, .06);
}
.lvc-nudge p { margin: 0; }
.lvc-nudge-close {
    position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border: 0; border-radius: 50%;
    background: transparent; color: var(--lvc-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lvc-nudge-close:hover { background: var(--lvc-soft); color: var(--lvc-text); }
.lvc-nudge-close svg, .lvc-nudge-close i { width: 11px !important; height: 11px; font-size: 11px; }
@keyframes lvc-nudge-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

.lvc-panel {
    position: fixed; left: 40px; bottom: 72px; z-index: 1041;
    width: 330px; max-width: calc(100vw - 24px); height: auto; max-height: calc(100vh - 100px);
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; color: var(--lvc-text); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28), 0 0 0 1px rgba(15, 23, 42, .06);
    font-size: 13.5px; line-height: 1.45;
    animation: lvc-in .22s ease;
}
.lvc-panel[hidden] { display: none; }
@keyframes lvc-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.lvc-head { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; background: var(--lvc-teal); color: #fff; flex: none; }
.lvc-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--lvc-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.lvc-avatar svg { width: 18px !important; height: 18px; }
.lvc-head-text { flex: 1; min-width: 0; }
.lvc-head-text strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvc-head-text small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; opacity: .85; }
.lvc-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: none; }
.lvc.is-online .lvc-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.lvc .lvc-when-on, .lvc.is-online .lvc-when-off { display: none; }
.lvc.is-online .lvc-when-on { display: inline; }
.lvc-x, .lvc-end { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; }
.lvc-x:hover, .lvc-end:hover { background: rgba(255, 255, 255, .22); }
.lvc-x svg, .lvc-end svg { width: 15px !important; height: 15px; }
/* "End chat" only makes sense once a conversation is actually going, not on the empty name/phone form. */
.lvc-end { display: none; }
.lvc.is-chatting .lvc-end { display: flex; }

.lvc-start { padding: 13px; overflow-y: auto; flex: 1; background: var(--lvc-soft); }
.lvc-start-note { margin: 12px 0 10px; font-size: 13px; color: var(--lvc-muted); }
.lvc-field { display: block; margin: 0 0 11px; }
.lvc-field > span { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--lvc-text); }
.lvc-field em { color: #dc2626; font-style: normal; }
.lvc-field input, .lvc-field textarea, .lvc-field select {
    width: 100%; padding: 8px 11px; border: 1px solid var(--lvc-line); border-radius: 10px; background: #fff;
    font: inherit; color: var(--lvc-text); resize: none; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.lvc-field input:focus, .lvc-field textarea:focus, .lvc-field select:focus { border-color: var(--lvc-accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.lvc-field.has-error input, .lvc-field.has-error select { border-color: #dc2626; }
.lvc-err { display: block; min-height: 0; margin-top: 4px; font-size: 12px; color: #dc2626; }
.lvc-err:empty { display: none; }
.lvc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.lvc-btn {
    width: 100%; margin-top: 2px; padding: 10px 14px; border: 0; border-radius: 12px; cursor: pointer;
    background: var(--lvc-accent); color: #fff; font: inherit; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lvc-btn:hover { background: var(--shop-primary-dark, #4338ca); }
.lvc-btn[disabled] { opacity: .6; cursor: wait; }
.lvc-btn svg { width: 14px !important; height: 14px; }

/* Offline + more than one staff WhatsApp number: who to message. */
.lvc-wa-pick { padding: 13px; overflow-y: auto; flex: 1; background: var(--lvc-soft); }
.lvc-wa-pick[hidden] { display: none; }
.lvc-wa-pick-note { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--lvc-text); }
.lvc-wa-pick-note svg { width: 16px !important; height: 16px; flex: none; color: #16a34a; }
.lvc-wa-list { display: flex; flex-direction: column; gap: 8px; }
.lvc-wa-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid var(--lvc-line);
    border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--lvc-text); text-align: left; transition: border-color .15s, background .15s;
}
.lvc-wa-item:hover { border-color: #16a34a; background: #f0fdf4; }
.lvc-wa-item-ico { width: 32px; height: 32px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: flex; align-items: center; justify-content: center; flex: none; }
.lvc-wa-item-ico svg { width: 16px !important; height: 16px; }
.lvc-wa-item-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.lvc-wa-item-arrow { color: var(--lvc-muted); flex: none; }
.lvc-wa-item-arrow svg { width: 11px !important; height: 11px; }

.lvc-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lvc-chat[hidden] { display: none; }
.lvc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--lvc-soft); display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.lvc-day { align-self: center; margin: 6px 0 2px; padding: 3px 10px; border-radius: 999px; background: #e2e8f0; color: var(--lvc-muted); font-size: 11px; font-weight: 600; }

.lvc-bubble { max-width: 84%; padding: 8px 11px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.lvc-bubble--admin { align-self: flex-start; background: #fff; border: 1px solid var(--lvc-line); border-bottom-left-radius: 5px; }
.lvc-bubble--customer { align-self: flex-end; background: var(--lvc-accent); color: #fff; border-bottom-right-radius: 5px; }

/* The replying staff member's photo (or generated initials avatar) next to their message. */
.lvc-msg-row { display: flex; align-items: flex-end; gap: 6px; align-self: flex-start; max-width: 84%; }
.lvc-msg-row .lvc-bubble { max-width: none; }
.lvc-msg-av { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; background: var(--lvc-soft); box-shadow: 0 0 0 1px var(--lvc-line); }
.lvc-meta { display: block; margin-top: 3px; font-size: 10.5px; opacity: .65; text-align: right; }
.lvc-bubble--admin .lvc-meta { text-align: left; }
.lvc-bubble.is-pending { opacity: .6; }
.lvc-bubble.is-failed { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.lvc-greet { margin: 0; }

.lvc-closed-note { margin: 0; padding: 8px 14px; background: #fef9c3; color: #713f12; font-size: 12px; border-top: 1px solid #fde68a; }
.lvc-closed-note[hidden] { display: none; }

.lvc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 10px 12px; border-top: 1px solid var(--lvc-line); background: #fff; flex: none; }
.lvc-compose textarea {
    flex: 1; max-height: 110px; min-height: 40px; padding: 9px 12px; border: 1px solid var(--lvc-line); border-radius: 20px;
    font: inherit; color: var(--lvc-text); resize: none; outline: 0; background: var(--lvc-soft);
}
.lvc-compose textarea:focus { border-color: var(--lvc-accent); background: #fff; }
.lvc-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--lvc-accent); color: #fff; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; }
.lvc-send:hover { filter: brightness(.95); }
.lvc-send svg { width: 16px !important; height: 16px; }

/* Phones: the panel fills the screen; with the tab bar on, the bar's Chat tab replaces the launcher. */
@media (max-width: 991.98px) {
    .lvc--tabbar .lvc-launcher, .lvc--tabbar .lvc-nudge { display: none; }
}
@media (max-width: 575.98px) {
    .lvc-launcher { left: 16px; bottom: 12px; height: 40px; padding: 0 12px 0 10px; font-size: 13px; }
    .lvc-nudge { left: 16px; bottom: 62px; max-width: 200px; }
    .lvc-panel { inset: 0; left: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; z-index: 1041; }
    .lvc-x, .lvc-end { width: 38px; height: 38px; }
    .lvc-compose { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .lvc-compose textarea, .lvc-field input, .lvc-field textarea, .lvc-field select { font-size: 16px; } /* no zoom on focus in iOS */
}
body.lvc-lock { overflow: hidden; }

/* The client Register page's phone box (frontEnd/client/partials/phone-input.blade.php's .gp) inside the widget */
.lvc-field .gp { background: #fff; border-radius: 10px; }
.lvc-field .gp-btn { border-radius: 10px 0 0 10px; padding: 0 10px; }
.lvc-field .gp .gp-input { padding: 8px 11px; }
.lvc-field.has-error .gp { border-color: #dc2626; }
.lvc-field .gp-pop { width: 100%; }
.lvc-field .gp-list { max-height: 200px; }

/* Staff offline + the shop has WhatsApp (.has-wa without .is-online): sending opens WhatsApp instead. */
.lvc-go-wa, .lvc-wa-note { display: none; }
.lvc.has-wa:not(.is-online) .lvc-go-chat { display: none; }
.lvc.has-wa:not(.is-online) .lvc-go-wa { display: inline-flex; align-items: center; gap: 8px; }
.lvc.has-wa:not(.is-online) .lvc-btn { background: #16a34a; }
.lvc.has-wa:not(.is-online) .lvc-btn:hover { background: #15803d; }
.lvc.has-wa:not(.is-online) .lvc-send { background: #16a34a; color: #fff; }
.lvc.has-wa:not(.is-online) .lvc-wa-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; background: #dcfce7; color: #14532d; font-size: 12px; border-top: 1px solid #bbf7d0; }
.lvc-wa-note svg { width: 14px !important; height: 14px; flex: none; }
.lvc-go-wa svg { width: 16px !important; height: 16px; }
.lvc-bubble .lvc-via { display: inline-flex; align-items: center; gap: 4px; }

/* The start form takes only the height it needs (no scroll bar); once the chat is running the panel has a fixed
   height and only the message list scrolls, with a thin bar that shows up when there are enough messages. */
.lvc.is-chatting .lvc-panel { height: 480px; }
.lvc-start { overflow-y: auto; }
.lvc-msgs { scrollbar-width: thin; scrollbar-color: rgba(15, 23, 42, .25) transparent; }
.lvc-msgs::-webkit-scrollbar { width: 6px; }
.lvc-msgs::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .22); border-radius: 6px; }
.lvc-msgs::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 575.98px) {
    .lvc.is-chatting .lvc-panel, .lvc-panel { height: 100%; }
}
/* start form: compact, and never a visible scroll bar (a very short window can still scroll it with the wheel) */
.lvc-start { scrollbar-width: none; }
.lvc-start::-webkit-scrollbar { display: none; }
.lvc-start .lvc-greet { padding: 7px 11px; }
.lvc-start-note { margin: 8px 0 8px; font-size: 12.5px; }
.lvc-field { margin-bottom: 8px; }
.lvc-field > span { margin-bottom: 3px; font-size: 12px; }
.lvc-panel { max-height: calc(100vh - 84px); }
