/* ==== Agroshop AI Widget (floating) ==== */

/* ========== Launcher (button) ========== */
.aiw-launcher{
  position: fixed !important;
  right: 16px !important;
  bottom: 50px !important;
  z-index: 6500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background-color: #4b5563 !important;
  background-image: url("/static/ai_assistant/al.png") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.18) !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  overflow: visible !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

.aiw-launcher__text{
  display: none !important;
  line-height: 1 !important;
}

.aiw-launcher::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  background: rgba(255,255,255,.95);
  pointer-events: none;
}

.aiw-launcher.aiw-launcher--intro{
  animation:
    aiwPop .42s cubic-bezier(.2, 1.2, .2, 1) both,
    aiwWiggle 1.1s ease-in-out .18s both;
}

.aiw-launcher.aiw-launcher--intro::before{
  opacity: 1;
  animation: aiwDot .40s ease-out both;
}

@keyframes aiwPop{
  0%   { transform: scale(0.12); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1.00); }
}

@keyframes aiwWiggle{
  0%   { transform: translateX(0) rotate(0deg); }
  15%  { transform: translateX(3px) rotate(3deg); }
  30%  { transform: translateX(-3px) rotate(-3deg); }
  45%  { transform: translateX(2px) rotate(2deg); }
  60%  { transform: translateX(-2px) rotate(-2deg); }
  75%  { transform: translateX(1px) rotate(1deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

@keyframes aiwDot{
  0%   { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  70%  { transform: translate(-50%, -50%) scale(2.2); opacity: .35; }
  100% { transform: translate(-50%, -50%) scale(3.0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce){
  .aiw-launcher.aiw-launcher--intro{ animation: none !important; }
  .aiw-launcher.aiw-launcher--intro::before{ animation: none !important; }
}

@media (min-width: 769px){
  .aiw-launcher:hover{
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,.26) !important;
    filter: brightness(1.02) !important;
  }
  .aiw-launcher:active{
    transform: translateY(0) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.18) !important;
    filter: brightness(0.99) !important;
  }
  .aiw-launcher:focus-visible{
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(28,150,117,.22), 0 18px 44px rgba(0,0,0,.22) !important;
  }
}

/* ========== Panel (chat) ========== */
.aiw{
  position: fixed !important;
  right: 16px !important;
  bottom: 76px !important;
  z-index: 6501 !important;
  width: min(420px, calc(100vw - 32px)) !important;
  height: min(560px, calc(100vh - 140px)) !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;

  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(20,35,60,.14) !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 55px rgba(15,23,42,.24) !important;
}

.aiw.aiw--open{
  display: flex !important;
}

.aiw__header{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px !important;
  flex: 0 0 auto !important;
  border-bottom: 1px solid rgba(0,0,0,.06) !important;
  background: linear-gradient(180deg,#ffffff 0%,#f5f8fb 100%) !important;
}

.aiw__title{
  font-family: "GTEestiPro","Arial",sans-serif !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  color: #232323 !important;
}

.aiw__close{
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(0,0,0,.06) !important;
  cursor: pointer !important;
  font-size: 20px !important;
  line-height: 34px !important;
}

/* ===== quick buttons ===== */
.aiw__quick{
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  flex: 0 0 auto !important;
  border-bottom: 1px solid rgba(0,0,0,.06) !important;
  background: #eff0f0 !important;
}

.aiw__chip{
  width: 100% !important;
  white-space: normal !important;
  text-align: center !important;
  padding: 8px 10px !important;
  cursor: pointer !important;

  border: 1px solid rgba(28,150,117,.35) !important;
  background: #fff !important;
  color: #4b5563 !important;
  border-radius: 999px !important;

  font-family: "GTEestiPro","Arial",sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.aiw__meta{
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: #666 !important;
  background: #fff !important;
}

/* ===== log / messages ===== */
.aiw__log{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  color: #4b5563 !important;

  background: #ebfff8 !important;
  background-image: url("/static/ai_assistant/chat-pattern.svg") !important;
  background-size: 260px !important;
  background-repeat: repeat !important;
}

.aiw__msg{
  max-width: 92% !important;
  margin: 0 0 10px 0 !important;
  padding: 10px 12px !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
  border-radius: 14px !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.06) !important;
}

.aiw__msg--assistant{
  background: #ffffff !important;
  border: 1px solid rgba(20,35,60,.08) !important;
}

.aiw__msg--user{
  margin-left: auto !important;
  background: #eefaf4 !important;
  border: 1px solid rgba(27,150,117,.16) !important;
}

.aiw__link{
  color: #1c9675 !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
}

/* ===== input ===== */
.aiw__input{
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border-top: 1px solid rgba(0,0,0,.06) !important;
  background: #fff !important;
}

.aiw__input input{
  width: 100% !important;
  height: 40px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,.16) !important;
  font-size: 14px !important;
}

.aiw__input button{
  height: 40px !important;
  padding: 0 12px !important;
  border-radius: 12px !important;
  border: 0 !important;
  background: #4b5563 !important;
  color: #fff !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}