#search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(21, 21, 21, 0.3);
    -webkit-backdrop-filter: blur(2px);
            backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
  
#search-modal-overlay.opened-search {
    visibility: visible;
    opacity: 1;
}

/* Modal container */
#search-modal-container {
    background: var(--white1);
    width: 1000px;
    text-align: center;
    position: relative;
    border-radius: 8px;
}

#search-modal-container:not(.showing-results) .categories-selection, #search-modal-container:not(.showing-results) #results-wrapper {
    display: none;
}

.search-functionality-wrapper{
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--greyBorder);
    padding: 15.5px 16px;
    height: 50px;
    gap: 12px;
}

.search-functionality-wrapper > div:last-child {
    display: flex;
    gap: 8px;
}
  
.search-functionality-wrapper > div:first-child {
    display: flex;
    width: 100%;
    gap: 12px;
}
  
.search-functionality-wrapper input {
    border: none;
    width: 100%;
}
  
.search-functionality-wrapper button {
    border-radius: 8px;
    background-color: var(--greyBackground1);
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    width: 26px;
    height: 26px;
    transition: 0.3s ease all;
}

.search-functionality-wrapper button:hover path {
    stroke: var(--blue1);
    transition: 0.3s ease all;
}
  
.search-functionality-wrapper button:hover {
    background-color: var(--blue2);
    transition: 0.3s ease all;
}

div:has(#search-query:not(:placeholder-shown)) + div #search-clear {
    display: flex;
}

#search-clear {
    display: none;
}

#search-results {
    min-height: 50px;
    background: var(--white1);
    border-radius: 8px;
}

#search-results.loading-search-results {
    filter: blur(2px);
    clip-path: inset(0);
}

.categories-selection {
    margin: 0px 20px;
    border-bottom: 1px solid var(--greyBorder);
    display: flex;
}

.categories-selection button {
    display: flex;
    gap: 8px;
    padding: 16px;
    border: none;
    background: none;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.categories-selection button.selected-category {
    pointer-events: none;
}

.categories-selection button::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: transparent;
}

.categories-selection button.selected-category::after {
    background-color: var(--blue1);
}

.categories-selection button.selected-category span:first-child,
.categories-selection button.selected-category span:last-child,
.categories-selection button span:first-child,
.categories-selection button span:last-child,
.categories-selection button.selected-category {
    transition: 0.3s ease all;
}

.categories-selection button.selected-category span:first-child {
    color: var(--blue1);
}

.categories-selection button.selected-category span:last-child {
    color: var(--blue1);
    background-color: var(--blue2);
    border: 1px solid var(--blue2);
}

.categories-selection button span:first-child {
    color: var(--black1);
}

.categories-selection button span:last-child, .product-count-div span:last-child, .category-count-div span:last-child {
    color: var(--grey2);
    border: 1px solid var(--greyBorder);
    border-radius: 80px;
    padding: 4px 8px;
}

.category-count-div {
    padding: 16px 20px;
}

#search-products {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#product-search-results {
    display: flex;
    gap: 30px;
    padding: 16px 20px;
}

#brands-search-results {
    padding: 16px 0px 42px 0px;
}

#search-category-separator {
    border: 1px solid var(--greyBorder);
    width: 100%;
}

.product-sorting-wrapper {
    display: flex;
    justify-content: space-between;
}

.product-count-div, .search-sorting-div, .category-count-div {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-sorting-div > button, .search-sorting-div > div > button {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid var(--greyBorder);
    background: none;
    cursor: pointer;
    align-items: center;
    transition: 0.3s ease all;
}

.search-sorting-div button:hover, #search-sort.show-sorting-options {
    border: 1px solid var(--blue1);
    transition: 0.3s ease all;
}

#search-sort.show-sorting-options svg {
    transform: rotate(180deg);
}

.search-show-all {
    width: fit-content;
    padding: 14px 24px;
    background-color: var(--blue1);
    color: var(--white1);
    border-radius: 8px;
    transition: 0.3s ease all;
    margin-top: 8px;
}

.search-show-all:hover {
    background-color: var(--hoverBlue);
    transition: 0.3s ease all;
}

