/* carparts-chatbot widget — RTL, Persian */
#carparts-chatbot { position: fixed; bottom: var(--cc-bottom-desktop, 90px); right: 0; z-index: 99999; font-family: inherit; }
@keyframes cc-pulse-idle {
  0% { box-shadow: -6px 0 20px rgba(0,0,0,.3), 0 0 0 0 rgba(20,20,20,.5); }
  70% { box-shadow: -6px 0 20px rgba(0,0,0,.3), 0 0 0 15px rgba(20,20,20,0); }
  100% { box-shadow: -6px 0 20px rgba(0,0,0,.3), 0 0 0 0 rgba(20,20,20,0); }
}
@keyframes cc-pulse-active {
  0% { box-shadow: -6px 0 20px rgba(211,47,47,.4), 0 0 0 0 rgba(211,47,47,.5); }
  70% { box-shadow: -6px 0 20px rgba(211,47,47,.4), 0 0 0 15px rgba(211,47,47,0); }
  100% { box-shadow: -6px 0 20px rgba(211,47,47,.4), 0 0 0 0 rgba(211,47,47,0); }
}
#carparts-chatbot-toggle { position: relative; height: 60px; border: 0; cursor: pointer; direction: ltr;
  border-radius: 20px 0 0 20px; background: #141414; color: #fff;
  display: inline-flex; align-items: center; padding: 0;
  animation: cc-pulse-idle 2s infinite;
  transition: background .3s ease; }
#carparts-chatbot-toggle .cc-toggle-icon { width: 60px; height: 60px; flex: none;
  display: flex; align-items: center; justify-content: center; }
#carparts-chatbot-toggle .cc-toggle-icon svg { filter: drop-shadow(0 0 6px rgba(255,255,255,.85)); }
#carparts-chatbot-toggle .cc-toggle-label {  max-width: 0; opacity: 0; overflow: hidden;
  white-space: nowrap; font-size: 14px; display: inline-flex;
  justify-content: center; align-items: center; text-align: center;
  transition: max-width .35s ease, opacity .25s ease, padding-inline-end .35s ease; }
#carparts-chatbot-toggle:hover .cc-toggle-label,
#carparts-chatbot-toggle:focus-visible .cc-toggle-label { max-width: 180px; opacity: 1; padding-inline-end: 16px; }
#carparts-chatbot-toggle.cc-active { background: #d32f2f; animation-name: cc-pulse-active; }
#carparts-chatbot-panel { position: absolute; bottom: 70px; right: 0; width: 340px; max-width: calc(100vw - 32px);
  height: 460px; max-height: 70vh; background: #fff; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
#carparts-chatbot-panel[hidden] { display: none; }
.cc-header { background: #000000; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.cc-header button { background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
#carparts-chatbot-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f7f7f7; }
.cc-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.cc-msg a { color: #d32f2f; text-decoration: underline; }
.cc-bot { background: #fff; border: 1px solid #e5e5e5; align-self: flex-end; }
.cc-user { background: #000000; color: #fff; align-self: flex-start; }
.cc-typing { opacity: .6; font-style: italic; }
#carparts-chatbot-form { display: flex; border-top: 1px solid #e5e5e5; }
#carparts-chatbot-input { flex: 1; border: 0; padding: 12px; font-size: 13px; outline: none; font-family: inherit; }
#carparts-chatbot-form button { border: 0; background: #000000; color: #fff; padding: 0 18px; cursor: pointer; font-family: inherit; }
@media (max-width: 480px) {
  #carparts-chatbot-panel { width: calc(100vw - 32px); height: 65vh; }
}
@media (max-width: 768px) {
  /* clear carparts-mobile-bottom-nav's floating dock (reserves 88px via body padding) */
  #carparts-chatbot { bottom: calc(var(--cc-bottom-mobile, 88px) + env(safe-area-inset-bottom)); }
}
/* --- guest phone gate --- */
.cc-phone-gate { display: flex; flex-direction: column; gap: 8px; }
.cc-phone-gate-row { display: flex; gap: 6px; }
.cc-phone-gate-input { flex: 1; min-width: 0; border: 1px solid #e5e5e5; border-radius: 8px;
  padding: 8px 10px; font-family: inherit; font-size: 13px; outline: none; }
.cc-phone-gate-input:focus { border-color: #d32f2f; }
.cc-phone-gate-btn { font-family: inherit; font-size: 12px; font-weight: 600; color: #fff; background: #141414;
  border: 0; border-radius: 8px; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.cc-phone-gate-btn:hover { background: #d32f2f; }
.cc-phone-gate-error { font-size: 11px; color: #c62828; }
#carparts-chatbot-input:disabled, #carparts-chatbot-form button:disabled { opacity: .5; cursor: not-allowed; }
/* --- human handoff card --- */
.cc-handoff { display: flex; flex-direction: column; gap: 8px; background: #fff8f7; border: 1px solid #f3c9c4;
  border-radius: 12px; padding: 10px; align-self: stretch; }
.cc-handoff-title { font-size: 12.5px; font-weight: 700; color: #191919; }
.cc-handoff-links { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-handoff-link { font-size: 12px; font-weight: 600; color: #fff; background: #d32f2f;
  border-radius: 8px; padding: 6px 10px; text-decoration: none; }
.cc-handoff-link:hover { background: #b71c1c; }
/* --- suggestion chips --- */
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; }
.cc-chip { font-family: inherit; font-size: 12px; color: #191919; background: #fff;
  border: 1px solid #e5e5e5; border-radius: 20px; padding: 6px 12px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease; }
.cc-chip:hover { border-color: #d32f2f; color: #d32f2f; }
/* --- product cards --- */
.cc-products { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.cc-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid #e5e5e5;
  border-radius: 12px; padding: 10px; transition: box-shadow .15s ease, border-color .15s ease; }
.cc-card:hover { border-color: #d32f2f; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.cc-card-link { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
.cc-card-img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #f2f2f2; }
.cc-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.cc-card-name { font-size: 12.5px; font-weight: 600; line-height: 1.6; color: #191919;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-card-meta { display: flex; align-items: center; gap: 8px; }
.cc-card-price { font-size: 12px; color: #d32f2f; font-weight: 700; }
.cc-card-stock { font-size: 10px; padding: 1px 8px; border-radius: 20px; }
.cc-card-stock.is-in { background: #e8f5e9; color: #2e7d32; }
.cc-card-stock.is-out { background: #fbe9e7; color: #c62828; }
.cc-card-btn { font-size: 11px; color: #d32f2f; align-self: flex-start; }
.cc-card-btn::after { content: ' ←'; }
.cc-add-cart-btn { font-family: inherit; font-size: 12px; font-weight: 600; color: #fff; background: #141414;
  border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: background .15s ease; }
.cc-add-cart-btn:hover { background: #d32f2f; }
.cc-add-cart-btn:disabled { cursor: default; opacity: .8; }
.cc-cart-link { font-size: 11px; color: #d32f2f; text-decoration: underline; margin-inline-start: 8px; }
/* Owner request: when chat space is tight, drop the image — text-only cards. */
@media (max-width: 380px) {
  .cc-card-img { display: none; }
}
