/**
 * Balochistan Minerals - AI Chatbot Premium Styling
 * Executive B2B mineral sourcing interface with refined typography and luxury accents.
 */

/* ==========================================================================
   Document Lock when AI Assistant is open (Mobile only)
   ========================================================================== */
@media (max-width: 768px) {
  html[data-assistant-open='true'],
  body[data-assistant-open='true'] {
    overflow: hidden !important;
    height: 100% !important;
    position: fixed !important;
    width: 100% !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
  }

  /* Completely unpaint background page elements on mobile so nothing can bleed or scroll */
  body[data-assistant-open='true'] > :not(#bm-chatbot-root) {
    display: none !important;
  }
}

/* ==========================================================================
   1. Chatbot Floating Action Launcher (FAB)
   ========================================================================== */
.bm-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: none;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  outline: none !important;
  font-family: var(--font-body, 'Poppins', sans-serif);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease, visibility 0.32s;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px);
}

.bm-chat-launcher.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.bm-chat-launcher.is-visible:hover {
  transform: translateY(-2px);
}

.bm-chat-launcher.is-visible:active {
  transform: translateY(1px) scale(0.98);
}

.bm-chat-launcher:focus,
.bm-chat-launcher:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Floating Prompt Pill (Appears 5s, disappears 15s smoothly) */
.bm-chat-launcher__pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  color: #0A1628;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9999px;
  box-shadow: 0 4px 18px rgba(10, 22, 40, 0.12), 0 0 0 1px rgba(204, 212, 218, 0.6);
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.bm-chat-launcher.is-visible .bm-chat-launcher__pill {
  animation: bmChatPillCycle 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.bm-chat-launcher:hover .bm-chat-launcher__pill {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
  animation-play-state: paused;
  box-shadow: 0 6px 22px rgba(10, 22, 40, 0.18), 0 0 0 1px rgba(212, 175, 55, 0.4);
}

.bm-chat-launcher__pill-dot,
.bm-chat-launcher__badge {
  display: none !important;
}

/* Main Circle Button */
.bm-chat-launcher__btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07101E 0%, #0F1F38 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-chat-launcher:hover .bm-chat-launcher__btn {
  border-color: #D4AF37;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
  transform: scale(1.04);
}

.bm-chat-launcher__btn:focus,
.bm-chat-launcher__btn:focus-visible {
  outline: none !important;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.5) !important;
}

.bm-chat-launcher__icon {
  width: 24px;
  height: 24px;
  stroke: #FFFFFF;
}


/* Smooth launcher dissolve when modal is open */
.bm-chat-open .bm-chat-launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.92);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}

/* ==========================================================================
   2. Outer Backdrop Overlay (Layer 1)
   ========================================================================== */
.bm-chat-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 16, 30, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9995;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.36s ease, visibility 0.36s;
  pointer-events: none;
}

.bm-chat-open .bm-chat-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ==========================================================================
   3. Chat Window Container (Layer 2)
   ========================================================================== */
.bm-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 385px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 44px);
  z-index: 9999;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 24px 54px -12px rgba(10, 22, 40, 0.32), 0 0 0 1px rgba(10, 22, 40, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateY(22px) scale(0.94);
  transform-origin: bottom right;
  transition: opacity 0.38s cubic-bezier(0.2, 0.9, 0.3, 1),
              transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1),
              visibility 0.38s;
  font-family: var(--font-body, 'Poppins', sans-serif);
}

.bm-chat-open .bm-chat-window {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Minimized State */
.bm-chat-window.bm-chat-minimized {
  height: 58px !important;
  border-radius: 14px;
  overflow: hidden;
}

.bm-chat-window.bm-chat-minimized .bm-chat-body,
.bm-chat-window.bm-chat-minimized .bm-chat-footer {
  display: none !important;
}

/* ==========================================================================
   3. Executive Header
   ========================================================================== */
.bm-chat-header {
  position: relative;
  background: #07101E;
  color: #FFFFFF;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  user-select: none;
  flex-shrink: 0;
  z-index: 2;
}

.bm-chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.55) 0%, rgba(212, 175, 55, 0.15) 50%, transparent 100%);
}

.bm-chat-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bm-chat-header__avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
}

.bm-chat-header__avatar svg {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF;
}

