/* ============================================================
   Виджет чата для сайта заказчика.
   Все цвета берутся из настроек (переменные --w-*), поэтому
   один и тот же виджет выглядит «своим» на любом сайте.
   ============================================================ */
.ocw{
  --w-brand:#8c6239;
  --w-accent:#c9a227;
  --w-text:#1d2229;
  --w-muted:#8a94a0;
  --w-border:#e9ecef;
  --w-bg:#ffffff;
  --w-in:#f2f4f6;
  --w-font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
  position:fixed;right:24px;bottom:24px;z-index:9000;font-family:var(--w-font);
  display:flex;flex-direction:column;align-items:flex-end;gap:12px}
.ocw.left{right:auto;left:24px;align-items:flex-start}
.ocw *{box-sizing:border-box}

/* режим предпросмотра внутри страницы настроек */
.ocw.embedded{position:relative;right:auto;bottom:auto;z-index:1;align-items:stretch}
.ocw.embedded .ocw-btn{display:none}
.ocw.embedded .ocw-panel{position:relative;width:100%;height:480px;box-shadow:0 10px 30px rgba(12,26,18,.12)}

/* кнопка-пузырь */
.ocw-btn{display:flex;align-items:center;gap:10px;border:none;border-radius:30px;padding:14px 20px;
  background:var(--w-brand);color:#fff;font-weight:700;font-size:14.5px;cursor:pointer;
  box-shadow:0 10px 26px rgba(20,20,20,.22)}
