/* ============================================================
   NOWISTECH ALGOLIA SEARCH — Dropdown de résultats
   Version : 1.0.0
   ============================================================ */


/* ============================================================
   1. CONTAINER (override de .nowis-header__search-results)
   ============================================================ */
.nowis-header__search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    max-height: 520px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: nowisSearchFadeIn 0.18s ease-out;
}

.nowis-header__search-results.is-active {
    display: block;
}

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


/* ============================================================
   2. LISTE DES RÉSULTATS
   ============================================================ */
.nowis-search-list {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.nowis-search-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nowis-search-item::before {
    display: none !important;
    content: none !important;
}


/* ============================================================
   3. CARTE DE RÉSULTAT (le lien complet)
   ============================================================ */
.nowis-search-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.15s ease;
    outline: none;
}

.nowis-search-link::after {
    display: none !important;
}

.nowis-search-link:hover,
.nowis-search-link:focus {
    background: linear-gradient(90deg, rgba(232, 162, 58, 0.08) 0%, rgba(233, 30, 99, 0.08) 100%);
    text-decoration: none !important;
}


/* ============================================================
   4. THUMBNAIL
   ============================================================ */
.nowis-search-thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nowis-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nowis-search-thumb--placeholder {
    background: linear-gradient(135deg, #E8A23A 0%, #E91E63 100%);
    position: relative;
}

.nowis-search-thumb--placeholder::after {
    content: '📱';
    font-size: 24px;
    filter: grayscale(1) brightness(2);
    opacity: 0.7;
}


/* ============================================================
   5. CONTENU DU RÉSULTAT
   ============================================================ */
.nowis-search-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.nowis-search-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #E91E63 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    -webkit-text-fill-color: #E91E63 !important;
}

.nowis-search-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 4px;
    color: #2c3049 !important;
    -webkit-text-fill-color: #2c3049 !important;
}

.nowis-search-snippet {
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
    color: #777 !important;
    -webkit-text-fill-color: #777 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* ============================================================
   6. HIGHLIGHTING ALGOLIA (le terme recherché en surbrillance)
   ============================================================ */
.nowis-search-title em,
.nowis-search-snippet em {
    background: linear-gradient(transparent 60%, rgba(233, 30, 99, 0.25) 60%);
    font-style: normal;
    font-weight: 700;
    color: inherit;
    padding: 0;
}


/* ============================================================
   7. FOOTER (Voir tous les résultats)
   ============================================================ */
.nowis-search-footer {
    border-top: 1px solid #f0f0f3;
    padding: 14px 22px;
    background: #fafafc;
    border-radius: 0 0 16px 16px;
}

.nowis-search-all {
    display: block;
    color: #2c3049 !important;
    -webkit-text-fill-color: #2c3049 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    transition: color 0.15s ease;
    outline: none;
}

.nowis-search-all::after {
    display: none !important;
}

.nowis-search-all:hover,
.nowis-search-all:focus {
    color: #E91E63 !important;
    -webkit-text-fill-color: #E91E63 !important;
}


/* ============================================================
   8. ÉTAT VIDE
   ============================================================ */
.nowis-search-empty {
    padding: 32px 24px;
    text-align: center;
}

.nowis-search-empty p {
    margin: 0 0 6px;
    font-size: 14px;
    color: #2c3049;
}

.nowis-search-empty strong {
    color: #E91E63;
    font-weight: 700;
}

.nowis-search-empty__hint {
    font-size: 13px !important;
    color: #999 !important;
    margin-top: 8px !important;
}


/* ============================================================
   9. SCROLLBAR du dropdown
   ============================================================ */
.nowis-header__search-results::-webkit-scrollbar {
    width: 8px;
}

.nowis-header__search-results::-webkit-scrollbar-track {
    background: transparent;
}

.nowis-header__search-results::-webkit-scrollbar-thumb {
    background: #d0d0d4;
    border-radius: 4px;
}

.nowis-header__search-results::-webkit-scrollbar-thumb:hover {
    background: #b0b0b4;
}


/* ============================================================
   10. RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .nowis-header__search-results {
        top: calc(100% + 8px);
        max-height: 70vh;
        border-radius: 14px;
    }

    .nowis-search-link {
        padding: 10px 12px;
        gap: 12px;
    }

    .nowis-search-thumb {
        width: 56px;
        height: 56px;
    }

    .nowis-search-title {
        font-size: 14px;
    }

    .nowis-search-snippet {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .nowis-search-cat {
        font-size: 10px;
    }

    .nowis-search-footer {
        padding: 12px 18px;
    }
}


/* ============================================================
   11. LOADING STATE (optionnel, pour plus tard)
   ============================================================ */
.nowis-header__search-results.is-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E8A23A, #E91E63);
    animation: nowisSearchLoading 1s infinite;
}

@keyframes nowisSearchLoading {
    0% { transform: scaleX(0); transform-origin: left; }
    50% { transform: scaleX(1); transform-origin: left; }
    100% { transform: scaleX(1); transform-origin: right; }
}
