/* ShopyIA store assistant (assets/js/chat-widget.js), GeekZone palette */
.enchat {
    --c-ink: #333e48; --c-link: #0062bd; --c-price: #dc3545; --c-accent: #fed700;
    --c-surface: #f5f6f8; --c-line: #e3e6ea; --c-muted: #5f6b76;
    position: fixed; right: 20px; bottom: 20px; z-index: 1060;
    display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: inherit;
}
body.has-enchat .back-to-top { bottom: 92px; }
body.has-enchat .toast-container { bottom: 92px; }

.enchat-launcher {
    display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px;
    border: 0; border-radius: 999px; background: var(--c-ink); color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: 0 12px 28px -12px rgba(51, 62, 72, .65); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.enchat-launcher i { color: var(--c-accent); font-size: 20px; }
.enchat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(51, 62, 72, .75); }
.enchat-launcher:focus-visible, .enchat button:focus-visible, .enchat a:focus-visible, .enchat textarea:focus-visible {
    outline: 3px solid var(--c-link); outline-offset: 2px;
}
.enchat.is-open .enchat-launcher span { display: none; }
.enchat.is-open .enchat-launcher { width: 56px; padding: 0; justify-content: center; }

.enchat-panel {
    width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px));
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: 16px;
    overflow: hidden; box-shadow: 0 28px 56px -24px rgba(51, 62, 72, .5); animation: enchatIn .22s ease both;
}
.enchat-panel[hidden] { display: none; }
@keyframes enchatIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.enchat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--c-ink); color: #fff; }
.enchat-head__icon {
    width: 38px; height: 38px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .12); color: var(--c-accent);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.enchat-head__text { flex: 1; min-width: 0; }
.enchat-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }
.enchat-head p { margin: 0; font-size: 12px; color: #c9d0d6; }
.enchat-close { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; }
.enchat-close:hover { background: rgba(255, 255, 255, .12); }

.enchat-list {
    flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 16px;
    display: flex; flex-direction: column; gap: 12px; background: var(--c-surface); overscroll-behavior: contain;
}
.enchat-msg { max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.enchat-msg--user {
    align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: 16px 16px 4px 16px;
    background: var(--c-ink); color: #fff; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.enchat-bubble {
    align-self: flex-start; max-width: 92%; padding: 10px 14px; border-radius: 16px 16px 16px 4px;
    background: #fff; border: 1px solid var(--c-line); color: #2b333a; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.enchat-bubble a { color: var(--c-link); font-weight: 600; }
.enchat-msg.is-error .enchat-bubble { border-color: #f1c2c7; background: #fdf2f3; color: #8a1c27; }

.enchat-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.enchat-suggest button {
    min-height: 36px; padding: 6px 12px; border: 1.5px solid var(--c-line); border-radius: 999px; background: #fff;
    color: var(--c-ink); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.enchat-suggest button:hover { border-color: var(--c-ink); }

.enchat-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.enchat-card { display: flex; gap: 10px; padding: 8px; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; }
.enchat-card__media { flex: none; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--c-surface); }
.enchat-card__media img { width: 100%; height: 100%; object-fit: contain; }
.enchat-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.enchat-card__name {
    color: var(--c-link); font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.enchat-card__name:hover { text-decoration: underline; }
.enchat-card__price { font-size: 14px; font-weight: 800; color: var(--c-price); }
.enchat-card__add {
    align-self: flex-start; margin-top: 4px; min-height: 34px; padding: 6px 12px; border: 0; border-radius: 6px;
    background: var(--c-ink); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center;
}
.enchat-card__add:hover { background: #1f272e; color: #fff; }
.enchat-card__add:disabled { opacity: .6; cursor: progress; }

.enchat-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.enchat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: enchatDot 1s ease-in-out infinite; }
.enchat-typing span:nth-child(2) { animation-delay: .15s; }
.enchat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes enchatDot { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }

.enchat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--c-line); background: #fff; }
.enchat-form textarea {
    flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px;
    border: 1.5px solid var(--c-line); border-radius: 22px; font: inherit; font-size: 14px; color: var(--c-ink);
}
.enchat-send { width: 44px; height: 44px; flex: none; border: 0; border-radius: 999px; background: var(--c-ink); color: #fff; cursor: pointer; }
.enchat-send:disabled { opacity: .5; cursor: progress; }
.enchat-note { margin: 0; padding: 0 12px 10px; font-size: 11px; color: var(--c-muted); background: #fff; }

@media (max-width: 575px) {
    .enchat { right: 12px; bottom: 12px; }
    .enchat-launcher { height: 52px; width: 52px; padding: 0; justify-content: center; }
    .enchat-launcher span { display: none; }
    body.has-enchat .back-to-top { bottom: 76px; right: 14px; }
    body.has-enchat .toast-container { bottom: 76px; }
    .enchat.is-open { left: 0; top: 0; right: 0; bottom: 0; z-index: 2100; }
    .enchat.is-open .enchat-launcher { display: none; }
    .enchat.is-open .enchat-panel { width: 100%; height: 100%; flex: 1; border-radius: 0; border: 0; }
    .enchat-form textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .enchat-panel, .enchat-typing span { animation: none; }
    .enchat-launcher { transition: none; }
}
