/**
 * Typesense Search Popup Styles
 * Version: 1.0.0
 */

:root {
    --typesense-search-popup-gap: 6px;
    --typesense-search-popup-outer-margin: 24px;
    --typesense-search-popup-max-height: 687px;
    --typesense-search-popup-max-width: 1370px;
    --typesense-popular-searches-max-width: 171px;
    --typesense-search-bar-height: 40px;
    --typesense-results-list-grid-row-items-count: 5;
}

/* Main popup backdrop */
#typesenseSearchPopup {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
}

/* Popup container */
.typesense-search-popup {
    position: fixed;
    top: var(--typesense-search-popup-outer-margin, 24px);
    left: 0;
    right: 0;
    gap: var(--typesense-search-popup-gap, 6px);
    display: flex;
    flex-direction: column;
    height: max-content;
    width: calc(100vw - var(--typesense-search-popup-outer-margin, 0px) * 2);
    max-height: var(--typesense-search-popup-max-height, 635px);
    max-width: var(--typesense-search-popup-max-width, 768px);
    margin: 0 auto;
    overflow: hidden;
    transition: 0.2s all ease-in-out;
    z-index: 22;
}

#typesenseSearchPopup:not(.active) .typesense-search-popup {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#typesenseSearchPopup.active .typesense-search-popup {
    opacity: 1;
    visibility: visible;
}

/* Search form */
.typesense-search-popup .typesense-form {
    flex: 0 0 auto;
    height: var(--typesense-search-bar-height, 40px);
    padding: 0 20px;
    border-radius: 30px;
    background-color: var(--Bg-Main, #FFF);
}

.typesense-search-popup .typesense-form input {
    height: var(--typesense-search-bar-height, 40px);
    width: 100%;
    padding: 10px 0;
    font-size: 18px;
    line-height: 20px;
    background-color: var(--Bg-Main, #FFF);
    border: 0;
}

.typesense-search-popup .ais-SearchBox-form {
    position: relative;
    display: flex;
    align-items: center;
}

.typesense-search-popup .ais-SearchBox-input {
    order: 1;
    outline: none;
}

.typesense-search-popup .ais-SearchBox-loadingIndicator,
.typesense-search-popup .ais-SearchBox-submit,
.typesense-search-popup .ais-SearchBox-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 32px;
    width: 32px;
    padding: 0;
    text-align: center;
    background-color: transparent;
    border-radius: 100%;
}

.typesense-search-popup .ais-SearchBox-loadingIndicator[hidden] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.typesense-search-popup .ais-SearchBox-submit {
    order: 3;
}

.typesense-search-popup .ais-SearchBox-reset {
    order: 2;
}

/* Image search button */
.typesense-search-popup .ais-SearchBox-image-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: 32px;
    width: 32px;
    padding: 0;
    text-align: center;
    background-color: transparent;
    border: none;
    border-radius: 100%;
    cursor: pointer;
    order: 3;
    transition: 0.2s opacity ease-in-out;
}

.typesense-search-popup .ais-SearchBox-image-upload:hover {
    opacity: 0.7;
}

.typesense-search-popup .ais-SearchBox-image-upload svg {
    height: 16px;
    width: 16px;
}

.typesense-search-popup .ais-SearchBox-submit svg,
.typesense-search-popup .ais-SearchBox-reset svg {
    height: 16px;
    width: 16px;
}

.typesense-search-popup .ais-SearchBox-loadingIndicator {
    order: 1;
}

