@if $local_search_enable or $algolia_search_enable {
  .search-active {
    overflow: hidden;
  }

  .search-pop-overlay {
    background: rgba(0, 0, 0, 0);
    display: flex;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    transition: visibility .4s, background .4s;
    visibility: hidden;
    width: 100%;
    z-index: $zindex-4; 

    .search-active & {
      background: rgba(0, 0, 0, .3);
      visibility: visible;
    }
  }

  .search-popup {
    background: var(--card-bg-color);
    border-radius: 5px;
    height: 65%;
    margin: auto;
    transform: scale(0);
    transition: transform .4s;
    width: 700px;

    .search-active & {
      transform: scale(1);
    }

    @include mobile() {
      border-radius: 0;
      height: 100%;
      width: 100%;
    }

    .search-icon, .popup-btn-close {
      color: $grey-dark;
      font-size: 18px;
      padding: 0 10px;
    }

    .popup-btn-close {
      cursor: pointer;

      &:hover .fa {
        color: $black-deep;
      }
    }

    .search-header {
      background: var(--content-bg-color);      
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
      display: flex;
      padding: 5px;
    }

    input.search-input {
      background: transparent;
      border: 0;
      outline: 0;
      width: 100%;
      color: var(--text-color);

      &::-webkit-search-cancel-button {
        display: none;
      }
    }

    .search-result-container {
      height: calc(100% - 55px);
      overflow: auto;
      padding: 0px 25px;
    }

    .search-footer {
      background: var(--content-bg-color);
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
      padding: 0 5px;
      color: var(--text-color);

      .search-meta-info {
        height: 26px;
        display: flex;
        padding: 5px 0;
        
        .search-hit-stats {
          font-size: $font-size-smaller;
          width: 65%;
          padding: 2px 8px;
        }

        .search-vendor {
          width: 34%;
          text-align: right;
          font-size: $font-size-small;
          font-weight: bold;
          
          img {
            width: 68px;
            margin: 5px;
            vertical-align: middle;
            display: inline;
          } 

          a {
            border: none;
          }     
        }
      }

    }

    .search-result-list {
      margin: 0 5px;
      padding: 0;
    }

    a.search-result-title {
      font-weight: bold;
    }

    p.search-result {
      border-bottom: 1px dashed $grey-light;
      padding: 5px 0;
    }
  }

  mark.search-keyword {
    background: transparent;
    border-bottom: 1px dashed $red;
    color: $red;
    font-weight: bold;
  }
}

@if $algolia_search_enable {
  .search-input-container {
    flex-grow: 1;

    form {
      padding: 2px;
    }
  }

  .search-stats {
    align-items: center;
    display: flex;
    justify-content: space-between;

    img {
      height: 1em;
      margin: 0;
    }
  }

  .algolia-pagination {
    // Override default style of ul
    //margin: 40px 0;
    opacity: 1;
    padding: 0;
    font-size: $font-size-smallest;
    margin-bottom: -16px;

    .pagination {
      visibility: visible;
      margin: 0;
    }

    .pagination-item {
      display: inline-block;
    }

    .current .page-number {
      @extend %page-number-current;
      cursor: default;
    }

    .disabled-item {
      visibility: hidden;
    }
  }
}

@if $local_search_enable {
  .search-popup {
    .search-input-container {
      flex-grow: 1;
      padding: 2px;
    }

    .no-result {
      display: flex;
    }

    .search-result-list {
      width: 100%;
    }

    .search-result-icon {
      color: $grey-light;
      margin: auto;
    }
  }
}