/* Raptis Chat Widget v3.4.0 — S2-10 UX Polish */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#bv-chat-panel, #bv-chat-trigger {
  --w:#4A3423; --g:#B88A3B; --c:#F7F3EB; --b:#2563EB; --wh:#fff;
  --txt:#1C1008; --mut:#8A6B3D;
  --font:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  --r:20px; --r2:24px;
}

/* Trigger (pill) */
#bv-chat-trigger {
  position:fixed; bottom:24px; right:24px;
  display:flex; align-items:center; gap:10px;
  background:var(--w); border:2.5px solid var(--g);
  border-radius:50px; padding:10px 18px 10px 10px;
  cursor:pointer; z-index:1000000002;
  box-shadow:0 6px 28px rgba(74,52,35,.42);
  font-family:var(--font);
  transition:transform .22s cubic-bezier(.34,1.56,.64,1),box-shadow .2s,width .22s ease,height .22s ease,border-radius .22s ease,padding .18s ease;
}
#bv-chat-trigger:hover { transform:translateY(-2px); box-shadow:0 10px 36px rgba(74,52,35,.52); }
#bv-chat-trigger:focus-visible { outline:3px solid var(--g); outline-offset:3px; }
.bv-trig-av { width:36px; height:36px; border-radius:10px; background:var(--g); color:var(--wh); font-size:12px; font-weight:700; letter-spacing:.04em; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.bv-trig-txt { display:flex; flex-direction:column; gap:1px; }
.bv-trig-t1 { font-size:13px; font-weight:600; color:var(--wh); line-height:1.2; }
.bv-trig-t2 { font-size:11px; color:rgba(247,243,235,.7); }
.bv-trig-arr { color:rgba(247,243,235,.7); display:flex; align-items:center; margin-left:4px; }
.bv-trig-x  { color:var(--wh); display:none; align-items:center; justify-content:center; }
#bv-chat-trigger.bv-open { border-radius:50%; width:56px; height:56px; padding:0; justify-content:center; }
#bv-chat-trigger.bv-open .bv-trig-av,
#bv-chat-trigger.bv-open .bv-trig-txt,
#bv-chat-trigger.bv-open .bv-trig-arr { display:none; }
#bv-chat-trigger.bv-open .bv-trig-x { display:flex; }

/* Panel — uses bv-panel-closed so display:none never blocks the transition */
#bv-chat-panel {
  position:fixed; bottom:88px; right:20px;
  width:390px; height:580px; max-height:calc(100vh - 104px);
  border-radius:var(--r2); background:var(--c);
  box-shadow:0 20px 60px rgba(74,52,35,.28),0 4px 16px rgba(0,0,0,.14);
  display:flex; flex-direction:column; overflow:hidden;
  z-index:1000000001; font-family:var(--font);
  border:1px solid rgba(184,138,59,.2);
  transition:opacity .25s ease, transform .28s cubic-bezier(.34,1.56,.64,1);
  opacity:1; transform:translateY(0) scale(1); pointer-events:auto;
}
#bv-chat-panel.bv-panel-closed { opacity:0; transform:translateY(16px) scale(.94); pointer-events:none; }

