/* DERRICK Motors chat widget — drop-in embed for any website. */
*{box-sizing:border-box}
#ca-widget *{box-sizing:border-box;margin:0;padding:0;font-family:'Manrope',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif}

#ca-launcher{
  position:fixed;
  bottom:calc(20px + env(safe-area-inset-bottom));
  right:calc(20px + env(safe-area-inset-right));
  z-index:999999;
  width:60px;height:60px;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(120deg,#ff7a18,#ff3d2e 55%,#ff2d6e);color:#fff;font-size:25px;line-height:1;
  box-shadow:0 16px 42px -12px rgba(255,60,60,.75);
  display:flex;align-items:center;justify-content:center;
  transition:transform .18s ease, box-shadow .18s ease;
}
#ca-launcher:hover{transform:translateY(-3px) scale(1.04);box-shadow:0 22px 54px -12px rgba(255,60,60,.85)}
#ca-launcher.ca-hidden{display:none}

#ca-box{
  position:fixed;
  bottom:calc(90px + env(safe-area-inset-bottom));
  right:calc(20px + env(safe-area-inset-right));
  z-index:999999;
  width:384px;max-width:calc(100vw - 32px);height:600px;max-height:calc(100vh - 120px);
  background:#101014;border:1px solid rgba(255,255,255,.10);border-radius:20px;overflow:hidden;
  box-shadow:0 26px 70px -18px rgba(0,0,0,.65);
  display:flex;flex-direction:column;
  font:15px/1.62 'Manrope',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:#f5f5f7;
}
#ca-box.ca-hidden{display:none}

/* Header */
#ca-header{
  background:linear-gradient(120deg,#ff7a18,#ff3d2e 55%,#ff2d6e);color:#fff;
  padding:14px 16px;display:flex;align-items:center;gap:11px;
}
#ca-avatar{
  width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.95);color:#ff3d2e;
  display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:700;flex:none;
}
#ca-hmeta{min-width:0;flex:1}
#ca-title{font-weight:800;font-size:15.5px;letter-spacing:.01em;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ca-sub{font-size:12.5px;opacity:.94;line-height:1.4;display:flex;align-items:center;gap:5px}
#ca-sub::before{content:'';width:7px;height:7px;border-radius:50%;background:#b4ffc9;box-shadow:0 0 0 3px rgba(180,255,201,.28);flex:none}
#ca-close{
  margin-left:auto;background:rgba(255,255,255,.16);border:none;color:#fff;font-size:16px;
  width:34px;height:34px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .18s ease;
}
#ca-close:hover{background:rgba(255,255,255,.3)}

