/* Vista RV: website chatbot (assets/js/chatbot.js).
   Uses the colour and type tokens from site.css, which loads first. */

#vrv-chat{ font-family:var(--f-body); color:var(--ink); }

.vrv-chat-launcher{
  position:fixed; right:22px; bottom:22px; z-index:130;
  display:inline-flex; align-items:center; gap:10px;
  padding:14px 20px; border:0; border-radius:999px; cursor:pointer;
  background:var(--red); color:#fff;
  font:700 15px/1 var(--f-display); letter-spacing:.01em;
  box-shadow:0 12px 28px -8px rgba(36,32,33,.45);
  transition:background .2s var(--ease), transform .2s var(--ease);
}
.vrv-chat-launcher:hover{ background:var(--red-dk); transform:translateY(-2px); }
.vrv-chat-launcher:focus-visible{ outline:3px solid var(--gold); outline-offset:3px; }
.vrv-chat-launcher svg{ width:20px; height:20px; fill:currentColor; }
.vrv-chat-active .vrv-chat-launcher{ display:none; }

.vrv-chat-box{
  position:fixed; right:22px; bottom:22px; z-index:130;
  width:390px; max-width:calc(100vw - 32px);
  height:640px; max-height:calc(100vh - 44px); max-height:calc(100dvh - 44px);
  display:none; flex-direction:column; overflow:hidden;
  background:var(--paper); border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow);
}
.vrv-chat-box.is-open{ display:flex; }

.vrv-chat-head{
  display:flex; align-items:center; gap:6px; padding:14px 12px 14px 18px;
  background:var(--ink); color:#fff; border-bottom:3px solid var(--red);
}
.vrv-chat-head > div{ flex:1; display:flex; flex-direction:column; min-width:0; }
.vrv-chat-head strong{ font:700 17px/1.2 var(--f-accent); }
.vrv-chat-head span{ font-size:13px; color:var(--steel-on-dark); }
.vrv-chat-icon{
  width:36px; height:36px; display:grid; place-items:center; flex:none;
  background:transparent; border:0; border-radius:var(--radius); color:#fff; cursor:pointer;
}
.vrv-chat-icon:hover, .vrv-chat-icon:focus-visible{ background:rgba(255,255,255,.12); outline:none; }
.vrv-chat-icon svg{ width:18px; height:18px; }

