
body.smart-search-lock {
    overflow: hidden;
}

.smart-search-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    border: 0;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 18px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #1f4fff 0%, #6d3bff 100%);
    box-shadow: 0 12px 35px rgba(48, 72, 255, 0.35);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.smart-search-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(48, 72, 255, 0.42);
}

.smart-search-fab__icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    font-size: 15px;
}

.smart-search-fab__text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.smart-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9991;
    background: rgba(8, 12, 24, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.smart-search-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.smart-search-popup {
    position: fixed;
    left: 50%;
    top: 24px;
    z-index: 9992;
    width: 600px;
    max-width: calc(100vw - 24px);
    height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .28s ease, visibility .28s ease, transform .28s ease;
}

.smart-search-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0%) scale(1);
}

.smart-search-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    background:
        radial-gradient(circle at top left, rgba(71, 108, 255, 0.08), transparent 40%),
        linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.smart-search-popup__title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.smart-search-popup__badge {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1f4fff 0%, #6d3bff 100%);
    box-shadow: 0 10px 24px rgba(66, 81, 255, 0.25);
}

.smart-search-popup__title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.smart-search-popup__subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.smart-search-popup__close {
    border: 0;
    background: #f1f5f9;
    color: #334155;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background .2s ease, transform .2s ease;
}

.smart-search-popup__close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.smart-search-chat {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(109, 59, 255, 0.04), transparent 25%),
        radial-gradient(circle at 100% 20%, rgba(31, 79, 255, 0.04), transparent 28%),
        #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.smart-search-chat::-webkit-scrollbar {
    width: 8px;
}
.smart-search-chat::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.24);
    border-radius: 999px;
}
.smart-search-chat::-webkit-scrollbar-track {
    background: transparent;
}

.smart-msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    animation: smartMsgIn .25s ease;
}

.smart-msg--user {
    justify-content: flex-end;
}

.smart-msg--assistant {
    justify-content: flex-start;
}

@keyframes smartMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.smart-avatar--assistant {
    color: #fff;
    background: linear-gradient(135deg, #1f4fff 0%, #6d3bff 100%);
    box-shadow: 0 8px 20px rgba(66, 81, 255, 0.22);
}

.smart-avatar--user {
    color: #1e293b;
    background: #e2e8f0;
}

.smart-bubble {
    max-width: calc(100% - 52px);
    padding: 14px 14px;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 14px;
}

.smart-bubble--assistant {
    background: #fff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    border-bottom-left-radius: 8px;
}

.smart-bubble--user {
    background: linear-gradient(135deg, #1f4fff 0%, #6d3bff 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(66, 81, 255, 0.2);
    border-bottom-right-radius: 8px;
}

.smart-answer {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.6;
}

.smart-answer--after-products {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.smart-loading-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.smart-loading-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.smart-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4f46e5;
    opacity: .25;
    animation: smartDots 1.2s infinite ease-in-out;
}

.smart-loading-dots span:nth-child(2) {
    animation-delay: .15s;
}

.smart-loading-dots span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes smartDots {
    0%, 80%, 100% {
        transform: scale(.75);
        opacity: .25;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.smart-loading-text {
    font-size: 13px;
    color: #64748b;
}

.smart-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.smart-followup-btn {
    border: 1px solid rgba(79, 70, 229, 0.14);
    background: #f8faff;
    color: #334155;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.25;
    cursor: pointer;
    transition: all .2s ease;
}

.smart-followup-btn:hover,
.smart-followup-btn.is-active {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.3);
    color: #312e81;
    transform: translateY(-1px);
}

.smart-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

.smart-products--compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 12px;
}

.smart-product-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.smart-product-card:hover {
    transform: translateY(-2px);
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.smart-product-card--compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.smart-product-card--compact:hover {
    transform: translateY(-1px);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.smart-product-card__media {
    width: 72px;
    min-width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-product-card--compact .smart-product-card__media {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.smart-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.smart-product-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.smart-product-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.smart-product-card--compact .smart-product-card__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.smart-product-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.smart-product-card--compact .smart-product-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
}

.smart-product-code {
    font-size: 12px;
    color: #64748b;
}

.smart-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
}

.smart-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.smart-product-meta .smart-product-code {
    font-size: 11px;
    color: #64748b;
}

.smart-product-meta .smart-product-price {
    font-size: 12px;
    font-weight: 700;
    color: #1d4ed8;
}

.smart-search-selected {
    padding: 0 14px;
    background: #fff;
}

.smart-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #eef2ff;
    color: #312e81;
    font-size: 13px;
    line-height: 1.35;
    border: 1px solid rgba(79, 70, 229, 0.12);
    animation: smartChipIn .2s ease;
}
.smart-selected-chip__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .7;
}

.smart-selected-chip__text {
    min-width: 0;
}

@keyframes smartChipIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#smart-remove-followup {
    border: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(49, 46, 129, 0.08);
    color: #312e81;
    cursor: pointer;
    line-height: 1;
    font-size: 16px;
}

.smart-search-form {
    padding: 14px;
    background: #fff;
    border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.smart-search-form__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.smart-search-form__inner:focus-within {
    border-color: rgba(79, 70, 229, 0.28);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
    background: #fff;
}

.smart-search-form.is-shaking .smart-search-form__inner {
    animation: smartShake .35s ease;
}

@keyframes smartShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.smart-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.4;
    padding: 2px 4px;
}

.smart-search-input::placeholder {
    color: #94a3b8;
}

.smart-search-submit {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    padding: 12px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, #1f4fff 0%, #6d3bff 100%);
    box-shadow: 0 10px 24px rgba(66, 81, 255, 0.22);
    transition: transform .2s ease, box-shadow .2s ease;
}

.smart-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(66, 81, 255, 0.28);
}

