/* ==================================================================
 * stylesheet_chatwidget.css — storefront support-chat widget
 * Auto-loaded site-wide (style*.css). Themed to match the main store
 * (zzz_modern_redesign.css): warm surfaces, near-black ink, brand #FF5A3C.
 * ================================================================== */
.zc-chat, .zc-chat * { box-sizing: border-box; }

.zc-chat {
    --zc-brand:#FF5A3C; --zc-brand-deep:#D63E22; --zc-brand-tint:#FFEFEA;
    --zc-bg:#F7F6F2; --zc-surface:#FFFFFF; --zc-warm:#FBF8F2;
    --zc-ink:#161616; --zc-ink-soft:#5B5B5B; --zc-ink-mute:#8A8A8A;
    --zc-line:#E8E4DB; --zc-line-soft:#F0ECE3; --zc-dark:#161616;
    position: fixed; right: 20px; bottom: 20px; z-index: 99990;
    font-family: inherit, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* launcher */
.zc-chat__launch {
    position: relative; width: 48px; height: 48px; border: 0; border-radius: 50%;
    background: var(--zc-brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(214,62,34,.34); transition: transform .15s, background .15s;
}
.zc-chat__launch:hover { transform: scale(1.06); background: var(--zc-brand-deep); }
.zc-chat__launch svg { width: 22px; height: 22px; }
.zc-chat.is-open .zc-chat__launch { display: none; }
.zc-chat__badge {
    position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
    padding: 0 5px; border-radius: 10px; background: var(--zc-brand-deep); color: #fff;
    font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; border: 2px solid #fff;
}
.is-hidden { display: none !important; }

/* panel */
.zc-chat__panel {
    display: none; flex-direction: column; width: 410px; max-width: calc(100vw - 32px);
    height: 660px; max-height: calc(100vh - 40px);
    background: var(--zc-surface); border-radius: 16px; overflow: hidden;
    box-shadow: 0 22px 60px rgba(22,22,22,.26); border: 1px solid var(--zc-line);
}
.zc-chat.is-open .zc-chat__panel { display: flex; }

.zc-chat__hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 16px; background: var(--zc-dark); color: #f4ede2;
}
.zc-chat__hdr-title { font-weight: 800; font-size: 15px; letter-spacing:.01em; }
.zc-chat__hdr-sub { font-size: 12px; opacity: .7; margin-top: 2px; }
.zc-chat__x { background: none; border: 0; color: #f4ede2; font-size: 26px; line-height: 1; cursor: pointer; opacity: .75; }
.zc-chat__x:hover { opacity: 1; }

.zc-chat__tabs { display: flex; background: var(--zc-warm); border-bottom: 1px solid var(--zc-line); }
.zc-chat__tab {
    flex: 1; padding: 11px; border: 0; background: none; cursor: pointer;
    font-weight: 700; font-size: 13px; color: var(--zc-ink-mute); border-bottom: 2px solid transparent;
}
.zc-chat__tab.is-active { color: var(--zc-brand); border-bottom-color: var(--zc-brand); background: var(--zc-surface); }

.zc-chat__body {
    flex: 1; overflow-y: auto; padding: 14px; background: var(--zc-bg);
    display: flex; flex-direction: column; gap: 10px;
}

/* messages */
.zc-msg { display: flex; flex-direction: column; max-width: 82%; }
.zc-msg--me { align-self: flex-end; align-items: flex-end; }
.zc-msg--them { align-self: flex-start; align-items: flex-start; }
.zc-msg__who { font-size: 11px; font-weight: 800; color: var(--zc-brand); margin: 0 4px 2px; }
.zc-msg--system .zc-msg__who { color: var(--zc-ink-mute); }
.zc-msg__bubble {
    padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45;
    word-wrap: break-word; overflow-wrap: anywhere;
}
.zc-msg--me .zc-msg__bubble { background: var(--zc-brand); color: #fff; border-bottom-right-radius: 4px; }
.zc-msg--them .zc-msg__bubble { background: var(--zc-surface); color: var(--zc-ink); border: 1px solid var(--zc-line); border-bottom-left-radius: 4px; }
.zc-msg--bot .zc-msg__bubble { background: var(--zc-brand-tint); border-color: #FBD3C7; color: var(--zc-ink); }
.zc-msg--system .zc-msg__bubble { background: var(--zc-line-soft); color: var(--zc-ink-soft); font-size: 13px; font-style: italic; }
.zc-msg__text a { color: inherit; text-decoration: underline; }
/* rendered HTML inside bot/FAQ answers stays inside the bubble */
.zc-msg__text p { margin: 0 0 6px; }
.zc-msg__text p:last-child { margin-bottom: 0; }
.zc-msg__text ul, .zc-msg__text ol { margin: 4px 0 4px 18px; padding: 0; }
.zc-msg__text img { max-width: 100%; height: auto; border-radius: 6px; }
.zc-msg__text table { max-width: 100%; display: block; overflow-x: auto; border-collapse: collapse; font-size: 12px; margin: 4px 0; }
.zc-msg__text td, .zc-msg__text th { border: 1px solid var(--zc-line); padding: 3px 6px; }
.zc-msg__text hr { border: 0; border-top: 1px solid var(--zc-line); margin: 8px 0; }
.zc-msg__time { font-size: 10px; color: var(--zc-ink-mute); margin: 2px 4px 0; }
.zc-msg__img img { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; margin-top: 4px; }
.zc-msg__file { display: inline-block; margin-top: 4px; color: inherit; font-size: 13px; text-decoration: underline; }

/* pills */
.zc-pills { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0; }
.zc-pill {
    padding: 7px 13px; border: 1px solid #FBD3C7; background: var(--zc-surface); color: var(--zc-brand-deep);
    border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .12s;
}
.zc-pill:hover { background: var(--zc-brand-tint); }
.zc-pill:disabled { opacity: .5; cursor: default; }
.zc-pill--agent { background: var(--zc-brand); color: #fff; border-color: var(--zc-brand); }
.zc-pill--agent:hover { background: var(--zc-brand-deep); }

.zc-chat__wa {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; padding: 8px 14px;
    background: #25d366; color: #fff; border-radius: 999px; font-weight: 700; font-size: 13px; text-decoration: none;
}
.zc-chat__wa svg { width: 16px; height: 16px; }
.zc-chat__closed { text-align: center; padding: 12px; }
.zc-chat__closed-note { color: var(--zc-ink-soft); font-size: 13px; margin-bottom: 10px; }
.zc-chat__closed .zc-pill { display: inline-block; }

/* typing */
.zc-chat__typing { display: flex; gap: 4px; padding: 6px 18px 10px; }
.zc-chat__typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--zc-ink-mute);
    animation: zc-bounce 1.2s infinite ease-in-out;
}
.zc-chat__typing span:nth-child(2) { animation-delay: .2s; }
.zc-chat__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes zc-bounce { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* composer */
.zc-chat__composer {
    display: flex; align-items: flex-end; gap: 6px; padding: 10px;
    border-top: 1px solid var(--zc-line); background: var(--zc-surface);
}
.zc-chat__icon-btn {
    flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: 9px; cursor: pointer; background: var(--zc-line-soft); color: var(--zc-ink-soft); border: 0;
}
.zc-chat__icon-btn:hover { background: var(--zc-line); color: var(--zc-ink); }
.zc-chat__icon-btn svg { width: 19px; height: 19px; }
.zc-chat__file { display: none; }
.zc-chat__input {
    flex: 1; resize: none; border: 1px solid var(--zc-line); border-radius: 10px;
    padding: 9px 12px; font-size: 14px; font-family: inherit; max-height: 90px; line-height: 1.35; color: var(--zc-ink);
}
.zc-chat__input:focus { outline: none; border-color: var(--zc-brand); box-shadow: 0 0 0 3px var(--zc-brand-tint); }
.zc-chat__send {
    flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 10px;
    background: var(--zc-brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.zc-chat__send:hover { background: var(--zc-brand-deep); }
.zc-chat__send svg { width: 18px; height: 18px; }

/* search */
.zc-chat__search { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--zc-bg); }
.zc-chat__search-in { margin: 12px; padding: 10px 12px; border: 1px solid var(--zc-line); border-radius: 10px; font-size: 14px; }
.zc-chat__search-in:focus { outline: none; border-color: var(--zc-brand); box-shadow: 0 0 0 3px var(--zc-brand-tint); }
.zc-chat__results { flex: 1; overflow-y: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.zc-result { display: flex; gap: 10px; align-items: flex-start; padding: 8px; background: var(--zc-surface); border: 1px solid var(--zc-line); border-radius: 10px; color: var(--zc-ink); }
.zc-result, .zc-result:hover, .zc-result:focus, .zc-result * { text-decoration: none !important; }
.zc-result:hover { border-color: var(--zc-brand); }
.zc-result__thumb { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; background: var(--zc-warm); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.zc-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.zc-result__meta { flex: 1; min-width: 0; text-align: left !important; }
.zc-result__name { font-weight: 700; font-size: 13px; color: var(--zc-ink) !important; line-height: 1.3; text-align: left !important; }
/* Zen price markup rendered inside the result card — force everything hard-left.
   Flexbox (justify-content:flex-start) beats any inherited text-align/margin. */
.zc-result__sub { display: flex !important; flex-wrap: wrap; align-items: baseline; justify-content: flex-start !important; gap: 5px; text-align: left !important; font-size: 12.5px; color: var(--zc-brand-deep); font-weight: 800; margin-top: 4px; line-height: 1.35; width: 100%; }
.zc-result__sub * { text-align: left !important; float: none !important; margin: 0 !important; }
.zc-result__sub .normalprice { text-decoration: line-through !important; color: var(--zc-ink-mute); font-weight: 500; margin-right: 5px !important; }
.zc-result__sub .productSpecialPrice, .zc-result__sub .productSalePrice { color: var(--zc-brand-deep); font-weight: 800; }
.zc-result__sub .productPriceDiscount { display: none !important; }
.zc-chat__noresult { text-align: center; color: var(--zc-ink-mute); font-size: 13px; padding: 20px; }

/* proactive teaser bubble */
.zc-chat__teaser {
    position: absolute; right: 2px; bottom: 60px; width: 232px;
    background: var(--zc-surface); border: 1px solid var(--zc-line); border-radius: 14px;
    padding: 12px 32px 12px 14px; box-shadow: 0 12px 30px rgba(22,22,22,.18);
    font-size: 13.5px; line-height: 1.42; color: var(--zc-ink); cursor: pointer; display: none;
}
.zc-chat__teaser.show { display: block; animation: zc-pop .22s ease; }
.zc-chat.is-open .zc-chat__teaser { display: none !important; }
.zc-chat__teaser::after {
    content: ''; position: absolute; right: 22px; bottom: -7px; width: 13px; height: 13px;
    background: var(--zc-surface); border-right: 1px solid var(--zc-line); border-bottom: 1px solid var(--zc-line);
    transform: rotate(45deg);
}
.zc-chat__teaser-x {
    position: absolute; top: 5px; right: 8px; border: 0; background: none;
    font-size: 16px; line-height: 1; color: var(--zc-ink-mute); cursor: pointer;
}
.zc-chat__teaser-x:hover { color: var(--zc-ink); }
@keyframes zc-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* inline product-search results (shown within the chat thread) */
.zc-search-inline { display: flex; flex-direction: column; gap: 8px; margin: 2px 0; }
.zc-search-saved { display: flex; flex-direction: column; gap: 8px; }
.zc-search-note { font-size: 12px; color: var(--zc-ink-soft); font-weight: 700; }

/* mobile */
@media (max-width: 480px) {
    .zc-chat { right: 12px; bottom: 12px; }
    .zc-chat__panel { width: calc(100vw - 24px); height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
}
