/* ===== Лада — чат-виджет Восход-Моторс ===== */
#lada-widget{
  position:fixed;right:22px;bottom:26px;z-index:9999;
  font-family:'IBM Plex Sans',system-ui,sans-serif;
  --v-ink:#14100e;--v-brand:#a3150b;--v-deep:#0f0d0c;--v-copper:#a3150b;--v-copper-dark:#7e0f07;
  --v-paper:#f5ece1;--v-line:#dccbb8;--v-muted:#66594f;
}

#lada-launcher{display:flex;align-items:center;gap:12px;}

#lada-cta{
  background:var(--v-ink);color:#fff;border:0;
  font-weight:500;font-size:14px;letter-spacing:.01em;white-space:nowrap;
  padding:12px 18px;border-radius:999px;
  box-shadow:0 10px 30px -12px rgba(22,24,26,.6);
  transition:transform .2s ease,opacity .2s ease,visibility .2s ease,background .15s ease;
}
#lada-cta:hover{background:#000;}
#lada-launcher:hover #lada-cta{transform:translateY(-1px);}
#lada-widget.open #lada-cta{opacity:0;visibility:hidden;pointer-events:none;}

#lada-bubble{
  width:76px;height:76px;padding:0;border:0;background:transparent;cursor:pointer;
  position:relative;flex-shrink:0;transition:transform .2s ease;
}
#lada-launcher:hover #lada-bubble{transform:scale(1.05);}
#lada-bubble .lada-avatar-circle{
  display:block;width:100%;height:100%;border-radius:50%;overflow:hidden;
  border:3px solid #fff;background:#d3d8dc;
  box-shadow:0 12px 30px -10px rgba(22,24,26,.55);
}
#lada-bubble video,#lada-header video{width:100%;height:100%;object-fit:cover;display:block;}
#lada-bubble .lada-dot{
  position:absolute;top:2px;right:8px;width:13px;height:13px;border-radius:50%;
  background:#3d8a4e;border:2px solid #fff;transition:opacity .2s ease;
}
#lada-bubble .lada-collapse{
  position:absolute;inset:3px;border-radius:50%;background:rgba(22,24,26,.55);
  display:flex;align-items:center;justify-content:center;
  opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease;
}
#lada-bubble .lada-collapse svg{width:24px;height:24px;color:#fff;}
#lada-widget.open #lada-bubble .lada-collapse{opacity:1;visibility:visible;}
#lada-widget.open #lada-bubble .lada-dot{opacity:0;}

#lada-panel{
  position:absolute;right:0;bottom:92px;width:360px;max-width:calc(100vw - 44px);
  height:520px;max-height:calc(100vh - 130px);
  background:#fff;border-radius:14px;overflow:hidden;
  box-shadow:0 30px 80px -20px rgba(22,24,26,.45),0 0 0 1px rgba(22,24,26,.06);
  display:flex;flex-direction:column;
  opacity:0;visibility:hidden;transform:translateY(12px) scale(.98);transform-origin:bottom right;
  transition:opacity .2s ease,transform .22s cubic-bezier(.2,.7,.2,1),visibility 0s linear .22s;
}
#lada-panel.open{opacity:1;visibility:visible;transform:none;transition-delay:0s;}

#lada-header{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 14px;background:var(--v-deep);color:#fff;}
#lada-header .lada-avatar-sm{width:40px;height:40px;border-radius:50%;overflow:hidden;flex-shrink:0;background:#d3d8dc;}
#lada-header .lada-title{font-family:'Russo One','IBM Plex Sans',sans-serif;font-weight:400;font-size:16px;line-height:1.2;}
#lada-header .lada-subtitle{display:flex;align-items:center;gap:6px;font-family:'IBM Plex Sans',system-ui,sans-serif;font-size:12px;color:#b3a394;margin-top:2px;}
#lada-header .lada-subtitle i{width:7px;height:7px;border-radius:50%;background:#5fbf75;}
#lada-header .lada-call{margin-left:auto;width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;background:rgba(255,255,255,.08);transition:background .15s ease;}
#lada-header .lada-call:hover{background:rgba(255,255,255,.16);}
#lada-header .lada-call svg{width:18px;height:18px;}
#lada-close{width:36px;height:36px;border:0;border-radius:50%;background:transparent;color:#fff;display:flex;align-items:center;justify-content:center;transition:background .15s ease;}
#lada-close:hover{background:rgba(255,255,255,.1);}
#lada-close svg{width:20px;height:20px;}