@media (max-width: 767px) {
    .smart-search-fab {
        right: 16px;
        bottom: 16px;
    }

    .smart-search-fab__text {
        display: none;
    }

    .smart-search-popup {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
        height: min(82vh, 760px);
        border-radius: 22px;
        transform-origin: bottom center;
    }
    .smart-search-popup.is-open{
        transform: translate(0%, 0%) scale(1);
    }

    .smart-search-popup__subtitle {
        display: none;
    }

    .smart-products {
      gap: 8px;
  }

  .smart-product-card__media {
      width: 64px;
      min-width: 64px;
      height: 64px;
  }

  .smart-product-card--compact .smart-product-card__media {
      width: 48px;
      min-width: 48px;
      height: 48px;
  }
}

.smart-answer-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.smart-answer-loader .smart-loading-text {
    font-size: 13px;
    color: #64748b;
}

.ai-search-trigger {
    border: 1px solid rgba(79, 70, 229, 0.18);
    background: #f8faff;
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.ai-search-trigger:hover {
    background: #eef2ff;
    border-color: rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.ai-search-trigger__icon {
    width: 18px;
    height: 18px;
    font-size: 11px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-search-trigger__text {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .ai-search-trigger {
        height: 38px;
        padding: 0 10px;
        margin-left: 8px;
    }

    .ai-search-trigger__text {
        display: none;
    }
}

.smart-search-form.is-loading {
    pointer-events: none;
}

.smart-search-input:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.smart-search-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.smart-search-submit.is-loading {
    position: relative;
    color: transparent;
}

.smart-search-submit.is-loading span {
    opacity: 0;
}

.smart-search-submit.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: smartBtnSpin .8s linear infinite;
}
@keyframes smartBtnSpin {
    to {
        transform: rotate(360deg);
    }
}
.smart-search-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
}
.title_input{
    margin: 2px 0 10px;
    font-size: 12px;
    color: rgb(100, 116, 139);
    line-height: 1.3;
}
