/* ==========================================================================
   RUSTEC™ AI SALES CONSULTANT / WIRTUALNY DORADCA TECHNICZNY (v1.0)
   Stylistyka: Industrial Dark, Techniczny Grafit, Akcent Pomarańczowy #ff6600
   ========================================================================== */

/* 1. Pływający przycisk wywołania (Floating Trigger) - Umieszczony elegancko po LEWEJ stronie */
.rustec-ai-trigger {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  right: auto !important;
  z-index: 9994 !important;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111620;
  border: 1px solid #ff6600;
  border-radius: 50px;
  padding: 8px 18px 8px 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 102, 0, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.rustec-ai-trigger:hover {
  transform: translateY(-2px);
  background: #171f2c;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 102, 0, 0.4);
  border-color: #ff8533;
}

.rustec-ai-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6600, #b34700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rustec-ai-avatar-icon {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.rustec-ai-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #111620;
  box-shadow: 0 0 6px #10b981;
}

.rustec-ai-trigger-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.rustec-ai-trigger-title {
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

.rustec-ai-trigger-sub {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

/* Dymek zachęty (Teaser tooltip) */
.rustec-ai-teaser {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  right: auto;
  background: #18202d;
  border: 1px solid #2d3748;
  border-left: 3px solid #ff6600;
  color: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  width: 240px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  animation: rustecFadeSlide 0.3s ease;
  pointer-events: none;
}

.rustec-ai-teaser::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 24px;
  border-width: 6px;
  border-style: solid;
  border-color: #18202d transparent transparent transparent;
}

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

/* 2. Główne Okno Czatu (Chat Drawer / Window) */
.rustec-ai-window {
  position: fixed;
  bottom: 86px;
  left: 24px;
  right: auto;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  background: #0f131a;
  border: 1px solid #263242;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 102, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9995;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.rustec-ai-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Nagłówek czatu */
.rustec-ai-header {
  background: #141b24;
  border-bottom: 1px solid #263242;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rustec-ai-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rustec-ai-header-title {
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
}

.rustec-ai-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11px;
}

.rustec-ai-header-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.rustec-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rustec-ai-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.15s;
}

.rustec-ai-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Ciało czatu - Wiadomości */
.rustec-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  background: radial-gradient(circle at 80% 10%, rgba(255, 102, 0, 0.03) 0%, transparent 60%);
}

.rustec-ai-body::-webkit-scrollbar {
  width: 5px;
}
.rustec-ai-body::-webkit-scrollbar-thumb {
  background: #2a3442;
  border-radius: 3px;
}

/* Chmurki wiadomości */
.rustec-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: rustecFadeSlide 0.25s ease;
}

.rustec-msg.bot {
  align-self: flex-start;
}

.rustec-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.rustec-msg-bubble {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.rustec-msg.bot .rustec-msg-bubble {
  background: #1a222f;
  color: #e2e8f0;
  border: 1px solid #283446;
  border-top-left-radius: 2px;
}

.rustec-msg.user .rustec-msg-bubble {
  background: linear-gradient(135deg, #ff6600, #ea580c);
  color: #fff;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.25);
}

.rustec-msg.bot strong {
  color: #fff;
}

/* Karta produktu / akcji wewnątrz czatu */
.rustec-chat-card {
  margin-top: 10px;
  background: #121822;
  border: 1px solid #ff6600;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rustec-chat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rustec-chat-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.rustec-chat-card-price {
  font-size: 14px;
  font-weight: 800;
  color: #ff8533;
  font-family: monospace;
}

.rustec-chat-card-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.rustec-chat-btn-buy {
  background: #ff6600;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}

.rustec-chat-btn-buy:hover {
  background: #ff7e1f;
}

/* Wskaźnik pisania (Typing dots) */
.rustec-typing-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #1a222f;
  border: 1px solid #283446;
  border-radius: 10px;
}

.rustec-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: rustecBounce 1.2s infinite ease-in-out;
}

.rustec-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.rustec-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Szybkie pytania (Suggestion Chips) */
.rustec-ai-chips-wrap {
  padding: 8px 14px;
  background: #121822;
  border-top: 1px solid #1f2735;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.rustec-ai-chips-wrap::-webkit-scrollbar { display: none; }

.rustec-chip {
  background: #1a222f;
  border: 1px solid #2d394b;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.rustec-chip:hover {
  background: rgba(255, 102, 0, 0.15);
  border-color: #ff6600;
  color: #fff;
}

/* Stopka z polem wpisywania */
.rustec-ai-footer {
  background: #141b24;
  border-top: 1px solid #263242;
  padding: 10px 12px;
}

.rustec-ai-input-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rustec-ai-input {
  flex: 1;
  background: #0d1117;
  border: 1px solid #2a3545;
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}

.rustec-ai-input:focus {
  border-color: #ff6600;
}

.rustec-ai-input::placeholder {
  color: #64748b;
  font-size: 12.5px;
}

.rustec-ai-btn-send {
  background: #ff6600;
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.rustec-ai-btn-send:hover {
  background: #ff7e1f;
}

.rustec-ai-btn-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* ==========================================================================
   GLOBALNA KOORDYNACJA PŁYWAJĄCYCH PRZYCISKÓW (KOSZYK, WHATSAPP, BACK-TO-TOP, AI)
   Gwarancja: Żadne ikony na siebie NIE nachodzą na żadnej rozdzielczości!
   ========================================================================== */

/* Usunięcie wadliwego szarego trapezu / poświaty obok logo */
.nav-brand::after {
  display: none !important;
  content: none !important;
}

.nav-brand {
  overflow: visible !important;
}

/* 1. PRAWA STRONA - PIONOWY STOS BEZ KOLIZJI */
.floating-cart-pill {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 9991 !important;
}

.floating-whatsapp-btn {
  position: fixed !important;
  bottom: 86px !important;
  right: 24px !important;
  z-index: 9992 !important;
}

.back-to-top {
  position: fixed !important;
  bottom: 148px !important;
  right: 28px !important;
  z-index: 9993 !important;
}

/* 2. LEWA STRONA - WIRTUALNY DORADCA AI */
.rustec-ai-trigger {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  right: auto !important;
  z-index: 9994 !important;
}

.rustec-ai-window {
  position: fixed !important;
  bottom: 86px !important;
  left: 24px !important;
  right: auto !important;
  z-index: 9995 !important;
}

/* Responsywność dla urządzeń mobilnych (telefony i małe tablety) */
@media (max-width: 768px) {
  /* Podniesienie elementów nad dolny pasek nawigacyjny sklepu */
  .floating-cart-pill {
    bottom: 74px !important;
    right: 14px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
  .floating-whatsapp-btn {
    bottom: 130px !important;
    right: 14px !important;
    padding: 8px 14px 8px 10px !important;
    font-size: 12px !important;
  }
  .back-to-top {
    bottom: 184px !important;
    right: 18px !important;
    width: 42px !important;
    height: 42px !important;
  }
  .rustec-ai-trigger {
    bottom: 74px !important;
    left: 14px !important;
    right: auto !important;
    padding: 6px 14px 6px 8px !important;
  }
  .rustec-ai-window {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
  }
}
