/* ==========================================================================
   JPC VELORA — website assistant (chatbot.js)
   ========================================================================== */
.vc { position: fixed; right: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2vw, 28px); z-index: 950; font-family: var(--sans); }
.vc *, .vc *::before, .vc *::after { box-sizing: border-box; }

.vc__fab {
  position: relative; display: grid; place-items: center; width: 60px; height: 60px; margin-left: auto;
  background: var(--gold); color: var(--navy); border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.6), 0 0 0 1px rgba(11,22,36,.25);
  transition: transform .5s var(--ease), background-color .3s ease;
}
.vc__fab:hover { transform: translateY(-3px); background: #c8a95e; }
.vc__fab:focus-visible { outline: 1px solid var(--cream); outline-offset: 4px; }
.vc__fab-ico { position: absolute; display: grid; place-items: center; transition: transform .5s var(--ease), opacity .3s ease; }
.vc__fab-ico--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.vc.is-open .vc__fab-ico--open { opacity: 0; transform: rotate(90deg) scale(.6); }
.vc.is-open .vc__fab-ico--close { opacity: 1; transform: none; }
.vc__dot { position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%; background: #5fcf8a; border: 2px solid var(--navy); }
.vc.is-open .vc__dot { display: none; }

.vc__nudge {
  position: absolute; right: 74px; bottom: 8px; display: flex; align-items: center; gap: 10px; max-width: 250px;
  background: var(--cream); color: var(--navy); padding: 12px 12px 12px 18px; border-radius: 14px 14px 4px 14px;
  font-size: 13px; line-height: 1.4; cursor: pointer; box-shadow: 0 16px 40px -14px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .5s ease, transform .6s var(--ease);
}
.vc__nudge.is-on { opacity: 1; transform: none; pointer-events: auto; }
.vc__nudge button { flex: 0 0 auto; width: 22px; height: 22px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--navy); opacity: .5; cursor: pointer; }
.vc__nudge button:hover { opacity: 1; }
.vc__nudge button svg { width: 12px; height: 12px; }

/* panel */
.vc__panel {
  position: absolute; right: 0; bottom: 78px; width: min(392px, calc(100vw - 32px)); height: min(620px, calc(100svh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--navy); color: var(--cream); border: 1px solid rgba(184,154,82,.35);
  box-shadow: 0 40px 90px -24px rgba(0,0,0,.75);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.98); transform-origin: 100% 100%;
  transition: opacity .35s ease, transform .6s var(--ease), visibility 0s linear .6s;
}
.vc.is-open .vc__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.vc__head { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 20px; background: var(--navy-2); border-bottom: 1px solid var(--line-l); }
.vc__avatar { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; font-family: var(--serif); font-style: normal; font-size: 22px; color: var(--gold); }
.vc__title { display: flex; flex-direction: column; min-width: 0; }
.vc__title strong { font-weight: 400; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; }
.vc__title span { margin-top: 3px; font-size: 12px; color: var(--taupe); }
.vc__close { margin-left: auto; flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--sand); cursor: pointer; transition: color .25s, background-color .25s; }
.vc__close:hover { color: var(--gold); background: rgba(229,222,209,.06); }

.vc__log { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: rgba(184,154,82,.35) transparent; outline: none; }
.vc__msg { display: flex; }
.vc__msg--user { justify-content: flex-end; }
.vc__bubble { max-width: 86%; padding: 12px 16px; font-size: 14px; line-height: 1.6; font-weight: 300; border-radius: 16px; animation: vc-in .5s var(--ease) both; }
.vc__msg--bot .vc__bubble { background: var(--navy-2); color: var(--sand); border-bottom-left-radius: 4px; border: 1px solid var(--line-l); }
.vc__msg--user .vc__bubble { background: var(--gold); color: var(--navy); font-weight: 400; border-bottom-right-radius: 4px; }
@keyframes vc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.vc__typing { display: inline-flex; gap: 5px; align-items: center; padding: 15px 18px; }
.vc__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .35; animation: vc-dot 1.2s ease-in-out infinite; }
.vc__typing i:nth-child(2) { animation-delay: .15s; } .vc__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes vc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.vc__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 12px; min-height: 8px; }
.vc__chip { padding: 8px 14px; background: transparent; border: 1px solid rgba(184,154,82,.5); border-radius: 100px; color: var(--sand); font-family: var(--sans); font-size: 12px; font-weight: 400; letter-spacing: .5px; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; animation: vc-in .5s var(--ease) both; }
.vc__chip:hover, .vc__chip:focus-visible { background: var(--gold); border-color: var(--gold); color: var(--navy); outline: none; }

.vc__form { display: flex; align-items: center; gap: 8px; margin: 0 18px; padding: 4px 4px 4px 16px; border: 1px solid rgba(229,222,209,.25); border-radius: 100px; transition: border-color .3s; }
.vc__form:focus-within { border-color: var(--gold); }
.vc__input { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none; color: var(--cream); font-family: var(--sans); font-size: 14px; padding: 8px 0; }
.vc__input::placeholder { color: rgba(229,222,209,.4); }
.vc__send { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; background: var(--gold); border: 0; border-radius: 50%; color: var(--navy); cursor: pointer; transition: background-color .25s; }
.vc__send:hover { background: #c8a95e; }

.vc__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 18px 18px; }
.vc__btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 10px; border-radius: 100px; text-decoration: none; font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; transition: background-color .25s, color .25s, border-color .25s; }
.vc__btn { font-family: var(--sans); cursor: pointer; }
.vc__btn--call { background: transparent; border: 1px solid var(--gold); color: var(--cream); }
.vc__btn--call:hover, .vc__btn--call:focus-visible { background: var(--gold); color: var(--navy); outline: none; }
.vc__btn--wa { background: #25d366; border: 1px solid #25d366; color: #06210f; }
.vc__btn--wa:hover, .vc__btn--wa:focus-visible { background: transparent; color: #25d366; outline: none; }

@media (max-width: 600px) {
  .vc { right: 14px; bottom: 14px; }
  .vc__fab { width: 54px; height: 54px; }
  .vc__panel { position: fixed; right: 10px; left: 10px; bottom: 80px; width: auto; height: min(70svh, 600px); }
  .vc__nudge { display: none; }
}
@media (prefers-reduced-motion: reduce) { .vc__bubble, .vc__chip, .vc__typing i { animation: none; } }
