/* ============================================================
   TREND & BRAND — Site-wide widgets
   Teddy chatbot · Floating WhatsApp · Cookie consent
   Self-contained: works on legal pages, blog pages, anywhere.
   ============================================================ */
:root {
  --tb-bg-2: #111111;
  --tb-bg-3: #161616;
  --tb-ink: #f5f1e8;
  --tb-ink-soft: rgba(245, 241, 232, 0.78);
  --tb-ink-mute: rgba(245, 241, 232, 0.5);
  --tb-gold: #d4a857;
  --tb-line: rgba(245, 241, 232, 0.08);
  --tb-line-strong: rgba(212, 168, 87, 0.25);
  --tb-serif: 'Fraunces', Georgia, serif;
  --tb-sans: 'Inter', -apple-system, sans-serif;
}

/* ===== FLOATING WHATSAPP ===== */
.float-wa {
  position: fixed;
  bottom: 100px; right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
  z-index: 50;
  transition: transform 0.3s, box-shadow 0.3s;
  animation: tb-wapulse 2.5s ease-in-out infinite;
  text-decoration: none;
}
.float-wa:hover { transform: scale(1.1); }
@keyframes tb-wapulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 12px 50px rgba(37, 211, 102, 0.7); }
}

/* ===== TEDDY CHATBOT ===== */
.chat-toggle {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tb-gold) 0%, #b8902f 100%);
  color: #0a0a0a;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 14px 36px rgba(212, 168, 87, 0.45);
  z-index: 60;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s;
  font-family: var(--tb-sans);
}
.chat-toggle:hover { transform: scale(1.08) rotate(-4deg); box-shadow: 0 16px 50px rgba(212, 168, 87, 0.6); }
.chat-toggle.open { background: #1a1a1a; color: var(--tb-gold); }
.chat-toggle-icon { display: flex; transition: transform 0.3s; }
.chat-toggle.open .chat-toggle-icon { transform: rotate(90deg); }
.chat-toggle-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--tb-gold);
  opacity: 0;
  animation: tb-chatPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes tb-chatPulse {
  0% { transform: scale(0.92); opacity: 0.6; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.chat-window {
  position: fixed;
  bottom: 100px; right: 28px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, #141414 0%, #0e0e0e 100%);
  border: 1px solid var(--tb-line-strong);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 168, 87, 0.05);
  z-index: 59;
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: var(--tb-sans);
  color: var(--tb-ink);
}
.chat-window.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--tb-line);
  background: linear-gradient(180deg, rgba(212, 168, 87, 0.08), transparent);
  flex-shrink: 0;
}
.chat-avatar {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tb-gold), #8b6914);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--tb-serif);
  font-weight: 700;
  font-size: 20px;
  color: #0a0a0a;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(212, 168, 87, 0.3);
}
.chat-avatar-mark { line-height: 1; }
.chat-status-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #141414;
  animation: tb-statusPulse 2s ease-in-out infinite;
}
@keyframes tb-statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  50% { box-shadow: 0 0 0 5px rgba(46, 204, 113, 0); }
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-info h4 {
  font-family: var(--tb-serif);
  font-size: 16px; font-weight: 600;
  color: var(--tb-ink);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.chat-badge {
  font-family: var(--tb-sans);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-gold);
  background: rgba(212, 168, 87, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(212, 168, 87, 0.2);
}
.chat-subtitle {
  font-size: 11px;
  color: var(--tb-ink-mute);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.02em;
}
.chat-status-mini { width: 6px; height: 6px; border-radius: 50%; background: #2ecc71; }
.chat-close {
  background: transparent;
  border: 1px solid var(--tb-line);
  color: var(--tb-ink-soft);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}
.chat-close:hover { color: var(--tb-gold); border-color: var(--tb-gold); }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--tb-line-strong) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--tb-line-strong); border-radius: 3px; }
.chat-msg { display: flex; animation: tb-msgIn 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes tb-msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.bot { justify-content: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tb-ink);
}
.chat-msg.bot .chat-bubble {
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid var(--tb-line);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--tb-gold), #b8902f);
  color: #0a0a0a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-bubble a { color: var(--tb-gold); font-weight: 500; }
