/* ══ Глобальные уведомления (колокольчик в шапке) ══ */
.global-notify-wrap { position: relative; display: inline-flex; margin-right: 10px; }
.global-notify-btn {
    position: relative; width: 44px; height: 44px; padding: 0; border-radius: 12px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(102, 126, 234, .35);
    background: linear-gradient(135deg, rgba(102, 126, 234, .14) 0%, rgba(118, 75, 162, .14) 100%);
    color: #5b6bd6;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .18);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.global-notify-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent; color: #fff;
    box-shadow: 0 8px 20px rgba(102, 126, 234, .4);
}
.global-notify-btn:active { transform: translateY(0); }
.global-notify-btn:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.global-notify-icon { display: block; transform-origin: 50% 4px; }
.global-notify-btn.has-unread .global-notify-icon { animation: gn-ring 3.2s ease-in-out infinite; }
@keyframes gn-ring {
    0%, 62%, 100% { transform: rotate(0); }
    66% { transform: rotate(14deg); }
    72% { transform: rotate(-12deg); }
    78% { transform: rotate(8deg); }
    84% { transform: rotate(-5deg); }
    90% { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) { .global-notify-btn.has-unread .global-notify-icon { animation: none; } }
.global-notify-badge {
    display: none; position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%); color: #fff;
    font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
    box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(239, 68, 68, .45);
}

.global-notify-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 19999; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.global-notify-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.global-notify-panel {
    position: fixed; right: 12px; top: 70px; width: 380px; max-width: 90vw; max-height: 520px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 16px 40px rgba(15,23,42,.2);
    z-index: 20000; opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    display: flex; flex-direction: column; overflow: hidden;
}
.global-notify-panel.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.global-notify-handle { display: none; }
.global-notify-head { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.global-notify-head-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.global-notify-close { display: none; width: 28px; height: 28px; border-radius: 8px; border: 0; background: #f1f5f9; color: #64748b; font-size: 16px; line-height: 1; cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.global-notify-tabs { display: flex; gap: 6px; padding: 10px 12px; flex-shrink: 0; border-bottom: 1px solid #f1f5f9; }
.global-notify-tab { flex: 1; padding: 8px 6px; border-radius: 10px; border: 1px solid transparent; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-notify-tab.active { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.global-notify-tab-dot { display: none; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; margin-left: 5px; vertical-align: middle; }
.global-notify-body { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; padding: 4px 10px 10px; }
.global-notify-day-header { position: sticky; top: 0; background: #fff; padding: 8px 4px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; z-index: 1; }
.global-notify-item { padding: 10px 8px; border-bottom: 1px solid #f8fafc; }
.global-notify-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.global-notify-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.global-notify-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: #334155; }
.global-notify-meta-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #94a3b8; }
.global-notify-sum { font-size: 12px; color: #0f172a; margin-top: 4px; }
.global-notify-products { font-size: 11px; color: #475569; margin-top: 5px; }
.global-notify-empty { padding: 24px 10px; text-align: center; color: #64748b; font-size: 13px; }

/* ══ AI Ассистент ══ */
/* FAB - только десктоп */
#ai-fab {
    position: fixed; bottom: 28px; right: 28px; z-index: 1100;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none; cursor: pointer;
    box-shadow: 0 4px 20px rgba(99,102,241,.45);
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
#ai-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(99,102,241,.55); }
#ai-fab svg { width: 26px; height: 26px; color: #fff; }

/* Окно чата - десктоп */
#ai-chat-window {
    position: fixed; bottom: 96px; right: 28px; z-index: 1100;
    width: 360px; max-height: 520px;
    background: #fff; border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    display: none; flex-direction: column; overflow: hidden;
    font-family: inherit;
}

#ai-chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 16px 20px; color: #fff;
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 15px; flex-shrink: 0;
}
#ai-chat-close {
    background: none; border: none; color: #fff; font-size: 22px;
    cursor: pointer; line-height: 1; padding: 0; opacity: .8;
}
#ai-chat-close:hover { opacity: 1; }
#ai-chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    min-height: 160px;
}
.ai-msg {
    max-width: 82%; padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.5; word-break: break-word;
}
.ai-msg.user { background: #6366f1; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.bot  { background: #f1f5f9; color: #1e293b; align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.bot.typing { color: #94a3b8; }
.ai-msg a { color: #6366f1; text-decoration: underline; }
#ai-chat-input-row {
    padding: 12px 16px; border-top: 1px solid #f1f5f9;
    display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
#ai-chat-input {
    flex: 1; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 9px 13px; font-size: 14px; outline: none;
    font-family: inherit; resize: none; max-height: 90px;
    background: #fff; color: #0f172a;
    transition: border-color .2s;
}
#ai-chat-input:focus { border-color: #6366f1; }
#ai-chat-send {
    background: #6366f1; color: #fff; border: none;
    border-radius: 10px; width: 38px; height: 38px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s; flex-shrink: 0;
}
#ai-chat-send:hover { background: #4f46e5; }
#ai-chat-send svg { width: 18px; height: 18px; color: #fff; }

/* ── Стили, вынесенные из шаблона base.html (были inline style="...") ── */
.u-1b7137cc52.u-1b7137cc52.u-1b7137cc52.u-1b7137cc52 { position: fixed; inset: 0; background: rgba(15,23,42,.65); z-index: 99999; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.u-1faeb5272f.u-1faeb5272f.u-1faeb5272f.u-1faeb5272f { color: #ef4444; font-size: 20px; font-weight: 700; }
.u-2944d68dfc.u-2944d68dfc.u-2944d68dfc.u-2944d68dfc { width: 100%; padding: 13px; border: none; border-radius: 12px; background: linear-gradient(135deg,#4f46e5,#7c3aed); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(99,102,241,.4); transition: opacity .15s; }
.u-3ab7284a95.u-3ab7284a95.u-3ab7284a95.u-3ab7284a95 { font-size: 17px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.u-60ef6411d7.u-60ef6411d7.u-60ef6411d7.u-60ef6411d7 { background: #fff; border-radius: 20px; padding: 32px 28px; max-width: 360px; width: 90%; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.u-63820c8b0f.u-63820c8b0f.u-63820c8b0f.u-63820c8b0f { color: #ef4444; font-weight: 600; }
.u-9dd1207e58.u-9dd1207e58.u-9dd1207e58.u-9dd1207e58 { color: #ef4444; }
.u-b92a9b5833.u-b92a9b5833.u-b92a9b5833.u-b92a9b5833 { width: 56px; height: 56px; background: #fef3c7; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 16px; }
.u-bf47fc8966.u-bf47fc8966.u-bf47fc8966.u-bf47fc8966 { font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 24px; }
