/* AGS floating chat widget — isolated from WP theme styles */
#ags-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  font-size: 16px !important;
  line-height: 1.5;
  font-family: "HK Grotesk Pro", Arial, sans-serif;
}

#ags-chat-widget,
#ags-chat-widget * {
  box-sizing: border-box;
}

#ags-chat-widget .ags-chat-widget__toggle {
  position: relative;
  z-index: 2;
  border: none !important;
  box-shadow: 0 6px 18px rgba(237, 28, 36, 0.28);
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  min-height: 50px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  background: #ed1c24 !important;
  color: #fff !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#ags-chat-widget .ags-chat-widget__toggle:hover,
#ags-chat-widget .ags-chat-widget__toggle:focus {
  background: #c4151c !important;
  color: #fff !important;
  transform: translateY(-1px);
  outline: none;
}

#ags-chat-widget .ags-chat-widget__icon {
  display: block;
  width: 22px;
  height: 22px;
  color: #fff;
}

#ags-chat-widget .ags-chat-widget__panel {
  position: fixed;
  right: 20px;
  bottom: 82px;
  width: min(300px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: #fff !important;
  border: 1px solid #e2e4e8;
  border-radius: 0 !important;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
  overflow: hidden;
  z-index: 1201;
}

#ags-chat-widget .ags-chat-widget__panel[hidden],
#ags-chat-widget:not([data-chat-expanded="true"]) .ags-chat-widget__panel {
  display: none !important;
}

#ags-chat-widget .ags-chat-widget__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px 12px;
  background: #1653ac !important;
  color: #fff !important;
  border-bottom: none;
}

#ags-chat-widget .ags-chat-widget__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

#ags-chat-widget .ags-chat-widget__toggle-icon--close {
  display: none;
  font-size: 30px;
  line-height: 1;
  font-weight: 300;
}

#ags-chat-widget[data-chat-expanded="true"] .ags-chat-widget__toggle-icon--open {
  display: none;
}

#ags-chat-widget[data-chat-expanded="true"] .ags-chat-widget__toggle-icon--close {
  display: inline-flex;
}

#ags-chat-widget .ags-chat-widget__title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: #fff !important;
}

#ags-chat-widget .ags-chatbot {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  background: #fff;
}

#ags-chat-widget .ags-chatbot__intro {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #4d4d4d !important;
  background: #fff;
  border-bottom: 1px solid #eceef3;
}

#ags-chat-widget .ags-chatbot__intro[hidden],
#ags-chat-widget .ags-chatbot__form[hidden],
#ags-chat-widget .ags-chatbot__success[hidden],
#ags-chat-widget .ags-chatbot__status[hidden] {
  display: none !important;
}

#ags-chat-widget .ags-chatbot__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 12px 14px 14px;
}

#ags-chat-widget .ags-chatbot__field {
  display: block;
  margin: 0;
}

#ags-chat-widget .ags-chatbot__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#ags-chat-widget .ags-chatbot__form input,
#ags-chat-widget .ags-chatbot__form textarea {
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 12px 14px !important;
  border: 1px solid #e2e4e8 !important;
  border-radius: 0 !important;
  font-family: "HK Grotesk Pro", Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #4d4d4d !important;
  background: #fff !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

#ags-chat-widget .ags-chatbot__form textarea {
  min-height: 88px !important;
  max-height: 140px;
  resize: vertical;
}

#ags-chat-widget .ags-chatbot__form input:focus,
#ags-chat-widget .ags-chatbot__form textarea:focus {
  outline: none !important;
  border-color: #1653ac !important;
  box-shadow: none !important;
}

#ags-chat-widget .ags-chatbot__actions {
  margin-top: 2px;
}

#ags-chat-widget .ags-chatbot__actions .ags-btn {
  width: 100% !important;
  min-height: 45px !important;
  cursor: pointer;
}

#ags-chat-widget .ags-chatbot__actions .ags-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none !important;
}

#ags-chat-widget .ags-chatbot__status {
  margin: 0;
  font-size: 12px !important;
  line-height: 1.4;
  color: #c0392b !important;
}

#ags-chat-widget .ags-chatbot__success {
  padding: 14px;
  background: #f7f8fb;
}

#ags-chat-widget .ags-chatbot__success p {
  margin: 0;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #4d4d4d !important;
}

.ags-footer-chat {
  cursor: pointer;
}

@media only screen and (max-width: 767px) {
  #ags-chat-widget {
    right: 16px;
    bottom: 16px;
  }

  #ags-chat-widget .ags-chat-widget__panel {
    right: 16px;
    bottom: 78px;
    width: min(300px, calc(100vw - 24px));
    max-height: min(400px, calc(100vh - 100px));
  }

  #ags-chat-widget .ags-chat-widget__toggle {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }
}
