/** Auto-completion menu */
html {
    --autocomplete-muted-color: #969faf;
    --redirect-hit-element-height: 45px;
}

/********************
     INPUT FORM
 ********************/

#algoliaAutocomplete {
    position: relative;
}

#algoliaAutocomplete .aa-SubmitButton {
    background: none;
    border: none;
    position: absolute;
    right: 0px;
    height: 32px;
    box-shadow: none;
}

#algoliaAutocomplete .aa-ClearButton {
    position: absolute;
    right: 1px;
    top: 1px;
    height: 30px;
    border: none;
    background: #fff;
    display: none;
}

#algoliaAutocomplete .aa-LoadingIndicator {
    position: absolute;
    top: 20%;
    right: 10px;
}

/********************
    PANEL LAYOUT
 ********************/

.aa-Panel {
    position: absolute;
    margin-top: -1px;
    right: 0;
    width: 100%;
    z-index: 1000 !important;
    border: 1px solid #BBB;
    border-top: 3px solid #8EB4D0;
    border-radius: 1px;
    background: white;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
}

.aa-Panel:after {
    clear: both;
    content: '';
}

@media (min-width: 769px) {
    .aa-Panel {
        left: auto !important;
    }
    .aa-Panel ul {
        padding-inline-start: 0;
        margin-bottom: 0 !important;
    }
}

.aa-Panel li.aa-Item {
    list-style-type: none;
    overflow: hidden;
}


/********************
      SECTIONS
 ********************/

.aa-Panel .aa-PanelLayout section {
    padding-top: 10px;
}

.aa-Panel .aa-PanelLayout section .aa-SourceHeader {
    padding: 4px;
    color: rgb(166, 166, 166);
    text-align: left;
    font-size: 0.8em;
    text-transform: uppercase;
    font-weight: bold;
}


/********************
   PRODUCT SECTION
 ********************/

#autocomplete-products-footer {
    background-color: #F9F9F9;
    text-align: center;
    padding: 10px 0;
    display: none;
}

#autocomplete-products-footer:empty {
    display: none;
}

.with-grid #autocomplete-products-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

@media (min-width: 769px) {
    #autocomplete-products-footer {
        display: block;
    }
}

#autocomplete-products-footer span {
    color: #15769c;
    font-weight: 600;
}

/********************
       HITS
 ********************/

.aa-Panel .algoliasearch-autocomplete-hit {
    display: inline-block;
    position: relative;
    padding: 5px 10px;
    color: #000;
    text-align: left;
    text-decoration: none;
    overflow: hidden;
}

.aa-Panel .aa-cursor .algoliasearch-autocomplete-hit {
    background-color: #f2f2f2;
    /*border: 1px solid #bbb;*/
}

.aa-Panel .algoliasearch-autocomplete-hit em {
    font-weight: bold;
    font-style: normal;
}

.aa-Panel .algoliasearch-autocomplete-hit .info {
    margin-left: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.aa-Panel .aa-PanelLayout section .aa-SourceNoResults{
    padding: 5px;
}

.aa-Panel mark {
    background: none;
    font-weight: 600;
}

/********************
    SUGGESTION HITS
 ********************/

.aa-Panel .aa-ItemLink.algolia-suggestions:has(svg.algolia-glass-suggestion) {
    position: relative;
    padding: 5px 0 5px 25px !important;
}

.aa-Panel .aa-ItemLink.algolia-suggestions svg.algolia-glass-suggestion.magnifying-glass {
    display: none;
}

.aa-Panel .aa-ItemLink.algolia-suggestions:has(svg.algolia-glass-suggestion) svg.algolia-glass-suggestion.magnifying-glass {
    display: block;
    position: absolute;
    right: auto;
    left: 5px;
    top: 7px;
    fill: #A6A6A6;
    stroke: #A6A6A6;
}

/********************
    PRODUCT HITS
 ********************/

/* Image thumbnails */
.aa-Panel .algoliasearch-autocomplete-hit .thumb {
    float: left;
    margin-right: 10px;
}

.aa-Panel .algoliasearch-autocomplete-hit .thumb img {
    width: 50px;
}

/* Categories */
.aa-Panel .algoliasearch-autocomplete-hit .info .algoliasearch-autocomplete-category {
    font-size: 0.8em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
}

.aa-Panel .algoliasearch-autocomplete-hit .info .algoliasearch-autocomplete-category em {
    color: #222;
}

.algoliasearch-autocomplete-hit .info .algoliasearch-autocomplete-category span:nth-child(n+2):before {
    content: " | ";
}

/* Prices */

.aa-Panel .before_special {
    color: #aaaaaa;
    text-decoration: line-through;
    font-size: 12px;
}

.aa-Panel .tier_price {
    color: #666666;
    font-size: 10px;
}

.aa-Panel .tier_price .tier_value {
    color: #54A5CD;
    font-size: 12px;
}

.aa-Panel .algoliasearch-autocomplete-price {
    font-size: 1.1em;
    color: #54A5CD;
    height: 22px;
}

.algoliasearch-autocomplete-hit .info .algoliasearch-autocomplete-price .after_special:after {
    content: " ";
}

.algoliasearch-autocomplete-hit .info .algoliasearch-autocomplete-price .tier_price {
    padding-left: 5px;
}

/********************
      PAGE HITS
 ********************/

.aa-Panel .info-without-thumb .details {
    font-size: 10px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 30px;
    max-height: 30px;
    display: -webkit-box;
}

.aa-Panel .info-without-thumb .details em {
    color: #222222;
}

/********************
     REDIRECT HITS
 ********************/

.aa-Panel .aa-PanelLayout:not(.show-selectable-redirect) section[data-autocomplete-source-id=redirectUrlPlugin] {
    display:none
}

.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemWrapper,
.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemWrapper .aa-ItemContent {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
}

.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemWrapper {
    min-height: 30px;
    padding-top: 10px;
}

/* Redirect icons */
.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemWrapper .aa-ItemActions {
    margin-left: auto; /* Consume remaining space to push to far right */
}

.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemIcon {
    margin-right: 10px;
}

.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemIcon,
.aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=redirectUrlPlugin] .aa-ItemActions
{
    width: 20px;
}

