/* new css */

/* Search */
.flex-search-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.flex-search-item a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  transition: background-color 0.3s;
  width: 100%; /* Make links full width for better touch targets on mobile */
}

.flex-search-item a:hover {
  background-color: #f0f0f0;
}

.flex-search-item figure {
  margin: 0;
  flex-shrink: 0;
}

.flex-search-item img {
  max-width: 50px;
  height: auto;
  border-radius: 5px;
}

.flex-search-item .inner {
  margin-left: 10px;
}

.flex-search-item .title {
  font-weight: bold;
}

.flex-search-item .price {
  color: #888;
  font-size: 0.9em;
}

.flex-search {
  position: absolute; /* Changed to absolute to position relative to the nearest positioned ancestor */
  bottom: 0; /* Set to position at the bottom of the container */
  margin-bottom: 20px;
  width: 100%; /* Ensure the search container is full width */
}

.flex-search input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

#search-results {
  position: absolute; /* Change to absolute positioning */
  top: calc(100% + 10px); /* Position it below the input field with some margin */
  left: 0; /* Align to the left of the input */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
  background-color: #fff;
  color: #333;
  transition: all 400ms ease-out;
  z-index: 5000;
  width: 100%; /* Make it full width of the input */
  max-width: 575px; /* Set a max width for larger screens */
  visibility: hidden; /* Initially hidden */
  opacity: 0; /* Initially transparent */
  height: calc(100vh - 200px);
  overflow: auto;
  padding: 6px;
}

#search-results ul{
  padding: 0;
}
#search-results > ul{
  margin-bottom: 0;
}

#search-results.show{
  visibility: visible;
  opacity: 1;
}

/* convert css from horney.js */
.flexsearch-container {
  position: fixed;
  top: 60px !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  background-color: #fbfbfb;
  color: #333;
  transition: left 0.1s ease-in-out;
  z-index: 600;
  width: 610px;
  visibility: hidden;
  opacity: 0;
  transition: all 400ms ease-out;
}
.flexsearch-container.tiny {
  top: 50px !important;
}
.flexsearch-list {
  padding: 5px 15px 15px 15px;
  margin: 10px 0 10px 0;
  list-style-type: none;
  overflow-y: scroll;
  max-height: 570px;
}
.flexsearch-autocomplete a:hover {
  padding: 0px;
  margin: 0px;
}
.flexsearch-list::-webkit-scrollbar {
  width: 4px;
}
.flexsearch-list::-webkit-scrollbar-track {
  background: #151d2a;
}
.flexsearch-list::-webkit-scrollbar-thumb {
  background: #ea633c;
}
.flexsearch-show {
  visibility: visible;
  opacity: 1;
  z-index: 5000;
}
.flexsearch-hide {
  display: none;
}
.flexsearch-empty {
  cursor: default;
  padding: 7px;
}
.flexsearch-item {
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 0px;
  background-color: transparent;
  border: 2px solid transparent;
  transition: all 400ms ease-out;
  padding: 6px;
}
.flexsearch-item:hover {
  background-color: transparent !important;
  border-color: var(--color-primary);
}
.flexsearch-item .link {
  display: flex;
  align-items: center;
  background-color: transparent !important;
  border: 0px !important;
}

.flexsearch-item .link .inner {
  padding-left: 12px;
  max-width: 360px;
}

.flexsearch-item .link .title {
  font-weight: 500;
  color: #000;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-wrap: wrap;
  line-height: 1.3em;
  max-width: 350px;
  font-size: 16px;
}
.flexsearch-item .link .title span {
  transition: all 200ms ease-out;
}

.flexsearch-item .link .sku {
  font-weight: 500;
  color: #000;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-wrap: wrap;
  line-height: 1.3em;
  max-width: 350px;
  font-size: 12px;
}
.flexsearch-item .link .sku span {
  transition: all 200ms ease-out;
}

.flexsearch-item .link .price {
  color: #ea633c;
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
}
.flexsearch-item .link .price small {
  font-size: 0.8em;
  color: #9b9b9b;
  text-decoration: line-through;
  font-weight: 500;
}
.flexsearch-item .link .cover {
  position: relative;
  width: 130px;
  padding-bottom: 90px;
  background-color: #fff;
  border: 1px solid #ebebeb;
}

.flexsearch-item .link .img-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.flexsearch-selected {
  background-color: #f3f3f3;
  color: #000;
}
.flexsearch-char-highlight {
  font-weight: bold;
  color: #ea633c;
}
.flexsearch-category-id {
  background-color: #eee;
  color: #aaa;
  text-align: right;
  text-transform: capitalize;
  font-style: italic;
  font-size: 12px;
  box-shadow: 1px 0px 1px;
  padding: 7px;
}

.flexsearch-char-highlight .highlight {
  font-weight: bold;
  color: #ea633c;
}

.flexsearch-autocomplete {
  position: fixed !important;
  z-index: 5000;
  padding: 5px 15px 15px 15px;
  margin: 10px 0 10px 0;
  list-style-type: none;
  overflow-y: scroll;
  max-height: 570px;
}
.flexsearch-autocomplete a:hover {
  padding: 0px !important;
  margin: 0px !important;
}
.flexsearch-autocomplete::-webkit-scrollbar {
  width: 4px;
}
.flexsearch-autocomplete::-webkit-scrollbar-track {
  background: #151d2a;
}
.flexsearch-autocomplete::-webkit-scrollbar-thumb {
  background: #ea633c;
}
.flexsearch-menu .flexsearch-menu-item-wrapper {
  position: relative;
  padding: 0px !important;
}
.flexsearch-item {
  list-style-type: none; /* Remove dot li */
}
@media (max-width: 1440px) {
  .flexsearch-container.tiny {
    top: 50px !important;
  }
}

@media (max-width: 991px) {
  .flexsearch-container {
    width: 100%;
    top: 0 !important;
    left: 0 !important;
    margin-top: 61.09px;
  }
  .flexsearch-container.tiny {
    top: 0 !important;
  }
}
@media (max-width: 575px) {
  .flexsearch-list {
    margin-right: 0;
    max-height: 100vh;
    padding: 0 10px 10px 10px;
    padding-top: 15px;
  }
  .flexsearch-item {
    margin-bottom: 5px;
  }
  .flexsearch-item .link .cover {
    width: 90px;
    padding-bottom: 60px;
  }
  .flexsearch-item .link .title {
    font-size: 14px;
    max-width: 240px;
  }
  .flexsearch-item .link .sku {
    font-size: 10px;
    max-width: 240px;
  }
  .flexsearch-item .link .price {
    font-size: 15px;
    margin-top: 5px;
  }
  .flexsearch-item .link .price small {
    font-size: 0.7em;
  }
}

.flexsearch-item {
  overflow: hidden; /* Prevent overflow */
  white-space: nowrap; /* Prevent text wrapping */
  text-overflow: ellipsis; /* Add ellipsis for overflowed text */
}
