/* Product Search Element Styles */

/* Container wrapper */
.product-search-wrapper {
  position: relative;
  max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search form */
.product-search-form {
  width: 100%;
  max-width: 100%;
  display: flex;
  position: relative;
}

/* Input wrapper */
.product-search-input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Input field */
.product-search-input {
  width: 100%;
  border-radius: 50px;
  border: 1px solid #e0e0e0;
  padding: 10px 15px;
  font-size: 15px;
  height: 46px;
  outline: none;
  transition: all 0.3s ease;
  background: #fff;
  color: #333;
  padding-right: 50px; /* Space for search button */
}

.product-search-input::placeholder {
  color: #999;
  opacity: 1;
}

.product-search-input:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

/* Search button */
.product-search-button {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #757575;
  transition: all 0.2s ease;
  font-size: 15px;
  z-index: 2;
  outline: none;
}

.product-search-button:hover {
  color: #2196F3;
  background-color: rgba(33, 150, 243, 0.1);
}

.product-search-button i {
  font-size: 16px;
}

.product-search-button.with-text {
  width: auto;
  border-radius: 0 50px 50px 0;
  padding: 0 15px;
  background-color: #f5f5f5;
  right: 0;
}

/* Results dropdown */
.product-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.product-search-results.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Result item */
.product-search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.product-search-result-item:last-child {
  border-bottom: none;
}

.product-search-result-item:hover {
  background-color: #f9f9f9;
}

/* Result image */
.product-search-result-image {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
}

.product-search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Result content */
.product-search-result-content {
  flex: 1;
}

.product-search-result-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0 0 5px;
  line-height: 1.3;
}

.product-search-result-meta {
  display: flex;
  align-items: center;
  font-size: 12px;
}

.product-search-result-category {
  color: #666;
  margin-right: 8px;
}

.product-search-result-price {
  color: #e53935;
  font-weight: 600;
}

/* No results */
.product-search-no-results {
  padding: 15px;
  text-align: center;
  color: #666;
}

/* Loading indicator */
.product-search-loading {
  display: none;
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(33, 150, 243, 0.3);
  border-radius: 50%;
  border-top-color: #2196F3;
  animation: search-spinner 0.8s infinite linear;
}

@keyframes search-spinner {
  to { transform: translateY(-50%) rotate(360deg); }
}

.product-search-wrapper.is-loading .product-search-loading {
  display: block;
}

/* View all results */
.product-search-view-all {
  text-align: center;
  padding: 10px 15px;
  background-color: #f5f5f5;
  color: #333;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  border-top: 1px solid #eee;
  transition: all 0.2s ease;
}

.product-search-view-all:hover {
  background-color: #eeeeee;
  color: #2196F3;
}

/* Responsive styles */
@media (max-width: 767px) {
  .product-search-input {
    height: 42px;
    font-size: 14px;
  }
  
  .product-search-button {
    width: 34px;
    height: 34px;
  }
  
  .product-search-result-item {
    padding: 10px;
  }
  
  .product-search-result-image {
    width: 40px;
    height: 40px;
  }
  
  .product-search-result-title {
    font-size: 13px;
  }
}

/* Loading animation */
.product-search-wrapper .spinner-dots {
  display: none;
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
}

.product-search-wrapper .spinner-dots:before,
.product-search-wrapper .spinner-dots:after,
.product-search-wrapper .spinner-dots span {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #2196F3;
  position: absolute;
  animation-name: pulse-search;
  animation-duration: 0.8s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.product-search-wrapper .spinner-dots:before {
  left: 0;
  animation-delay: 0s;
}

.product-search-wrapper .spinner-dots span {
  left: 7px;
  animation-delay: 0.15s;
}

.product-search-wrapper .spinner-dots:after {
  right: 0;
  animation-delay: 0.3s;
}

@keyframes pulse-search {
  0%, 80%, 100% { 
    opacity: 0;
    transform: scale(0.8);
  }
  40% { 
    opacity: 1;
    transform: scale(1.2);
  }
}

.product-search-wrapper.is-loading .spinner-dots {
  display: block;
} 