.vrv-chat-body{
  flex:1; overflow-y:auto; padding:16px; background:var(--paper-2);
  display:flex; flex-direction:column; gap:10px; overscroll-behavior:contain;
}
.vrv-chat-msg{ display:flex; }
.vrv-chat-user{ justify-content:flex-end; }
.vrv-chat-bubble{
  max-width:90%; padding:10px 14px; border-radius:12px;
  font-size:15px; line-height:1.45; overflow-wrap:anywhere;
}
.vrv-chat-bot .vrv-chat-bubble{ background:var(--paper); border:1px solid var(--line); border-bottom-left-radius:4px; }
.vrv-chat-user .vrv-chat-bubble{ background:var(--ink); color:#fff; border-bottom-right-radius:4px; }
.vrv-chat-bubble a{ color:var(--red); font-weight:600; }
.vrv-chat-bubble a.vrv-chat-model{ color:var(--ink); font-weight:400; }
.vrv-chat-model strong{ color:var(--ink); }

.vrv-chat-options{ display:flex; flex-direction:column; gap:6px; }
.vrv-chat-option{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left;
  padding:10px 14px; cursor:pointer;
  background:var(--paper); color:var(--ink);
  border:1.5px solid var(--line-2); border-radius:8px;
  font:600 14.5px/1.3 var(--f-body);
  transition:border-color .15s, background .15s;
}
.vrv-chat-option:hover, .vrv-chat-option:focus-visible{ border-color:var(--red); outline:none; }
.vrv-chat-option.is-primary{ border-color:var(--red); background:var(--red-tint); }
.vrv-chat-option-hint{ font-weight:400; font-size:13px; color:var(--steel); }

.vrv-chat-model{
  display:block; margin:10px 0 4px; overflow:hidden; text-decoration:none; color:var(--ink);
  border:1px solid var(--line); border-radius:10px; background:var(--paper);
}
.vrv-chat-model img{ display:block; width:100%; height:150px; object-fit:cover; }
.vrv-chat-model-body{ display:flex; flex-direction:column; gap:6px; padding:12px 14px; }
.vrv-chat-model strong{ font:700 17px/1.2 var(--f-display); }
.vrv-chat-model ul{ margin:0; padding-left:18px; font-size:14px; color:var(--ink-soft); }
.vrv-chat-model-link{ color:var(--red); font-weight:700; font-size:14px; }
.vrv-chat-model:hover .vrv-chat-model-link{ text-decoration:underline; }
.vrv-chat-tag{
  align-self:flex-start; padding:3px 9px; border-radius:999px;
  background:var(--red); color:#fff; font:700 11px/1.4 var(--f-display); letter-spacing:.06em; text-transform:uppercase;
}
.vrv-chat-tag.is-order{ background:var(--gold); color:var(--ink); }
.vrv-chat-note{ margin:8px 0 6px; font-size:14px; color:var(--ink-soft); }

.vrv-chat-card{
  display:flex; flex-direction:column; gap:6px; margin:10px 0;
  padding:12px; background:var(--paper-2); border-radius:8px;
}
.vrv-chat-card span{ font-size:13.5px; color:var(--steel); }
.vrv-chat-cta{
  display:block; text-align:center; padding:10px; border-radius:var(--radius);
  background:var(--red); color:#fff !important; text-decoration:none;
}
.vrv-chat-cta.is-secondary{ background:var(--ink); }

.vrv-chat-form{
  display:flex; flex-direction:column; gap:10px; padding:14px;
  background:var(--paper); border:1px solid var(--line); border-radius:10px;
}
.vrv-chat-field{ display:flex; flex-direction:column; gap:4px; }
.vrv-chat-field label{ font-size:13.5px; font-weight:700; }
.vrv-chat-field label span{ color:var(--red); }
.vrv-chat-field input, .vrv-chat-field textarea, .vrv-chat-field select{
  width:100%; padding:9px 11px; font:16px/1.3 var(--f-body); color:var(--ink);
  border:1px solid var(--line-2); border-radius:var(--radius); background:#fff;
}
.vrv-chat-field textarea{ resize:vertical; }
.vrv-chat-field input:focus, .vrv-chat-field textarea:focus, .vrv-chat-field select:focus{
  outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(208,42,44,.15);
}
.vrv-chat-error{ display:none; margin:0; font-size:13px; color:var(--red-dk); }
.vrv-chat-field.has-error input{ border-color:var(--red-dk); }
.vrv-chat-field.has-error .vrv-chat-error{ display:block; }
.vrv-chat-submit{
  padding:12px; border:0; border-radius:var(--radius); cursor:pointer;
  background:var(--red); color:#fff; font:700 15px/1 var(--f-display);
}
.vrv-chat-submit:hover{ background:var(--red-dk); }
.vrv-chat-submit:disabled{ opacity:.7; cursor:wait; }
.vrv-chat-privacy{ margin:0; font-size:12.5px; color:var(--steel); text-align:center; }

.vrv-chat-foot{
  padding:10px 16px; text-align:center; font-size:14px;
  border-top:1px solid var(--line); background:var(--paper);
}
.vrv-chat-foot a{ color:var(--red); font-weight:700; text-decoration:none; }

/* site.css shows a sticky Call / Enquire bar at the bottom at this width
   (body padding-bottom 93px), so the launcher sits above it. */
@media (max-width:960px){
  .vrv-chat-launcher{ right:16px; bottom:calc(93px + 12px + env(safe-area-inset-bottom)); padding:12px 16px; }
}
@media (max-width:520px){
  /* Phones: icon-only round launcher; the label stays for screen readers. */
  .vrv-chat-launcher{ width:56px; height:56px; padding:0; justify-content:center; }
  .vrv-chat-launcher svg{ width:24px; height:24px; }
  .vrv-chat-launcher span{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }
  .vrv-chat-box{
    right:0; bottom:0; width:100vw; max-width:none;
    height:100vh; height:100dvh; max-height:none; border-radius:0; border:0;
  }
}
@media (prefers-reduced-motion: reduce){
  .vrv-chat-launcher, .vrv-chat-option{ transition:none; }
  .vrv-chat-launcher:hover{ transform:none; }
}