/* Hide products when redirecting */
.aa-Panel .aa-PanelLayout:not(.show-hits-with-redirect) section[data-autocomplete-source-id=redirectUrlPlugin] ~ section[data-autocomplete-source-id=products] {
    display: none;
}

/********************
    ALGOLIA FOOTER
 ********************/

.footer_algolia {
    display: none;
}

.with-grid .footer_algolia {
    position: absolute;
    bottom: 0;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    align-items: flex-start;
    margin: 5px 0 5px 10px
}

.footer_algolia .algolia-search-by-label {
    color: var(--autocomplete-muted-color);
    font-size: .9em;
    margin-right: 5px;
}

.footer_algolia img {
    min-width: 80px;
}

@media (max-width: 768px) {
    .aa-Panel .algoliasearch-autocomplete-hit .info {
        padding-left: 15px;
    }
}

/********************
    GRID LAYOUT
 ********************/

@media (min-width: 900px) {
    .aa-Panel .aa-PanelLayout {
        width: 800px;
    }
}

@media (min-width: 769px) {
    .aa-Panel .aa-PanelLayout {
        position: relative;
        min-width: 680px;
    }

    .aa-Panel .aa-PanelLayout.with-grid {
        display: grid;
        grid-template-columns: 3fr 7fr;
        grid-auto-columns: auto;
        grid-column-gap: 0;
        grid-row-gap: 0;
        min-height: 280px;
    }

    .aa-Panel .aa-PanelLayout.with-grid section {
        grid-column: 1;
        padding: 10px;
    }

    .aa-Panel .aa-PanelLayout section:last-of-type:not([data-autocomplete-source-id=products]) {
        margin-bottom: 45px;
    }

    /* Redirect section */
    .aa-Panel .aa-PanelLayout.with-grid section[data-autocomplete-source-id=redirectUrlPlugin] {
        grid-column: 2;
        grid-row: 1 / 999; /* Default mode is to replace the product section */
        border-left: 1px solid #BBB;
        z-index: 999;
    }

    .aa-Panel .aa-PanelLayout.with-grid.show-hits-with-redirect section[data-autocomplete-source-id=redirectUrlPlugin] {
        z-index: 1000;
        /* Contain if showing with selectable redirect option */
        grid-row: 1;
        max-height: var(--redirect-hit-element-height);
    }

    /* Products section */
    .aa-Panel .aa-PanelLayout.with-grid section[data-autocomplete-source-id=products] {
        grid-column: 2;
        grid-row: 1 / 999;
        border-left: 1px solid #BBB;
        position: relative;
        margin-bottom: 0;
    }

    /* Redirect behaviors */
    .aa-Panel .aa-PanelLayout.with-grid.show-selectable-redirect section[data-autocomplete-source-id=redirectUrlPlugin] ~ section[data-autocomplete-source-id=products] {
        padding-top: var(--redirect-hit-element-height); /* Pad if showing with selectable redirect option */
        z-index: 999;
    }

    /* Products grid */
    .aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=products] .aa-List {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow-y: auto;
        max-height: 420px;
    }

    .aa-Panel .aa-PanelLayout section[data-autocomplete-source-id=products] .aa-List li {
        width: 100%;
    }
}

/********************
    MOBILE LAYOUT
 ********************/


@media (max-width: 768px) {
    .aa-Panel .aa-PanelLayout {
        justify-content: start;
        width:100%;
        display: flex;
        flex-direction: column;
    }
    .footer_algolia{
        width: 100%;
        justify-content: center;
    }
    .aa-Panel .aa-List {
        padding-left: 0px;
    }
    #autocomplete-products-footer{
        left: 0;
        width: 100%;
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }
    .footer_algolia{
        text-align: center;
        padding-top: 15px;
    }
    .aa-Panel .aa-PanelLayout section {
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }
    #algoliaAutocomplete{
        margin-bottom: 10px;
        clear: both;
    }
    #algoliaAutocomplete.block-search input{
        left: inherit;
        position: relative;
        margin: 0px;
    }
    #algoliaAutocomplete .aa-SubmitButton{
        z-index: 2;
    }
}
