:root {
  --wa-green: #25d366;
  --wa-green-dark: #1da851;
  --wa-teal: #075e54;
  --wa-header: #075e54;
  --wa-bg: #ece5dd;
  --wa-out: #dcf8c6;
  --wa-in: #ffffff;
  --wa-text: #111b21;
  --wa-muted: #667781;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--wa-text);
  background: #f0f2f5;
}

/* Pagina demo din spate */
.demo-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px;
}
.demo-page h1 { color: var(--wa-teal); }
.demo-page .hint { color: var(--wa-muted); }

/* Buton flotant */
.rc-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.15s ease, background 0.15s ease;
}
.rc-launcher:hover { background: var(--wa-green-dark); transform: scale(1.05); }
.rc-launcher.hidden { display: none; }

/* Fereastra de chat */
.rc-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 44px);
  background: var(--wa-bg);
  border-radius: 14px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: var(--shadow);
  z-index: 9999;
}
.rc-chat.open { display: flex; }

/* Header */
.rc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--wa-header);
  color: #fff;
}
.rc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #128c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
}
.rc-hinfo { flex: 1; min-width: 0; }
.rc-title { font-weight: 600; font-size: 16px; }
.rc-status { font-size: 12px; opacity: 0.85; }
.rc-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

/* Banner preluare operator */
.rc-takeover {
  background: #fff3cd;
  color: #664d03;
  font-size: 12.5px;
  padding: 8px 14px;
  text-align: center;
  border-bottom: 1px solid #ffe69c;
}

/* Zona mesaje */
.rc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background-image: linear-gradient(rgba(229, 221, 213, 0.4), rgba(229, 221, 213, 0.4));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rc-row { display: flex; }
.rc-row.out { justify-content: flex-end; }
.rc-row.in { justify-content: flex-start; }

.rc-bubble {
  max-width: 82%;
  padding: 7px 10px 5px;
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.35;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  position: relative;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.rc-row.out .rc-bubble { background: var(--wa-out); border-top-right-radius: 2px; }
.rc-row.in .rc-bubble { background: var(--wa-in); border-top-left-radius: 2px; }

.rc-meta {
  display: block;
  font-size: 10.5px;
  color: var(--wa-muted);
  margin-top: 3px;
  text-align: right;
}
.rc-oplabel {
  display: block;
  font-size: 10.5px;
  color: var(--wa-green-dark);
  font-weight: 600;
  margin-top: 2px;
}

/* Indicator „scrie…" */
.rc-typing .rc-bubble { padding: 10px 12px; }
.rc-dots { display: inline-flex; gap: 4px; }
.rc-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5ab;
  animation: rc-blink 1.2s infinite ease-in-out both;
}
.rc-dots span:nth-child(2) { animation-delay: 0.2s; }
.rc-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes rc-blink {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Carduri produs */
.rc-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rc-card {
  background: #fff;
  border: 1px solid #e3e8ec;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.rc-card-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--wa-teal);
  background: #e7f4f1;
  border-radius: 6px;
  padding: 2px 7px;
  margin-bottom: 5px;
}
.rc-card-name { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.rc-card-price { font-size: 16px; font-weight: 700; color: var(--wa-green-dark); }
.rc-card-note { font-size: 11.5px; color: var(--wa-muted); margin: 2px 0 8px; }
.rc-card-btn {
  display: inline-block;
  background: var(--wa-green);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}
.rc-card-btn:hover { background: var(--wa-green-dark); }

.rc-related-title { font-size: 12px; color: var(--wa-muted); margin: 8px 0 2px; }
.rc-related { display: flex; flex-direction: column; gap: 4px; }
.rc-related a {
  font-size: 12.5px;
  color: var(--wa-teal);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px dashed #e3e8ec;
}
.rc-related a:hover { text-decoration: underline; }
.rc-related .p { font-weight: 600; white-space: nowrap; }

/* Bara de input */
.rc-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f0f0f0;
}
.rc-input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 11px 14px;
  font-size: 14.5px;
  outline: none;
}
.rc-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rc-send:hover { background: var(--wa-green-dark); }

/* Mobil: fullscreen sub 480px */
@media (max-width: 480px) {
  .rc-chat {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .rc-launcher { right: 16px; bottom: 16px; }
}
