.tg-ai-trigger {
    cursor: pointer;
}

    .tg-ai-trigger .search__input,
    .tg-ai-trigger .search__button {
        cursor: pointer;
        color: #343a40;
        font-weight:700;
    }

.tg-ai-trigger:focus-within {
    outline: 2px solid rgba(0, 123, 255, .45);
    outline-offset: 2px;
}

.tg-ai-modal {
    direction: rtl;
    text-align: right;
}

.tg-ai-modal .modal-dialog {
    width: calc(100% - 2rem);
    max-width: 860px;
    margin-right: auto;
    margin-left: auto;
}

.tg-ai-modal .modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    overflow: hidden;
}

.tg-ai-header {
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.tg-ai-header .modal-title {
    line-height: 1.5;
}

.tg-ai-close {
    flex: 0 0 auto;
    margin: 0 !important;
    padding: .25rem .5rem !important;
}

.tg-ai-body {
    padding: 1.5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
}

.tg-ai-intro {
    margin-bottom: 1rem;
    color: #343a40;
    font-size: 1.05rem;
}

.tg-ai-examples {
    display: grid;
    gap: .65rem;
    margin-bottom: 1.25rem;
}

.tg-ai-example {
    padding: .75rem 1rem;
    border: 1px solid #e1e6eb;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
}

.tg-ai-label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
}

.tg-ai-question {
    min-height: 92px;
    resize: vertical;
    direction: rtl;
    text-align: right;
}

.tg-ai-response {
    margin-top: 1rem;
    padding: .75rem 1rem;
    border: 1px solid #cfe2ff;
    border-radius: 8px;
    background: #eaf3ff;
    color: #084298;
    white-space: pre-line;
}

.tg-ai-response[hidden] {
    display: none;
}

.tg-ai-response--results {
    padding: 0;
    border: 0;
    background: transparent;
    color: #212529;
    white-space: normal;
}

.tg-ai-results-title {
    margin: 0 0 1rem;
    color: #084298;
    font-size: 1.1rem;
    font-weight: 600;
}

.tg-ai-results-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.tg-ai-result-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .07);
}

.tg-ai-result-media {
    min-height: 130px;
    background: #f1f3f5;
}

.tg-ai-result-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 130px;
    object-fit: cover;
}

.tg-ai-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 130px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .35rem;
    color: #868e96;
}

.tg-ai-image-placeholder-icon {
    font-size: 1.7rem;
    line-height: 1;
}

.tg-ai-image-placeholder-text {
    font-size: .78rem;
}

.tg-ai-result-content {
    min-width: 0;
    padding: .8rem;
}

.tg-ai-result-name {
    margin: 0 0 .35rem;
    color: #212529;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.tg-ai-result-vehicle,
.tg-ai-result-part-number,
.tg-ai-result-id {
    margin: 0 0 .25rem;
    color: #6c757d;
    font-size: .84rem;
    line-height: 1.45;
}

.tg-ai-result-price {
    margin: .55rem 0 0;
    color: #084298;
    font-size: 1rem;
    font-weight: 600;
}

.tg-ai-result-actions {
    display: grid;
    gap: .45rem;
    margin-top: .7rem;
}

.tg-ai-cart-form {
    margin: 0;
}

.tg-ai-add-to-cart,
.tg-ai-login-link,
.tg-ai-whatsapp-link {
    width: 100%;
    padding: .42rem .65rem;
    font-size: .86rem;
    line-height: 1.35;
}

.tg-ai-whatsapp-link {
    border-color: #25d366;
    background-color: #25d366;
    color: #fff;
}

.tg-ai-whatsapp-link:hover,
.tg-ai-whatsapp-link:focus {
    border-color: #1ebe5d;
    background-color: #1ebe5d;
    color: #fff;
}

.tg-ai-results-count-note {
    margin: .85rem 0 0;
    color: #6c757d;
    font-size: .85rem;
    text-align: center;
}

.tg-ai-follow-up-answer {
    margin-top: .9rem;
    padding: .8rem 1rem;
    border: 1px solid #b6d4fe;
    border-radius: 8px;
    background: #e7f1ff;
    color: #084298;
    font-size: .95rem;
    line-height: 1.5;
}

.tg-ai-intent-summary {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .3rem .65rem;
    margin: 0;
    padding: .85rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

.tg-ai-intent-label,
.tg-ai-intent-value {
    margin: 0;
    font-size: .9rem;
}

.tg-ai-intent-label {
    color: #495057;
    font-weight: 600;
}

.tg-ai-intent-value {
    min-width: 0;
    color: #212529;
    overflow-wrap: anywhere;
}

.tg-ai-submit {
    width: 100%;
    margin-top: 1rem;
}

@media (max-width: 575.98px) {
    .tg-ai-modal .modal-dialog {
        width: calc(100% - 1rem);
        margin-top: .5rem;
        margin-bottom: .5rem;
    }

    .tg-ai-header {
        padding: .9rem 1rem;
    }

    .tg-ai-body {
        padding: 1rem;
    }

    .tg-ai-intro {
        font-size: 1rem;
    }

    .tg-ai-example {
        padding: .65rem .75rem;
    }

    .tg-ai-results-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tg-ai-result-card {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .tg-ai-result-media,
    .tg-ai-result-image,
    .tg-ai-image-placeholder {
        min-height: 118px;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .tg-ai-results-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
