/* Floating support chat */
.ad-chat-fab {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 99990 !important;
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  max-width: 60px !important;
  max-height: 60px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  background: var(--ad-accent, #ff5722) !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(255, 87, 34, 0.35);
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
  overflow: visible !important;
  transition: transform 0.15s ease, background 0.2s ease;
}

.ad-chat-fab i {
  margin: 0 !important;
  line-height: 1 !important;
}

.ad-chat-fab:hover {
  transform: translateY(-2px);
  background: #f4511e !important;
}

.ad-chat-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #1c1d1f;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.ad-chat-fab__badge.is-on {
  display: inline-flex;
}

body.ad-chat-open {
  overflow: hidden;
}

.ad-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 99991;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(17, 18, 19, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #eceef1;
}

.ad-chat-panel[hidden] {
  display: none !important;
}

.ad-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: #1c1d1f;
  color: #fff !important;
}

.ad-chat-panel__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  font-family: 'Manrope', system-ui, sans-serif;
  color: #fff !important;
  letter-spacing: normal;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-chat-panel__head #ad-chat-title {
  color: #fff !important;
}

.ad-chat-plus {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  background: var(--ad-accent, #ff5722);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.ad-chat-plus:not([hidden]) {
  display: inline-flex;
}

.ad-chat-panel__head p,
.ad-chat-panel__head #ad-chat-sub {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.7;
  color: #fff !important;
}

.ad-chat-panel__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.ad-chat-tabs {
  display: none;
}

.ad-chat-tab {
  border: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  color: #2c3e50;
}

.ad-chat-tab.is-active {
  background: #ff5722;
  border-color: #ff5722;
  color: #fff;
}

.ad-chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 14px 14px 8px;
  background: #f7f8f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-chat-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  font-family: 'Manrope', system-ui, sans-serif;
}

.ad-chat-bubble--bot,
.ad-chat-bubble--manager {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #eceef1;
  color: #1c1d1f;
}

.ad-chat-bubble--user {
  align-self: flex-end;
  background: #ff5722;
  color: #fff;
}

.ad-chat-bubble__who {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0.7;
}

.ad-chat-products {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ad-chat-product {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: #f3f4f6;
  text-decoration: none;
  color: inherit;
}

.ad-chat-product img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.ad-chat-product__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.ad-chat-product__meta {
  font-size: 12px;
  color: #707980;
  margin-top: 2px;
}

.ad-chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eceef1;
  background: #fff;
  align-items: center;
}

.ad-chat-attach {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1c1d1f;
  background: #f3f4f6;
  cursor: pointer;
  flex-shrink: 0;
}

.ad-chat-attach:hover {
  background: #ffe8df;
  color: #ff5722;
}

.ad-chat-compose input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
}

.ad-chat-compose button {
  border: 0;
  border-radius: 12px;
  background: #1c1d1f;
  color: #fff;
  padding: 0 14px;
  height: 42px;
  font-weight: 800;
  cursor: pointer;
}

.ad-chat-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
  background: #fff;
  border-top: 1px solid #eceef1;
}

.ad-chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
}

.ad-chat-chip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

.ad-chat-chip em {
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.ad-chat-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.ad-chat-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ad-chat-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.ad-chat-file--img img {
  display: block;
  max-width: 180px;
  max-height: 140px;
  border-radius: 10px;
  object-fit: cover;
}

.ad-chat-login {
  padding: 24px 16px;
  text-align: center;
  color: #707980;
  font-size: 14px;
}

.ad-chat-login a {
  color: #ff5722;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 768px) {
  .ad-chat-fab {
    right: 14px !important;
    bottom: 78px !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    border-radius: 50% !important;
  }
  .ad-chat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 148px;
    height: min(520px, calc(100vh - 170px));
  }
}
