/* =========================================================
   ZIJAI AI ASSISTANT
   Floating chat widget — answers menu questions using the
   live menu data. Loaded on every public page.
   ========================================================= */

.zijai-ai-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;

  z-index: 9200;

  width: 56px;
  height: 56px;

  border: 0;
  border-radius: 50%;

  background: #212529;
  color: #fff;

  font-size: 25px;
  line-height: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);

  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.zijai-ai-fab:hover {
  background: #343a40;
  color: #fff;

  transform: translateY(-3px) scale(1.04);

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.zijai-ai-fab .zijai-ai-dot {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 11px;
  height: 11px;

  border: 2px solid #fff;
  border-radius: 50%;

  background: #ffc107;
}

.zijai-ai-fab.open .zijai-ai-dot {
  display: none;
}

/* ---------- Panel ---------- */

.zijai-ai-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;

  z-index: 9210;

  width: min(400px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 130px));

  display: none;
  flex-direction: column;

  background: #fff;

  border: 1px solid #e9ecef;
  border-radius: 18px;

  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);

  overflow: hidden;
}

.zijai-ai-panel.open {
  display: flex;

  animation: zijai-ai-pop 0.2s ease;
}

@keyframes zijai-ai-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Header ---------- */

.zijai-ai-header {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px 16px;

  background: #212529;
  color: #fff;
}

.zijai-ai-avatar {
  width: 40px;
  height: 40px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 21px;

  border-radius: 50%;

  background: #8b0000;
}

.zijai-ai-title {
  font-weight: 700;
  font-size: 15px;

  line-height: 1.2;
}

.zijai-ai-subtitle {
  font-size: 12px;

  color: rgba(255, 255, 255, 0.65);
}

.zijai-ai-subtitle .zijai-ai-online {
  display: inline-block;

  width: 7px;
  height: 7px;

  margin-right: 5px;

  border-radius: 50%;

  background: #22c55e;
}

.zijai-ai-close {
  margin-left: auto;

  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;

  width: 30px;
  height: 30px;

  border-radius: 8px;

  cursor: pointer;

  transition: background-color 0.15s ease;
}

.zijai-ai-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Messages ---------- */

.zijai-ai-messages {
  flex: 1;

  overflow-y: auto;

  padding: 16px 14px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  background: #f8f9fa;

  scroll-behavior: smooth;
}

.zijai-ai-row {
  display: flex;
}

.zijai-ai-row.bot {
  justify-content: flex-start;
}

.zijai-ai-row.user {
  justify-content: flex-end;
}

.zijai-ai-bubble {
  max-width: 84%;

  padding: 10px 14px;

  font-size: 13.5px;
  line-height: 1.5;

  border-radius: 16px;

  word-wrap: break-word;
}

.zijai-ai-row.bot .zijai-ai-bubble {
  background: #fff;
  color: #212529;

  border: 1px solid #e9ecef;

  border-bottom-left-radius: 5px;
}

.zijai-ai-row.user .zijai-ai-bubble {
  background: #212529;
  color: #fff;

  border-bottom-right-radius: 5px;
}

.zijai-ai-bubble p {
  margin: 0 0 6px;
}

.zijai-ai-bubble p:last-child {
  margin-bottom: 0;
}

.zijai-ai-bubble ul,
.zijai-ai-bubble ol {
  margin: 4px 0 6px;
  padding-left: 18px;
}

.zijai-ai-bubble li {
  margin-bottom: 3px;
}

.zijai-ai-bubble strong {
  font-weight: 700;
}

.zijai-ai-bubble a {
  color: #8b0000;
  font-weight: 600;
  text-decoration: none;
}

.zijai-ai-bubble a:hover {
  text-decoration: underline;
}

.zijai-ai-price {
  color: #8b0000;
  font-weight: 700;
  white-space: nowrap;
}

.zijai-ai-tag {
  display: inline-block;

  margin: 0 4px 3px 0;

  padding: 2px 8px;

  font-size: 11px;
  font-weight: 600;

  color: #8b0000;

  background: rgba(139, 0, 0, 0.08);

  border-radius: 12px;
}

.zijai-ai-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}

.zijai-ai-typing span {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #adb5bd;

  animation: zijai-ai-blink 1.2s infinite both;
}

.zijai-ai-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.zijai-ai-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes zijai-ai-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* ---------- Quick replies ---------- */

.zijai-ai-quick {
  flex-shrink: 0;

  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  padding: 0 14px 10px;

  background: #f8f9fa;
}

.zijai-ai-chip {
  border: 1px solid #cfd6dc;
  background: #fff;
  color: #212529;

  padding: 6px 12px;

  font-size: 12.5px;
  font-weight: 600;

  border-radius: 20px;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.zijai-ai-chip:hover {
  background: #212529;
  border-color: #212529;
  color: #fff;
}

.zijai-ai-chip:empty {
  display: none;
}

/* ---------- Input ---------- */

.zijai-ai-input {
  flex-shrink: 0;

  display: flex;
  gap: 8px;

  padding: 12px 14px;

  background: #fff;

  border-top: 1px solid #e9ecef;
}

.zijai-ai-input input {
  flex: 1;

  border: 1px solid #dee2e6;
  border-radius: 22px;

  padding: 10px 16px;

  font-size: 13.5px;

  outline: none;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.zijai-ai-input input:focus {
  border-color: #8b0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.12);
}

.zijai-ai-send {
  width: 42px;
  height: 42px;

  flex-shrink: 0;

  border: 0;
  border-radius: 50%;

  background: #8b0000;
  color: #fff;

  font-size: 17px;

  cursor: pointer;

  transition: background-color 0.15s ease, transform 0.15s ease;
}

.zijai-ai-send:hover {
  background: #6d0000;
}

.zijai-ai-send:active {
  transform: scale(0.92);
}

.zijai-ai-send:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

.zijai-ai-note {
  font-size: 11px;
  color: #adb5bd;
  text-align: center;

  padding: 0 14px 10px;

  background: #fff;
}

/* ---------- Mobile ---------- */

@media (max-width: 575px) {

  .zijai-ai-fab {
    right: 14px;
    bottom: 14px;
  }

  .zijai-ai-panel {
    right: 0;
    left: 0;
    bottom: 0;

    width: 100%;
    height: calc(100vh - 56px);

    border-radius: 18px 18px 0 0;
    border: 0;
  }
}