.bm-chat-header__meta {
  display: flex;
  flex-direction: column;
}

.bm-chat-header__title {
  font-family: var(--font-brand, 'Montserrat', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  line-height: 1.2;
  margin: 0;
}

.bm-chat-header__status {
  font-size: 0.6875rem;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.bm-chat-header__white-light {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.95);
  display: inline-block;
  flex-shrink: 0;
}

.bm-chat-header__actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.bm-chat-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
  outline: none;
  text-decoration: none;
}

.bm-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.bm-chat-btn-icon.bm-chat-btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.14);
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.35);
}

.bm-chat-btn-icon.bm-chat-btn-whatsapp.is-blinking {
  animation: bm-whatsapp-blink 0.9s ease-in-out 0.25s 2;
}

@keyframes bm-whatsapp-blink {
  0%, 100% {
    background: rgba(255, 255, 255, 0.05);
    color: #94A3B8;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transform: scale(1);
  }
  45%, 55% {
    background: rgba(37, 211, 102, 0.25);
    color: #25D366;
    border-color: rgba(37, 211, 102, 0.65);
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.5), 0 0 3px rgba(37, 211, 102, 0.85);
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bm-chat-btn-icon.bm-chat-btn-whatsapp.is-blinking {
    animation: none;
  }
}

.bm-chat-btn-icon:focus-visible {
  outline: 2px solid #D4AF37;
  outline-offset: 1px;
}

/* ==========================================================================
   4. Chat Body / Messages
   ========================================================================== */
.bm-chat-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: #F8FAFC;
  scroll-behavior: smooth;
  scroll-padding-top: 14px;
}

