/* Чат-консультант ЭКОЯР (eco-chat.js): кнопка справа внизу, окно; на телефоне — во весь экран.
   Файл подключён на всех страницах, поэтому здесь же компактная шапка сайта на телефоне. */
@media (max-width: 767px) {
  html:not(.eco-new) header > .container > .d-flex { flex-wrap: nowrap !important; flex-direction: row !important; align-items: center !important; padding: 6px 0; }
  html:not(.eco-new) header .logo { flex: 0 0 auto; margin: 0 !important; }
  html:not(.eco-new) header .logo img { height: 44px !important; width: auto !important; max-width: 120px; }
  html:not(.eco-new) header .header-call { margin: 0 0 0 auto !important; padding: 0 !important; }
  html:not(.eco-new) header .call-number { align-items: flex-end; }
  html:not(.eco-new) header .call-number a { font-size: 15px !important; line-height: 1.35 !important; white-space: nowrap; }
}
.ecc-btn {
  position: fixed; right: 20px; bottom: 24px; z-index: 9990; width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: #00753B; color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.ecc-btn:hover, .ecc-btn:focus { background: #006030; outline: none; }
.ecc-btn svg { width: 30px; height: 30px; }
.ecc-btn .ecc-dot {
  position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #e53935; color: #fff; font: 700 12px/20px Arial, sans-serif; display: none;
}
.ecc-btn.ecc-unread .ecc-dot { display: block; }
.ecc-tip {
  position: fixed; right: 90px; bottom: 34px; z-index: 9990; max-width: 230px; padding: 9px 12px; border-radius: 10px;
  background: #fff; color: #222; font: 14px/1.35 Arial, sans-serif; box-shadow: 0 3px 14px rgba(0, 0, 0, .18); cursor: pointer;
}
.ecc-tip b { color: #00753B; }
.ecc-tip-x { margin-left: 6px; color: #999; cursor: pointer; }

.ecc-win {
  position: fixed; right: 20px; bottom: 96px; z-index: 9991; width: 370px; height: 560px; max-height: calc(100vh - 120px);
  display: none; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .28); font: 15px/1.4 Arial, sans-serif; color: #222;
}
.ecc-open .ecc-win { display: flex; }
.ecc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #00753B; color: #fff; }
.ecc-head-ava { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; flex: 0 0 36px; }
.ecc-head-ava img { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.ecc-head-t { flex: 1; min-width: 0; }
.ecc-head-t b { display: block; font-size: 16px; }
.ecc-head-t span { font-size: 12.5px; opacity: .9; }
.ecc-x { border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ecc-msgs { flex: 1; overflow-y: auto; padding: 12px; background: #f3f5f4; display: flex; flex-direction: column; gap: 8px; }
.ecc-m { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.ecc-m a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.ecc-m-in { align-self: flex-start; background: #fff; border: 1px solid #e3e7e5; border-bottom-left-radius: 4px; }
.ecc-m-out { align-self: flex-end; background: #00753B; color: #fff; border-bottom-right-radius: 4px; }
.ecc-m-who { display: block; font-size: 11.5px; color: #00753B; margin-bottom: 2px; font-weight: 700; }
.ecc-typing { align-self: flex-start; color: #888; font-size: 13px; padding: 2px 6px; }
.ecc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ecc-chip { border: 1px solid #00753B; background: #fff; color: #00753B; border-radius: 16px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.ecc-chip:hover { background: #e8f3ed; }
.ecc-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px 4px; border-top: 1px solid #e3e7e5; background: #fff; }
.ecc-in {
  flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border: 1px solid #cfd6d2; border-radius: 10px;
  font: 15px/1.35 Arial, sans-serif; outline: none; color: #222; background: #fff;
}
.ecc-in:focus { border-color: #00753B; }
.ecc-send { flex: 0 0 44px; width: 44px; height: 42px; border: 0; border-radius: 10px; background: #00753B; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ecc-send[disabled] { opacity: .6; cursor: wait; }
.ecc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }
.ecc-note { padding: 2px 12px 8px; font-size: 11.5px; color: #888; background: #fff; }
.ecc-note a { color: #888; }
.ecc-err { color: #c62828; font-size: 13px; align-self: center; text-align: center; }

@media (max-width: 767px) {
  .ecc-btn { right: 14px; bottom: 80px; width: 54px; height: 54px; }
  .eyb-on .ecc-btn { bottom: 130px; }
  .ecc-tip { right: 76px; bottom: 88px; }
  .eyb-on .ecc-tip { bottom: 138px; }
  .ecc-win { inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; }
  .ecc-open .ecc-btn, .ecc-open .ecc-tip { display: none; }
  html.ecc-open, html.ecc-open body { overflow: hidden; }
  .ecc-in { font-size: 16px; }
}

/* ссылка на товар в ответе — мини-карточка */
.ecc-m a.ecc-prod { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 6px 8px; border: 1px solid #e3e7e5; border-radius: 10px;
  background: #f7faf8; text-decoration: none; white-space: normal; }
.ecc-m a.ecc-prod:hover { border-color: #00753B; }
.ecc-prod img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; flex: 0 0 48px; }
.ecc-prod span { display: flex; flex-direction: column; min-width: 0; }
.ecc-prod b { font-weight: 600; font-size: 13px; line-height: 1.3; color: #1d2b24; }
.ecc-prod i { font-style: normal; font-size: 12.5px; color: #00753B; margin-top: 2px; }
.ecc-ct { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #cfe3d6; border-radius: 12px; background: #f3f9f5; font-size: 14px; line-height: 1.4; }
.ecc-ct-t { color: #333; }
.ecc-ct-ch { display: flex; flex-wrap: wrap; gap: 6px; }
.ecc-ct-ch .ecc-chip { padding: 4px 10px; font-size: 13px; }
.ecc-ct-ch .ecc-chip.on { background: #00753B; color: #fff; }
.ecc-ct input.ecc-ct-name, .ecc-ct input.ecc-ct-val { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font: inherit; font-size: 16px; }
.ecc-ct-ok { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: #555; margin: 0; font-weight: 400; }
.ecc-ct-ok input { margin-top: 2px; }
.ecc-ct-b { display: flex; gap: 8px; flex-wrap: wrap; }
.ecc-ct-go { border: 0; background: #00753B; color: #fff; border-radius: 8px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.ecc-ct-skip { border: 0; background: none; color: #666; text-decoration: underline; font-size: 13px; cursor: pointer; padding: 8px 4px; }
.ecc-ct-err { color: #b3261e; font-size: 13px; }
.ecc-ct-err:empty { display: none; }


/* заметная кнопка AI-консультанта */
.ecc-btn {
  width: 64px; height: 64px; padding: 0;
  background: #fff !important;
  border: 2px solid #00753B;
  box-shadow: 0 6px 20px rgba(0, 117, 59, .28);
  overflow: hidden;
}
.ecc-btn:hover, .ecc-btn:focus { background: #f3faf5 !important; transform: translateY(-1px); }
.ecc-btn .ecc-btn-ava { width: 40px; height: 40px; border-radius: 50%; display: block; object-fit: cover; }
.ecc-btn svg { display: none; }
@media (max-width: 767px) {
  .ecc-btn { width: 58px; height: 58px; }
  .ecc-btn .ecc-btn-ava { width: 36px; height: 36px; }
}