#search-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#search-filters > div:first-child {
    padding: 9px 0px;
    text-align: start;
}

#search-filters > div:first-child button {
    display: none;
    pointer-events: none;
}

.search-filtering-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

#search-filters > div {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 230px;
}

.specific-filter-option {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    cursor: pointer;
    gap: 15px;
}

.specific-filter-option > div {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-filtering-header + div {
    margin-top: 16px;
    display: flex;
    gap: 16px;
    flex-direction: column;
}

.specific-filter-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--grey3);
    background-color: transparent;
    opacity: 0;
    z-index: 1;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    position: relative;
}

.search-checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: transparent;
    border: 1px solid var(--grey1);
    border-radius: 4px;
    cursor: pointer;
}

.search-checkmark:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 3px;
    height: 6px;
    border: solid white;
    border-width: 0px 2px 2px 0px;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

.specific-filter-option input:checked ~ .search-checkmark {
    background-color: var(--blue1);
    border: 1px solid var(--blue1);
}

.specific-filter-option > span {
    padding: 4px 8px;
    color: var(--grey2);
    border: 1px solid var(--greyBorder);
    border-radius: 80px;
}

.specific-filter-option:has(input:checked) .caption5 {
    color: var(--blue1);
    background-color: var(--blue2);
    border: 1px solid var(--blue2);
}

.hidden-filter-category svg {
    transform: rotate(180deg);
}

.hidden-filter-category + div {
    display: none;
}

#results-wrapper {
    max-height: 70vh;
    height: 70vh;
    overflow-y: auto;
}

#results-wrapper::-webkit-scrollbar {
    display: none;
}

.custom-checkbox + span {
    text-align: start;
}

.brands-item,
.models-item,
.quality-item,
.dimensions-item {
    display: block;
}

.brands-item:nth-child(n+5),
.models-item:nth-child(n+5),
.quality-item:nth-child(n+5),
.dimensions-item:nth-child(n+5) {
    display: none;
}

.filtering-submenu-expanded .brands-item:nth-child(n+5), 
.filtering-submenu-expanded .models-item:nth-child(n+5),
.filtering-submenu-expanded .quality-item:nth-child(n+5),
.filtering-submenu-expanded .dimensions-item:nth-child(n+5) {
    display: block;
}

.brands-item:nth-child(4),
.models-item:nth-child(4),
.quality-item:nth-child(4),
.dimensions-item:nth-child(4) {
    opacity: 0.5;
    pointer-events: none;
}

.filtering-submenu-expanded .brands-item:nth-child(4),
.filtering-submenu-expanded .models-item:nth-child(4),
.filtering-submenu-expanded .quality-item:nth-child(4),
.filtering-submenu-expanded .dimensions-item:nth-child(4) {
    opacity: 1;
    pointer-events: all;
}

.brands-item:nth-child(4) label > span, 
.models-item:nth-child(4) label > span,
.quality-item:nth-child(4) label > span,
.dimensions-item:nth-child(4) label > span {
    display: none;
}

.filtering-submenu-expanded .brands-item:nth-child(4) label > span, 
.filtering-submenu-expanded .models-item:nth-child(4) label > span,
.filtering-submenu-expanded .quality-item:nth-child(4) label > span,
.filtering-submenu-expanded .dimensions-item:nth-child(4) label > span {
    display: block;
}

.show-more-btn-container {
    display: flex;
    justify-content: start;
}

.show-more-btn {
    background:none;
    color: var(--blue1);
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.show-more-btn:hover {
    color: var(--hoverBlue);
}

.show-more-btn > span:last-child {
    display: none;
}

.filtering-submenu-expanded .show-more-btn > span:last-child {
    display: block;
}

.filtering-submenu-expanded .show-more-btn > span:first-child {
    display: none;
}

.search-found-categories {
    display: flex;
    flex-direction: column;
}

.search-found-categories > a {
    text-align: start;
    padding: 10.5px 20px;
    transition: 0.3s ease all;
}

.search-found-categories > a:hover {
    background-color: var(--blue2);
    transition: 0.3s ease all;
}

.categories-selection:has(#category-products.selected-category) + #results-wrapper #search-sort {
    display: flex;
}

#search-filter-mobile {
    pointer-events: none;
}

