/* ================================================================
   MLK SearchAI — стили компонента
   ================================================================ */

/* --- Контейнер --- */
.mlk-search-container {
    position: relative;
    width: 100%;
    max-width: 620px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* --- Строка поиска (pill) --- */
.mlk-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 14px;
    background: #fff;
    border: 2px solid #e0e6ef;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.mlk-search-bar:focus-within {
    border-color: #b3d4f5;
    box-shadow: 0 2px 12px rgba(24,144,255,.12);
}

.mlk-search-bar.ai-mode {
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24,144,255,.15), 0 2px 14px rgba(24,144,255,.22);
    background: linear-gradient(90deg, #f0f8ff 0%, #e8f3ff 100%);
    animation: mlk-ai-pulse 2.5s ease-in-out infinite;
}

@keyframes mlk-ai-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(24,144,255,.15), 0 2px 14px rgba(24,144,255,.22); }
    50%       { box-shadow: 0 0 0 5px rgba(24,144,255,.10), 0 2px 20px rgba(24,144,255,.32); }
}

/* Иконка лупы меняет цвет в AI-режиме */
.mlk-search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .55;
    transition: opacity .2s;
}
.mlk-search-icon circle,
.mlk-search-icon path { transition: stroke .25s; }

.mlk-search-bar:focus-within .mlk-search-icon { opacity: .8; }

.mlk-search-bar.ai-mode .mlk-search-icon { opacity: 1; }
.mlk-search-bar.ai-mode .mlk-search-icon circle,
.mlk-search-bar.ai-mode .mlk-search-icon path { stroke: #1890ff; }

/* Поле ввода — в AI-режиме синяя тема */
.mlk-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #222;
    padding: 6px 0;
    line-height: 1.4;
    caret-color: #555;
    transition: color .25s, caret-color .25s;
}

.mlk-search-input::placeholder {
    color: #aab;
    transition: color .25s;
}

.mlk-search-bar.ai-mode .mlk-search-input {
    color: #0a3d7a;
    caret-color: #1890ff;
}

.mlk-search-bar.ai-mode .mlk-search-input::placeholder {
    color: #6ea8d8;
}

/* --- Свич AI (внутри строки) --- */
.mlk-ai-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    color: #9aa5b4;
    border-radius: 20px;
    transition: color .2s;
    -webkit-tap-highlight-color: transparent;
}

.mlk-ai-switch:hover { color: #1890ff; }
.mlk-ai-switch.active { color: #1890ff; }

.mlk-ai-switch-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: opacity .2s, transform .3s;
    opacity: .45;
}
.mlk-ai-switch.active .mlk-ai-switch-icon {
    opacity: 1;
    transform: rotate(15deg) scale(1.1);
}

.mlk-ai-switch-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    line-height: 1;
    transition: color .2s;
}

/* Трек */
.mlk-ai-switch-track {
    position: relative;
    width: 34px;
    height: 19px;
    background: #d0d9e4;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background .2s;
}
.mlk-ai-switch.active .mlk-ai-switch-track {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    box-shadow: 0 0 0 2px rgba(24,144,255,.2);
}

/* Ползунок */
.mlk-ai-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
    transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.mlk-ai-switch.active .mlk-ai-switch-thumb {
    transform: translateX(15px);
}

/* Иконка внутри ползунка (показывается только в активном состоянии) */
.mlk-ai-switch-thumb::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #1890ff 0%, transparent 70%);
    opacity: 0;
    transition: opacity .2s;
}
.mlk-ai-switch.active .mlk-ai-switch-thumb::after {
    opacity: .6;
}

/* Иконка свича в AI-режиме превращается в «найти» (submit-режим) */
.mlk-search-bar.ai-mode .mlk-ai-switch-label::before {
    content: '';
}

/* --- Кнопка перехода в чат (внутри строки) — ненавязчивая --- */
.mlk-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #aab3c0;
    cursor: pointer;
    opacity: .7;
    transition: color .15s, background .15s, opacity .15s;
    -webkit-tap-highlight-color: transparent;
}

.mlk-chat-btn svg {
    width: 16px;
    height: 16px;
}