/* Custom Scrollbar */
.bm-chat-body::-webkit-scrollbar {
  width: 4px;
}
.bm-chat-body::-webkit-scrollbar-track {
  background: transparent;
}
.bm-chat-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
.bm-chat-body::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Messages Stream Wrapper */
.bm-chat-messages-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* Welcome Card */
.bm-chat-welcome {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 12px 13px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  margin-bottom: 2px;
  animation: bmChatMsgSlide 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bm-chat-welcome__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.bm-chat-welcome__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #0A1628;
  color: #D4AF37;
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-chat-welcome__title {
  font-family: var(--font-brand, 'Montserrat', sans-serif);
  font-size: 0.78125rem;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
  line-height: 1.2;
}

.bm-chat-welcome__subtitle {
  font-size: 0.65625rem;
  color: #64748B;
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.bm-chat-welcome__text {
  font-size: 0.71875rem;
  color: #475569;
  line-height: 1.48;
  margin: 0 0 9px 0;
}

/* Message Rows */
.bm-chat-msg {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: bmChatMsgSlide 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bm-chat-msg--bot {
  align-items: flex-start;
}

.bm-chat-msg--user {
  align-items: flex-end;
}

.bm-chat-msg__bubble {
  position: relative;
  word-break: break-word;
}

/* Bot Bubble Styling */
.bm-chat-msg--bot .bm-chat-msg__bubble {
  background: #FFFFFF;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-radius: 14px 14px 14px 3px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  padding: 10px 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  max-width: 92%;
}

/* User Bubble Styling - Compact pill on the right */
.bm-chat-msg--user .bm-chat-msg__bubble {
  background: #0A1628;
  color: #FFFFFF;
  border-radius: 14px 14px 3px 14px;
  box-shadow: 0 2px 6px rgba(10, 22, 40, 0.15);
  padding: 6px 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 78%;
  width: fit-content;
}

.bm-chat-msg__meta {
  font-size: 0.625rem;
  color: #94A3B8;
  margin-top: 3px;
  padding: 0 3px;
}

.bm-chat-msg--user .bm-chat-msg__meta {
  text-align: right;
  color: #64748B;
}

/* Markdown styling inside Bot Messages */
.bm-chat-msg__bubble p {
  margin: 0 0 6px 0;
}

.bm-chat-msg__bubble p:last-child {
  margin-bottom: 0;
}

.bm-chat-msg__bubble strong,
.bm-chat-msg__bubble b {
  color: #0F172A;
  font-weight: 500 !important;
  letter-spacing: 0.005em;
}

/* ==========================================================================
   5. Compact Micro-Thumbnail Pill Badge
   ========================================================================== */
.bm-chat-thumb-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #D4AF37;
  border-radius: 7px;
  padding: 4px 8px 4px 5px;
  margin-bottom: 7px;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.bm-chat-thumb-badge__img {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  background: #0A1628;
  flex-shrink: 0;
  border: 1px solid #CBD5E1;
}

.bm-chat-thumb-badge__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.bm-chat-thumb-badge__title {
  font-family: var(--font-brand, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
  line-height: 1.2;
}

.bm-chat-thumb-badge__sub {
  font-size: 0.65625rem;
  color: #64748B;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   6. Direct Source Navigation Link Badge (Click to Jump Directly to Page/Section)
   ========================================================================== */
.bm-chat-source {
  margin-top: 7px;
  display: flex;
  align-items: center;
}

.bm-chat-source__link,
.bm-chat-msg__bubble a.bm-chat-source__link,
.bm-chat-msg__bubble a.bm-chat-source__link:visited {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  cursor: pointer !important;
}

.bm-chat-source__link:hover,
.bm-chat-msg__bubble a.bm-chat-source__link:hover {
  background: #0A1628 !important;
  color: #FFFFFF !important;
  border-color: #0A1628 !important;
  text-decoration: none !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(10, 22, 40, 0.15) !important;
}

.bm-chat-source__icon {
  flex-shrink: 0;
  stroke: #D4AF37 !important;
  transition: stroke 0.18s ease;
}

.bm-chat-source__link:hover .bm-chat-source__icon {
  stroke: #D4AF37 !important;
}

/* ==========================================================================
   7. Interactive Chips
   ========================================================================== */
.bm-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
  animation: bmChatSubItemSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.bm-chat-chip {
  background: #F1F5F9;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
  outline: none;
  font-family: var(--font-body, 'Poppins', sans-serif);
}

.bm-chat-chip--thumb {
  padding: 2px 7px 2px 3px;
}

.bm-chat-chip__img {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0A1628;
}

.bm-chat-chip:hover {
  background: #0A1628;
  color: #FFFFFF;
  border-color: #0A1628;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(10, 22, 40, 0.14);
}

.bm-chat-chip:active {
  transform: translateY(0);
}

/* ==========================================================================
   7.1 Product Mini-Showroom Grid (Interactive Product Cards in Chat)
   ========================================================================== */
.bm-chat-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin: 7px 0 4px 0;
  width: 100%;
  animation: bmChatSubItemSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.bm-chat-product-card {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.bm-chat-product-card:hover {
  background: #FFFFFF;
  border-color: #D4AF37;
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.08);
  transform: translateY(-1px);
}

.bm-chat-product-card__img {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0A1628;
  border: 1px solid #CBD5E1;
}

.bm-chat-product-card__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.bm-chat-product-card__name {
  font-family: var(--font-brand, 'Montserrat', sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bm-chat-product-card__grade {
  font-size: 0.59375rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ==========================================================================
   8. Re-Engineered RFQ Card & Executive Desk Action Buttons
   ========================================================================== */
.bm-chat-rfq-card {
  margin-top: 9px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  animation: bmChatSubItemSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.bm-chat-rfq-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.bm-chat-rfq-card__title-group {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0F172A;
}

.bm-chat-rfq-card__title-group svg {
  color: #D4AF37;
}

.bm-chat-rfq-card__title {
  font-family: var(--font-brand, 'Montserrat', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  color: #0F172A;
}

.bm-chat-rfq-card__badge {
  font-size: 0.625rem;
  background: #0F1F3A;
  color: #D4AF37;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.bm-chat-rfq-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 9px;
}

.bm-chat-rfq-card__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bm-chat-rfq-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #475569;
  margin: 0;
}

.bm-chat-rfq-card__input {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.6875rem;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  outline: none;
  font-family: inherit;
  color: #0F172A;
  box-sizing: border-box;
  transition: border-color 0.2s, background-color 0.2s;
}

.bm-chat-rfq-card__input:focus {
  background: #FFFFFF;
  border-color: #0A1628;
  box-shadow: 0 0 0 2px rgba(10, 22, 40, 0.08);
}

.bm-chat-rfq-card__actions {
  display: flex;
  gap: 6px;
}

/* Bulletproof RFQ Buttons (Guaranteed No Underlines & White Text) */
.bm-chat-rfq-btn,
.bm-chat-msg__bubble a.bm-chat-rfq-btn,
.bm-chat-msg__bubble a.bm-chat-rfq-btn:visited,
.bm-chat-msg__bubble a.bm-chat-rfq-btn:hover {
  flex: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 6px 9px !important;
  font-size: 0.71875rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  color: #FFFFFF !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-underline-offset: 0 !important;
}

.bm-chat-rfq-btn svg {
  flex-shrink: 0;
}

/* Refined British Racing Green / Dark Pine for WhatsApp */
.bm-chat-rfq-btn--wa {
  background: #0B3D2E !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
  box-shadow: 0 2px 6px rgba(11, 61, 46, 0.25) !important;
}

.bm-chat-rfq-btn--wa:hover {
  background: #0F4F3C !important;
  box-shadow: 0 4px 10px rgba(11, 61, 46, 0.35) !important;
  transform: translateY(-1px);
}

/* Executive Midnight Navy for Email */
.bm-chat-rfq-btn--email {
  background: #0A1628 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 2px 6px rgba(10, 22, 40, 0.2) !important;
}

.bm-chat-rfq-btn--email:hover {
  background: #162A4A !important;
  box-shadow: 0 4px 10px rgba(10, 22, 40, 0.28) !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   9. Typing Indicator
   ========================================================================== */
.bm-chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px 12px 12px 3px;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  animation: bmChatMsgSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bm-chat-typing__dot {
  width: 4px;
  height: 4px;
  background: #64748B;
  border-radius: 50%;
  animation: bmChatBounce 1.4s infinite ease-in-out both;
}

.bm-chat-typing__dot:nth-child(1) { animation-delay: -0.32s; }
.bm-chat-typing__dot:nth-child(2) { animation-delay: -0.16s; }

/* ==========================================================================
   10. Chat Footer & Input Controls
   ========================================================================== */
.bm-chat-footer {
  padding: 8px 12px 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.bm-chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 3px 5px 3px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.bm-chat-form:focus-within {
  border-color: #0A1628;
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(10, 22, 40, 0.08);
}

.bm-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 4px 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #0F172A;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 75px;
  min-height: 20px;
}

.bm-chat-input::placeholder {
  color: #94A3B8;
  font-size: 0.75rem;
}

.bm-chat-send {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0A1628;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.bm-chat-send:hover:not(:disabled) {
  background: #162A4A;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(10, 22, 40, 0.25);
}

.bm-chat-send:active:not(:disabled) {
  transform: translateY(1px);
}

.bm-chat-send:disabled {
  background: #E2E8F0;
  color: #94A3B8;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ==========================================================================
   11. Keyframe Animations
   ========================================================================== */
@keyframes bmChatPillCycle {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    pointer-events: none;
  }
  2% {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }
  25% {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }
  27% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    pointer-events: none;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    pointer-events: none;
  }
}

@keyframes bmChatBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes bmChatMsgSlide {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bmChatSubItemSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   12. Mobile Responsiveness (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .bm-chat-launcher {
    bottom: 16px;
    right: 16px;
  }

  .bm-chat-launcher__pill {
    display: none;
  }

  .bm-chat-launcher__btn {
    width: 48px;
    height: 48px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
  }

  .bm-chat-overlay {
    background: #07101E; /* Solid luxury navy - 100% full screen coverage, never shrinks */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 9998;
  }

  .bm-chat-window {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    z-index: 9999;
    transform: translateY(16px);
    transform-origin: center bottom;
    transition: opacity 0.35s cubic-bezier(0.2, 0.9, 0.3, 1),
                transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1),
                visibility 0.35s;
  }

  .bm-chat-open .bm-chat-window {
    transform: translateY(0) !important;
  }

  .bm-chat-header {
    padding: 12px 14px;
    border-radius: 0;
  }

  .bm-chat-body {
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .bm-chat-msg {
    max-width: 95%;
  }

  .bm-chat-rfq-card__grid {
    grid-template-columns: 1fr;
  }

  /* Critical fix: 16px font-size prevents iOS Safari optical auto-zoom when tapping input */
  .bm-chat-input,
  .bm-chat-input::placeholder {
    font-size: 16px !important;
  }

  .bm-chat-footer {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
  }
}