#lada-messages{flex:1;overflow-y:auto;padding:16px 14px 8px;display:flex;flex-direction:column;gap:10px;background:var(--v-paper);}
.lada-msg{
  max-width:84%;padding:10px 13px;border-radius:14px;font-size:14px;line-height:1.45;
  white-space:pre-wrap;word-break:break-word;color:var(--v-ink);
}
.lada-msg.bot{align-self:flex-start;background:#fff;border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(22,24,26,.06);}
.lada-msg.user{align-self:flex-end;background:var(--v-ink);color:#fff;border-bottom-right-radius:4px;}
.lada-msg.typing{display:flex;gap:4px;align-items:center;padding:12px 14px;}
.lada-msg.typing span{width:6px;height:6px;border-radius:50%;background:#9aa0a6;animation:lada-blink 1.2s infinite ease-in-out;}
.lada-msg.typing span:nth-child(2){animation-delay:.2s;}
.lada-msg.typing span:nth-child(3){animation-delay:.4s;}
@keyframes lada-blink{0%,80%,100%{opacity:.25;}40%{opacity:1;}}

#lada-quick{display:flex;flex-wrap:wrap;gap:6px;padding:4px 14px 10px;background:var(--v-paper);}
#lada-quick.hidden{display:none;}
#lada-header .lada-subtitle{white-space:nowrap;}
/* телефон: быстрые вопросы — одной лентой с прокруткой пальцем, чтобы не съедали переписку */
@media (max-width:480px){
  #lada-quick{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:8px;}
  #lada-quick::-webkit-scrollbar{display:none;}
  #lada-quick button{flex:none;white-space:nowrap;}
}
#lada-quick button{
  font:inherit;font-size:13px;font-weight:500;color:var(--v-brand);
  background:#fff;border:1px solid var(--v-line);border-radius:999px;padding:7px 12px;cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
#lada-quick button:hover{border-color:var(--v-copper);}

#lada-inputbar{display:flex;align-items:flex-end;gap:8px;padding:10px;border-top:1px solid var(--v-line);background:#fff;margin:0;}
#lada-consent{margin:0;padding:0 8px 8px;background:#fff;font-size:10.5px;line-height:1.3;text-wrap:balance;color:var(--v-muted);text-align:center;}
#lada-consent a{color:inherit;text-decoration:underline;text-underline-offset:2px;}
#lada-consent a:hover{color:var(--v-copper);}
@media (max-width:380px){#lada-consent{font-size:10px;padding:0 6px 8px;}}
#lada-input{
  flex:1;font:inherit;font-size:14px;line-height:1.4;color:var(--v-ink);
  border:1px solid var(--v-line);border-radius:20px;padding:10px 14px;outline:none;resize:none;overflow-y:hidden;
  max-height:120px;background:var(--v-paper);transition:border-color .15s ease,background .15s ease;
}
#lada-input:focus{border-color:var(--v-copper);background:#fff;}
#lada-send{
  flex-shrink:0;width:40px;height:40px;border:0;border-radius:50%;background:var(--v-copper);color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease;
}
#lada-send:hover{background:var(--v-copper-dark);}
#lada-send:disabled{opacity:.5;cursor:default;}
#lada-send svg{width:18px;height:18px;}

/* зазор над мобильной CTA-панелью (.mobile-cta в style.css) */
@media (max-width:760px){
  #lada-widget{bottom:84px;right:14px;}
  #lada-panel{max-height:calc(100vh - 180px);}
}
/* пока видна плашка куки (main.js: html.cookie-open, --cookie-h) — Лада над ней, а не поверх */
@media (max-width:760px){
  #lada-widget{transition:bottom .3s ease;}
  html.cookie-open #lada-widget{bottom:calc(80px + var(--cookie-h, 70px) + 12px);}
  /* виджет поднят на высоту плашки — панель на столько же ниже, иначе на 320–360 уходит за верх экрана */
  html.cookie-open #lada-panel{max-height:calc(100vh - 180px - var(--cookie-h, 70px) - 12px);}
  /* открыт чат — плашка временно прячется, Лада на обычном месте (на 320×640 иначе не влезает приветствие) */
  html.cookie-open:has(#lada-widget.open) .cookie-bar{opacity:0;transform:translateY(10px);pointer-events:none;}
  html.cookie-open:has(#lada-widget.open) #lada-widget{bottom:84px;}
  html.cookie-open:has(#lada-widget.open) #lada-panel{max-height:calc(100vh - 180px);}
}
/* 761–860px: плашка куки (до 560px) упирается в надпись «Спросить Ладу» — прячем надпись, пока плашка открыта */
@media (max-width:860px){
  html.cookie-open #lada-cta{opacity:0;visibility:hidden;pointer-events:none;}
}
@media (max-width:480px){
  #lada-cta{display:none;}
  #lada-bubble{width:64px;height:64px;}
  #lada-panel{width:calc(100vw - 28px);right:-6px;bottom:80px;}
}
