/* بلسم أفندي — صفحات التسويق العامة */
.balsam-public {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 9999;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  pointer-events: none;
}
.balsam-public > * { pointer-events: auto; }

.balsam-public__fab {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.balsam-public__fab-glow {
  position: absolute;
  inset: 8% 5% 18%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(240, 162, 2, 0.35), transparent 70%);
  animation: balsamPubGlow 4.8s ease-in-out infinite;
  pointer-events: none;
}
.balsam-public__fab img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(15, 61, 36, 0.28));
  animation: balsamPubBreathe 4.4s ease-in-out infinite;
}
.balsam-public__fab-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f3d24;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(12, 31, 20, 0.12);
}

.balsam-public__peek {
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem;
  box-shadow: 0 8px 20px rgba(12, 31, 20, 0.15);
  cursor: pointer;
}
.balsam-public__peek img { width: 44px; height: 44px; display: block; }

.balsam-public__panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: 6.5rem;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 50px rgba(12, 31, 20, 0.22);
  border: 1px solid rgba(15, 61, 36, 0.1);
  animation: balsamPubIn 0.22s ease;
}
.balsam-public__panel[hidden] { display: none !important; }

.balsam-public__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(120deg, #0f3d24, #1a6b3c 55%, #0e4d6e);
  color: #fff;
}
.balsam-public__head img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}
.balsam-public__head strong { display: block; font-size: 1rem; }
.balsam-public__head span { display: block; font-size: 0.78rem; opacity: 0.9; }
.balsam-public__close {
  margin-inline-start: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
}

.balsam-public__msgs {
  flex: 1;
  overflow: auto;
  padding: 0.85rem;
  background: linear-gradient(180deg, #eef4f0, #f7fbf8);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.balsam-public__bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.balsam-public__bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid rgba(15, 61, 36, 0.1);
  border-start-start-radius: 4px;
}
.balsam-public__bubble--user {
  align-self: flex-end;
  background: #143528;
  color: #f4faf7;
  border-start-end-radius: 4px;
}
.balsam-public__bubble a { color: #0b6b60; font-weight: 700; }
.balsam-public__bubble--user a { color: #ffe08a; }

.balsam-public__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 0.28rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 61, 36, 0.1);
}
.balsam-public__typing i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #90a4ae;
  animation: balsamPubDot 1s infinite ease-in-out;
}
.balsam-public__typing i:nth-child(2) { animation-delay: 0.15s; }
.balsam-public__typing i:nth-child(3) { animation-delay: 0.3s; }

.balsam-public__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.85rem 0.6rem;
  background: #f7fbf8;
}
.balsam-public__chip {
  border: 1px solid rgba(15, 61, 36, 0.18);
  background: #fff;
  color: #0f3d24;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.balsam-public__chip:hover { background: #e8f5ee; }

.balsam-public__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid rgba(15, 61, 36, 0.1);
  background: #fff;
}
.balsam-public__form input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid rgba(15, 61, 36, 0.16);
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
}
.balsam-public__form button[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: #f0a202;
  color: #0c1f14;
  font: inherit;
  font-weight: 800;
  padding: 0 1rem;
  cursor: pointer;
}

.balsam-public__hint {
  margin: 0;
  padding: 0.45rem 0.85rem 0.65rem;
  font-size: 0.72rem;
  color: #4a6354;
  background: #fff;
  border-top: 1px solid rgba(15, 61, 36, 0.06);
}

@keyframes balsamPubBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes balsamPubGlow {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@keyframes balsamPubIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes balsamPubDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 420px) {
  .balsam-public { inset-inline-end: 0.65rem; bottom: 0.65rem; }
  .balsam-public__fab img { width: 78px; height: 78px; }
  .balsam-public__panel {
    width: calc(100vw - 1.1rem);
    max-height: min(70vh, 30rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .balsam-public__fab img,
  .balsam-public__fab-glow { animation: none !important; }
}
