/* Widget czatu sklepu (Obsługa klienta → Ustawienia → Czat). Wspólny dla starego renderera (storefront.js)
   i skórek nowego silnika - te dostają go z StorefrontChatListener, więc reguły nie mogą zależeć od CSS skórki. */
.sd-chat, .sd-chat * { box-sizing: border-box; }
/* ── Chat widget ───────────────────────────────────────────────────────── */
.sd-chat { position: fixed; bottom: 20px; z-index: 900; --sd-chat: #1f5c4d; font: 14px/1.45 var(--sf-font, var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif)); color: #1a1a1a; text-align: left; }
.sd-chat--right { right: 20px; }
.sd-chat--left { left: 20px; }
.sd-chat__launcher { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--sd-chat); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); position: relative; }
.sd-chat__badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #b3261e; color: #fff; font-size: 12px; display: grid; place-items: center; }
.sd-chat__badge[hidden] { display: none; }
.sd-chat__panel { position: absolute; bottom: 64px; width: min(370px, calc(100vw - 32px)); height: min(540px, calc(100vh - 110px)); background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .22); display: flex; flex-direction: column; overflow: hidden; }
.sd-chat--right .sd-chat__panel { right: 0; }
.sd-chat--left .sd-chat__panel { left: 0; }
.sd-chat__panel[hidden] { display: none; }
.sd-chat__head { background: var(--sd-chat); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.sd-chat__close { display: inline-flex; background: none; border: 0; color: #fff; padding: 4px; line-height: 1; cursor: pointer; opacity: .85; }
.sd-chat__close:hover { opacity: 1; }
.sd-chat__svg { display: block; flex: none; }
.sd-chat__icon { display: inline-flex; }
.sd-chat__head { gap: 4px; }
.sd-chat__messages { flex: 1; overflow-y: auto; padding: 14px; background: #f6f7f8; display: flex; flex-direction: column; gap: 8px; }
.sd-chat__msg { display: flex; flex-direction: column; max-width: 82%; gap: 2px; }
.sd-chat__msg--agent { align-self: flex-start; }
.sd-chat__msg--customer { align-self: flex-end; align-items: flex-end; }
.sd-chat__bubble { padding: 8px 12px; border-radius: 14px; background: #fff; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); }
.sd-chat__msg--customer .sd-chat__bubble { background: var(--sd-chat); color: #fff; }
.sd-chat__meta { font-size: 11px; color: #8a8a8a; }
.sd-chat__file { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; text-decoration: underline; }
.sd-chat__hint { font-size: 12px; color: #8a8a8a; text-align: center; margin: 4px 8px; }
.sd-chat__error { background: #fdecea; color: #8e1f0b; font-size: 12.5px; padding: 6px 12px; }
.sd-chat__error[hidden], .sd-chat__contact[hidden], .sd-chat__composer[hidden] { display: none; }
.sd-chat__composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid #eee; }
.sd-chat__composer textarea { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 10px; padding: 9px 10px; font: inherit; max-height: 120px; }
#sd-chat .sd-chat__composer textarea, #sd-chat .sd-chat__contact input { box-shadow: none; outline: none; margin: 0; background: #fff; color: #222; -webkit-appearance: none; appearance: none; transition: border-color .15s; }
#sd-chat .sd-chat__composer textarea:focus, #sd-chat .sd-chat__composer textarea:focus-visible, #sd-chat .sd-chat__contact input:focus, #sd-chat .sd-chat__contact input:focus-visible { outline: none; box-shadow: none; border-color: var(--sd-chat); }
.sd-chat__composer button, .sd-chat__contact button { border: 0; background: var(--sd-chat); color: #fff; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.sd-chat__attach { display: inline-flex; align-items: center; cursor: pointer; padding: 8px 2px; color: #6b6b6b; transition: color .15s; }
.sd-chat__attach:hover { color: var(--sd-chat); }
#sd-chat .sd-chat__composer .sd-chat__send { display: inline-flex; align-items: center; justify-content: center; padding: 9px 11px; }
.sd-chat__contact { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid #eee; }
.sd-chat__contact p { margin: 0; font-size: 12.5px; color: #555; }
.sd-chat__contact input { border: 1px solid #ddd; border-radius: 8px; padding: 9px 10px; font: inherit; }
/* Odpowiedź sklepu, gdy czat jest zwinięty: przycisk podskakuje (chat.js → is-ringing). */
.sd-chat__head strong { flex: 1; }
.sd-chat__mute { display: inline-flex; background: none; border: 0; color: #fff; line-height: 1; cursor: pointer; padding: 4px 6px; opacity: .85; }
.sd-chat__mute:hover { opacity: 1; }
.sd-chat__launcher.is-ringing { animation: sd-chat-ring 1.1s ease-in-out 2; }
.sd-chat__launcher.is-ringing .sd-chat__badge { animation: sd-chat-pop .4s ease-out; }
@keyframes sd-chat-ring { 0%, 100% { transform: translateY(0); } 15% { transform: translateY(-8px); } 30% { transform: translateY(0); } 45% { transform: translateY(-4px); } 60% { transform: translateY(0); } }
@keyframes sd-chat-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sd-chat__launcher.is-ringing, .sd-chat__launcher.is-ringing .sd-chat__badge { animation: none; } }
