/* ===========================================================================
   Rowa Studio chat widget
   Floating support chat in Rowa's palette (clay / cream / glaze).
   Everything is prefixed with .rowa- so it can't clash with the rest of the site.
   =========================================================================== */

/* ---------- launcher bubble (bottom-right) ---------- */
.rowa-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 1500;
  display: grid;
  place-items: center;
  color: #FAF7F1;
  background: #8A5A44;
  box-shadow: 0 14px 30px -10px rgba(138, 90, 68, 0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.rowa-launcher:hover { transform: translateY(-3px) scale(1.05); background: #6f4634; }
.rowa-launcher svg { width: 28px; height: 28px; }
.rowa-launcher .rowa-icon-close { display: none; }
.rowa-launcher.rowa-open .rowa-icon-open { display: none; }
.rowa-launcher.rowa-open .rowa-icon-close { display: block; }

/* ---------- panel ---------- */
.rowa-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: #FAF7F1;
  border: 1px solid rgba(46, 33, 27, 0.12);
  border-radius: 22px;
  box-shadow: 0 28px 60px -24px rgba(46, 33, 27, 0.45);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  font-family: 'Inter', system-ui, sans-serif;
}
.rowa-panel.rowa-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* ---------- header ---------- */
.rowa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  color: #FAF7F1;
  background: linear-gradient(135deg, #8A5A44, #6f4634);
}
.rowa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #F4E8D8;
  flex-shrink: 0;
  overflow: hidden;
}
.rowa-avatar img { width: 30px; height: 30px; object-fit: contain; }
.rowa-htext { flex: 1; min-width: 0; }
.rowa-htext h3 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.25rem; font-weight: 600; line-height: 1.2; margin: 0; }
.rowa-status { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; opacity: 0.85; margin-top: 1px; }
.rowa-status::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #8F9B86;
  box-shadow: 0 0 0 0 rgba(143, 155, 134, 0.6);
  animation: rowa-pulse 2s infinite;
}
@keyframes rowa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143, 155, 134, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(143, 155, 134, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 155, 134, 0); }
}
.rowa-close {
  background: rgba(250, 247, 241, 0.18);
  border: none;
  color: #FAF7F1;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.rowa-close:hover { background: rgba(250, 247, 241, 0.32); }

/* ---------- messages ---------- */
.rowa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F4E8D8;
}
.rowa-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.rowa-msg.rowa-bot {
  align-self: flex-start;
  background: #FAF7F1;
  color: #2E211B;
  border: 1px solid rgba(46, 33, 27, 0.1);
  border-bottom-left-radius: 4px;
}
.rowa-msg.rowa-user {
  align-self: flex-end;
  background: #8A5A44;
  color: #FAF7F1;
  border-bottom-right-radius: 4px;
}

/* typing dots */
.rowa-typing { display: flex; gap: 4px; align-items: center; }
.rowa-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #B9AB99;
  animation: rowa-bounce 1.2s infinite ease-in-out;
}
.rowa-typing span:nth-child(2) { animation-delay: 0.15s; }
.rowa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rowa-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- input ---------- */
.rowa-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(46, 33, 27, 0.1);
  background: #FAF7F1;
}
.rowa-input input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid rgba(46, 33, 27, 0.15);
  border-radius: 100px;
  background: #fff;
  color: #2E211B;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.rowa-input input::placeholder { color: rgba(46, 33, 27, 0.4); }
.rowa-input input:focus { border-color: #8A5A44; }
.rowa-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #FAF7F1;
  background: #8A5A44;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
}
.rowa-send:hover { transform: scale(1.08); background: #6f4634; }
.rowa-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.rowa-send svg { width: 18px; height: 18px; }

/* mobile: full-width panel */
@media (max-width: 480px) {
  .rowa-panel {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    height: 70vh;
  }
  .rowa-launcher { bottom: 16px; right: 16px; }
}
