.fm-search-wrapper{
    position: relative;

    .fm-input-group{
        position: relative;
        display: block;
        &:after{
            content:"\55";
            font-family: ETModules;
            width: 50px;
            height: 100%;
            position: absolute;
            right: 0;
            top: 0;
            background: #4f331d;
            color: #fff;
            font-size: 26px;
            display: flex;
            justify-content: center;
            align-items: center;
            pointer-events: none;
        }
        #fm-search-input{
            width: 100%;
            border: none;
            padding: 18px 60px 18px 10px;
            cursor: pointer;
            &::placeholder{
                color: #000;
            }
        }
    }
}

/* ---------- Modal de recherche ---------- */

body.fm-modal-open{
    overflow: hidden;
}

.fm-modal-overlay{
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 8vh 20px 20px;

    &.active{
        display: flex;
    }

    .fm-modal{
        background: #fff;
        width: 100%;
        max-width: 680px;
        max-height: 80vh;
        border-radius: 10px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, .35);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .fm-modal-header{
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 18px;
        border-bottom: 1px solid #eee;

        .fm-icon-search{
            color: #4f331d;
            flex-shrink: 0;
        }

        #fm-modal-input{
            flex: 1;
            border: none;
            outline: none;
            font-size: 1.15em;
            padding: 4px 0;
            background: transparent;
            color: #000;
            &::placeholder{
                color: #999;
            }
        }

        .fm-modal-clear{
            display: none;
            background: none;
            border: none;
            color: #777;
            font-size: .85em;
            cursor: pointer;
            padding: 4px 6px;
            &.visible{
                display: block;
            }
            &:hover{
                color: #4f331d;
                text-decoration: underline;
            }
        }

        .fm-modal-close{
            background: none;
            border: none;
            color: #777;
            font-size: 26px;
            line-height: 1;
            cursor: pointer;
            padding: 0 4px;
            &:hover{
                color: #4f331d;
            }
        }
    }

    .fm-modal-results{
        overflow-y: auto;
        padding: 14px 18px;
        flex: 1;

        .fm-section{
            margin-bottom: 16px;
            strong{
                display: block;
                color: #4f331d;
                margin-bottom: 8px;
                font-size: .9em;
                text-transform: uppercase;
                letter-spacing: .04em;
            }
        }

        ul{
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .fm-result{
            margin: 6px 0;

            a{
                display: flex;
                align-items: center;
                gap: 12px;
                padding: 10px 14px;
                background: #f7f5f2;
                border-radius: 6px;
                color: #4f331d;
                text-decoration: none;
                transition: background .15s ease, color .15s ease;

                .fm-icon{
                    flex-shrink: 0;
                }
                .fm-icon-folder{
                    color: #c99a3c;
                }
                .fm-icon-file{
                    color: #4f331d;
                }

                .fm-result-text{
                    display: flex;
                    flex-direction: column;
                    min-width: 0;
                }
                .fm-result-name{
                    font-weight: 600;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }
                .fm-result-path{
                    font-size: .8em;
                    color: #999;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                &:hover{
                    background: #4f331d;
                    color: #fff;
                    .fm-icon-folder,
                    .fm-icon-file{
                        color: #fff;
                    }
                    .fm-result-path{
                        color: rgba(255, 255, 255, .7);
                    }
                }
            }
        }

        .fm-loading,
        .fm-error,
        .fm-no-result{
            color: #777;
            margin: 0;
            text-align: center;
            padding: 20px 0;
        }
    }

    .fm-modal-footer{
        padding: 10px 18px;
        border-top: 1px solid #eee;
        color: #999;
        font-size: .8em;

        kbd{
            background: #f1f1f1;
            border: 1px solid #ddd;
            border-radius: 4px;
            padding: 1px 6px;
            font-size: .9em;
            font-family: inherit;
        }
    }
}