/* Content area */
.typesense-search-popup .typesense-content {
    display: flex;
    flex-direction: column;
    /*height: calc(100% - var(--typesense-search-bar-height, 40px) - var(--typesense-search-popup-gap, 6px));*/
    color: var(--Text-Main, #1C1C1C);
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    background-color: var(--Bg-Main, #FFF);
    border-radius: 30px;
    overflow: hidden;
}

.typesense-content-inner {
    display: flex;
    gap: 36px;
    height: 100%;
    padding: 0 36px;
    overflow: hidden;
}

.typesense-search-header {
    display: block;
    flex: 0 0 auto;
    text-transform: uppercase;
}

/* Popular searches and results sections */
.typesense-popular-searches,
.typesense-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 0;
}

.typesense-search-product-type-selector {
    margin: 0;
    list-style: none;
    display: flex;
    gap: 0px 12px;
}

.typesense-search-product-type-selector > li {
    cursor: pointer;
}

.typesense-search-product-type-selector > li.active,
.typesense-search-product-type-selector > li:hover {
    color: #b20200;
}

.typesense-search-result-wrapper:not(.active) {
    display: none;
}

.typesense-popular-searches {
    max-width: var(--typesense-popular-searches-max-width, 171px);
    padding-right: 12px;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
}

.typesense-results {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Popular searches list */
#typesensePopularSearchesList ol {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#typesensePopularSearchesList li {
    display: inline-block;
    max-width: 100%;
    padding: 6px 8px;
    color: var(--Text-Second, #585858);
    text-align: center;
    font-size: 14px;
    line-height: 21px;
    background-color: var(--Bg-Second, #F3F3F3);
    border-radius: 30px;
    cursor: pointer;
}

#typesensePopularSearchesList li > div {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.typesense-search-popup #typesensePopularSearchesList,
.typesense-search-result-wrapper
{
    height: 100%;
}

.typesense-search-popup #typesensePopularSearchesList {
    overflow-x: hidden;
    overflow-y: auto;
}

.typesense-search-popup #typesenseResultsList .ais-Hits-list,
.typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-list
{
    display: grid;
    grid-template-columns: repeat(var(--typesense-results-list-grid-row-items-count), minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    list-style: none;
}

.typesense-search-popup #typesenseResultsList .ais-Hits-item a,
.typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item a
{
    display: flex;
    height: auto;
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--Bg-Second, #F3F3F3);
    border-radius: 8px;
}

.typesense-search-popup #typesenseResultsList .ais-Hits-item picture,
.typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item picture
{
    height: 100%;
    width: 100%;
}

.typesense-search-popup #typesenseResultsList .ais-Hits-item img,
.typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item img
{
    height: 100%;
    width: 100%;
    font-size: 0;
    background-color: var(--Bg-Second, #F3F3F3);
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    transition: 0.2s opacity ease-in-out;
}
.typesense-search-popup #typesenseResultsList .ais-Hits-item img.lazy:not(.loaded),
.typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item img.lazy:not(.loaded)
{
    opacity: 0;
}

.typesense-search-popup .typesense-all-results-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.typesense-search-popup .typesense-all-results-wrapper a {
    color: var(--Brand-Black-Default, #585858);
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0.56px;
    text-transform: uppercase;
    text-decoration: none;
}

ul.search-product-type-selector {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0;
    flex-wrap: wrap;
}

ul.search-product-type-selector > li {

    /* text-decoration: none; */
}

ul.search-product-type-selector > li.active a,
ul.search-product-type-selector > li:hover a {
    background: var(--Text-Main, #1C1C1C);
}

ul.search-product-type-selector > li.active a,
ul.search-product-type-selector > li:hover a {
    color: #fff;
}

ul.search-product-type-selector > li a {
    display: inline-block;
    max-width: 100%;
    padding: 6px 12px;
    color: var(--Text-Second, #585858);
    text-align: center;
    font-size: 14px;
    line-height: 21px;
    background-color: var(--Bg-Second, #F3F3F3);
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
}

@media (max-height: var(--typesense-search-popup-max-height, 768px)) {
    .typesense-search-popup {

    }
}

@media (max-width: 1920px) {
    :root {
        --typesense-search-popup-max-height: 592px;
        --typesense-search-popup-max-width: 1025px;
        --typesense-results-list-grid-row-items-count: 4;
    }

    .typesense-search-popup #typesenseResultsList .ais-Hits-item:nth-child(8) ~ .ais-Hits-item,
    .typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item:nth-child(8) ~ .ais-Hits-item
    {
        display: none;
    }

    @media (max-width: 1440px) {
        :root {
            --typesense-search-popup-max-height: 618px;
            --typesense-search-popup-max-width: 972px;
        }

        @media (max-width: 768px) {
            :root {
                --typesense-search-popup-outer-margin: 16px;
                --typesense-search-popup-max-height: 719px;
                --typesense-search-popup-max-width: 515px;
                --typesense-popular-searches-max-width: 100%;
                --typesense-results-list-grid-row-items-count: 3;
            }

            .typesense-search-popup {
                height: calc(100vh - var(--typesense-search-popup-outer-margin, 0px) * 2);
                /*TODO CHECK THIS LINE?*/
                max-height: calc(100vh - var(--typesense-search-popup-outer-margin, 0px) * 2);
            }

            .typesense-content-inner {
                flex-direction: column;
                gap: 12px;
                padding: 0 20px;
            }

            .typesense-popular-searches {
                padding: 20px 0 12px;
                border-right: none;
                border-bottom: 1px solid rgba(0, 0, 0, 0.15);
            }

            #typesensePopularSearchesList ol {
                flex-direction: row;
                flex-wrap: wrap;
            }

            .typesense-results {
                height: 100%;
                padding-top: 0;
                overflow: hidden;
            }

            .typesense-search-result-wrapper
            {
                overflow-x: hidden;
                overflow-y: auto;
            }

            .typesense-search-popup #typesenseResultsList .ais-Hits-item:nth-child(6) ~ .ais-Hits-item,
            .typesense-search-popup #typesenseResultsPaintingsList .ais-Hits-item:nth-child(6) ~ .ais-Hits-item
            {
                display: none;
            }

            @media (max-width: 500px) {
                :root {
                    --typesense-search-popup-max-height: 592px;
                    --typesense-results-list-grid-row-items-count: 2;
                }
            }
        }
    }
}

@-webkit-keyframes typesense-ball-beat {
    50% {
        opacity: 0.2;
        -webkit-transform: scale(0.75);
        transform: scale(0.75);
    }

    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

@keyframes typesense-ball-beat {
    50% {
        opacity: 0.2;
        -webkit-transform: scale(0.75);
        transform: scale(0.75);
    }

    100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

.typesense-ball-beat > div {
    background-color: #b20200;
    width: 15px;
    height: 15px;
    border-radius: 100%;
    margin: 2px;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    display: inline-block;
    -webkit-animation: typesense-ball-beat 0.7s 0s infinite linear;
    animation: typesense-ball-beat 0.7s 0s infinite linear;
}

.typesense-ball-beat > div:nth-child(2n-1) {
    -webkit-animation-delay: -0.35s !important;
    animation-delay: -0.35s !important;
}

.wp-child-theme-generatepress_child #typesenseSearchPopup #typesensePopularSearchesList mark {
    background: #B20200;
    color: white;
}

.ais-SearchBox .search-image-control {
    display: none;
    height: var(--typesense-search-bar-height, 40px);
}

.ais-SearchBox.image-search-active .search-image-control {
    display: flex;
    width: 100%;
    align-items: center;
}

.ais-SearchBox.image-search-active .ais-SearchBox-submit {
    display: none;
}

.ais-SearchBox.image-search-active .ais-SearchBox-input {
    display: none;
}

.search-image-control .search-image {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--Bg-Second, #F3F3F3);
    display: inline-block;
}

.search-image-control .search-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-image-control .search-image-delete {display: inline-block;}

.search-image-control .search-image-delete img {
    width: 14px;
    display: block;
}

.search-image-control-container {
    cursor: pointer;
    display: flex;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: calc(var(--typesense-search-bar-height, 40px) * 0.8);
    flex-direction: row;
    gap: 8px;
    align-items: center;
    background-color: var(--Bg-Second, #F3F3F3);
    height: 80%;
}


#typesenseSearchPopup.muralas .typesense-search-popup .typesense-form,
#typesenseSearchPopup.muralas .typesense-search-popup .typesense-content {
    border-radius: 3px;
}

#typesenseSearchPopup.muralas .typesense-search-product-type-selector > li.active,
#typesenseSearchPopup.muralas .typesense-search-product-type-selector > li:hover,
#typesenseSearchPopup.muralas .typesense-search-popup .typesense-all-results-wrapper a {
    color: #FF4802;
}

#typesenseSearchPopup.muralas #typesensePopularSearchesList li {
    border-radius: 0px;
    background: #EDEDED;
    color: rgba(26, 75, 86, 0.80);
}

#typesenseSearchPopup.muralas #typesensePopularSearchesList mark {
    background: #FF4802;
    color: white;
}

#typesenseSearchPopup.muralas .typesense-search-header,
#typesenseSearchPopup.muralas .typesense-results > span:first-of-type {
    color: #0D252B;
    font-family: Verdana;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    line-height: 21px;
    text-transform: uppercase;
}

.typesense-search-product-type-selector {
    font-size: 14px;
}
