.instant-search-results {
  max-height: 400px;
  overflow: overlay;
  margin-top: 15px;
  padding-right: 5px;
}

.instant-search-results .instant-search-result {
  background-color: #f2f2f2;
  border-radius: 5px;
  padding: 7px;
  margin-bottom: 10px;
}

.instant-search-tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #ccc;
  margin-top: 20px;
}

.instant-search-tabs .tab {
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-bottom: none;
  background: #f9f9f9;
  border-radius: 4px 4px 0 0;
}

.instant-search-tabs .tab.active {
  background: #fff;
  font-weight: bold;
}

.instant-search-section {
  display: none;
}

.instant-search-section:first-of-type {
  display: block;
}

/**
 * Shortcode
 */
.speedy-search-container {
  position: relative;
}

.speedy-search-container .instant-search-wrapper {
  width: 100%;
  position: absolute;
  top: 40px;
  background-color: #fff;
}

.speedy-search-container .snappy-search-form {
  position: relative;
}

.speedy-search-container .snappy-search-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #737373;
  display: none;
}

.speedy-search-container .snappy-search-input:focus + .snappy-search-close,
.speedy-search-container .snappy-search-input:not(:placeholder-shown) + .snappy-search-close {
  display: inline;
}

.speedy-search-container a {
  text-decoration: none;
}

.speedy-search-container .instant-search-section {
  padding: 0 0px;
}

.speedy-search-container .instant-search-section p {
  margin: 0;
}

.speedy-search-container .title-result {
  text-decoration: underline;
}

.speedy-search-container input {
  width: 100%;
  border-radius: 25px;
  padding: 6px 12px;
  border: 1px solid #fff;
}

.speedy-search-container .instant-search-wrapper {
  position: absolute;
  width: 100%;
  top: 48px;
  border-radius: 5px;
  background-color: #fff;
  z-index: 9999;
  padding: 10px;
}

.speedy-search-container .instant-search-result {
  padding: 10px 10px !important;
}

.speedy-search-container .instant-search-result:hover {
  background-color: #ccc !important;
}

.speedy-search-container .instant-search-results {
  margin-top: 0;
}

.speedy-search-container .instant-search-results .instant-search-result {
  background-color: #fff;
  margin-bottom: 0;
}

.speedy-search-container .snappy-search-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.speedy-search-container .instant-search-result .permalink-result {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.speedy-search-container .instant-search-result {
  border-bottom: 1px solid #555;
  border-radius: 0 !important;
}

.speedy-search-container .image-wrapper {
  flex: 0 0 100px;
}

.speedy-search-container .image-wrapper img {
  width: 100px;
  height: auto;
  object-fit: cover;
}

.speedy-search-container .search-content {
  flex: 1;
}

.speedy-search-container .title-result {
  font-size: 16px;
  margin: 0 0 5px;
  text-decoration: none;
}

.speedy-search-container .price-result {
  font-weight: bold;
  margin: 0 0 5px;
}

.speedy-search-container .excerpt-result {
  margin: 0;
  font-size: 14px;
  color: #555;
}

/**
 * Popular
 */
.popular-searches .popular {
  margin: 5px 0 0 0;
  font-weight: 700;
}

.popular-searches a.search-term {
  background-color: #999;
  color: #fff;
  padding: 5px 8px;
  border-radius: 25px;
  text-decoration: none !important;
  margin-right: 5px;
  margin-top: 5px;
  display: inline-block;
}

.popular-searches a.search-term:hover {
  background-color: #737373;
  color: #fff;
}

/**
 * Advanced Search
 */
.speedy-search-container.advanced-search .instant-search-wrapper {
  position: unset;
}

.speedy-search-container.advanced-search .instant-search-results {
  max-height: unset;
}

/**
 * Skeleton Loader
 */
.instant-search-result.skeleton-loading .image-wrapper,
.instant-search-result.skeleton-loading .title-result,
.instant-search-result.skeleton-loading .price-result,
.instant-search-result.skeleton-loading .rating-result,
.instant-search-result.skeleton-loading .read-more,
.instant-search-result.skeleton-loading .excerpt-result {
  background-color: #e0e0e0;
  color: transparent!important;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  animation: pulse 1.2s ease-in-out infinite;
}

.instant-search-result.skeleton-loading .image-wrapper {
  width: 80px;
  height: 100px;
}

.instant-search-result.skeleton-loading .image-wrapper img,
.instant-search-result.skeleton-loading .woocommerce .star-rating {
  visibility: hidden;
}

.instant-search-result.skeleton-loading .title-result,
.instant-search-result.skeleton-loading .price-result,
.instant-search-result.skeleton-loading .excerpt-result {
  min-height: 14px;
}

@keyframes pulse {
  0% {
    background-color: #e0e0e0;
  }
  50% {
    background-color: #f0f0f0;
  }
  100% {
    background-color: #e0e0e0;
  }
}

/**
 * CSS Loader https://github.com/vineethtrv/css-loader
 */
.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: absolute;
  top: 12px;
  right: 15px;
  animation: rotate 1s linear infinite
}