.chat-msg.user .chat-bubble a { color: #0a0a0a; text-decoration: underline; }
.chat-bubble strong { font-weight: 600; }
.chat-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tb-ink-mute);
  animation: tb-typingDot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tb-typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 18px 0;
  border-top: 1px solid var(--tb-line);
  flex-shrink: 0;
}
.chat-chip {
  font-family: var(--tb-sans);
  font-size: 12px;
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid var(--tb-line);
  color: var(--tb-ink-soft);
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chat-chip:hover {
  background: rgba(212, 168, 87, 0.1);
  border-color: rgba(212, 168, 87, 0.3);
  color: var(--tb-gold);
}
.chat-input-row {
  display: flex; gap: 8px; align-items: center;
  padding: 14px 18px;
  flex-shrink: 0;
  margin: 0;
}
.chat-input {
  flex: 1;
  background: rgba(245, 241, 232, 0.04);
  border: 1px solid var(--tb-line);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--tb-ink);
  font-family: var(--tb-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.chat-input:focus { border-color: rgba(212, 168, 87, 0.45); background: rgba(245, 241, 232, 0.06); }
.chat-input::placeholder { color: var(--tb-ink-mute); }
.chat-send {
  background: linear-gradient(135deg, var(--tb-gold), #b8902f);
  color: #0a0a0a;
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.chat-send:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(212, 168, 87, 0.4); }
.chat-foot {
  font-size: 10px;
  color: var(--tb-ink-mute);
  text-align: center;
  padding: 8px 18px 12px;
  border-top: 1px solid var(--tb-line);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.chat-foot a { color: var(--tb-gold); text-decoration: none; }
.chat-foot a:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .chat-window { bottom: 88px; right: 12px; left: 12px; width: auto; height: calc(100vh - 130px); }
  .chat-toggle { bottom: 18px; right: 18px; width: 54px; height: 54px; font-size: 22px; }
  .float-wa { bottom: 84px; right: 22px; width: 44px; height: 44px; font-size: 20px; }
}

/* ===== COOKIE CONSENT ===== */
.cookie-banner {
  position: fixed; bottom: 24px; left: 24px; right: 24px;
  max-width: 920px; margin: 0 auto;
  background: var(--tb-bg-3);
  border: 1px solid var(--tb-line-strong);
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  z-index: 9000;
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: var(--tb-sans);
  color: var(--tb-ink);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.cookie-text { flex: 1; min-width: 280px; }
.cookie-text strong {
  display: block;
  font-family: var(--tb-serif);
  font-size: 17px; font-weight: 600;
  margin-bottom: 6px;
}
.cookie-text p { font-size: 13px; color: var(--tb-ink-soft); line-height: 1.55; margin: 0; }
.cookie-text a { color: var(--tb-gold); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-actions button {
  padding: 11px 22px; font-size: 13px;
  font-family: var(--tb-sans);
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.01em;
}
.cookie-actions .ck-reject {
  background: transparent;
  color: var(--tb-ink);
  border: 1px solid var(--tb-line);
}
.cookie-actions .ck-reject:hover { border-color: var(--tb-gold); color: var(--tb-gold); }
.cookie-actions .ck-accept {
  background: var(--tb-gold);
  color: #0a0a0a;
  border: none;
  box-shadow: 0 8px 20px rgba(212, 168, 87, 0.25);
}
.cookie-actions .ck-accept:hover { background: #e8c47a; transform: translateY(-1px); }
@media (max-width: 600px) {
  .cookie-banner { left: 12px; right: 12px; padding: 20px; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; justify-content: center; }
}