/* Messages */
#ca-messages{
  flex:1;overflow-y:auto;padding:16px 14px;background:#0b0b0e;
  display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth;
}
.ca-msg{max-width:84%;padding:11px 14px;border-radius:16px;white-space:pre-wrap;word-wrap:break-word;font-size:14.5px}
.ca-msg.ca-bot{background:#1a1a20;color:#f5f5f7;align-self:flex-start;border-bottom-left-radius:5px;border:1px solid rgba(255,255,255,.07)}
.ca-msg.ca-user{background:linear-gradient(120deg,#ff7a18,#ff2d6e);color:#fff;align-self:flex-end;border-bottom-right-radius:5px}
.ca-msg.ca-hint{background:rgba(255,255,255,.05);border:1px dashed rgba(255,255,255,.16);color:#c6c6d0;font-size:13.5px;align-self:flex-start;border-radius:14px}

/* Typing indicator */
.ca-typing{display:flex;gap:5px;align-self:flex-start;background:#1a1a20;border:1px solid rgba(255,255,255,.07);padding:14px;border-radius:16px;border-bottom-left-radius:5px}
.ca-typing i{width:7px;height:7px;border-radius:50%;background:#ff6a3d;display:block;animation:caBlink 1.1s infinite}
.ca-typing i:nth-child(2){animation-delay:.18s}
.ca-typing i:nth-child(3){animation-delay:.36s}
.ca-wa-btn{display:block;align-self:flex-start;background:#25d366;color:#05230f;font-weight:800;font-size:14px;text-decoration:none;padding:11px 18px;border-radius:12px;white-space:nowrap}
.ca-wa-btn:hover{background:#1fbb59;color:#05230f}
@keyframes caBlink{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}

/* Car cards */
.ca-msg.ca-car{
  background:#14141a;border:1px solid rgba(255,90,31,.34);border-radius:16px;padding:0;
  overflow:hidden;align-self:flex-start;max-width:92%;width:92%;
}
.ca-car-photo{width:100%;height:132px;object-fit:cover;display:block;background:#0b0b0e}
.ca-car-body{padding:11px 13px 13px}
.ca-car-name{font-weight:800;font-size:14.5px;line-height:1.35;margin-bottom:4px}
.ca-car-price{color:#ff5a1f;font-weight:800;font-size:15.5px;letter-spacing:-.01em}
.ca-car-specs{margin-top:6px;font-size:12.5px;color:#a5a5b0;line-height:1.5}
.ca-car-cta{
  display:block;margin-top:10px;width:100%;text-align:center;padding:9px 12px;border-radius:999px;
  background:linear-gradient(120deg,#ff7a18,#ff2d6e);color:#fff;font-size:12.5px;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;text-decoration:none;
}

/* Chips */
#ca-chips{display:flex;flex-wrap:wrap;gap:7px;padding:10px 14px 0;background:#0b0b0e}
#ca-chips.ca-hidden{display:none}
.ca-chip{
  background:#1a1a20;border:1px solid rgba(255,90,31,.42);color:#ff9b6a;border-radius:999px;
  padding:7px 12px;font-size:13px;font-weight:600;cursor:pointer;transition:all .16s ease;
}
.ca-chip:hover{background:linear-gradient(120deg,#ff7a18,#ff2d6e);border-color:transparent;color:#fff}

/* Input */
#ca-input-row{
  display:flex;gap:8px;padding:12px;background:#101014;border-top:1px solid rgba(255,255,255,.08);
}
#ca-input{
  flex:1;min-width:0;border:1px solid rgba(255,255,255,.13);background:#0b0b0e;color:#f5f5f7;
  border-radius:999px;padding:12px 16px;font-size:14.5px;outline:none;transition:border-color .18s ease;
}
#ca-input::placeholder{color:#7a7a85}
#ca-input:focus{border-color:#ff5a1f}
#ca-send{
  background:linear-gradient(120deg,#ff7a18,#ff2d6e);color:#fff;border:none;border-radius:50%;
  width:44px;height:44px;cursor:pointer;font-size:17px;flex:none;
  display:flex;align-items:center;justify-content:center;
  transition:filter .16s ease, opacity .16s ease;
}
#ca-send:hover{filter:brightness(1.1)}
#ca-send:disabled{opacity:.45;cursor:not-allowed}

/* Footer CTA row */
#ca-foot{display:flex;gap:8px;padding:0 12px 12px;background:#101014}
#ca-foot a{
  flex:1;text-align:center;padding:9px 8px;border-radius:999px;font-size:12.5px;font-weight:700;
  letter-spacing:.05em;text-decoration:none;transition:filter .16s ease;
}
#ca-foot a:hover{filter:brightness(1.1)}
#ca-wa{background:#25d366;color:#05240f}
#ca-call{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);color:#e6e6ec}

/* Mobile: dock to the bottom like a sheet */
@media (max-width:520px){
  #ca-launcher{bottom:calc(16px + env(safe-area-inset-bottom));right:calc(16px + env(safe-area-inset-right));width:56px;height:56px;font-size:23px}
  #ca-box{
    bottom:0;right:0;left:0;width:100%;max-width:100%;height:88vh;max-height:88vh;
    padding-bottom:env(safe-area-inset-bottom);
    border-radius:20px 20px 0 0;border-bottom:none;
  }
  #ca-header{border-radius:20px 20px 0 0;padding-top:16px}
}