/* ==========================================================================
   299SEARCH — Widget Loupe Pilule Slide Navbar & Résultats
   ========================================================================== */

.search299-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
    z-index: 100;
}

/* Formulaire en forme de pilule qui s'étire vers la gauche */
.search299-pill-form {
    display: inline-flex;
    align-items: center;
    flex-direction: row-reverse; /* La loupe reste à droite, le champ s'étire vers la gauche */
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 9999px;
    overflow: hidden;
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Bouton icône Loupe */
.search299-icon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
    background: transparent !important;
    border: none !important;
    color: #475569 !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
    flex-shrink: 0;
}

.search299-icon-btn:hover {
    color: var(--vb-blue, #1b365d) !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: scale(1.08) !important;
}

/* Zone texte masquée au repos */
.search299-input {
    width: 0;
    height: 100%;
    opacity: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #0f172a;
    font-size: 0.88rem;
    font-family: inherit;
    padding: 0;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                padding 0.3s ease;
}

.search299-input::placeholder {
    color: #94a3b8;
    font-size: 0.84rem;
}

/* Expansion vers la gauche au hover OU quand le champ a le focus */
.search299-wrapper:hover .search299-pill-form,
.search299-pill-form:focus-within {
    width: 250px;
    background: #ffffff;
    border-color: var(--vb-gold, #c8861e);
    box-shadow: 0 4px 16px rgba(200, 134, 30, 0.18),
                0 0 0 3px rgba(200, 134, 30, 0.1);
}

.search299-wrapper:hover .search299-input,
.search299-pill-form:focus-within .search299-input {
    width: 200px;
    opacity: 1;
    padding: 0 10px 0 14px;
}

.search299-wrapper:hover .search299-icon-btn,
.search299-pill-form:focus-within .search299-icon-btn {
    color: var(--vb-gold, #c8861e) !important;
    transform: scale(1.05) !important;
}

/* Adaptation Mobile */
@media (max-width: 768px) {
    .search299-wrapper {
        margin-left: 0;
        margin-top: 4px;
    }
    .search299-pill-form {
        width: 100%;
        max-width: 280px;
        background: #1e1b2e;
        border-color: rgba(255, 255, 255, 0.2);
    }
    .search299-input {
        width: 100% !important;
        opacity: 1 !important;
        padding: 0 10px 0 14px !important;
    }
}

/* ==========================================================================
   PAGE DE RÉSULTATS — /search?q=...
   ========================================================================== */
.search299-results-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    color: #1e293b;
}

.search299-header {
    margin-bottom: 32px;
}

.search299-page-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.search299-query-badge {
    color: #d97706;
}

/* Formulaire central de recherche sur la page de résultats */
.search299-main-searchform {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 6px 8px 6px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 680px;
}

.search299-main-searchform:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.15);
}

.search299-main-searchform i {
    color: #94a3b8;
    font-size: 1.1rem;
}

.search299-main-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #0f172a;
    background: transparent;
    font-family: inherit;
}

.search299-main-btn {
    background: #f59e0b;
    color: #1e1b2e;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}

.search299-main-btn:hover {
    background: #d97706;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Filtres par type de résultat */
.search299-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 32px 0;
}

.search299-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}

.search299-chip:hover,
.search299-chip.is-active {
    background: #fef3c7;
    color: #b45309;
}

.search299-chip-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Liste des résultats */
.search299-results-count {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 20px;
}

.search299-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search299-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 24px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.search299-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.search299-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.search299-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 6px;
}

.badge-page { background: #e0f2fe; color: #0369a1; }
.badge-blog { background: #fef3c7; color: #b45309; }
.badge-event { background: #fce7f3; color: #be185d; }
.badge-poi { background: #dcfce7; color: #15803d; }
.badge-category { background: #f3e8ff; color: #7e22ce; }

.search299-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.search299-card:hover .search299-card-title {
    color: #d97706;
}

.search299-card-excerpt {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin: 8px 0 10px 0;
}

.search299-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #94a3b8;
    padding-top: 10px;
    border-top: 1px solid #f8fafc;
}

.search299-card-url {
    color: #64748b;
    font-family: monospace;
    font-size: 0.82rem;
}

/* État vide */
.search299-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.search299-empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.search299-empty-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.search299-empty-text {
    color: #64748b;
    max-width: 460px;
    margin: 0 auto 24px;
    line-height: 1.5;
}
