/* Netti AI Assistant Widget */

.netti-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, sans-serif;
}

/* Toggle button */
.netti-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--np-primary, #2C2C2C);
  color: #fff;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: all 0.3s;
  font-size: 0.9rem;
  font-weight: 500;
}

.netti-toggle:hover {
  background: var(--np-secondary, #8B7355);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.netti-icon {
  flex-shrink: 0;
}

.netti-label {
  white-space: nowrap;
  transition: opacity 0.3s;
}

/* Chat window */
.netti-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 600px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: netti-slide-up 0.3s ease;
}

@keyframes netti-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.netti-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--np-primary, #2C2C2C);
  color: #fff;
}

.netti-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.netti-header-info strong {
  display: block;
  font-size: 1rem;
}

.netti-header-info small {
  font-size: 0.78rem;
  opacity: 0.7;
}

.netti-avatar {
  width: 36px;
  height: 36px;
  background: var(--np-accent, #C4A76C);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.netti-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
}

.netti-close:hover { opacity: 1; }

/* Messages */
.netti-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.netti-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: netti-fade-in 0.3s ease;
}

@keyframes netti-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.netti-netti {
  background: var(--np-bg-alt, #F5F0EB);
  color: var(--np-text, #333);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.netti-user {
  background: var(--np-primary, #2C2C2C);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.netti-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--np-bg-alt, #F5F0EB);
  border-radius: 12px;
  align-self: flex-start;
  width: 60px;
}

.netti-typing span {
  width: 8px;
  height: 8px;
  background: var(--np-text-light, #999);
  border-radius: 50%;
  animation: netti-dot 1.4s infinite;
}

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

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

/* Product cards */
.netti-product-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
}

.netti-product-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--np-border, #E5E0DA);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.netti-product-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.netti-card-info {
  flex: 1;
  min-width: 0;
}

.netti-card-info strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.netti-card-info span {
  font-size: 0.78rem;
  color: var(--np-text-light, #666);
}

.netti-card-info small {
  display: block;
  font-size: 0.72rem;
  color: var(--np-text-light, #999);
  margin-top: 2px;
}

.netti-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.netti-card-link,
.netti-card-cart {
  padding: 5px 10px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.netti-card-link {
  background: transparent;
  border: 1px solid var(--np-border, #E5E0DA);
  color: var(--np-text, #333);
}

.netti-card-cart {
  background: var(--np-accent, #C4A76C);
  color: #fff;
}

/* Calculation box */
.netti-calc-box {
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--np-border, #E5E0DA);
  border-left: 4px solid var(--np-accent, #C4A76C);
  border-radius: 8px;
  font-size: 0.85rem;
  align-self: flex-start;
  max-width: 90%;
}

.netti-calc-box strong {
  display: block;
  margin-bottom: 6px;
}

.netti-calc-box div {
  padding: 2px 0;
}

.netti-calc-total {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--np-border, #E5E0DA);
}

.netti-calc-cart {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--np-success, #4A7C59);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Input area */
.netti-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--np-border, #E5E0DA);
  background: #fff;
}

.netti-upload-btn {
  cursor: pointer;
  color: var(--np-text-light, #999);
  flex-shrink: 0;
  display: flex;
}

.netti-upload-btn:hover { color: var(--np-secondary, #8B7355); }

.netti-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--np-border, #E5E0DA);
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
}

.netti-input:focus {
  border-color: var(--np-secondary, #8B7355);
}

.netti-send {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--np-secondary, #8B7355);
  flex-shrink: 0;
  padding: 4px;
}

/* Mobile: fullscreen */
@media (max-width: 768px) {
  .netti-chat {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  .netti-widget {
    bottom: 16px;
    right: 16px;
  }
  
  .netti-label { display: none; }
  
  .netti-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
}
