/* Container for the search bar and results */
.mwas-search-container {
  position: relative;
  max-width: 500px;
  /* Adjust width as needed */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@keyframes mwas-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Visually hide the label while keeping it available to screen readers */
.mwas-screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  word-wrap: normal;
}

/* The search input field */
.mwas-search-input {
  width: 100%;
  padding: 10px 52px 10px 14px;
  box-sizing: border-box;
  border: 2px solid #043391;
  border-radius: 999px;
  font-size: 16px;
  color: #043391;
  background: #fff;
  transition: border-color 0.2s ease;
}

.mwas-search-input::placeholder {
  color: #8fa8e0;
}

.mwas-search-input:focus {
  outline: none;
  border-color: #12277a;
}

/* Circular search button */
.mwas-search-submit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #043391;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mwas-search-submit svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* Loading spinner replaces the icon inside the button */
.mwas-search-container.is-loading .mwas-search-submit svg {
  visibility: hidden;
}

.mwas-search-container.is-loading .mwas-search-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mwas-spin 0.6s linear infinite;
}

/* The dropdown results container */
.mwas-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
  display: none;
}

/* A single result item row matching technical catalog layout */
.mwas-result-item {
  display: flex;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid #e0e0e0;
  text-decoration: none;
  color: #111;
  background: #fff;
  transition: background-color 0.12s ease;
  white-space: normal;
}

.mwas-result-item:last-child {
  border-bottom: none;
}

.mwas-result-item:hover,
.mwas-result-item.is-active {
  background-color: #f7f7f7;
}

/* Product thumbnail */
.mwas-result-thumbnail {
  flex-shrink: 0;
  margin-right: 18px;
}

.mwas-result-thumbnail img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

/* Product details wrapper */
.mwas-result-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* SKU / Item Code in bold uppercase on top */
.mwas-result-sku {
  font-weight: 800;
  font-size: 16px;
  color: #000000;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

/* Product title */
.mwas-result-title {
  font-weight: 400;
  font-size: 14.5px;
  color: #1a1a1a;
  line-height: 1.35;
}

/* Product description snippet */
.mwas-result-description {
  font-size: 13px;
  color: #444444;
  line-height: 1.35;
  margin-top: 1px;
}

/* Categories / Meta in light grey at bottom */
.mwas-result-categories {
  font-weight: 400;
  font-size: 13px;
  color: #999999;
  line-height: 1.35;
  margin-top: 2px;
}

/* Matched substring highlight */
.mwas-result-item mark {
  background: none;
  color: inherit;
  font-weight: 700;
  padding: 0;
}

/* "View all results" row */
.mwas-view-all {
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #333;
  padding: 14px;
}

/* Loading/No results messages */
.mwas-loading,
.mwas-no-results {
  padding: 16px;
  color: #666;
  text-align: center;
  font-size: 14px;
}