#search-filter,
#search-sort,
#search-filters,
#search-filter-mobile,
.categories-selection:has(#category-brands.selected-category) + #results-wrapper #product-search-results, 
.categories-selection:has(#category-brands.selected-category) + #results-wrapper #search-category-separator, 
.categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filter-by,
.categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filter-mobile,
.categories-selection:has(#category-products.selected-category) + #results-wrapper #search-category-separator,
.categories-selection:has(#category-products.selected-category) + #results-wrapper #brands-search-results {
    display: none;
}

.categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filters {
    display: flex;
}

.sorting-container {
    position: relative;
}

#sorting-option {
    display: none;
    position: absolute;
    right: 0px;
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid var(--greyBorder);
    flex-direction: column;
    z-index: 1;
}

#search-sort.show-sorting-options + #sorting-option{
    display: flex;
}

#sorting-option button {
    color: var(--black2);
    padding: 12px 16px;
    border: none;
    background: none;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s ease all;
    text-align: start;
    background: var(--white1);
}

#sorting-option button:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#sorting-option button:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

#sorting-option button:hover, #sorting-option button.selected-sort-option {
    background-color: var(--blue2);
    transition: 0.3s ease all;
}

#sorting-option button.selected-sort-option {
    pointer-events: none;
    color: var(--blue1);
}

#search-apply-filters {
    display: none;
    pointer-events: none;
}

.search-found-categories .highlight {
    color: var(--blue1);
}

.filtering-container:empty {
    display: none;
}

.search-filtering-header:has(+ .filtering-container:empty) svg {
    display: none;
}

.search-filtering-header:has(+ .filtering-container:empty) {
    pointer-events: none;
}

#search-product-query {
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-product-container {
    display: flex;
    gap: 30px;
    border-radius: 8px;
    border: 1px solid var(--greyBorder);
    transition: 0.3s ease all;
}

.search-product-container:hover {
    border: 1px solid var(--blue1);
    transition: 0.3s ease all;
}

.search-product-image {
    padding: 2px;
    position: relative;
    display: flex;
    align-items: end;
}

.search-product-image > div {
    position: absolute;
    top: 10px;
    left: 10px;
}

.search-filter-display {
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
}

.search-filter-display.filter-green {
    color: var(--green1);
    background-color: rgba(9, 134, 73, 0.1);
}

.search-filter-display.filter-yellow {
    color: var(--yellow1);
    background-color: rgba(245, 166, 35, 0.1);
}

.search-product-description {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: start;
    padding: 16px 24px 16px 0px;
    justify-content: space-between;
}

.search-product-description > .h5 {
    text-align: start;
}

.search-product-description > div:first-of-type {
    display: flex;
    gap: 32px;
}

.search-product-description > div > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: start;
}

.search-product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-product-description .search-product-price > div {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-direction: row;
}

.search-product-price ins span.woocommerce-Price-amount, .search-product-price > div > span.woocommerce-Price-amount {
    font-size: 20px;
    line-height: 27px;
    font-weight: 700;
    font-family: "OpenSans-Bold";
    color: var(--blue1);
}

.search-product-price del span.woocommerce-Price-amount {
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
    font-family: "OpenSans-SemiBold";
}

.search-specific-descr {
    display: flex;
    gap: 8px;
}

.search-specific-descr > span:first-of-type {
    color: var(--grey2);
    text-align: start;
}

.search-vat-text {
    color: var(--grey2);
    text-align: start;
}

.search-product-image img, .search-product-image picture {
    width: 180px;
    height: calc(100% - 46px);
    object-fit: contain;
}

@media screen and (max-width:1100px) {

    #search-modal-container {
        width: 800px;
    }
}

