/* @import '/menu/typesense.css';*/

/* Make sure font-size is correct, so `em` and `rem` are correct */
#instant-search {
    font-size: 16px;

    /* Fix Googlebot styles */
    &[data-skip-search] {
        .results {
            display: flex;
            flex-direction: column;
            gap: 15px;

            > div {
                display: grid;
                grid-template-columns: 200px 2fr 1fr;
                border: 1px solid rgb(203 213 225); /* tw-border-slate-300 */
                box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* tw-shadow-md */

                tbody {
                    > tr:nth-child(odd) {
                        background-color: rgb(229 231 235); /* tw-bg-gray-200 */
                    }
                }
            }
        }

        .pagination {
            li.disabled > span {
                border: 1px solid #ddd !important;
                font-size: inherit !important;
            }
        }
    }
}

/* Override/fix bootstrap styles */
#dynamic {
    ul.ais-RefinementList-list {
        border: none;

        li.ais-RefinementList-item {
            border: none;
            background: none;
            padding: 0;

            &, label.ais-RefinementList-label {
                color: #3b82f6;
                font-weight: normal;
            }

            label.ais-RefinementList-label {
                line-height: 1;

                &, input.ais-RefinementList-checkbox {
                    margin: 0;
                }
            }
        }
    }

    button.ais-Panel-collapseButton {
        font-size: 0.75rem;
    }
}

#hits {
    .ais-Hits--empty {
        margin-left: 0;
        font-size: inherit;

        &::after {
            content: unset;
        }
    }

    .ais-Hits-item {
        border: none;
        overflow: visible;
        margin-bottom: 0;
    }
}

.ais-Pagination {
    .ais-Pagination-item--selected > a {
        color: currentColor !important;
        background-color: inherit !important;
    }
}

/* Adjust mobile filters panel to work with the top menu bar */
body[data-overlay] {
    #dynamic {
        z-index: 2;
        top: 4rem;

        div:has(#filters-close) {
            top: 4.5rem;
            left: 67vw;
        }
    }

    div.tw-absolute:has(#search-box) {
        display: none;
    }

    &::before {
        z-index: 1;
    }
}

/* Fix styles on dialogs */
dialog#product-cart-modal, dialog#product-call-modal {
    label {
        font-weight: normal;
    }

    input[type="number"] {
        border: none;
        color: unset;
    }
}