.chat-widget {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 1000;
}

.chat-widget-button {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px var(--primary-glow);
  transition: var(--transition-base);
  position: relative;
  cursor: pointer;
}

.chat-widget-button:hover {
  transform: scale(1.1);
}

.chat-widget-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: white;
  stroke-width: 2;
}

.chat-icon-close {
  display: none;
}

.chat-widget.active .chat-icon-open {
  display: none;
}

.chat-widget.active .chat-icon-close {
  display: block;
}

.chat-widget-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--darker);
}

.chat-widget.active .chat-widget-badge {
  display: none;
}

.chat-widget-popup {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition-base);
}

.chat-widget.active .chat-widget-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-widget-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.chat-widget-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget-avatar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: white;
  stroke-width: 2;
}

.chat-widget-info {
  flex: 1;
  color: white;
}

.chat-widget-info h4 {
  font-size: 16px;
  font-weight: 700;
}

.chat-widget-info span {
  font-size: 12px;
  opacity: 0.8;
}

.chat-widget-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
}

.chat-widget-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-widget-body {
  padding: 20px;
  background: #0d1117;
}

.chat-widget-message {
  background: #161b22;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.chat-widget-message p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  color: #e6edf3;
}

.chat-widget-message p:last-child {
  margin-bottom: 0;
}

.chat-widget-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-widget-action {
  display: block;
  padding: 14px 16px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: var(--radius-md);
  font-size: 14px;
  text-align: center;
  color: #e6edf3;
  transition: var(--transition-base);
  cursor: pointer;
}

.chat-widget-action:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.15);
}

/* Responsive */
@media (max-width: 1024px) {
  .final-cta-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .footer-main {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .footer-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .final-cta-buttons {
    flex-direction: column;
  }
  
  .footer-links {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .chat-widget {
    bottom: 90px;
    right: 16px;
  }
  
  .chat-widget-popup {
    width: calc(100vw - 32px);
    right: -8px;
  }
}

@media (max-width: 480px) {
  .footer-links {
    grid-template-columns: 1fr;
  }
  
  .footer-legal {
    flex-direction: column;
    gap: 8px;
  }
}
