/* =========================================================
   ADVAITA LIFE SCIENCES — "Advaita AI" Chatbot Widget
   Theme-matched: Crimson / Orange / Gold, site typography.
   All selectors are prefixed (.als-chat / #als-chat) to avoid
   any collision with the existing site styles.
   ========================================================= */

/* Existing floating buttons (WhatsApp / phone / scroll-top) stack
   ABOVE the chat launcher so nothing overlaps. */
.float-btns{bottom:96px !important}

/* ============ LAUNCHER — floating AI robot button ============ */
.als-chat-launcher{
  position:fixed;right:20px;bottom:20px;z-index:1200;
  width:62px;height:62px;border-radius:50%;border:none;cursor:pointer;padding:0;
  background:linear-gradient(135deg,#9c2a1f 0%,#c8392a 45%,#e97829 100%);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 30px rgba(156,42,31,.42),0 3px 10px rgba(15,23,42,.16);
  transition:transform .3s cubic-bezier(.22,1,.36,1),box-shadow .3s,opacity .22s ease;
  -webkit-tap-highlight-color:transparent;
}
.als-chat-launcher:hover{
  transform:scale(1.08) translateY(-2px);
  box-shadow:0 16px 38px rgba(156,42,31,.52),0 4px 12px rgba(15,23,42,.18);
}
.als-chat-launcher:focus-visible{outline:3px solid rgba(232,179,65,.55);outline-offset:2px}
.als-chat-launcher svg{
  width:76%;height:76%;pointer-events:none;
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.16));
}
/* soft pulse ring */
.als-chat-launcher::after{
  content:"";position:absolute;inset:-6px;border-radius:50%;
  border:2px solid rgba(200,57,42,.35);
  animation:alsPulse 2.6s ease-out infinite;pointer-events:none;
}
@keyframes alsPulse{0%{transform:scale(.82);opacity:.9}70%{transform:scale(1.28);opacity:0}100%{opacity:0}}
/* hidden while the panel is open — the panel header has the
   minimize / close controls, so there is never a big "X" button */
.als-chat-launcher.als-open{opacity:0;transform:scale(.4);pointer-events:none}
.als-chat-launcher.als-open::after{animation:none;opacity:0}
.als-chat-launcher.als-open .als-chat-tip{display:none}