.loader::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  inset: 0px;
  border-radius: 50%;
  border: 5px solid #FFF;
  animation: prixClipFix 2s linear infinite ;
}

@keyframes rotate {
  100%   {transform: rotate(360deg)}
}

@keyframes prixClipFix {
  0%   {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
  25%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
  50%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
  75%  {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)}
  100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)}
}

/**
 * Errors
 */
.speedy-search-container .search-error {
  color: #ff0000;
}


/**
 * Advanced Stacked
 */
.speedy-search-container.advanced-search.stacked .instant-search-section {
  display: block;
  width: 100%;
}

.speedy-search-container.advanced-search.stacked .hidden-result {
  display: none;
}

.speedy-search-container.advanced-search.stacked .instant-search-result.more-results {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%; /* Make sure it fills the grid cell */
}

.speedy-search-container.advanced-search.stacked button.show-all-results {
  background-color: #fff;
  border: none;
}

.speedy-search-container.advanced-search.stacked button.show-all-results:hover {
  text-decoration: underline;
}

.speedy-search-container.advanced-search.stacked .instant-search-result.more-results:hover {
  background-color: transparent !important;
}

.speedy-search-container.advanced-search.stacked .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.speedy-search-container.advanced-search.stacked .instant-search-result .title-result,
.speedy-search-container.advanced-search.stacked .instant-search-result .excerpt-result,
.speedy-search-container.advanced-search.stacked .instant-search-result .image-wrapper,
.speedy-search-container.advanced-search.stacked .instant-search-result .rating-result,
.speedy-search-container.advanced-search.stacked .instant-search-result .price-result,
.speedy-search-container.advanced-search.stacked .instant-search-result .read-more {
  text-align: left;
}

.speedy-search-container.advanced-search.stacked .instant-search-result .rating-result {
  display: flex;
  margin: 3px 0 8px 0;
}

.speedy-search-container.advanced-search.stacked .instant-search-result .read-more {
  margin-top: 3px;
}

.speedy-search-container.advanced-search.stacked .instant-search-result {
  border-bottom: none;
}

/**
 * Skeleton
 */
.speedy-search-container.advanced-search.stacked .instant-search-result.skeleton-loading .image-wrapper {
  margin-left: 0;
  margin-right: 0;
}

/**
 * Advanced Stacked - Grid
 */
.speedy-search-container.advanced-search.stacked .grid-item {
  flex: 0 0 calc(20% - 16px); /* fixed width for 5 items */
  box-sizing: border-box;
  padding: 20px;
  text-align: center;
}

/**
 * Advanced Stacked - Grid Responsive
 */
@media (max-width: 900px) {
  .speedy-search-container.advanced-search.stacked .grid-item {
    flex: 1 1 calc(50% - 20px); /* 2 items per row */
  }
}

@media (max-width: 600px) {
  .speedy-search-container.advanced-search.stacked .grid-item {
    flex: 1 1 100%; /* 1 item per row */
  }
}