.mlk-chat-btn:hover {
    color: #2C7BE5;
    background: #f0f6ff;
    opacity: 1;
}

.mlk-chat-btn:active { background: #e3eefb; }

/* ================================================================
   Выпадающий список
   ================================================================ */

.mlk-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 360px;
    background: #fff;
    border: 1px solid #e0e6ef;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 10000;
    /* Высота — относительно viewport, чтобы влезало больше результатов на больших экранах. */
    max-height: min(720px, calc(100vh - 120px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Прокручиваемая часть — товары/категории/марки. Подсказки и футер остаются видимыми. */
.mlk-search-items {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}

/* --- Загрузка --- */
.mlk-search-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    color: #888;
    font-size: 14px;
}

.mlk-search-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: mlk-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes mlk-spin { to { transform: rotate(360deg); } }

/* --- Исправление раскладки --- */
.mlk-search-corrected {
    padding: 8px 18px;
    background: #fffbe6;
    border-bottom: 1px solid #ffe58f;
    font-size: 13px;
    color: #7a5800;
}

.mlk-corrected-link {
    color: #1890ff;
    font-weight: 600;
    text-decoration: none;
    margin-left: 3px;
}

.mlk-corrected-link:hover { text-decoration: underline; }

/* --- AI-режим хинт --- */
.mlk-ai-mode-hint {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: linear-gradient(to right, #e6f4ff, #f0faff);
    border-bottom: 1px solid #bae0ff;
    font-size: 13px;
    color: #0958d9;
    font-weight: 500;
}

.mlk-ai-mode-hint svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Подсказка «введите запрос и нажмите Enter» в AI-режиме до запуска поиска */
.mlk-search-ai-hint-inner {
    padding: 18px 20px;
    text-align: center;
    color: #5a6e8c;
    font-size: 13px;
    line-height: 1.5;
}

.mlk-search-ai-hint-inner kbd {
    display: inline-block;
    padding: 2px 7px;
    margin: 0 2px;
    background: #f0f4f9;
    border: 1px solid #d0dae8;
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #1656C9;
}

/* --- Список товаров (правила выше, в блоке .mlk-search-results) --- */
.mlk-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f5f5f5;
}

.mlk-search-item:last-child { border-bottom: none; }

.mlk-search-item:hover,
.mlk-search-item--selected {
    background: #f0f8ff;
}

.mlk-item-img {
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f5f5f5;
}

.mlk-item-info { flex: 1; min-width: 0; }

.mlk-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mlk-item-article {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* AI-обоснование под товаром */
.mlk-item-reason {
    font-size: 12px;
    color: #5a6e8c;
    margin-top: 4px;
    padding: 4px 8px;
    background: linear-gradient(to right, #f0f8ff, #e6f4ff);
    border-left: 2px solid #1890ff;
    border-radius: 4px;
    line-height: 1.4;
    font-style: italic;
}

/* AI-метка на товаре, выбранном LLM. Inline-flex + фиксированные размеры,
   чтобы бейдж не «расплывался» при переносе многострочных заголовков. */
.mlk-item-ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    min-width: 24px;
    padding: 0 6px;
    background: linear-gradient(135deg, #2C7BE5, #1656C9);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 8px;
    margin-right: 6px;
    vertical-align: 1px;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(44, 123, 229, 0.3);
}

.mlk-search-item--ai-picked {
    background: linear-gradient(to right, #fafdff, #fff);
}
.mlk-search-item--ai-picked:hover,
.mlk-search-item--ai-picked.mlk-search-item--selected {
    background: #e6f4ff;
}

/* --- Пусто --- */
.mlk-search-empty {
    padding: 16px 18px;
    font-size: 14px;
    color: #aaa;
    text-align: center;
}

/* --- Подсказки следующего слова --- */
.mlk-search-suggestions {
    padding: 10px 18px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.mlk-search-suggestions__title {
    font-size: 12px;
    color: #bbb;
    display: block;
    margin-bottom: 6px;
}

.mlk-suggestion-chip {
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.mlk-suggestion-chip:hover {
    background: #e0edff;
    color: #1890ff;
}

/* --- Футер (всегда видимый) --- */
.mlk-search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
}

.mlk-search-all-link {
    font-size: 13px;
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
}

.mlk-search-all-link:hover { text-decoration: underline; }

.mlk-to-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(24,144,255,.35);
}

.mlk-to-chat-btn svg {
    width: 14px;
    height: 14px;
}

.mlk-to-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24,144,255,.45);
}

/* ================================================================
   Модальное окно чата
   ================================================================ */

.mlk-chat-modal {
    position: fixed;
    /* Поднимаем чат повыше, чтобы кнопка соцсетей в углу не перекрывала ввод. */
    bottom: 96px;
    right: 24px;
    width: 420px;
    height: min(640px, calc(100vh - 140px));
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(15, 38, 78, 0.18), 0 2px 6px rgba(15, 38, 78, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 20000;
    overflow: hidden;
    animation: mlk-slide-up .25s cubic-bezier(.16,.84,.44,1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Arial, sans-serif;
}

@keyframes mlk-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.mlk-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    /* Более глубокий, чуть менее агрессивный градиент */
    background: linear-gradient(135deg, #2C7BE5 0%, #1656C9 100%);
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.mlk-chat-header::before {
    /* Тонкий световой блик сверху для современного вида */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 40%);
    pointer-events: none;
}

.mlk-chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.mlk-chat-header-title svg {
    width: 16px;
    height: 16px;
}

.mlk-chat-close-btn {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.mlk-chat-close-btn:hover { background: rgba(255,255,255,.35); }

.mlk-chat-messages {
    flex: 1;
    padding: 16px 16px 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
}

/* Тонкий полированный скроллбар */
.mlk-chat-messages::-webkit-scrollbar { width: 6px; }
.mlk-chat-messages::-webkit-scrollbar-track { background: transparent; }
.mlk-chat-messages::-webkit-scrollbar-thumb {
    background: #d0dae8;
    border-radius: 3px;
}
.mlk-chat-messages::-webkit-scrollbar-thumb:hover { background: #aab8cc; }

.mlk-msg {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: mlk-msg-in .2s ease;
}

@keyframes mlk-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mlk-msg-user {
    background: linear-gradient(135deg, #2C7BE5, #1656C9);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(44, 123, 229, 0.18);
}

.mlk-msg-bot {
    background: #fff;
    color: #2c3848;
    align-self: flex-start;
    border: 1px solid #e8edf3;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 38, 78, 0.04);
    /* Карточки товаров внутри бота должны занимать всю ширину сообщения */
    max-width: 92%;
}

.mlk-msg-bot p { margin: 4px 0; }
.mlk-msg-bot p:first-child { margin-top: 0; }
.mlk-msg-bot p:last-child  { margin-bottom: 0; }

/* --- Chips подсказки --- */
.mlk-chat-chips {
    padding: 12px 14px 10px;
    border-top: 1px solid #e8edf3;
    background: #f7faff;
    flex-shrink: 0;
}

.mlk-chat-chips-label {
    font-size: 11px;
    color: #8a96a8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.mlk-chat-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mlk-chip {
    background: #fff;
    border: 1px solid #d6e3f4;
    color: #1656C9;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s;
}

.mlk-chip:hover {
    background: #2C7BE5;
    color: #fff;
    border-color: #2C7BE5;
}

.mlk-chip:active { transform: scale(0.97); }

/* --- Поле ввода чата --- */
.mlk-chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #e8edf3;
    background: #fff;
    flex-shrink: 0;
}

.mlk-chat-input-row input {
    flex: 1;
    border: 1.5px solid #e0e6ef;
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: #f7faff;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.mlk-chat-input-row input::placeholder { color: #a4b0c2; }

.mlk-chat-input-row input:focus {
    border-color: #2C7BE5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.12);
}

.mlk-chat-input-row button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2C7BE5, #1656C9);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 10px rgba(44, 123, 229, 0.4);
}

.mlk-chat-input-row button svg {
    width: 18px;
    height: 18px;
}

.mlk-chat-input-row button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(44, 123, 229, 0.5);
}

.mlk-chat-input-row button:active {
    transform: scale(0.96);
}

/* Консультантское вступление перед карточками */
.mlk-chat-intro {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.55;
    color: #2c3848;
}
.mlk-chat-intro + .mlk-chat-intro {
    margin-top: 8px;
}

/* Карточки товаров в ответе бота */
.mlk-chat-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 4px;
}

.mlk-chat-product {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    padding: 10px 12px;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.mlk-chat-product:hover {
    border-color: #c7d8ee;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 123, 229, 0.08);
}

.mlk-chat-product-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f7fa;
}

.mlk-chat-product-info {
    min-width: 0; /* нужно для truncate в flex */
    flex: 1;
}

.mlk-chat-product-info a {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #1656C9;
    text-decoration: none;
    line-height: 1.35;
}

.mlk-chat-product-info a:hover {
    color: #2C7BE5;
    text-decoration: underline;
}

.mlk-chat-product-info span:not(.mlk-item-ai-badge) {
    display: block;
    font-size: 11px;
    color: #8a96a8;
    margin-top: 3px;
}

/* Обоснование AI под товаром в чате */
.mlk-chat-product-reason {
    display: block;
    font-size: 11px;
    color: #5a6e8c;
    margin-top: 4px;
    padding: 3px 7px;
    background: linear-gradient(to right, #f0f8ff, #e6f4ff);
    border-left: 2px solid #1890ff;
    border-radius: 3px;
    line-height: 1.35;
    font-style: italic;
}

/* Кнопка акций в ответе бота */
.mlk-chat-promo-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff7a45, #fa541c);
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(250,84,28,.35);
}

.mlk-chat-promo-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(250,84,28,.45);
}

/* ================================================================
   Модальное окно акций (iframe)
   ================================================================ */

.mlk-promo-modal {
    position: fixed;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 96vw);
    height: 88vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 50px rgba(0,0,0,.25);
    display: flex;
    flex-direction: column;
    z-index: 20001;
    overflow: hidden;
    animation: mlk-slide-up .25s ease;
}

.mlk-promo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.mlk-promo-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.mlk-promo-close:hover { background: rgba(255,255,255,.35); }

.mlk-promo-modal iframe {
    flex: 1;
    border: none;
    width: 100%;
}

/* ================================================================
   Адаптив
   ================================================================ */

@media (max-width: 480px) {
    .mlk-chat-modal {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    .mlk-promo-modal {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
    }
    .mlk-ai-switch-label { display: none; }
    .mlk-ai-switch { padding: 4px 4px; gap: 3px; }
}

/* На планшетах — отодвигаем чат от нижнего края меньше, но всё равно отступ */
@media (min-width: 481px) and (max-width: 1024px) {
    .mlk-chat-modal {
        bottom: 80px;
        right: 16px;
        width: min(380px, calc(100vw - 32px));
    }
}

/* ── Результаты: категории, марки, гаммы ────────────────────────────── */
.mlk-search-item--category,
.mlk-search-item--brand,
.mlk-search-item--gamma {
    gap: 10px;
}

.mlk-item-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f0f4ff;
    color: #1890ff;
}

.mlk-search-item--brand .mlk-item-type-icon {
    background: #fff4f0;
    color: #fa541c;
}

.mlk-search-item--gamma .mlk-item-type-icon {
    background: #f6ffed;
    color: #389e0d;
}

.mlk-item-type-icon svg {
    width: 16px;
    height: 16px;
}

.mlk-item-badge {
    font-size: 10px;
    color: #8c8c8c;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.mlk-search-item--category .mlk-item-name,
.mlk-search-item--brand .mlk-item-name,
.mlk-search-item--gamma .mlk-item-name {
    font-weight: 500;
}

/* ================================================================
   COMPACT-режим: встроенный поиск в каталоге.
   Без AI-кнопки, без чата, узкий вид.
   ================================================================ */
.mlk-search-container--compact {
    max-width: 320px;
    margin-left: auto;
}

.mlk-search-container--compact .mlk-search-bar {
    padding: 4px 4px 4px 14px;
    border-radius: 999px;
    box-shadow: none;
    border-width: 1px;
}

.mlk-search-container--compact .mlk-search-input {
    font-size: 14px;
    padding: 5px 0;
}

.mlk-search-container--compact .mlk-search-results {
    max-height: min(560px, calc(100vh - 200px));
}
