/* Green Route · Chat de cotización Astrid
   Compartido por la página principal y /promociones/.
   El panel usa flex-column para mantener el compositor siempre abajo. */
.gr-chat,
.gr-chat *{box-sizing:border-box}
.gr-chat{
  position:fixed;
  right:18px;
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  z-index:1100;
  font-family:Inter,Montserrat,Arial,sans-serif;
}
.gr-chat-launcher{
  position:relative;
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:#fff;
  box-shadow:0 10px 28px rgba(18,48,27,.24);
  cursor:pointer;
  overflow:visible;
  isolation:isolate;
  transition:transform .2s ease,box-shadow .2s ease;
}
.gr-chat-launcher:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(18,48,27,.30)}
.gr-chat-launcher::before{
  content:"";
  position:absolute;
  inset:-7px;
  z-index:-1;
  border-radius:50%;
  background:radial-gradient(circle,rgba(47,170,63,.22) 0%,rgba(47,170,63,.09) 48%,rgba(47,170,63,0) 72%);
  animation:grLauncherPulse 2.4s ease-out infinite;
}
.gr-launcher-avatar{
  width:56px;
  height:56px;
  display:block;
  object-fit:cover;
  border-radius:50%;
  box-shadow:0 5px 15px rgba(18,48,27,.12);
  transform-origin:72% 72%;
  animation:grLauncherWave 2.8s ease-in-out infinite;
}
.gr-launcher-badge{
  position:absolute;
  top:-4px;
  right:-3px;
  min-width:20px;
  height:20px;
  padding:0 4px;
  display:grid;
  place-items:center;
  border:2px solid #fff;
  border-radius:999px;
  background:#ef2e2e;
  color:#fff;
  font-size:10px;
  font-weight:800;
}
.gr-chat-panel{
  position:absolute;
  right:0;
  bottom:78px;
  width:min(360px,calc(100vw - 28px));
  height:min(480px,calc(100dvh - 118px));
  min-height:390px;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  overflow:hidden;
  background:#fff;
  border:1px solid #dfe7e1;
  border-radius:20px;
  box-shadow:0 24px 58px rgba(13,37,20,.25);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(12px) scale(.985);
  transform-origin:bottom right;
  transition:opacity .2s ease,transform .2s ease,visibility .2s ease;
}
.gr-chat.is-open .gr-chat-panel{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0) scale(1)}
.gr-chat-progress{flex:0 0 4px!important;width:100%;height:4px!important;background:#edf1ee;overflow:hidden}
.gr-chat-progress span{display:block;width:10%;height:100%;background:linear-gradient(90deg,#2faa3f,#6bd477);transition:width .35s ease}
.gr-chat-header{
  flex:0 0 auto!important;
  min-height:66px;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px;
  padding:10px 12px;
  background:#fff;
  border-bottom:1px solid #edf1ee;
}
.gr-chat-brand{display:flex;align-items:center;gap:10px;min-width:0}
.gr-chat-brand>img{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#edf8ef}
.gr-chat-brand>div{display:grid;line-height:1.08}
.gr-chat-brand strong{font:800 15px Inter,Montserrat,Arial,sans-serif;color:#202622}
.gr-chat-brand>div>span{display:flex;align-items:center;gap:6px;margin-top:4px;color:#238d38;font-size:10px;font-weight:700}
.gr-chat-brand>div>span i{width:7px;height:7px;border-radius:50%;background:#17a83a;box-shadow:0 0 0 3px rgba(23,168,58,.10)}
.gr-chat-actions{display:flex;align-items:center;gap:5px}
.gr-chat-actions button{
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  display:grid!important;
  place-items:center;
  padding:0!important;
  margin:0!important;
  border:0;
  border-radius:10px;
  background:#f4f7f5;
  color:#455149;
  cursor:pointer;
  font-size:13px;
}
.gr-chat-actions button:hover{background:#eaf4ec;color:#218a35}
.gr-chat-messages{
  flex:1 1 auto!important;
  min-height:0!important;
  width:100%;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding:20px 12px 14px;
  background:linear-gradient(180deg,#f7f9f8 0%,#f2f6f3 100%);
  scrollbar-width:thin;
  scrollbar-color:#bbc6be transparent;
}
.gr-message-row{display:flex;align-items:flex-end;gap:7px;margin:0 0 10px}
.gr-message-user{justify-content:flex-end}
.gr-message-avatar{flex:0 0 28px;width:28px;height:28px;border-radius:50%}
.gr-message-avatar-img{display:block;object-fit:cover;background:#e8f6ea;box-shadow:0 4px 10px rgba(35,141,56,.13)}
.gr-message-bubble{
  max-width:82%;
  padding:10px 12px;
  border:1px solid #e2e9e4;
  border-radius:15px 15px 15px 5px;
  background:#fff;
  color:#27302a;
  font-size:12.5px;
  line-height:1.45;
  box-shadow:0 3px 10px rgba(20,43,25,.035);
}
.gr-message-user .gr-message-bubble{border:0;border-radius:15px 15px 5px 15px;background:#c8f0ce;color:#1d5427}
.gr-message-summary{width:82%;max-width:82%;padding:12px}
.gr-message-summary>strong{display:block;margin-bottom:8px;font:800 12px Inter,Montserrat,Arial,sans-serif;color:#163b20}
.gr-message-summary dl{display:grid;gap:5px;margin:0}
.gr-message-summary dl>div{display:grid;grid-template-columns:67px 1fr;gap:7px;padding-top:5px;border-top:1px solid #edf1ee}
.gr-message-summary dt{font-size:9.5px;color:#7b867f}.gr-message-summary dd{margin:0;font-size:10.5px;font-weight:700;color:#2e3831}
.gr-typing{display:flex;align-items:center;gap:4px;min-width:46px}
.gr-typing i{width:5px;height:5px;border-radius:50%;background:#90a096;animation:grTyping 1s infinite ease-in-out}
.gr-typing i:nth-child(2){animation-delay:.14s}.gr-typing i:nth-child(3){animation-delay:.28s}
.gr-chat-composer{
  flex:0 0 auto!important;
  width:100%;
  min-height:58px!important;
  margin-top:auto!important;
  padding:9px 10px calc(9px + env(safe-area-inset-bottom,0px));
  background:#fff;
  border-top:1px solid #e3eae5;
}
.gr-chat-form{
  width:100%;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 42px!important;
  align-items:center!important;
  gap:8px!important;
  margin:0!important;
  padding:0!important;
  min-height:0!important;
  height:auto!important;
}
.gr-chat-form input,.gr-chat-form select{
  appearance:auto;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  border:1px solid #cfdad2!important;
  border-radius:12px!important;
  padding:0 12px!important;
  background:#fff!important;
  color:#202622!important;
  outline:none!important;
  font:400 12px/42px Inter,Montserrat,Arial,sans-serif!important;
}
.gr-chat-form input:focus,.gr-chat-form select:focus{border-color:#2faa3f!important;box-shadow:0 0 0 3px rgba(47,170,63,.11)!important}
.gr-chat-form button{
  width:42px!important;
  height:42px!important;
  min-height:42px!important;
  display:grid!important;
  place-items:center;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:12px!important;
  background:#2faa3f!important;
  color:#fff!important;
  cursor:pointer;
  font-size:15px!important;
}
.gr-chat-form button:hover{background:#238d38!important}
.gr-chat-finish{display:grid;gap:6px}
.gr-whatsapp-auto-note{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:10px 12px;border-radius:13px;background:#eaf9ee;color:#168735;font-weight:800;font-size:11.5px;border:1px solid #c8ecd1}
.gr-whatsapp-auto-note i{font-size:18px}
.gr-start-over{border:0;background:transparent;color:#238d38;font-size:10.5px;font-weight:800;cursor:pointer;padding:4px}
@keyframes grTyping{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}
@keyframes grLauncherWave{0%,52%,100%{transform:translateY(0) rotate(0deg) scale(1)}8%{transform:translateY(-2px) rotate(8deg) scale(1.02)}14%{transform:translateY(-1px) rotate(-7deg) scale(1.02)}20%{transform:translateY(-2px) rotate(7deg) scale(1.02)}26%{transform:translateY(-1px) rotate(-5deg) scale(1.02)}34%{transform:translateY(-1px) rotate(4deg) scale(1.01)}}
@keyframes grLauncherPulse{0%{transform:scale(.86);opacity:0}28%{opacity:.55}70%{opacity:.12}100%{transform:scale(1.18);opacity:0}}
@media(max-width:600px){
  .gr-chat{right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  .gr-chat-launcher{width:56px;height:56px}.gr-launcher-avatar{width:50px;height:50px}
  .gr-chat-panel{
    position:fixed!important;
    left:10px!important;
    right:10px!important;
    bottom:calc(76px + env(safe-area-inset-bottom,0px))!important;
    width:auto!important;
    height:min(440px,calc(100dvh - 98px))!important;
    min-height:0!important;
    max-height:440px!important;
    border-radius:18px;
    transform-origin:bottom right;
  }
  .gr-chat-header{min-height:62px;padding:9px 10px}.gr-chat-brand>img{width:40px;height:40px}
  .gr-chat-brand strong{font-size:14px}.gr-chat-brand>div>span{font-size:9.5px}
  .gr-chat-actions button{width:32px!important;height:32px!important;min-height:32px!important}
  .gr-chat-messages{padding:18px 10px 12px}
  .gr-message-bubble{max-width:84%;font-size:12px}.gr-message-summary{width:84%;max-width:84%}
  .gr-chat-composer{min-height:58px!important;padding:8px 9px calc(8px + env(safe-area-inset-bottom,0px))}
  .gr-chat-form{grid-template-columns:minmax(0,1fr) 40px!important;gap:7px!important}
  .gr-chat-form input,.gr-chat-form select{height:40px!important;min-height:40px!important;font-size:11.5px!important;line-height:40px!important}
  .gr-chat-form button{width:40px!important;height:40px!important;min-height:40px!important}
}
@media(max-width:360px){
  .gr-chat-panel{left:8px!important;right:8px!important;bottom:70px!important;height:min(420px,calc(100dvh - 86px))!important}
  .gr-chat-messages{padding-left:8px;padding-right:8px}
  .gr-message-bubble{max-width:86%}
}
@media(max-height:560px){
  .gr-chat-panel{height:calc(100dvh - 84px)!important;max-height:none!important;bottom:68px!important}
  .gr-chat-header{min-height:56px;padding-top:6px;padding-bottom:6px}
  .gr-chat-messages{padding-top:12px}
}
@media(prefers-reduced-motion:reduce){.gr-chat-panel,.gr-chat-launcher,.gr-typing i,.gr-chat-launcher::before,.gr-launcher-avatar{transition:none!important;animation:none!important}}
