.sales-chat { position: relative; z-index: 78; }
.sales-chat-toggle { position: fixed; z-index: 78; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: .55rem; min-height: 54px; padding: .7rem 1rem; border: 0; border-radius: 999px; color: #fff; background: var(--accent-dark); box-shadow: 0 14px 36px rgba(93, 12, 47, .28); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 850; }
.sales-chat-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sales-chat-toggle:hover { background: var(--accent-deep); }
.sales-chat-toggle:focus-visible, .sales-chat button:focus-visible, .sales-chat textarea:focus-visible, .sales-chat input:focus-visible { outline: 3px solid #171217; outline-offset: 3px; }
.sales-chat-nudge { position: fixed; z-index: 77; right: 1.1rem; bottom: calc(5.3rem + env(safe-area-inset-bottom)); display: flex; align-items: center; max-width: min(310px, calc(100vw - 2rem)); overflow: hidden; border: 1px solid rgba(215, 11, 82, .16); border-radius: 999px; background: #fff; box-shadow: var(--shadow); }
.sales-chat-nudge > button { min-height: 44px; border: 0; background: transparent; cursor: pointer; font: inherit; }
.sales-chat-nudge > button:first-child { padding: .55rem .2rem .55rem 1rem; font-size: .72rem; font-weight: 800; }
.sales-chat-nudge > button:last-child { width: 44px; color: var(--muted); font-size: 1.15rem; }
.sales-chat-panel { position: fixed; z-index: 79; right: 1.1rem; bottom: calc(5.35rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; width: min(390px, calc(100vw - 2rem)); height: min(650px, calc(100dvh - 7rem)); overflow: hidden; border: 1px solid rgba(112, 72, 88, .15); border-radius: 1.35rem; background: #fff; box-shadow: 0 28px 70px rgba(48, 20, 32, .24); }
.sales-chat-panel[hidden] { display: none; }
.sales-chat-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: .7rem; padding: .85rem .75rem .8rem 1rem; color: #fff; background: linear-gradient(120deg, #c80048, #e53170); }
.sales-chat-avatar { display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); }
.sales-chat-avatar img { width: 34px; height: 34px; object-fit: contain; }
.sales-chat-header strong { display: block; font-size: .88rem; }
.sales-chat-header small { display: flex; align-items: center; gap: .35rem; margin-top: .18rem; color: rgba(255,255,255,.84); font-size: .64rem; }
.sales-chat-header small i { width: 7px; height: 7px; border-radius: 50%; background: #9ff0af; box-shadow: 0 0 0 3px rgba(159,240,175,.18); }
.sales-chat-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; font-size: 1.4rem; }
.sales-chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; overscroll-behavior: contain; background: linear-gradient(#fffafc, #fff); }
.sales-chat-message { display: grid; justify-items: start; margin-bottom: .72rem; }
.sales-chat-message.is-user { justify-items: end; }
.sales-chat-bubble { max-width: 86%; padding: .68rem .78rem; border-radius: 1rem 1rem 1rem .25rem; color: #3f3439; background: #f6edf1; font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.sales-chat-message.is-user .sales-chat-bubble { border-radius: 1rem 1rem .25rem 1rem; color: #fff; background: var(--accent-dark); }
.sales-chat-products { display: grid; width: 100%; gap: .48rem; margin-top: .55rem; }
.sales-chat-product { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: .65rem; width: 100%; padding: .45rem; border: 1px solid var(--line); border-radius: .9rem; background: #fff; box-shadow: 0 5px 15px rgba(70,35,49,.06); }
.sales-chat-product img { display: block; width: 62px; height: 76px; padding: .15rem; border-radius: .65rem; background: var(--soft); object-fit: contain; }
.sales-chat-product div { min-width: 0; }
.sales-chat-product small, .sales-chat-product strong, .sales-chat-product b { display: block; }
.sales-chat-product small { color: var(--muted); font-size: .58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-chat-product strong { margin-top: .16rem; font-size: .7rem; line-height: 1.25; }
.sales-chat-product b { margin-top: .22rem; color: var(--accent-dark); font-size: .7rem; }
.sales-chat-product button { min-width: 44px; min-height: 44px; padding: 0 .65rem; border: 0; border-radius: 999px; color: #fff; background: var(--ink); cursor: pointer; font: inherit; font-size: .63rem; font-weight: 800; }
.sales-chat-typing .sales-chat-bubble { display: flex; gap: .3rem; width: 54px; }
.sales-chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9b7886; animation: sales-chat-dot 1s infinite alternate; }
.sales-chat-typing i:nth-child(2) { animation-delay: .16s; }
.sales-chat-typing i:nth-child(3) { animation-delay: .32s; }
.sales-chat-quick { display: flex; gap: .4rem; overflow-x: auto; padding: .62rem .8rem .25rem; scrollbar-width: none; }
.sales-chat-quick:empty { display: none; }
.sales-chat-quick::-webkit-scrollbar { display: none; }
.sales-chat-quick button { flex: 0 0 auto; min-height: 40px; padding: .48rem .72rem; border: 1px solid rgba(200, 0, 72, .24); border-radius: 999px; color: var(--accent-deep); background: #fff7fa; cursor: pointer; font: inherit; font-size: .65rem; font-weight: 800; }
.sales-chat-operator { align-self: flex-start; min-height: 40px; margin: .35rem .8rem .25rem; padding: .45rem .65rem; border: 0; color: var(--accent-deep); background: transparent; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font: inherit; font-size: .66rem; font-weight: 800; }
.sales-chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: .45rem; padding: .55rem .65rem; border-top: 1px solid var(--line); background: #fff; }
.sales-chat-form textarea { width: 100%; max-height: 104px; min-height: 46px; resize: none; padding: .72rem .78rem; border: 1px solid var(--line); border-radius: .85rem; background: #fff; font: inherit; font-size: .75rem; line-height: 1.35; }
.sales-chat-form button { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; color: #fff; background: var(--accent-dark); cursor: pointer; }
.sales-chat-form button:disabled { cursor: wait; opacity: .5; }
.sales-chat-form svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sales-chat-privacy { margin: 0; padding: .25rem .8rem calc(.55rem + env(safe-area-inset-bottom)); color: var(--muted); background: #fff; font-size: .57rem; line-height: 1.35; }
.sales-handoff { position: absolute; z-index: 3; inset: 0; overflow-y: auto; padding: 1rem; background: #fff; }
.sales-handoff[hidden] { display: none; }
.sales-handoff-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.sales-handoff-heading strong { font-size: 1rem; }
.sales-handoff-heading p { margin: .35rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.sales-handoff-heading button { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; font-size: 1.3rem; }
.sales-handoff form { display: grid; gap: .8rem; margin-top: 1rem; }
.sales-handoff form > label:not(.sales-handoff-consent) span { display: block; margin-bottom: .32rem; font-size: .68rem; font-weight: 800; }
.sales-handoff input[type="text"], .sales-handoff input:not([type]) { width: 100%; min-height: 48px; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .72rem; font: inherit; }
.sales-handoff-consent { display: grid; grid-template-columns: 22px 1fr; gap: .6rem; align-items: flex-start; color: #4c4146; font-size: .67rem; line-height: 1.45; }
.sales-handoff-consent input { width: 20px; height: 20px; margin: .05rem 0 0; accent-color: var(--accent-dark); }
.sales-handoff .button { width: 100%; }
.sales-handoff-error { margin: 0; color: #a40034; font-size: .68rem; font-weight: 750; }
.sales-handoff-result { margin-top: 1rem; padding: .9rem; border-radius: .85rem; background: #f0faef; color: #315d32; font-size: .74rem; line-height: 1.45; }
.sales-handoff-phone { display: block; min-height: 44px; margin-top: .8rem; padding: .7rem; border-radius: .75rem; color: var(--accent-deep); background: var(--soft); text-align: center; font-size: .8rem; font-weight: 850; }
.ask-sales-agent { width: 100%; border-color: rgba(215, 11, 82, .22); color: var(--accent-deep); background: #fff7fa; }
@keyframes sales-chat-dot { to { transform: translateY(-3px); opacity: .55; } }

@media (max-width: 620px) {
  .sales-chat-toggle { right: .7rem; bottom: calc(.7rem + env(safe-area-inset-bottom)); min-width: 54px; padding-inline: .85rem; }
  body.has-cart .sales-chat-toggle { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
  .sales-chat-nudge { right: .7rem; bottom: calc(4.9rem + env(safe-area-inset-bottom)); }
  body.has-cart .sales-chat-nudge { bottom: calc(9.45rem + env(safe-area-inset-bottom)); }
  .sales-chat-panel { right: 0; bottom: 0; width: 100%; height: min(78dvh, 680px); border-width: 1px 0 0; border-radius: 1.25rem 1.25rem 0 0; }
  .sales-chat-toggle[aria-expanded="true"] { display: none; }
  .sales-chat-privacy { padding-bottom: calc(.55rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .sales-chat-typing i { animation: none; }
}
