.search-header-page {
  &.container {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
  }

  button {
    border: none;
    background-color: transparent;
  }

  .search-form {
    position: relative;

    .search-input {
      width: 100%;
      margin: 0 auto;
      max-height: 40px;

      .back-arrow-btn {
        display: none;
      }

      input {
        border: 0;
        border-bottom: 1px solid var(--tertiary-deep-Grey);
        width: 100%;
        padding: 6px 0;
        font-size: 16px;
        line-height: 20px;
        overflow: hidden;
        color: var(--secondary-main);
        font-weight: 400;
        background-color: transparent;
        display: block;
        padding-right: 24px;
        font-family: var(--body-font-family);
        height: 32px;
        outline: none;

        &::placeholder {
          color: var(--secondary-main);
        }
      }

      .search-icon {
        width: 24px;
        display: block;
        height: 24px;
        background: url('/icons/search_icon_grey.svg') transparent no-repeat center / contain;
        position: absolute;
        right: 0;
        top: 6px;
        border: 0;
        cursor: pointer;
        padding: 0;
        background-size: 24px;
      }
    }

    .search-suggestions {
      display: none;
      position: relative;
      margin-top: 2px;
      width: 100%;
      background-color: var(--tertiary-white);
      max-height: 10rem;
      overflow-y: auto;
      z-index: 1;
      margin-bottom: 0;

      .suggestion-item {
        button {
          text-decoration: none;
          color: var(--secondary-main);
          width: 100%;
          display: block;
          font-style: normal;
          line-height: 1rem;
          cursor: pointer;
          padding: 0.75rem 3.5rem 0.75rem 1rem;
          text-align: left;

          &:hover {
            background: var(--tertiary-light-grey);
          }
        }
      }
    }

    .search-suggestions.visible {
      display: block;
    }
  }
}

/* desktop search header */
.desktop-panel .search-header-page {
  .wrapper {
    padding: 0;
    row-gap: 4px;
  }

  &.container {
    /* 8 Column Grid Width */
    max-width: calc((var(--grid-formula) * 8) + (var(--grid-gutter-width) * (8 - 1)));
  }
}

/* Search Recomm */

.search-recomm {
  font-family: var(--body-font-family);
  margin-bottom: 64px;
  .search-recomm-title {
    font-family: var(--body-heading-font-family);
    font-size: var(--heading-font-4-mob);
    line-height: 28px;
    letter-spacing: 0.48px;
    color: var(--tertiary-black);
    margin: 0px 0px 16px 0px;
    padding: 0px;
    font-weight: var(--keplar-fw-700);
    margin-top: 32px;
  }

  .search-recomm-list {
    display: flex;
    color: var(--secondary-main);
    gap: 12px;
    flex-direction: row;
    flex-wrap: wrap;

    .search-recomm-list-item {
      color: var(--secondary-main);
      border: 1px solid var(--secondary-main);
      padding: 4px 12px;
      border-radius: 54px;
      font-size: 14px;
      line-height: 20px;
      font-weight: 400;
    }
  }
}

.car-filter-menu:has(input.header-search) {
  .search-header {
    width: 100%;
    position: relative;
  }
  .search-header-page {
    .wrapper {
      padding: 0;
      flex-direction: column-reverse;
      .search-form {
        .search-input {
          gap: 8px;
          display: flex;
          align-items: center;
          flex-direction: row;
          height: 4rem;
          padding: 16px 20px;
          max-height: unset;
          background-color: var(--primary-main);

          label {
            flex-grow: 1;
          }

          input {
            padding: 0;
            border: none;
            color: var(--tertiary-medium-grey, #b2b2b2);
            font-size: var(--body-font-size-xs);

            &::placeholder {
              color: var(--tertiary-medium-grey);
              font-size: 16px;
            }
          }

          .back-arrow-btn {
            width: 24px;
            height: 24px;
            display: block;
            background: url('/icons/arrow_backword.svg');
            background-repeat: no-repeat;
            background-size: contain;
          }

          .search-icon {
            position: unset;
            background-image: url('/icons/search_white.svg');
          }
        }
        .search-suggestions-wrapper {
          box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.05);
          .search-suggestions {
            width: calc(100% - 8px);
            &.visible {
              margin-bottom: 16px;
            }
          }
        }
      }
      .search-recomm {
        margin-top: 24px;
        padding: 0 20px;
        .search-recomm-title {
          margin-top: 0;
        }
      }
    }
  }
  .search-recomm {
    display: none;
  }
}

.car-filter-menu:has(input.header-search:focus),
.car-filter-menu:has(.search-recomm-list-item:active),
.car-filter-menu:has(input.header-search:not(:placeholder-shown)) {
  .search-header {
    z-index: 1;
    height: 100vh;
    position: absolute;
    background: var(--tertiary-white);
  }
  .search-recomm {
    display: block;
  }
}

@media screen and (width >= 768px) {
  .panel {
    &.mob-popupsearch {
      display: none !important;
    }
  }

  .search-header {
    &.block {
      width: 100%;
    }

    .search-header-page {
      &.container {
        padding: 0 0 40px;
        position: relative;
        background-color: transparent;
      }

      .menu-header {
        display: none;
      }

      .search-form {
        .search-input {
          input {
            font-size: var(--body-font-size-xs);
            line-height: 20px;
            height: 40px;
            padding: 10px 75px 10px 0;
          }
        }
        .search-suggestions {
          max-height: 11rem;
          margin-top: 0.375rem;
          .suggestion-item {
            button {
              padding: 0.75rem 6rem 0.75rem 1rem;
              font-style: normal;
              line-height: 1.25rem;
            }
          }
        }
      }

      .search-recomm {
        .search-recomm-list {
          row-gap: 12px;
          column-gap: 16px;
        }

        .search-recomm-title {
          margin-top: 0px;
        }
      }
    }
  }
}

@media screen and (width >= 1200px) {
  .search-header {
    .search-header-page {
      &.container {
        padding: 32px 0 40px;
      }
    }
  }
}