/* unread count badge */
.als-chat-badge{
  position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 5px;
  border-radius:11px;background:#e8b341;color:#221b17;
  font:700 11px/22px "Plus Jakarta Sans","DM Sans",system-ui,sans-serif;text-align:center;
  box-shadow:0 3px 8px rgba(0,0,0,.22);pointer-events:none;
}
/* hover tooltip */
.als-chat-tip{
  position:absolute;right:74px;top:50%;transform:translateY(-50%) translateX(6px);
  background:#221b17;color:#fff;font:600 12px/1 "Plus Jakarta Sans","DM Sans",system-ui,sans-serif;
  padding:9px 14px;border-radius:9px;white-space:nowrap;opacity:0;pointer-events:none;
  transition:opacity .25s,transform .25s;box-shadow:0 6px 18px rgba(15,23,42,.25);
}
.als-chat-tip::after{content:"";position:absolute;right:-5px;top:50%;transform:translateY(-50%);border:5px solid transparent;border-left-color:#221b17;border-right:0}
.als-chat-launcher:hover .als-chat-tip{opacity:1;transform:translateY(-50%) translateX(0)}

/* ============ PANEL ============ */
.als-chat-panel{
  /* bottom kept low (24px) so the 580px panel sits well below the
     site's sticky nav bar; the launcher is hidden while open */
  position:fixed;right:20px;bottom:24px;z-index:1250;
  width:384px;height:580px;
  max-height:calc(100vh - 130px);max-height:calc(100dvh - 130px);
  /* defensive: no global element rule may add space inside the panel */
  padding:0;margin:0;
  background:#fff;border-radius:22px;overflow:hidden;
  display:flex;flex-direction:column;
  box-shadow:0 30px 70px rgba(15,23,42,.30),0 4px 16px rgba(15,23,42,.12);
  transform-origin:bottom right;
  animation:alsPop .3s cubic-bezier(.22,1,.36,1);
  font-family:"Plus Jakarta Sans","DM Sans",system-ui,sans-serif;
}
@keyframes alsPop{from{opacity:0;transform:scale(.92) translateY(14px)}to{opacity:1;transform:scale(1) translateY(0)}}
.als-hidden{display:none !important}

/* ============ HEADER ============ */
.als-chat-head{
  display:flex;align-items:center;gap:11px;padding:12px 10px 12px 14px;
  background:linear-gradient(120deg,#9c2a1f 0%,#c8392a 42%,#e97829 80%,#e8b341 120%);
  color:#fff;flex:0 0 auto;position:relative;overflow:hidden;
}
/* subtle molecular pattern */
.als-chat-head::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='100' viewBox='0 0 160 100' fill='none' stroke='%23ffffff' stroke-opacity='0.13' stroke-width='1.4'%3E%3Cpath d='M28 12l13 7.5v15L28 42l-13-7.5v-15z'/%3E%3Ccircle cx='112' cy='22' r='4'/%3E%3Ccircle cx='134' cy='36' r='3'/%3E%3Ccircle cx='118' cy='55' r='3.4'/%3E%3Cpath d='M112 22l22 14-18 19'/%3E%3Ccircle cx='58' cy='80' r='3'/%3E%3Ccircle cx='74' cy='70' r='2.5'/%3E%3Ccircle cx='88' cy='79' r='2.8'/%3E%3Cpath d='M58 80l16-10 14 9'/%3E%3C/svg%3E");
  background-size:190px 119px;
}
/* warm golden glow */
.als-chat-head::after{
  content:"";position:absolute;right:-30px;top:-46px;width:130px;height:130px;border-radius:50%;
  background:radial-gradient(circle,rgba(232,179,65,.4),transparent 65%);pointer-events:none;
}
.als-chat-avatar{
  width:42px;height:42px;border-radius:14px;flex:0 0 auto;position:relative;z-index:1;
  background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.42);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.25);
  display:flex;align-items:center;justify-content:center;
}
.als-chat-avatar svg{width:78%;height:78%;pointer-events:none}
.als-chat-head-info{flex:1 1 auto;min-width:0;position:relative;z-index:1}
.als-chat-head-info b{display:block;font-size:15px;font-weight:800;letter-spacing:.01em;color:#fff;line-height:1.3}
.als-chat-head-info small{
  display:flex;align-items:center;font-size:11px;font-weight:500;letter-spacing:.01em;
  color:rgba(255,255,255,.94);margin-top:1px;
}
.als-status-dot{
  flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:#5ee38a;margin-right:6px;
  animation:alsStatusPing 2.2s ease-out infinite;
}
@keyframes alsStatusPing{
  0%{box-shadow:0 0 0 0 rgba(94,227,138,.55)}
  75%{box-shadow:0 0 0 5px rgba(94,227,138,0)}
  100%{box-shadow:0 0 0 0 rgba(94,227,138,0)}
}
.als-chat-head-btns{display:flex;gap:2px;position:relative;z-index:1}
.als-chat-head-btns button{
  width:30px;height:30px;border:none;border-radius:9px;background:transparent;color:#fff;
  font-size:12.5px;opacity:.92;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .2s,opacity .2s;
}
.als-chat-head-btns button:hover{background:rgba(255,255,255,.2);opacity:1}
.als-chat-head-btns button i{pointer-events:none}

/* ============ BODY ============ */
.als-chat-body{
  /* min-height:0 lets this flex item shrink below its content size
     so the scrollbar lives HERE (internal message area only) and the
     fixed panel itself never grows or moves */
  flex:1 1 auto;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;
  padding:14px 14px 8px;
  background:#fbf8f2;
  background-image:
    radial-gradient(ellipse 60% 26% at 12% 0%,rgba(232,179,65,.08),transparent 60%),
    radial-gradient(ellipse 50% 26% at 92% 100%,rgba(200,57,42,.06),transparent 60%);
}
.als-chat-body::-webkit-scrollbar{width:5px}
.als-chat-body::-webkit-scrollbar-thumb{background:#d8c9b8;border-radius:3px}

/* ============ MESSAGES ============ */
.als-msg{display:flex;margin-bottom:12px;animation:alsMsgIn .3s cubic-bezier(.22,1,.36,1)}
@keyframes alsMsgIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.als-msg-bot{justify-content:flex-start}
.als-msg-user{justify-content:flex-end}
.als-bubble{
  max-width:86%;padding:10px 14px;font-size:13.5px;line-height:1.6;color:#334155;
  word-wrap:break-word;overflow-wrap:break-word;
}
.als-msg-bot .als-bubble{
  background:#fff;border:1px solid #ece4d6;border-radius:4px 16px 16px 16px;
  box-shadow:0 2px 10px rgba(15,23,42,.05);
}
.als-msg-user .als-bubble{
  background:linear-gradient(135deg,#c8392a 0%,#e97829 100%);color:#fff;
  border-radius:16px 4px 16px 16px;box-shadow:0 6px 16px rgba(200,57,42,.28);
}
.als-bubble b{color:#1e293b}
.als-msg-user .als-bubble b{color:#fff}
.als-bubble a{color:#c8392a;font-weight:600;text-decoration:none;border-bottom:1px solid rgba(200,57,42,.35)}
.als-bubble a:hover{color:#9c2a1f}
.als-bubble .als-mini{display:block;margin-top:6px;font-size:11.5px;color:#94a3b8}
.als-day-divider{
  text-align:center;margin:2px 0 14px;font-size:10.5px;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:#94a3b8;
}
.als-day-divider span{background:#efe9dd;border-radius:20px;padding:4px 12px}

/* welcome hero card (first greeting message) */
.als-msg-bot .als-bubble.als-bubble-card{
  max-width:100%;border:1.5px solid transparent;
  background:linear-gradient(#fff,#fff) padding-box,
             linear-gradient(135deg,rgba(200,57,42,.38),rgba(232,179,65,.55)) border-box;
  box-shadow:0 4px 18px rgba(200,57,42,.08);
}
.als-welcome-title{font-size:14.5px;font-weight:800;color:#1e293b;margin-bottom:6px;line-height:1.45}
.als-welcome-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:9px 0 10px}
.als-welcome-grid span{
  background:#fdf5ea;border:1px solid #f2e2cb;border-radius:9px;padding:7px 9px;
  font-size:11px;font-weight:600;color:#8a5a20;line-height:1.35;
}

/* typing indicator */
.als-typing .als-bubble{display:flex;gap:5px;align-items:center;padding:14px 16px}
.als-typing .d{width:7px;height:7px;border-radius:50%;background:#c8392a;opacity:.45;animation:alsBlink 1.2s infinite}
.als-typing .d:nth-child(2){animation-delay:.18s}
.als-typing .d:nth-child(3){animation-delay:.36s}
@keyframes alsBlink{0%,70%,100%{opacity:.3;transform:translateY(0)}35%{opacity:1;transform:translateY(-4px)}}

/* ============ QUICK ACTION CHIPS ============ */
.als-chips{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 12px;animation:alsMsgIn .35s cubic-bezier(.22,1,.36,1)}
.als-chip{
  border:1.5px solid rgba(200,57,42,.4);background:#fff;color:#9c2a1f;cursor:pointer;
  font:600 12px/1.25 "Plus Jakarta Sans","DM Sans",system-ui,sans-serif;letter-spacing:.01em;
  padding:9px 14px;border-radius:20px;transition:.2s;
  box-shadow:0 1px 4px rgba(15,23,42,.05);
}
.als-chip:hover{background:linear-gradient(135deg,#c8392a,#e97829);color:#fff;border-color:transparent;transform:translateY(-1px);box-shadow:0 6px 16px rgba(200,57,42,.3)}
.als-chip.gold{border-color:#b8860b;color:#8a6508}
.als-chip.gold:hover{background:linear-gradient(135deg,#e8b341,#f0c863);color:#221b17}
.als-chip.muted{border-color:#cbd5e1;color:#64748b}
.als-chip.muted:hover{background:#475569;border-color:transparent;color:#fff}


/* ============ PRODUCT CARD ============ */
.als-prod-list{display:flex;flex-direction:column;width:94%;max-width:94%}
.als-prod{
  background:#fff;border:1px solid #ece4d6;border-radius:16px;padding:13px 14px;margin:8px 0;
  max-width:94%;box-shadow:0 4px 14px rgba(15,23,42,.06);animation:alsMsgIn .35s cubic-bezier(.22,1,.36,1);
}
.als-prod-top{display:flex;align-items:flex-start;gap:8px;margin-bottom:8px}
.als-prod-cat{
  flex:0 0 auto;font:700 9.5px/1 "Plus Jakarta Sans",sans-serif;letter-spacing:.07em;text-transform:uppercase;
  padding:5px 8px;border-radius:6px;margin-top:2px;
}
.als-prod-cat.impurity{background:#fdf1ed;color:#c8392a}
.als-prod-cat.intermediate{background:#faeab6;color:#8a6508}
.als-prod-cat.nitroso{background:#fde8c5;color:#c24e1a}
.als-prod-cat.agro{background:#e7f3ea;color:#2f7a44}
.als-prod-cat.default{background:#eef2f7;color:#475569}
.als-prod h5{font-size:13.5px;font-weight:700;color:#1e293b;margin:0;line-height:1.4;font-family:inherit}
.als-prod .als-prod-chem{font-size:11.5px;color:#64748b;margin:5px 0 8px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.als-prod-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:5px 12px;
  background:#fbf8f2;border:1px solid #f0e9dc;border-radius:10px;padding:9px 11px;margin-bottom:10px;
}
.als-prod-grid div{font-size:11.5px;color:#64748b;line-height:1.5;min-width:0}
.als-prod-grid div span{display:block;font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#94a3b8}
.als-prod-grid div b{color:#1e293b;font-weight:600;word-break:break-word}
.als-prod-actions{display:flex;gap:8px}
.als-prod-actions .als-btn{flex:1}

.als-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  font:700 11.5px/1 "Plus Jakarta Sans",sans-serif;letter-spacing:.03em;
  padding:10px 14px;border-radius:9px;border:none;cursor:pointer;transition:.2s;text-decoration:none;
}
.als-btn-primary{background:linear-gradient(135deg,#c8392a,#e97829);color:#fff !important;box-shadow:0 5px 14px rgba(200,57,42,.28)}
.als-btn-primary:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(200,57,42,.36)}
.als-btn-ghost{background:#fff;color:#c8392a !important;border:1.5px solid #f0c5b8}
.als-btn-ghost:hover{border-color:#c8392a;background:#fdf1ed}

/* ============ CLOSE CONFIRMATION DIALOG ============ */
.als-confirm{
  position:absolute;inset:0;z-index:6;
  display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(17,24,39,.45);
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  animation:alsConfirmFade .18s ease;
}
@keyframes alsConfirmFade{from{opacity:0}to{opacity:1}}
.als-confirm-card{
  width:100%;max-width:276px;background:#fff;border-radius:16px;
  padding:22px 18px 14px;text-align:center;
  box-shadow:0 18px 44px rgba(15,23,42,.28);
  animation:alsConfirmPop .22s cubic-bezier(.22,1,.36,1);
}
@keyframes alsConfirmPop{from{opacity:0;transform:scale(.92) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}
.als-confirm-icon{
  width:46px;height:46px;border-radius:50%;margin:0 auto 12px;
  background:linear-gradient(135deg,#c8392a,#e97829);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:19px;box-shadow:0 8px 18px rgba(200,57,42,.3);
}
.als-confirm-card h5{margin:0 0 6px;font-size:15px;font-weight:800;color:#1e293b}
.als-confirm-card p{margin:0 0 16px;font-size:12.5px;line-height:1.55;color:#64748b}
.als-confirm-actions{display:flex;gap:8px}
.als-confirm-actions .als-btn{flex:1}
.als-confirm-clear{
  margin-top:10px;padding:7px 10px;border:none;border-radius:8px;
  background:transparent;cursor:pointer;
  font:600 12px/1 "Plus Jakarta Sans",sans-serif;color:#94a3b8;
  transition:color .2s,background .2s;
}
.als-confirm-clear:hover{color:#c8392a;background:#fdf1ed}
.als-confirm-clear i{margin-right:5px}

/* summary / confirm card inside enquiry */
.als-summary{
  background:#fdfaf5;border:1px dashed #e8b341;border-radius:12px;padding:11px 13px;margin:8px 0;
  font-size:12.5px;color:#334155;line-height:1.8;
}
.als-summary b{color:#1e293b}
.als-summary .row{display:flex;gap:8px}
.als-summary .row span:first-child{flex:0 0 86px;color:#94a3b8;font-weight:700;font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;padding-top:2px}

/* success state */
.als-success-icon{
  width:44px;height:44px;border-radius:50%;background:#e7f3ea;color:#2f7a44;
  display:flex;align-items:center;justify-content:center;font-size:20px;margin:0 auto 8px;
}

/* ============ FOOTER / INPUT ============ */
.als-chat-foot{flex:0 0 auto;background:#fff;border-top:1px solid #eee5d8;padding:10px 12px 8px}
.als-chat-form{display:flex;align-items:center;gap:8px}
.als-chat-form input{
  flex:1;min-width:0;height:42px;padding:0 16px;border-radius:22px;
  border:1.5px solid #e2e8f0;background:#f8fafc;color:#1e293b;
  font:500 13.5px "Plus Jakarta Sans","DM Sans",system-ui,sans-serif;
  outline:none;transition:border-color .2s,background .2s;box-shadow:none;
}
.als-chat-form input:focus{border-color:#c8392a;background:#fff}
.als-chat-form input::placeholder{color:#94a3b8}
.als-chat-send{
  flex:0 0 auto;width:42px;height:42px;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(135deg,#c8392a,#e97829);color:#fff;font-size:15px;
  display:flex;align-items:center;justify-content:center;transition:.2s;
  box-shadow:0 5px 14px rgba(200,57,42,.3);
}
.als-chat-send:hover{transform:scale(1.07)}
.als-chat-send:disabled{opacity:.55;cursor:default;transform:none}
.als-chat-powered{
  text-align:center;font-size:10px;color:#b3a68f;margin-top:7px;letter-spacing:.02em;
}
.als-chat-powered b{color:#94856b}

/* ============ RESPONSIVE ============ */
@media (max-width:580px){
  .float-btns{bottom:88px !important;right:14px !important}
  .als-chat-launcher{right:14px;bottom:16px;width:58px;height:58px}
  .als-chat-tip{display:none}
  /* On small screens the panel becomes a near-full bottom sheet.
     The 100px top gap keeps the site header (logo + nav) visible,
     and the input stays comfortably reachable above the keyboard/home bar. */
  .als-chat-panel{
    right:0;left:0;bottom:0;top:auto;
    width:100%;height:calc(100vh - 100px);height:calc(100dvh - 100px);
    max-height:none;border-radius:22px 22px 0 0;
    animation:alsSheet .32s cubic-bezier(.22,1,.36,1);
  }
  .als-chat-foot{padding-bottom:calc(8px + env(safe-area-inset-bottom))}
  .als-bubble{max-width:92%}
}
@keyframes alsSheet{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
@media (max-height:700px) and (min-width:581px){
  .als-chat-panel{height:calc(100vh - 130px);height:calc(100dvh - 130px)}
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion:reduce){
  .als-chat-launcher::after,.als-status-dot,.als-msg,.als-chips,.als-prod{animation:none}
}