/* Home view */
#bv-home-view { display:flex; flex-direction:column; flex:1; overflow:hidden; }
#bv-hero {
  flex:1; background-color:var(--w);
  background-image:linear-gradient(to bottom,rgba(26,12,4,.32) 0%,rgba(42,24,10,.68) 55%,rgba(58,30,10,.90) 100%),url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=800&q=75');
  background-size:cover; background-position:center 30%;
  padding:18px 20px 20px; display:flex; flex-direction:column; justify-content:space-between;
}
.bv-hero-top { display:flex; align-items:flex-start; justify-content:space-between; }
.bv-hero-mon { width:44px; height:44px; border-radius:12px; background:rgba(74,52,35,.82); border:2px solid var(--g); color:var(--g); font-family:var(--font); font-size:14px; font-weight:700; letter-spacing:.05em; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 10px rgba(0,0,0,.28); }
#bv-hero-close { background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.2); color:rgba(255,255,255,.8); width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s; backdrop-filter:blur(4px); }
#bv-hero-close:hover { background:rgba(255,255,255,.25); color:var(--wh); }
#bv-hero-close:focus-visible { outline:2px solid rgba(255,255,255,.7); outline-offset:2px; }
.bv-hero-body { display:flex; flex-direction:column; gap:8px; }
.bv-hero-brand { font-size:22px; font-weight:700; color:var(--wh); letter-spacing:-.01em; line-height:1.2; text-shadow:0 2px 8px rgba(0,0,0,.45); margin:0; }
.bv-hero-intro { font-size:13px; color:rgba(247,243,235,.8); line-height:1.55; margin:0; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
#bv-home-body { padding:16px; background:#FAFAF8; }
#bv-cta-card { display:flex; align-items:center; justify-content:space-between; background:var(--wh); border:1px solid rgba(184,138,59,.22); border-radius:16px; padding:16px 18px; cursor:pointer; box-shadow:0 2px 12px rgba(74,52,35,.10); transition:box-shadow .2s,transform .15s; }
#bv-cta-card:hover { box-shadow:0 5px 20px rgba(74,52,35,.18); transform:translateY(-1px); }
#bv-cta-card:focus-visible { outline:3px solid var(--g); outline-offset:2px; }
.bv-cta-left { display:flex; flex-direction:column; gap:3px; }
.bv-cta-t1 { font-size:14.5px; font-weight:700; color:var(--txt); }
.bv-cta-t2 { font-size:12px; color:var(--mut); }
.bv-cta-btn { width:38px; height:38px; border-radius:50%; flex-shrink:0; background:var(--b); color:var(--wh); display:flex; align-items:center; justify-content:center; pointer-events:none; }

/* Chat view */
#bv-chat-view { display:flex; flex-direction:column; flex:1; overflow:hidden; }
#bv-chat-messages { flex:1; overflow-y:auto; padding:18px 14px 10px; display:flex; flex-direction:column; gap:10px; background:#FAFAF8; scroll-behavior:smooth; scrollbar-width:thin; scrollbar-color:rgba(184,138,59,.3) transparent; }
#bv-chat-messages::-webkit-scrollbar { width:4px; }
#bv-chat-messages::-webkit-scrollbar-thumb { background:rgba(184,138,59,.3); border-radius:4px; }

/* Bubbles */
.bv-msg { max-width:80%; padding:11px 15px; border-radius:var(--r); font-family:var(--font); font-size:14px; line-height:1.55; word-break:break-word; animation:bvFadeIn .2s ease; }
@keyframes bvFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.bv-msg-bot { align-self:flex-start; background:var(--wh); color:var(--txt); border:1px solid rgba(184,138,59,.15); border-bottom-left-radius:5px; box-shadow:0 1px 8px rgba(74,52,35,.07); }
.bv-msg-user { align-self:flex-end; background:var(--w); color:var(--wh); border-bottom-right-radius:5px; box-shadow:0 2px 12px rgba(74,52,35,.28); }
.bv-typing { align-self:flex-start; display:flex; align-items:center; gap:5px; padding:11px 15px; background:var(--wh); border:1px solid rgba(184,138,59,.15); border-radius:var(--r); border-bottom-left-radius:5px; animation:bvFadeIn .2s ease; }
.bv-typing span { width:6px; height:6px; border-radius:50%; background:var(--g); animation:bvBounce 1.2s infinite ease-in-out; }
.bv-typing span:nth-child(2){animation-delay:.2s}.bv-typing span:nth-child(3){animation-delay:.4s}
@keyframes bvBounce { 0%,80%,100%{transform:translateY(0);opacity:.5} 40%{transform:translateY(-6px);opacity:1} }

/* Input */
#bv-chat-input-area { display:flex; align-items:flex-end; gap:8px; padding:10px 14px 12px; background:var(--wh); border-top:1px solid rgba(184,138,59,.13); flex-shrink:0; }
#bv-chat-input { flex:1; border:1.5px solid rgba(184,138,59,.24); border-radius:14px; padding:9px 14px; font-family:var(--font); font-size:13.5px; color:var(--txt); background:var(--c); outline:none; resize:none; line-height:1.5; min-height:38px; max-height:96px; overflow-y:auto; transition:border-color .15s,box-shadow .15s; }
#bv-chat-input:focus { border-color:var(--g); box-shadow:0 0 0 3px rgba(184,138,59,.15); }
#bv-chat-input::placeholder { color:rgba(74,52,35,.38); font-style:italic; }
#bv-chat-send { width:38px; height:38px; border-radius:12px; flex-shrink:0; background:var(--w); border:none; color:var(--g); cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s,transform .12s,opacity .15s; }
#bv-chat-send:not(:disabled):hover { background:#3D2A1B; transform:scale(1.08); }
#bv-chat-send:disabled { opacity:.38; cursor:default; }
#bv-chat-send:focus-visible { outline:3px solid var(--g); outline-offset:2px; }

/* Bottom nav */
#bv-bottom-nav { display:flex; background:var(--wh); border-top:1px solid rgba(184,138,59,.13); flex-shrink:0; }
.bv-nav-tab { flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:10px 8px; background:none; border:none; cursor:pointer; font-family:var(--font); font-size:11px; font-weight:500; color:rgba(74,52,35,.45); border-top:2px solid transparent; transition:color .15s,border-color .15s; -webkit-tap-highlight-color:transparent; min-height:48px; }
.bv-nav-tab svg { flex-shrink:0; }
.bv-nav-tab.bv-active { color:var(--b); border-top-color:var(--b); }
.bv-nav-tab:focus-visible { outline:2px solid var(--b); outline-offset:-2px; }

/* Products */
.bv-product-cards { display:flex; flex-direction:column; gap:8px; width:100%; }
.bv-product-card { background:var(--wh); border:1px solid rgba(184,138,59,.18); border-radius:var(--r); overflow:hidden; font-family:var(--font); transition:box-shadow .2s; }
.bv-product-card:hover { box-shadow:0 4px 18px rgba(74,52,35,.12); }
.bv-product-top { padding:12px 14px 6px; }
.bv-product-name { font-size:13px; font-weight:600; color:var(--txt); line-height:1.4; margin:0 0 4px; }
.bv-product-price { font-size:13.5px; font-weight:700; color:var(--g); }
.bv-price-over { color:#b91c1c; }
.bv-over-budget { border-left:3px solid #b91c1c; }
.bv-product-desc { font-size:12px; color:var(--mut); line-height:1.5; margin:3px 0 0; padding:0 14px 8px; }
.bv-product-tags { display:flex; flex-wrap:wrap; gap:5px; padding:0 14px 8px; }
.bv-tag { font-size:10.5px; padding:3px 9px; border-radius:20px; font-family:var(--font); font-weight:500; }
.bv-product-flag { background:rgba(184,138,59,.13); color:#7A5010; }
.bv-product-oos  { background:rgba(74,52,35,.07); color:rgba(74,52,35,.5); }
.bv-product-foot { border-top:1px solid rgba(184,138,59,.1); padding:8px 14px; }
.bv-product-link { font-size:11.5px; font-weight:600; color:var(--w); text-decoration:none; letter-spacing:.03em; text-transform:uppercase; transition:color .15s; }
.bv-product-link:hover { color:var(--g); }
.bv-product-link:focus-visible { outline:2px solid var(--g); outline-offset:2px; border-radius:2px; }
.bv-product-note { padding:8px 14px; font-size:12px; font-style:italic; color:var(--mut); border-top:1px solid rgba(184,138,59,.1); background:rgba(247,243,235,.5); }

/* Handoff CTA */
.bv-handoff-cta { margin:8px 0 4px; text-align:center; animation:bvFadeIn .2s ease; }
.bv-handoff-cta a { display:inline-block; padding:10px 22px; background:var(--w); color:var(--g) !important; border-radius:12px; font-family:var(--font); font-size:13px; font-weight:600; letter-spacing:.04em; text-decoration:none; border:1.5px solid rgba(184,138,59,.3); transition:background .15s,transform .12s; box-shadow:0 2px 12px rgba(74,52,35,.22); }
.bv-handoff-cta a:hover { background:#3D2A1B; transform:translateY(-1px); }
.bv-handoff-cta a:focus-visible { outline:3px solid var(--g); outline-offset:2px; }

/* Utility */
.bv-hidden { display:none !important; }

/* Mobile */
@media (max-width:480px) {
  #bv-chat-panel { width:calc(100vw - 16px); right:8px; left:8px; bottom:80px; height:calc(var(--vh,1vh)*100 - 100px); max-height:640px; border-radius:20px; }
  #bv-chat-trigger { bottom:16px; right:16px; }
  #bv-hero { min-height:160px; }
  .bv-hero-brand { font-size:19px; }
  .bv-nav-tab { min-height:52px; padding:12px 8px; }
  #bv-chat-send { width:42px; height:42px; }
  #bv-chat-input-area { padding:10px 12px 14px; }
}
@supports (padding-bottom:env(safe-area-inset-bottom)) {
  @media (max-width:480px) {
    #bv-chat-panel { bottom:calc(80px + env(safe-area-inset-bottom)); }
    #bv-chat-trigger { bottom:calc(16px + env(safe-area-inset-bottom)); }
  }
}