#search_widget {
  margin-bottom: .625rem;
  overflow: auto;
}
#search_widget form {
  position: relative;
}
#search_widget form i {
  position: absolute;
  padding: .5rem;
  font-size: 20px;
  right: 24px;
}
#search_widget form i.clear {
  right: 15px;
  display: none;
}
#search_widget form input {
  width: 100%;
  padding: 7px 40px 7px 16px;
  outline: none;
  background-color: transparent;
  border: 2px solid #BBB09C;
  border-radius: 50px;
  line-height: 14px;
  font-size: 14px;
}

.ui-autocomplete.searchbar-autocomplete {
  width: 100%;
  min-height: 100%;
  border: none;
}

.ui-autocomplete.searchbar-autocomplete li a, .ui-autocomplete.searchbar-autocomplete li a.ui-state-focus {
  padding: 8px 15px;
  overflow: auto;
  border: none;
  background: none;
  margin: auto;
  border-radius: 0;
}

.ui-autocomplete.searchbar-autocomplete li a:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}

.ui-autocomplete.searchbar-autocomplete li a .autocomplete-thumbnail {
  float: left;
  width: 50px;
  height: auto;
  margin-right: 8px;
}

@media only screen and (min-width: 768px) {
  #search_widget {
    float: right;
    margin-bottom: 0;
  }

  .ui-autocomplete.searchbar-autocomplete {
    width: 400px;
    min-height: auto;
    left: auto;
  }
}

@media only screen and (min-width: 992px) {
  #search_widget {
    min-width: 16.5rem;
  }
}

@media (max-width: 767.98px) {
  .header__bottom #search_widget input, .search__offcanvas #search_widget input {
    font-size: 12px;
  }
}

.header__bottom #search_widget input, .search__offcanvas #search_widget input {
  background: var(--bs-gray-100);
  border-radius: 12px;
  height: 2.25rem;
  padding-left: 1rem;
  padding-right: 3.5rem;
}

/* Override the offcanvas-top behavior for your search bar */
.search__offcanvas.offcanvas-top {
    position: absolute;
    top: 100%; /* Position right below parent */
    left: 0;
    right: 0;
    bottom: auto;
    transform: none; /* Remove transform */
    border-bottom: var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color);
    border-top: none;
    max-height: 0; /* Start collapsed */
    overflow: hidden; /* Hide content when collapsed */
    transition: max-height 0.3s ease-in-out;
}

/* When showing/shown, expand */
.search__offcanvas.offcanvas-top.show:not(.hiding),
.search__offcanvas.offcanvas-top.showing {
    max-height: 47px; /* Adjust this value based on your content height */
}

/* When hiding, collapse */
.search__offcanvas.offcanvas-top.hiding {
    max-height: 0;
}

/* Respect reduced motion preference */
@media(prefers-reduced-motion: reduce) {
    .search__offcanvas.offcanvas-top {
        transition: none;
    }
}
