.shop-chat {
  position: fixed;
  left: 22px;
  bottom: 24px;
  z-index: 99990;
  font-family: inherit;
}

.shop-chat__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--aurexo-accent, #84cc16);
  color: #111;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(132, 204, 22, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.shop-chat__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(17, 17, 17, 0.34);
}

.shop-chat__toggle i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.shop-chat.is-open .shop-chat__toggle {
  background: #111;
  color: #fff;
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.28);
}

.shop-chat__panel {
  position: absolute;
  left: 0;
  bottom: 68px;
  width: min(400px, calc(100vw - 28px));
  height: min(520px, calc(100dvh - 140px));
  max-height: min(520px, calc(100dvh - 140px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  box-sizing: border-box;
}

.shop-chat__panel[hidden] {
  display: none !important;
}

.shop-chat__panel:not([hidden]) {
  display: flex;
}

.shop-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #111 0%, #2d2d2d 100%);
  color: #fff;
  flex-shrink: 0;
}

.shop-chat__header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.shop-chat__header-main > div {
  min-width: 0;
}

.shop-chat__header strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.shop-chat__header small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.shop-chat__status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.18);
  flex-shrink: 0;
}

.shop-chat__close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.shop-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.shop-chat__msg {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.shop-chat__msg.is-bot {
  align-self: flex-start;
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

.shop-chat__msg.is-user {
  align-self: flex-end;
  background: #111;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.shop-chat__msg.is-typing {
  color: #6b7280;
  font-style: italic;
}

.shop-chat__cards {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
}

.shop-chat__card {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  box-sizing: border-box;
}

.shop-chat__card:hover {
  border-color: #111;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.shop-chat__card img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.shop-chat__card-body {
  min-width: 0;
  flex: 1;
}

.shop-chat__card strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shop-chat__card small {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shop-chat__card-price {
  display: block;
  margin-top: 4px;
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

.shop-chat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #eef2f7;
  background: #fff;
  max-height: 132px;
  overflow-x: hidden;
  overflow-y: auto;
  flex-shrink: 0;
  overscroll-behavior: contain;
}

.shop-chat__btn {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.shop-chat__btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.shop-chat__btn--whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.shop-chat__btn--whatsapp:hover {
  background: #1ebe5d;
  border-color: #1ebe5d;
}

.shop-chat__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid #eef2f7;
  background: #fff;
  flex-shrink: 0;
  min-height: 68px;
  box-sizing: border-box;
}

.shop-chat__form input {
  flex: 1 1 auto;
  min-width: 0;
  width: 0;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.25;
  outline: none;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.shop-chat__form input:focus {
  border-color: #111;
  outline: 2px solid rgba(17, 17, 17, 0.12);
  outline-offset: 0;
  box-shadow: none;
}

.shop-chat__form button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .shop-chat {
    left: 14px;
    bottom: 18px;
  }

  .shop-chat__toggle span {
    display: none;
  }

  .shop-chat__panel {
    left: 0;
    bottom: 62px;
    height: min(480px, calc(100dvh - 120px));
    max-height: min(480px, calc(100dvh - 120px));
  }
}

@media print {
  .shop-chat {
    display: none !important;
  }
}
