/* Site online chat widget */
.site-chat {
  --site-chat-cta: var(--forest-cta, #c8332f);
  --site-chat-cta-hover: var(--forest-cta-hover, #b32e2a);
  --site-chat-panel-bg: #f7f7f8;
  --site-chat-panel-text: #1d1d1f;
  --site-chat-muted: #6e6e73;
  --site-chat-border: #d2d2d7;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 12000;
  font-family: inherit;
}

.site-chat__fab {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--site-chat-cta);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-chat__fab:hover {
  background: var(--site-chat-cta-hover);
}

.site-chat__fab svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.site-chat__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #1d1d1f;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 600;
  display: none;
}

.site-chat__badge.is-on {
  display: inline-block;
}

.site-chat__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(360px, calc(100vw - 24px));
  height: min(480px, calc(100vh - 100px));
  background: var(--site-chat-panel-bg);
  color: var(--site-chat-panel-text);
  border: 1px solid var(--site-chat-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.site-chat.is-open .site-chat__panel {
  display: flex;
}

.site-chat:not(.is-open) .site-chat__panel {
  display: none !important;
}

.site-chat__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #2c2c2e;
  color: #f5f5f7;
}

.site-chat__head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.site-chat__head-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.site-chat__favicon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 4px;
  display: block;
  object-fit: contain;
  background: #fff;
}

.site-chat__head-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-chat__call {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  padding: 5px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.site-chat__call:hover {
  background: rgba(255, 255, 255, 0.2);
}

.site-chat__call:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-chat__head-messengers {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.site-chat__messenger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
  text-decoration: none;
}

.site-chat__messenger:hover {
  background: rgba(255, 255, 255, 0.24);
}

.site-chat__messenger svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  display: block;
}

.site-chat__messenger--telegram {
  color: #7dd3fc;
}

.site-chat__messenger--viber {
  color: #c4b5fd;
}

.site-chat__head-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.site-chat__name-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.site-chat__name-wrap[hidden] {
  display: none !important;
}

.site-chat__name-label {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(245, 245, 247, 0.78);
}

.site-chat__name {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

.site-chat__name::placeholder {
  color: rgba(245, 245, 247, 0.55);
}

.site-chat__name[hidden] {
  display: none !important;
}

.site-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ececee;
}

.site-chat__hint {
  margin: 0;
  font-size: 13px;
  color: var(--site-chat-muted);
  text-align: center;
  padding: 4px 2px 0;
  line-height: 1.4;
}

.site-chat__intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 2px;
}

.site-chat__contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.site-chat__contacts-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--site-chat-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

.site-chat__contacts-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-chat__contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  background: #f5f7fb;
  color: #0f172a;
}

.site-chat__contact:hover {
  background: #ebf0f8;
}

.site-chat__contact svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

.site-chat__contact--telegram {
  color: #0284c7;
}

.site-chat__contact--viber {
  color: #6d28d9;
}

.site-chat__bubble {
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-chat__bubble--visitor {
  align-self: flex-end;
  background: #fff;
  border: 1px solid var(--site-chat-border);
}

.site-chat__bubble--admin {
  align-self: flex-start;
  background: #e8f1ff;
  border: 1px solid #c5d8f5;
}

.site-chat__bubble-time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--site-chat-muted);
}

.site-chat__foot {
  border-top: 1px solid var(--site-chat-border);
  padding: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-chat__compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.site-chat__input {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid var(--site-chat-border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
}

.site-chat__send {
  border: 0;
  border-radius: 8px;
  background: var(--site-chat-cta);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.site-chat__send:hover {
  background: var(--site-chat-cta-hover);
}

.site-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-chat__status {
  margin: 0;
  font-size: 12px;
  color: #b42318;
  line-height: 1.35;
}

.site-chat__status.is-ok {
  color: #067647;
}

.site-chat__status[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .site-chat {
    right: 10px;
    bottom: 10px;
  }

  .site-chat__panel {
    width: calc(100vw - 20px);
    height: min(70vh, 520px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-chat__fab,
  .site-chat__panel {
    transition: none;
  }
}
