/* sundoze.aiconsultant — widget.css */

#ai-msg-container::-webkit-scrollbar, .ai-cards-scroll::-webkit-scrollbar { height: 4px; width: 5px !important; }
#ai-msg-container::-webkit-scrollbar-track, .ai-cards-scroll::-webkit-scrollbar-track { background: transparent !important; }
#ai-msg-container::-webkit-scrollbar-thumb, .ai-cards-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15) !important; border-radius: 10px !important; }

@keyframes ai-pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0,174,239,0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(0,174,239,0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0,174,239,0); }
}
@keyframes robot-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}
@keyframes robot-blink {
    0%, 94%, 98%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.1); }
}
.ai-anim-float { animation: robot-float 3s ease-in-out infinite; }
.ai-anim-blink { transform-origin: center; transform-box: fill-box; animation: robot-blink 5s infinite; }

@keyframes tooltip-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.ai-tooltip-anim { animation: tooltip-bounce 2s ease-in-out infinite; transition: opacity 0.5s ease, transform 0.5s ease; }

.ai-popup-anim {
    transition: opacity 0.4s cubic-bezier(0.16,1,0.3,1), transform 0.4s cubic-bezier(0.16,1,0.3,1);
    transform-origin: top right;
}
.ai-popup-hidden { opacity: 0 !important; transform: scale(0.9) translateY(-20px) !important; pointer-events: none; }

.ai-glass-effect {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(35px) saturate(210%) brightness(105%) !important;
    -webkit-backdrop-filter: blur(35px) saturate(210%) !important;
    border: 1px solid rgba(255,255,255,0.8) !important;
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.5) !important;
}

.ai-full-screen {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100dvh !important;
    max-width: none !important; max-height: none !important;
    border-radius: 0 !important; margin: 0 !important;
    transform: none !important; z-index: 2147483647 !important;
    background: white !important;
}
.ai-full-screen .ai-content-wrapper { max-width: 900px; margin: 0 auto; width: 100%; height: 100%; display: flex; flex-direction: column; }
.ai-full-screen .ai-input-area {
    position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    background: rgba(255,255,255,0.95) !important; backdrop-filter: blur(15px) !important;
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 15px)) !important;
    border-top: 1px solid rgba(0,0,0,0.05) !important; z-index: 2147483647 !important;
}
@media (min-width: 768px) {
    .ai-full-screen .ai-input-area { position: relative !important; width: 100% !important; background: transparent !important; }
}

.ai-trigger-btn-brand {
    width: 68px; height: 68px; background: #007aff !important;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 12px 30px rgba(0,122,255,0.4);
    position: relative; animation: ai-pulse-ring 3s infinite;
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275); z-index: 1000;
}
.ai-trigger-btn-brand:hover { -webkit-transform: scale(1.08) rotate(3deg); transform: scale(1.08) rotate(3deg); }

