/* Shared styles */
#ffsearch {

    #searchbox {
        width: 100%;

        > .input-group {
            position: relative;
            width: 100%;

            /* text input */

            input {
                border: none;
                background: transparent;

                &:focus {
                    z-index: 0
                }
            }
        }

        /* search button */

        #ffsearch-button {
            position: relative;
            width: 2.1rem;
            display: flex;
            justify-content: center;
            align-items: center;

            button,
            .spinner-border {
                padding: 0;
            }

            .spinner-border {
                width: 1.3rem;
                height: 1.3rem;
            }

            button {
                border: none;
                width: 100%;
                margin: 0;
                padding: 0;
                height: 100%;
                background: transparent;

                .icon {
                    display: flex;
                    justify-content: center;
                    width: 100%;
                    align-items: center;
                    font-size: 20px;
                    color: #0d956b;
                    -webkit-transition: opacity 0.3s ease-in-out;
                    -moz-transition: opacity 0.3s ease-in-out;
                    -ms-transition: opacity 0.3s ease-in-out;
                    -o-transition: opacity 0.3s ease-in-out;
                    transition: opacity 0.3s ease-in-out;
                }

                &:hover .icon {
                    opacity: .8;
                }
            }
        }
    }

    #ffsearch-footer {
        display: flex;
        justify-content: center;
        flex-wrap: wrap-reverse;
        gap: 15px;
        margin: 15px 0;
    }

    #ffsearch-no-results {
        display: flex;
        justify-content: center;
        padding: 30px 0;
        color: #444;
        font-weight: 600;
        font-size: 1.3rem;
    }
}

/* desktop */
@media (min-width: 992px) {
    #header-blocks #top-search {
        width: auto;
        flex-grow: 2;
        padding: 0 3%;
    }

    #ffsearch {
        background: #fbfbf5;
        border: 1px solid #cbcbbf;
        border-radius: 0.3rem;

        /* result element */
        #ffsearch-dropdown-menu {
            top: 108px;
            width: 100%;
            display: none;

            ul {
                margin-left: 0;
                margin-right: 0;
            }

            .product_list .product-content .attributes {
                gap: 4px;

                & > * {
                    margin: 0;
                }
            }

            .category-suggestions {
                margin-bottom: 15px;
                padding: 0 10px;

                > div {
                    background: #fff;
                    border: 1px dotted #dedede;
                    border-radius: 3px;
                    padding: 6px 10px;
                    height: 100%;

                    .title {
                        font-size: 1.2rem
                    }

                    .category-buttons {
                        display: flex;
                        flex-direction: column;
                        flex-wrap: wrap;
                        gap: 10px;
                        align-items: start;
                        margin-top: 8px;

                        a {
                            padding: 6px 8px;
                            line-height: 130%;
                            text-align: left;
                            font-size: 0.9rem;
                            font-weight: 500;
                        }

                    }
                }
            }
        }
    }
}


/* mobile */
@media (max-width: 991px) {

    #ffsearch {
        display: none;
        flex-direction: column;
    }

    #ffsearch.has-results {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        width: calc(100% - 30px);
        max-height: calc(100vh - 30px);
        border-radius: 5px;
        overflow: scroll;
        padding: 10px 15px;
        background: #FFF;
        z-index: 2;
    }


    #ffsearch-dropdown-menu {
        /* reset bootstrap dropdown styles */
        background: none;
        border: none;
        border-radius: unset;
        float: none;
        position: relative;
        top: 0;
        left: 0;
        padding: 0;
        margin: 15px 0 0 0;
        width: 100%;
        min-width: auto;

        /* container fluid */
        > .container {
            width: 100%;
            max-width: 100%;
            padding: 0 15px;
        }

        .category-suggestions {
            .title {
                font-size: 1.25rem
            }

            .category-buttons {
                display: inline-flex;
                flex-direction: row;
                flex-flow: wrap;
                gap: 8px;
                margin: 10px 0;
            }
        }
    }

}


/* Bootstrap overrides */
@media (min-width: 1200px) {
    .row-cols-xl-7 > * {
        -ms-flex: 0 0 14.285714%;
        flex: 0 0 14.285714%;
        max-width: 14.285714%;
    }

    .row-cols-xl-8 > * {
        -ms-flex: 0 0 12.5%;
        flex: 0 0 12.5%;
        max-width: 12.5%;
    }

    .row-cols-xl-9 > * {
        -ms-flex: 0 0 11.111112%;
        flex: 0 0 11.111112%;
        max-width: 11.111112%;
    }

    .row-cols-xl-10 > * {
        -ms-flex: 0 0 10%;
        flex: 0 0 10%;
        max-width: 10%;
    }
}