.ocw-btn:hover{filter:brightness(1.07)}
.ocw-btn svg{width:21px;height:21px}
.ocw-btn .dot{position:absolute;top:-3px;right:-3px;width:11px;height:11px;border-radius:50%;
  background:#e03131;border:2px solid #fff}
.ocw-btn-wrap{position:relative;display:inline-flex}
.ocw-teaser{background:#fff;border:1px solid var(--w-border);border-radius:16px;padding:12px 14px;
  max-width:266px;font-size:13.5px;color:var(--w-text);box-shadow:0 8px 24px rgba(20,20,20,.12);
  line-height:1.45;position:relative;cursor:pointer}
.ocw-teaser .tx{border:none;background:none;position:absolute;top:6px;right:6px;color:var(--w-muted);
  cursor:pointer;padding:2px;line-height:0}
.ocw-teaser .tx svg{width:14px;height:14px}
.ocw-teaser b{display:block;margin-bottom:2px}

/* панель чата */
.ocw-panel{width:392px;max-width:calc(100vw - 32px);height:min(620px,calc(100vh - 210px));
  background:var(--w-bg);border-radius:20px;box-shadow:0 18px 60px rgba(15,25,20,.28);
  display:none;flex-direction:column;overflow:hidden}
.ocw.open .ocw-panel{display:flex}
.ocw-head{background:var(--w-brand);color:#fff;padding:14px 16px;display:flex;align-items:center;gap:11px}
.ocw-logo{width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.16);
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;flex:0 0 40px;
  overflow:hidden}
.ocw-logo img,.ocw-logo svg{width:100%;height:100%;object-fit:contain}
.ocw-head .nm{font-weight:800;font-size:14.5px;line-height:1.25}
.ocw-head .st{font-size:11.5px;opacity:.85;display:flex;align-items:center;gap:5px}
.ocw-head .st i{width:7px;height:7px;border-radius:50%;background:#7ee08a;display:inline-block}
.ocw-head .hx{margin-left:auto;border:none;background:rgba(255,255,255,.16);color:#fff;border-radius:9px;
  width:30px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 30px}
.ocw-head .hx svg{width:16px;height:16px}
.ocw-body{flex:1;overflow-y:auto;padding:16px;background:#fbfbfc;display:flex;flex-direction:column;gap:10px}
.ocw-m{max-width:84%;display:flex;flex-direction:column;gap:3px}
.ocw-m .b{padding:10px 13px;border-radius:15px;font-size:13.5px;line-height:1.45;color:var(--w-text)}
.ocw-m .t{font-size:10.5px;color:var(--w-muted)}
.ocw-m.bot{align-self:flex-start}
.ocw-m.bot .b{background:var(--w-in);border-bottom-left-radius:5px}
.ocw-m.me{align-self:flex-end;align-items:flex-end}
.ocw-m.me .b{background:var(--w-brand);color:#fff;border-bottom-right-radius:5px}
.ocw-m.op{align-self:flex-start}
.ocw-m.op .b{background:#eef7f0;border:1px solid #d3ead8;border-bottom-left-radius:5px}
.ocw-m .who{font-size:11px;color:var(--w-muted);font-weight:700;display:flex;align-items:center;gap:5px}
.ocw-m .who svg{width:12px;height:12px}
.ocw-sys{align-self:center;font-size:11.5px;color:var(--w-muted);background:#eef1f3;border-radius:20px;
  padding:4px 12px;text-align:center;max-width:92%}
.ocw-typing{align-self:flex-start;background:var(--w-in);border-radius:15px;padding:11px 14px;
  display:flex;gap:4px;align-items:center}
.ocw-typing i{width:6px;height:6px;border-radius:50%;background:#b3bcc5;display:inline-block;
  animation:ocwb 1s infinite}
.ocw-typing i:nth-child(2){animation-delay:.15s}
.ocw-typing i:nth-child(3){animation-delay:.3s}
@keyframes ocwb{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* карточки товаров (картинки заказчика) */
.ocw-cards{display:flex;gap:9px;overflow-x:auto;padding:2px 0 4px;align-self:stretch}
.ocw-card{flex:0 0 148px;border:1px solid var(--w-border);border-radius:14px;background:#fff;overflow:hidden}
.ocw-card .ph{height:96px;background:var(--w-ph,linear-gradient(150deg,#f6f1e8,#efe6d6));display:flex;
  align-items:center;justify-content:center}
.ocw-card .ph svg{width:74px;height:74px}
.ocw-card .in{padding:8px 10px}
.ocw-card .cn{font-size:12.5px;font-weight:700;line-height:1.3}
.ocw-card .cp{font-size:12px;color:var(--w-muted);margin-top:2px}
.ocw-card .cb{display:block;width:100%;margin-top:7px;border:none;border-radius:9px;padding:7px;
  background:var(--w-brand);color:#fff;font-size:12px;font-weight:700;cursor:pointer}

/* быстрые кнопки и ввод */
.ocw-quick{display:flex;gap:7px;flex-wrap:wrap;padding:0 16px 10px;background:#fff}
.ocw-quick button{border:1px solid var(--w-border);background:#fff;border-radius:20px;padding:7px 12px;
  font-size:12.5px;font-weight:600;color:var(--w-text);cursor:pointer}
.ocw-quick button:hover{background:#f4f6f7}
.ocw-foot{border-top:1px solid var(--w-border);background:#fff;padding:10px 12px 12px}
.ocw-row{display:flex;gap:8px;align-items:flex-end}
.ocw-row textarea{flex:1;border:1px solid var(--w-border);border-radius:12px;padding:10px 12px;
  font-size:13.5px;font-family:inherit;resize:none;outline:none;min-height:42px;max-height:110px;line-height:1.4}
.ocw-row textarea:focus{border-color:var(--w-brand)}
.ocw-ib{border:1px solid var(--w-border);background:#fff;border-radius:11px;width:42px;height:42px;
  display:flex;align-items:center;justify-content:center;color:var(--w-muted);cursor:pointer;flex:0 0 42px}
.ocw-ib:hover{background:#f4f6f7}
.ocw-ib svg{width:19px;height:19px}
.ocw-ib.send{background:var(--w-brand);border-color:var(--w-brand);color:#fff}
.ocw-note{font-size:10.5px;color:var(--w-muted);text-align:center;margin-top:7px}
.ocw-note b{color:var(--w-brand)}

/* светлая шапка — для брендов с тёмным логотипом */
.ocw.head-light .ocw-head{background:#fff;color:var(--w-text);border-bottom:1px solid var(--w-border)}
.ocw.head-light .ocw-logo{background:#fff;border:1px solid var(--w-border)}
.ocw.head-light .ocw-head .st{opacity:1;color:var(--w-muted)}
.ocw.head-light .ocw-head .st i{background:var(--w-brand)}
.ocw.head-light .ocw-head .hx{background:var(--w-in);color:var(--w-muted)}
.ocw-logo img{max-width:100%;max-height:100%}

/* при открытом чате подсказка не нужна, кнопка остаётся под окном */
.ocw.open .ocw-teaser{display:none}

/* вложения в переписке */
.ocw-att-img{display:block;margin-top:8px}
.ocw-att-img img{max-width:200px;max-height:180px;border-radius:10px;display:block}
.ocw-att{display:inline-flex;align-items:center;gap:7px;margin-top:8px;
  background:rgba(255,255,255,.8);border:1px solid var(--w-border);border-radius:10px;
  padding:7px 10px;font-size:12.5px;font-weight:600;color:var(--w-text);text-decoration:none}
.ocw-att svg{width:15px;height:15px;color:var(--w-muted)}
.ocw-m.me .ocw-att{background:rgba(255,255,255,.9)}

/* ── Просьба о телефоне ─────────────────────────────────── */
.ocw .ocw-phone{display:flex;gap:8px;margin:8px 0 4px;padding:10px;
  background:#fff;border:1px solid var(--w-border, #e9ecef);border-radius:14px}
.ocw .ocw-phone input{flex:1;min-width:0;border:1px solid var(--w-border, #e9ecef);
  border-radius:10px;padding:9px 11px;font:inherit;font-size:14px;outline:none}
.ocw .ocw-phone input:focus{border-color:var(--w-brand, #2e8b57)}
.ocw .ocw-phone button{border:none;border-radius:10px;padding:9px 14px;
  background:var(--w-brand, #2e8b57);color:#fff;font:inherit;font-weight:700;
  font-size:13.5px;cursor:pointer;white-space:nowrap}
.ocw .ocw-phone button:hover{filter:brightness(1.05)}

/* ── Диалог закрыт: начать новое обращение ──────────────── */
.ocw .ocw-again{display:flex;justify-content:center;margin:6px 0 4px}
.ocw .ocw-again button{border:1px solid var(--w-brand, #2e8b57);background:#fff;
  color:var(--w-brand, #2e8b57);border-radius:20px;padding:8px 16px;font:inherit;
  font-size:13.5px;font-weight:700;cursor:pointer}
.ocw .ocw-again button:hover{background:var(--w-brand, #2e8b57);color:#fff}