.ai-msg-link {
    display: -webkit-inline-flex !important; display: inline-flex !important;
    -webkit-align-items: center; align-items: center;
    -webkit-justify-content: center; justify-content: center;
    gap: 8px;
    background: var(--sdz-brand, #00aeef) !important; color: white !important;
    padding: 10px 20px; border-radius: 20px; font-weight: 800; font-size: 11px;
    text-decoration: none !important; margin: 4px 4px 4px 0;
    box-shadow: 0 4px 15px rgba(0,174,239,0.3) !important;
    -webkit-transition: all 0.2s cubic-bezier(0.4,0,0.2,1); transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    text-transform: uppercase; max-width: 100%; letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
}
.ai-msg-link:hover { filter: brightness(0.9); -webkit-transform: translateY(-2px); transform: translateY(-2px); }

/* Кнопка менеджера в шапке */
.ai-hdr-manager {
    display: -webkit-inline-flex; display: inline-flex;
    -webkit-align-items: center; align-items: center; gap: 4px;
    background: var(--sdz-brand, #00aeef); color: white;
    padding: 5px 12px; border-radius: 12px; font-weight: 700; font-size: 10px;
    border: none; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.5px;
    -webkit-transition: all 0.2s ease; transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,174,239,0.25);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}
.ai-hdr-manager:hover { filter: brightness(0.9); -webkit-transform: translateY(-1px); transform: translateY(-1px); }

.ai-contact-block {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.ai-contact-block .ai-msg-link { margin: 0; }

/* Формы сбора контактов — Single Line Glass */
.ai-form-card {
    background: rgba(255,255,255,0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 18px;
    padding: 16px 18px;
    margin-top: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    -webkit-animation: ai-form-in 0.4s cubic-bezier(0.2,0.8,0.2,1);
    animation: ai-form-in 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@media (max-width: 480px) {
    .ai-form-card { padding: 12px; border-radius: 14px; }
}
.ai-form-card.ai-form-out {
    -webkit-animation: ai-form-out 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
    animation: ai-form-out 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}
@-webkit-keyframes ai-form-in {
    from { opacity: 0; -webkit-transform: translateY(10px) scale(0.96); transform: translateY(10px) scale(0.96); }
    to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes ai-form-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@-webkit-keyframes ai-form-out {
    0% { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
    100% { opacity: 0; -webkit-transform: translateY(-8px) scale(0.95); transform: translateY(-8px) scale(0.95); }
}
@keyframes ai-form-out {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
}
.ai-form-name-card {
    /* Без отличий, единый стиль */
}
.ai-form-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
}
/* Единый инпут-строка */
.ai-form-line {
    display: flex;
    align-items: center;
    border: 2px solid var(--sdz-accent, #00aeef);
    border-radius: 14px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
    margin-bottom: 12px;
}
.ai-form-line:focus-within {
    box-shadow: 0 0 0 4px rgba(var(--sdz-accent-rgb, 0,174,239), 0.15);
}
.ai-form-flag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 8px 12px 14px;
    font-size: 15px;
    color: #64748b;
    white-space: nowrap;
    user-select: none;
    border-right: 1px solid rgba(0,0,0,0.06);
}
.ai-form-flag img {
    width: 22px; height: 15px; border-radius: 2px; object-fit: cover;
}
.ai-form-flag span {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
    font-family: -apple-system, sans-serif;
}
.ai-form-linput {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: #1e293b;
    background: transparent;
    letter-spacing: 0.5px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 0;
}
.ai-form-linput::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
/* Email и Name — тоже в линии */
.ai-form-linput-full {
    width: 100%;
    border: 2px solid var(--sdz-accent, #00aeef);
    border-radius: 14px;
    outline: none;
    padding: 12px 16px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    margin-bottom: 12px;
    -webkit-transition: box-shadow 0.25s ease;
    transition: box-shadow 0.25s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
.ai-form-linput-full:focus {
    box-shadow: 0 0 0 4px rgba(var(--sdz-accent-rgb, 0,174,239), 0.15);
}
.ai-form-linput-full::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
@media (max-width: 480px) {
    .ai-form-linput, .ai-form-linput-full { font-size: 16px; padding: 10px 12px; }
    .ai-form-linput-full { border-radius: 12px; margin-bottom: 10px; }
    .ai-form-line { border-radius: 12px; }
    .ai-form-flag { padding: 10px 6px 10px 12px; }
}
/* Кнопка */
.ai-form-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: var(--sdz-accent, #00aeef);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    -webkit-appearance: none;
    -moz-appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.ai-form-btn:hover {
    filter: brightness(1.08);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
}
.ai-form-btn:active {
    -webkit-transform: scale(0.98);
    transform: scale(0.98);
}
@media (max-width: 480px) {
    .ai-form-btn { padding: 11px; font-size: 13px; border-radius: 12px; }
}
.ai-form-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}
/* Error shake */
.ai-form-error {
    border-color: #ef4444 !important;
    -webkit-animation: ai-shake 0.4s ease;
    animation: ai-shake 0.4s ease;
}
.ai-form-line.ai-form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.1) !important;
}
@-webkit-keyframes ai-shake {
    0%,100%{-webkit-transform:translateX(0)} 20%{-webkit-transform:translateX(-6px)} 40%{-webkit-transform:translateX(6px)} 60%{-webkit-transform:translateX(-3px)} 80%{-webkit-transform:translateX(3px)}
}
@keyframes ai-shake {
    0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)}
}
/* Success checkmark */
.ai-form-success {
    text-align: center;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
    -webkit-animation: ai-form-in 0.3s ease;
    animation: ai-form-in 0.3s ease;
}
.ai-form-success-icon {
    font-size: 28px;
    margin-bottom: 4px;
    -webkit-animation: ai-check-pop 0.4s cubic-bezier(0.2,0.8,0.2,1);
    animation: ai-check-pop 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
@-webkit-keyframes ai-check-pop {
    0% { -webkit-transform: scale(0); opacity: 0; }
    50% { -webkit-transform: scale(1.2); }
    100% { -webkit-transform: scale(1); opacity: 1; }
}
@keyframes ai-check-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.ai-marketing-card {
    flex-shrink: 0; background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.05); border-radius: 14px;
    padding: 12px 24px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: all 0.25s ease;
    display: flex; align-items: center; justify-content: center;
}
.ai-marketing-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,174,239,0.15); border-color: rgba(0,174,239,0.3); }

.ai-detached {
    position: absolute !important; z-index: 2147483647 !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.04) !important;
    transition: box-shadow 0.3s ease !important;
}

@media (min-width: 768px) {
    .ai-drag-handle { cursor: grab !important; user-select: none; }
    .ai-dragging .ai-drag-handle { cursor: grabbing !important; }
    .ai-drag-bar { width: 36px; height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; margin: 0 auto 4px; transition: background 0.2s, width 0.2s; }
    .ai-drag-handle:hover .ai-drag-bar { background: rgba(0,0,0,0.18); width: 48px; }
}
@media (max-width: 767px) {
    .ai-drag-bar { display: none !important; }
    #ai-btn-fullscreen { display: none !important; }
    #ai-btn-dock { display: none !important; }
}

.ai-product-card { display: flex; align-items: center; gap: 12px; background: #1e293b; border-radius: 14px; padding: 10px 12px; margin-top: 2px; transition: all 0.2s ease; }
.ai-product-card-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #334155; }
.ai-product-card-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: #f1f5f9; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.ai-cart-btn {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
    background: #f97316; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}
.ai-cart-btn:hover { background: #ea580c; transform: scale(1.08); }
.ai-cart-btn:active { transform: scale(0.95); }
.ai-cart-btn.ai-cart-added { background: #22c55e !important; box-shadow: 0 4px 12px rgba(34,197,94,0.35) !important; }
.ai-cart-btn.ai-cart-noavail { background: #64748b !important; box-shadow: none !important; cursor: default; }
@keyframes ai-cart-bounce { 0%{transform:scale(1)} 30%{transform:scale(1.25)} 50%{transform:scale(0.9)} 70%{transform:scale(1.1)} 100%{transform:scale(1)} }
.ai-cart-bounce { animation: ai-cart-bounce 0.5s ease; }