@media screen and (max-width:1000px) {

    .search-sizes-wrapper {
        order: -1;
    }

    #search-filter > span,
    #search-sort > span,
    #search-filter-mobile > span {
        color: var(--black2);
    }

    .categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filters {
        display: none;
    }

    .categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filter {
        display: flex;
    }

    #search-modal-overlay {
        -webkit-backdrop-filter: unset;
                backdrop-filter: unset;
        background-color: var(--white1);
        padding-top: 0px;
        top: 56px;
        padding-top: 15px;
    }

    #search-modal-container {
        width: 100%;
        height: 100%;
        padding: 0px;
    }

    .search-functionality-wrapper {
        border: 1px solid var(--greyBorder);
        border-radius: 8px;
        height: 45px;
        padding: 8px 12px;
        margin: 0px 20px;
    }
    
    .search-functionality-wrapper button {
        width: 36px;
        height: 36px;
    }

    .categories-selection {
        margin: 16px 0px 0px 0px;
        padding: 0px 20px 0px 20px;
        gap: 16px;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .categories-selection::-webkit-scrollbar {
        display: none;
    }

    .categories-selection button {
        padding: 12px 0px 12px 0px;
    }

    .product-count-div {
        margin: 8px 0px;
        gap: 8px
    }

    .categories-selection:has(#category-products.selected-category) + #results-wrapper .product-sorting-wrapper {
        flex-direction: column;
    }

    #search-filter, .sorting-container {
        flex: 1;
        justify-content: center;
    }

    #search-sort {
        width: 100%;
        justify-content: center;
    }

    #search-filter-by {
        display: none;
        pointer-events: none;
    }

    #search-filter-mobile {
        display: flex;
        pointer-events: all;
        padding: 12px 16px;
    }

    .search-sorting-div > button, .search-sorting-div > div > button {
        padding: 0px;
    }

    .search-sorting-div > button, .search-sorting-div > div > button {
        height: 40px;
    }

    .category-count-div {
        gap: 8px;
        padding: 0px 20px 16px 20px;
    }

    #search-modal-overlay {
        transition: none;
    }

    .search-show-all {
        height: 45px;
        display: flex;
        align-items: center;
        margin-top: 0px;
    }

    .categories-selection:has(#category-products.selected-category) + #results-wrapper #search-filters.expanded-filter-menu {
        display: flex;
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: var(--white1);
    }

    #search-filters > div {
        width: 100%;
        padding: 0px 20px;
    }

    #product-search-results:has(#search-filters.expanded-filter-menu) {
        padding: 0px;
    }

    #search-filters > div:first-child {
        border-bottom: 1px solid var(--greyBorder);
        padding: 12px 20px;
        display: flex;
        justify-content: space-between;
        flex-direction: row;
        align-items: center;
    }

    #search-filters.expanded-filter-menu + #search-products {
        display: none;
    }

    #search-filters > div:first-child button {
        display: flex;
        pointer-events: all;
        justify-content: center;
        align-items: center;
        border: none;
        cursor: pointer;
        background: none;
        width: 34px;
        height: 34px;
    }

    #search-apply-filters {
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        pointer-events: all;
        padding: 12px 24px;
        height: 45px;
        color: var(--white1);
        background: var(--blue1);
        margin: 14px 20px 0px 20px;
        transition: 0.3s ease all;
    }

    #search-apply-filters:hover {
        background: var(--hoverBlue);
        transition: 0.3s ease all;
    }

    .search-filtering-categories {
        height: calc(100vh - 252px);
        overflow: auto;
    }
}

@media screen and (max-width:769px) {

    .search-product-container {
        flex-direction: column;
        gap: 8px;
    }

    .search-product-image {
        display: flex;
    }

    .search-product-image img, .search-product-image picture {
        width: 146px;
        height: 146px;
    }

    .search-product-description {
        padding: 16px;
    }

    .search-product-description > div:first-of-type {
        flex-direction: column;
        gap: 8px;
    }

    .search-product-description > div > div {
        gap: 8px;
    }

    .search-product-price ins span.woocommerce-Price-amount, .search-product-price > div > span.woocommerce-Price-amount {
        font-size: 18px;
        line-height: 25px;
    }
    
    .search-product-price del span.woocommerce-Price-amount {
        font-size: 14px;
        line-height: 19px;
        font-weight: 600;
        font-family: "OpenSans-SemiBold";
    }

    .search-product-image > div {
        left: unset;
        right: 10px;
    }
}