/* ============================================================
   Royal Foods — Chatbot Widget CSS
   Dark Obsidian & Amber Glow theme — ZERO EMOJIS
   ============================================================ */

/* ---- Floating Action Button ---- */
.rf-chat-fab {
  position: fixed;
  z-index: 9999;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a3d, #e8551b);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 28px rgba(232, 85, 27, 0.55), 0 0 0 1px rgba(255,255,255,0.12) inset;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.rf-chat-fab:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 14px 36px rgba(232, 85, 27, 0.65), 0 0 0 1px rgba(255,255,255,0.18) inset;
}
.rf-chat-fab:active { transform: scale(0.95); }

.rf-chat-fab__icon,
.rf-chat-fab__close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rf-chat-fab__icon  { opacity: 1; transform: scale(1) rotate(0deg); }
.rf-chat-fab__close { opacity: 0; transform: scale(0.5) rotate(-90deg); }

.rf-chat-fab.is-open .rf-chat-fab__icon  { opacity: 0; transform: scale(0.5) rotate(90deg); }
.rf-chat-fab.is-open .rf-chat-fab__close { opacity: 1; transform: scale(1) rotate(0deg); }

/* Pulse ring */
.rf-chat-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 122, 61, 0.6);
  animation: rf-chat-pulse 2.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}
@keyframes rf-chat-pulse {
  0%   { transform: scale(1);    opacity: 0.85; }
  65%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ---- Chat Panel ---- */
.rf-chatbot {
  position: fixed;
  z-index: 9998;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 560px;
  border-radius: 24px;
  background: linear-gradient(160deg, #1a1916 0%, #111110 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 122, 61, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.88) translateY(16px);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.28s ease,
    visibility 0.28s;
}
.rf-chatbot.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---- Header ---- */
.rf-chatbot__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(26, 25, 22, 0.95);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.rf-chatbot__avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7a3d, #e8551b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 85, 27, 0.45);
  flex-shrink: 0;
}
.rf-chatbot__info { flex: 1; min-width: 0; }
.rf-chatbot__name {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.rf-chatbot__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}
.rf-chatbot__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  flex-shrink: 0;
  animation: chatbot-dot-pulse 2s ease-in-out infinite;
}
@keyframes chatbot-dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.rf-chatbot__close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.rf-chatbot__close-btn:hover {
  background: rgba(232, 85, 27, 0.18);
  color: #ff7a3d;
  border-color: rgba(232, 85, 27, 0.35);
}

/* ---- Message Body ---- */
.rf-chatbot__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.rf-chatbot__body::-webkit-scrollbar { width: 4px; }
.rf-chatbot__body::-webkit-scrollbar-track { background: transparent; }
.rf-chatbot__body::-webkit-scrollbar-thumb { background: rgba(255, 122, 61, 0.25); border-radius: 4px; }

/* ---- Message Rows ---- */
.rf-chatbot__msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: chatbot-msg-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes chatbot-msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.rf-chatbot__msg-row--user { justify-content: flex-end; }
.rf-chatbot__bot-dot {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(255, 122, 61, 0.15);
  border: 1px solid rgba(255, 122, 61, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff7a3d;
  flex-shrink: 0;
}

/* ---- Bubbles ---- */
.rf-chatbot__bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 0.86rem;
  line-height: 1.5;
}
.rf-chatbot__bubble--bot {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  border-bottom-left-radius: 6px;
}
.rf-chatbot__bubble--user {
  background: linear-gradient(135deg, #ff7a3d, #e8551b);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 85, 27, 0.35);
  border-bottom-right-radius: 6px;
  font-weight: 600;
}

/* ---- Quick-Reply Chips ---- */
.rf-chatbot__chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: chatbot-chips-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes chatbot-chips-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.rf-chatbot__chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.rf-chatbot__chip:hover {
  background: rgba(255, 122, 61, 0.12);
  border-color: rgba(255, 122, 61, 0.32);
  color: #fff;
  transform: translateX(3px);
}
.rf-chatbot__chip svg { flex-shrink: 0; color: rgba(255, 122, 61, 0.7); transition: transform 0.2s; }
.rf-chatbot__chip:hover svg { transform: translateX(2px); color: #ff7a3d; }

/* WhatsApp chips */
.rf-chatbot__chip--wa {
  background: rgba(37, 211, 102, 0.07);
  border-color: rgba(37, 211, 102, 0.2);
  color: rgba(255, 255, 255, 0.85);
}
.rf-chatbot__chip--wa:hover {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
}
.rf-chatbot__chip--wa svg { color: #25D366; }
.rf-chatbot__chip--wa:hover svg { color: #25D366; }

/* ---- Footer ---- */
.rf-chatbot__footer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.rf-chatbot__powered {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .rf-chat-fab { bottom: 20px; right: 18px; width: 52px; height: 52px; }
  .rf-chatbot {
    bottom: 86px;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 70dvh;
    border-radius: 24px 24px 0 0;
    transform-origin: bottom center;
  }
}
