/**
 * Onglet « Assistant » du drawer de recherche.
 * Markup : templates/search-drawer.php — Comportement : assets/js/bs-search-assistant.js
 * Complète bs-search.css (la grille de résultats hérite de product-cards.css).
 */

/* ===== Onglets ===== */
.bs-search__tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 1px solid #ECECEC;
    padding: 0 24px;
    flex: 0 0 auto;
}

.bs-search__tab {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #8A8A8A;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.bs-search__tab:hover {
    color: #1F1F1F;
}

.bs-search__tab.is-active {
    color: #1F1F1F;
    border-bottom-color: #1F1F1F;
}

/* ===== Bascule des vues ===== */
.bs-search__view {
    display: none;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.bs-search__view.is-active {
    display: flex;
}

/* ===== Barre de l'assistant (textarea + bouton) ===== */
.bs-assistant__bar {
    align-items: flex-start;
}

#bs-search-drawer .bs-assistant__input {
    flex: 1 1 auto;
    border: 0;
    outline: none;
    background: transparent;
    border-bottom: 1px solid #000000;
    font-size: 20px;
    line-height: 1.3;
    padding: 6px 0;
    color: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    box-shadow: none;
}

#bs-search-drawer .bs-assistant__input::placeholder {
    color: #9A9A9A;
}

.bs-assistant__submit {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    background: #1F1F1F;
    color: #FFF;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.bs-assistant__submit:hover {
    opacity: 0.85;
}

.bs-assistant__submit:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ===== Corps de l'assistant ===== */
.bs-assistant__hint {
    margin: 24px 0;
    text-align: center;
    color: #8A8A8A;
    font-size: 15px;
}

.bs-assistant__spinner {
    margin: 32px auto;
    width: 34px;
    height: 34px;
    border: 3px solid #E6E6E6;
    border-top-color: #999;
    border-radius: 50%;
    animation: bs-search-spin 0.8s linear infinite;
}

/* Justification de la sélection renvoyée par l'IA */
.bs-assistant__intro {
    margin: 0 0 24px;
    padding: 16px 18px;
    background: #F7F6F4;
    border-left: 3px solid #1F1F1F;
    border-radius: 4px;
    color: #3A3A3A;
    font-size: 15px;
    line-height: 1.5;
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
    .bs-search__tabs {
        padding: 0 16px;
    }

    .bs-search__tab {
        padding: 14px 14px;
        font-size: 14px;
    }

    .bs-assistant__input {
        font-size: 17px;
    }

    .bs-assistant__submit {
        padding: 9px 16px;
        font-size: 14px;
    }
}
