/* ============================================================
   ZEUS: EireSafe chat widget
   Zoom-style launcher + chat panel, branded for EireSafe.
   ============================================================ */

.es-chat{
  --es-chat-green:#004D2C;
  --es-chat-green-dark:#003620;
  --es-chat-green-soft:#e8f2ed;
  --es-chat-orange:#F8991D;
  --es-chat-orange-dark:#d97f0e;
  --es-chat-border:#E2E5E0;
  --es-chat-muted:#6b7280;
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:99980;
  font-family:'Barlow',sans-serif;
  color:#2c3338;
}
body.es-quote-visible .es-chat{bottom:84px;}
@media (max-width:768px){
  body.single-product .es-chat:not(.is-open){bottom:88px;}
  body.es-quote-visible .es-chat{bottom:84px;}
}

/* Keep the widget self-contained if the theme does not define WordPress's
   screen-reader utility class. */
.es-chat .screen-reader-text{
  position:absolute !important;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ---------------- Launcher ---------------- */
.es-chat-launcher{
  position:relative;
  width:60px;height:60px;
  border:0;border-radius:50%;
  padding:0;
  background:linear-gradient(145deg,#00603a,#004D2C);
  color:#fff;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 10px 30px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.15) inset;
  transition:transform .18s ease, box-shadow .18s ease;
}
.es-chat-launcher:hover{transform:translateY(-2px);box-shadow:0 14px 34px rgba(0,0,0,.32);}
.es-chat-launcher-icon{
  width:100%;height:100%;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;font-size:24px;
}
.es-chat-launcher-icon img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;}
.es-chat-launcher-svg{width:28px;height:28px;display:block;}
.es-chat-launcher-dot{fill:var(--es-chat-green);}
.es-chat-launcher-close{
  position:absolute;inset:0;display:none;align-items:center;justify-content:center;
  border-radius:50%;background:linear-gradient(145deg,#00603a,#004D2C);font-size:22px;
}
.es-chat.is-open .es-chat-launcher-icon{display:none;}
.es-chat.is-open .es-chat-launcher-close{display:flex;}
.es-chat-unread{
  position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;
  border-radius:99px;background:var(--es-chat-orange);color:#fff;
  font-family:'Oswald',sans-serif;font-size:10px;font-weight:600;
  display:flex;align-items:center;justify-content:center;
  border:2px solid #fff;box-sizing:content-box;
}
.es-chat-unread[hidden]{display:none;}

/* ---------------- Panel ---------------- */
.es-chat-panel{
  position:absolute;right:0;bottom:76px;
  width:390px;height:min(640px,calc(100vh - 120px));
  max-height:calc(100vh - 120px);
  padding:0;box-sizing:border-box;
  background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.30);
  display:none;flex-direction:column;overflow:hidden;
  transform-origin:bottom right;
}
.es-chat.is-open .es-chat-panel{display:flex;animation:es-chat-in .18s ease both;}
@keyframes es-chat-in{from{opacity:0;transform:translateY(8px) scale(.985);}to{opacity:1;transform:none;}}

/* ---------------- Header ---------------- */
.es-chat-head{
  position:relative;flex:0 0 auto;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:13px 14px;
  background:linear-gradient(135deg,#003820 0%,#004D2C 55%,#00603a 100%);
  color:#fff;
}
.es-chat-brand{display:flex;align-items:center;gap:10px;min-width:0;}
.es-chat-logo{
  height:24px;width:auto;max-width:122px;display:block;object-fit:contain;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
.es-chat-logo-text{
  font-family:'Anton',sans-serif;font-size:19px;letter-spacing:.03em;
  text-transform:uppercase;color:#fff;line-height:1;
}
.es-chat-head-avatar{
  width:36px;height:36px;flex:0 0 36px;border-radius:50%;overflow:hidden;
  background:var(--es-chat-orange);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:17px;
  box-shadow:0 0 0 2px rgba(255,255,255,.22);
}
.es-chat-head-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.es-chat-head-text{display:flex;flex-direction:column;gap:1px;min-width:0;margin-left:3px;}
.es-chat-head-text strong{
  font-family:'Oswald',sans-serif;font-weight:400;font-size:14px;
  letter-spacing:.05em;text-transform:uppercase;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.es-chat-head-text small{
  display:flex;align-items:center;gap:5px;
  font-size:11px;color:rgba(255,255,255,.78);line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.es-chat-dot{
  width:7px;height:7px;border-radius:50%;background:#7CE38B;
  box-shadow:0 0 0 3px rgba(124,227,139,.18);flex:0 0 7px;
}
.es-chat-disclaimer{
  display:flex;align-items:flex-start;gap:7px;flex:0 0 auto;
  padding:8px 14px;
  background:#FFF8E9;border-bottom:1px solid #F0E1C2;
  color:#785A20;font-size:11.5px;line-height:1.45;
}
.es-chat-disclaimer i{color:#C37D00;font-size:12px;margin-top:2px;flex:0 0 auto;}
.es-chat-disclaimer strong{font-weight:600;}
.es-chat-head-actions{display:flex;gap:2px;flex:0 0 auto;}
.es-chat-icon-btn{
  width:30px;height:30px;border:0;border-radius:7px;background:transparent;
  color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;
  font-size:15px;opacity:.9;
}
.es-chat-icon-btn:hover{background:rgba(255,255,255,.14);opacity:1;}

/* ---------------- Header menu ---------------- */
.es-chat-menu{
  position:absolute;top:56px;right:10px;z-index:20;
  min-width:220px;background:#fff;border:1px solid var(--es-chat-border);
  border-radius:10px;box-shadow:0 14px 36px rgba(0,0,0,.18);
  padding:6px;
}
.es-chat-menu[hidden]{display:none;}
.es-chat-menu button,.es-chat-menu a{
  width:100%;display:flex;align-items:center;gap:9px;
  border:0;background:transparent;border-radius:7px;
  padding:9px 10px;text-align:left;text-decoration:none;
  font-family:'Barlow',sans-serif;font-size:13.5px;color:#2c3338;cursor:pointer;
}
.es-chat-menu button:hover,.es-chat-menu a:hover{background:var(--es-chat-green-soft);color:var(--es-chat-green);}
.es-chat-menu i{width:15px;text-align:center;color:var(--es-chat-green);}

/* ---------------- Messages ---------------- */
.es-chat-body{
  flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:16px 14px 10px;
  background:#F7F8F6;
  scrollbar-width:thin;scrollbar-color:#c8d0cb transparent;
}
.es-chat-body::-webkit-scrollbar{width:7px;}
.es-chat-body::-webkit-scrollbar-thumb{background:#c8d0cb;border-radius:99px;}
.es-chat-msg{display:flex;gap:8px;align-items:flex-start;margin:0 0 14px;}
.es-chat-msg--user{justify-content:flex-end;}
.es-chat-msg-avatar{
  width:28px;height:28px;flex:0 0 28px;border-radius:50%;overflow:hidden;
  background:var(--es-chat-green);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:11px;
  margin-top:16px;
}
.es-chat-msg-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.es-chat-msg-main{max-width:92%;min-width:0;}
.es-chat-msg--bot .es-chat-msg-main{max-width:calc(100% - 36px);}
.es-chat-msg-meta{
  display:flex;align-items:center;gap:6px;
  font-size:10px;letter-spacing:.06em;text-transform:uppercase;
  color:#8a938d;margin:0 0 4px;line-height:1.2;
}
.es-chat-msg-meta strong{font-family:'Oswald',sans-serif;font-weight:500;color:#6b756e;letter-spacing:.08em;}
.es-chat-msg--user .es-chat-msg-meta{justify-content:flex-end;}
.es-chat-msg--user .es-chat-msg-meta strong{color:#8a938d;}
.es-chat-bubble{
  background:#fff;border:1px solid var(--es-chat-border);
  border-radius:12px 12px 12px 4px;
  padding:10px 12px;
  font-size:14px;line-height:1.55;color:#2c3338;
  box-shadow:0 2px 8px rgba(0,0,0,.03);
  overflow-wrap:anywhere;
}
.es-chat-msg--user .es-chat-bubble{
  background:var(--es-chat-green);border-color:var(--es-chat-green);
  color:#fff;border-radius:12px 12px 4px 12px;
}
.es-chat-bubble p{margin:0 0 8px;}
.es-chat-bubble p:last-child{margin:0;}
.es-chat-bubble a{color:var(--es-chat-green);text-decoration:underline;}
.es-chat-msg--user .es-chat-bubble a{color:#fff;}

/* ---------------- Quick replies ---------------- */
.es-chat-quick{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.es-chat-chip{
  border:1px solid var(--es-chat-green);background:#fff;color:var(--es-chat-green);
  border-radius:99px;padding:7px 11px;cursor:pointer;
  font-family:'Oswald',sans-serif;font-size:10.5px;font-weight:400;
  letter-spacing:.05em;text-transform:uppercase;line-height:1.2;
  transition:background .16s ease,color .16s ease;
}
.es-chat-chip:hover{background:var(--es-chat-green);color:#fff;}
.es-chat-feedback{
  display:flex;align-items:center;flex-wrap:wrap;gap:5px;
  margin:7px 0 0;font-size:11px;color:#8a938d;line-height:1.4;
}
.es-chat-feedback-q{margin-right:2px;}
.es-chat-feedback button{
  border:1px solid var(--es-chat-border);background:#fff;color:#3b4640;
  border-radius:99px;padding:2px 7px;font-size:13px;line-height:1.35;
  cursor:pointer;transition:border-color .15s,background .15s;
}
.es-chat-feedback button:hover{border-color:var(--es-chat-green);background:#f2f7f4;}
.es-chat-feedback.is-done button{display:none;}
.es-chat-feedback.is-done .es-chat-feedback-q{display:none;}
.es-chat-feedback-thanks{color:#00693e;font-weight:500;}
.es-chat-feedback-thanks[hidden]{display:none;}

/* ---------------- Action buttons ---------------- */
.es-chat-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;}
.es-chat-action{
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:8px;padding:8px 12px;text-decoration:none;
  font-family:'Oswald',sans-serif;font-size:10.5px;letter-spacing:.06em;
  text-transform:uppercase;line-height:1.2;border:1px solid transparent;
}
.es-chat-action--primary{background:var(--es-chat-orange);color:#fff;}
.es-chat-action--primary:hover{background:var(--es-chat-orange-dark);}
.es-chat-action--outline{border-color:var(--es-chat-green);color:var(--es-chat-green);background:#fff;}
.es-chat-action--outline:hover{background:var(--es-chat-green);color:#fff;}
.es-chat-action--link{color:var(--es-chat-green);text-decoration:underline;padding-left:2px;padding-right:2px;}

/* ---------------- Chat product cards ---------------- */
.es-chat-products{display:flex;flex-direction:column;gap:8px;margin-top:10px;}
.es-chat-product{
  display:flex;gap:9px;align-items:center;
  border:1px solid var(--es-chat-border);border-radius:10px;
  background:#fff;padding:8px;
}
.es-chat-product-media{
  width:54px;height:54px;flex:0 0 54px;border-radius:8px;
  background:#F7F8F6;display:flex;align-items:center;justify-content:center;
  overflow:hidden;padding:4px;box-sizing:border-box;
}
.es-chat-product-media img{max-width:100%;max-height:100%;object-fit:contain;display:block;}
.es-chat-product-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;}
.es-chat-product-name{
  font-family:'Oswald',sans-serif;font-size:11.5px;font-weight:400;
  text-transform:uppercase;letter-spacing:.02em;line-height:1.3;
  color:var(--es-chat-green);text-decoration:none;
}
.es-chat-product-name:hover{text-decoration:underline;}
.es-chat-product-price{font-size:12.5px;font-weight:700;color:var(--es-chat-green);}
.es-chat-product-price del{color:#9ca3af;font-weight:400;}
.es-chat-product-stock{font-size:10.5px;color:var(--es-chat-muted);}
.es-chat-product-actions{display:flex;align-items:center;gap:9px;margin-top:3px;flex-wrap:wrap;}
.es-chat-view{
  font-family:'Oswald',sans-serif;font-size:10px;letter-spacing:.06em;
  text-transform:uppercase;color:var(--es-chat-green);text-decoration:underline;
}
.es-chat-add-quote{
  display:inline-flex !important;align-items:center !important;justify-content:center !important;
  width:auto !important;min-height:0 !important;
  margin:0 !important;padding:6px 9px !important;
  font-size:9.5px !important;line-height:1.2 !important;border-radius:6px !important;
}

/* ---------------- Lead form ---------------- */
.es-chat-lead{
  display:flex;flex-direction:column;gap:7px;
  margin-top:10px;padding:10px;border:1px solid var(--es-chat-border);
  border-radius:10px;background:#fff;
}
.es-chat-lead strong{
  font-family:'Oswald',sans-serif;font-size:11.5px;font-weight:400;
  letter-spacing:.05em;text-transform:uppercase;color:var(--es-chat-green);
}
.es-chat-lead input,.es-chat-lead textarea{
  width:100%;box-sizing:border-box;border:1px solid var(--es-chat-border);
  border-radius:7px;padding:8px 10px;font-family:'Barlow',sans-serif;
  font-size:13px;line-height:1.35;background:#fff;color:#2c3338;
}
.es-chat-lead input:focus,.es-chat-lead textarea:focus{
  outline:none;border-color:var(--es-chat-green);box-shadow:0 0 0 2px rgba(0,77,44,.12);
}
.es-chat-lead textarea{resize:vertical;min-height:54px;}
.es-chat-lead button{
  border:0;border-radius:7px;background:var(--es-chat-orange);color:#fff;
  padding:9px 12px;font-family:'Oswald',sans-serif;font-size:11px;
  letter-spacing:.06em;text-transform:uppercase;cursor:pointer;
}
.es-chat-lead button:hover{background:var(--es-chat-orange-dark);}
.es-chat-lead button:disabled{opacity:.6;cursor:default;}
.es-chat-lead small{font-size:10.5px;color:var(--es-chat-muted);line-height:1.4;}
.es-chat-lead-msg{font-size:11.5px;line-height:1.4;}
.es-chat-lead-msg.ok{color:#166534;}
.es-chat-lead-msg.bad{color:#b32d2e;}
.es-chat-lead-success{
  display:flex;gap:8px;align-items:flex-start;
  padding:10px;border-radius:9px;background:var(--es-chat-green-soft);
  color:#166534;font-size:12.5px;line-height:1.45;
}
.es-chat-lead-success i{margin-top:2px;}

/* ---------------- Typing ---------------- */
.es-chat-typing{display:inline-flex;gap:4px;align-items:center;padding:4px 1px;}
.es-chat-typing span{
  width:6px;height:6px;border-radius:50%;background:#9aa49d;
  animation:es-chat-bounce 1.1s infinite ease-in-out;
}
.es-chat-typing span:nth-child(2){animation-delay:.14s;}
.es-chat-typing span:nth-child(3){animation-delay:.28s;}
@keyframes es-chat-bounce{0%,60%,100%{transform:translateY(0);opacity:.5;}30%{transform:translateY(-4px);opacity:1;}}

/* ---------------- Composer ---------------- */
.es-chat-form{
  flex:0 0 auto;
  display:flex;align-items:flex-end;gap:7px;
  padding:9px 11px 8px;border-top:1px solid var(--es-chat-border);background:#fff;
}
.es-chat-input-wrap{flex:1;min-width:0;display:block;}
.es-chat-input-wrap textarea{
  width:100%;box-sizing:border-box;border:1px solid var(--es-chat-border);
  border-radius:18px;padding:9px 12px;background:#fff;color:#2c3338;
  font-family:'Barlow',sans-serif;font-size:14px;line-height:1.4;
  resize:none;max-height:110px;min-height:38px;overflow-y:auto;
}
.es-chat-input-wrap textarea:focus{
  outline:none;border-color:var(--es-chat-green);box-shadow:0 0 0 2px rgba(0,77,44,.12);
}
.es-chat-input-wrap textarea::placeholder{color:#9ca3af;}
.es-chat-send{
  width:38px;height:38px;flex:0 0 38px;border:0;border-radius:50%;
  background:var(--es-chat-orange);color:#fff;cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:14px;
  transition:background .16s ease,transform .16s ease;
}
.es-chat-send:hover{background:var(--es-chat-orange-dark);transform:translateY(-1px);}
.es-chat-send:disabled{opacity:.5;cursor:default;transform:none;}

/* ---------------- Footer ---------------- */
.es-chat-foot{
  flex:0 0 auto;
  display:flex;justify-content:space-between;gap:5px;align-items:center;
  padding:5px 12px 7px;background:#fff;border-top:1px solid #f1f3f2;
  font-size:9px;line-height:1.3;color:#9aa49d;white-space:nowrap;
}
.es-chat-foot-tag{white-space:nowrap;min-width:0;}
.es-chat-foot-accent{color:var(--es-chat-orange);font-weight:600;}
.es-chat-foot a{color:#8a938d;text-decoration:none;}
.es-chat-foot a:hover{text-decoration:underline;color:var(--es-chat-green);}

@media (max-width:340px){
  .es-chat-foot{font-size:8px;gap:3px;padding-left:6px;padding-right:6px;}
}

/* ---------------- Mobile ---------------- */
@media (max-width:640px){
  .es-chat{right:12px;bottom:12px;}
  .es-chat-launcher{width:56px;height:56px;}
  .es-chat-panel{
    position:fixed;inset:8px;width:auto;height:auto;max-height:none;
    bottom:8px;border-radius:14px;
  }
  .es-chat.is-open .es-chat-launcher{display:none;}
  body.es-chat-open{overflow:hidden;}
  .es-chat-msg-main{max-width:95%;}
  .es-chat-head-text strong{font-size:13px;}
}
@media (max-width:380px){
  .es-chat-brand{gap:8px;}
  .es-chat-head-avatar{width:32px;height:32px;flex-basis:32px;}
  .es-chat-head-avatar img{width:32px;height:32px;}
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion:reduce){
  .es-chat-panel,.es-chat-launcher,.es-chat-send,.es-chat-typing span{animation:none !important;transition:none !important;}
}

/* ---------------- Proactive invitation ---------------- */
.es-chat-teaser{
  position:absolute;right:0;bottom:74px;width:270px;
  display:flex;align-items:flex-start;gap:8px;
  background:#fff;border:1px solid #E2E5E0;border-radius:14px;
  padding:9px 10px;box-shadow:0 12px 34px rgba(0,0,0,.18);
  animation:es-chat-teaser-in .25s ease both;
}
.es-chat-teaser[hidden]{display:none !important;}
.es-chat.is-open .es-chat-teaser{display:none !important;}
@keyframes es-chat-teaser-in{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}
.es-chat-teaser-open{
  display:flex;align-items:center;gap:8px;flex:1;min-width:0;
  border:0;background:transparent;padding:0;text-align:left;cursor:pointer;
  font-family:'Barlow',sans-serif;font-size:12.5px;line-height:1.4;color:#2c3338;
}
.es-chat-teaser-avatar{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;overflow:hidden;
  background:var(--es-chat-green,#004D2C);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:13px;
}
.es-chat-teaser-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.es-chat-teaser-close{
  width:20px;height:20px;flex:0 0 20px;border:0;background:transparent;
  color:#9aa49d;font-size:17px;line-height:1;cursor:pointer;padding:0;border-radius:50%;
}
.es-chat-teaser-close:hover{background:#f2f5f3;color:#004D2C;}
@media (max-width:640px){
  .es-chat-teaser{right:0;bottom:68px;width:calc(100vw - 24px);max-width:290px;}
}
@media (prefers-reduced-motion:reduce){.es-chat-teaser{animation:none;}}
