.saps-results {
  --saps-pink: #d6537c;
  position: fixed;
  z-index: 100000;
  top: var(--saps-top, 0);
  left: var(--saps-left, 0);
  width: var(--saps-width, 420px);
  max-height: var(--saps-max-height, 480px);
  overflow: auto;
  padding: 8px;
  border: 1px solid #eadde2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(66, 45, 55, .18);
  color: #332d30;
  direction: rtl;
  overscroll-behavior: contain;
}

.saps-results[hidden] { display: none !important; }
.saps-products { display: grid; }

.saps-product {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 8px;
  border-radius: 13px;
  color: inherit;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.saps-product:hover,
.saps-product:focus-visible,
.saps-product.is-active {
  background: #fff3f7;
  color: #8e2e52;
  outline: 0;
}

.saps-product + .saps-product { border-top: 1px solid #f3eaed; }
.saps-product__image {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 1px solid #f0e5e9;
  border-radius: 11px;
  background: #fffafb;
}
.saps-product__image img { width: 100%; height: 100%; object-fit: contain; }
.saps-product__content { display: grid; min-width: 0; gap: 5px; }
.saps-product__content strong { overflow: hidden; color: #322a2e; font-size: 13px; line-height: 1.65; text-overflow: ellipsis; white-space: nowrap; }
.saps-product__content small { overflow: hidden; color: #8f8288; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.saps-product__meta { display: grid; justify-items: end; gap: 6px; white-space: nowrap; }
.saps-product__price { color: #bd3f69; font-size: 12px; font-weight: 700; }
.saps-product__price del { color: #a99da2; font-size: 10px; }
.saps-product__price ins { text-decoration: none; }
.saps-product__meta small { font-size: 10px; font-weight: 700; }
.saps-product__meta .is-in-stock { color: #388459; }
.saps-product__meta .is-out-of-stock { color: #a84c59; }

.saps-all-results {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 6px;
  border-radius: 12px;
  background: #f9e6ed;
  color: #963357;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.saps-all-results::after { margin-right: 7px; content: '←'; font-size: 15px; }
.saps-all-results:hover { background: #f4d7e1; color: #76223f; }

.saps-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 14px;
  color: #766a70;
  font-size: 12px;
  text-align: center;
}
.saps-message.is-loading::before {
  width: 17px;
  height: 17px;
  margin-left: 9px;
  border: 2px solid #edced9;
  border-top-color: var(--saps-pink);
  border-radius: 50%;
  content: '';
  animation: saps-spin .7s linear infinite;
}
.saps-message.is-error { color: #a23c4d; }
@keyframes saps-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .saps-results { box-sizing: border-box; max-width: calc(100vw - 24px); padding: 6px; border-radius: 15px; }
  .saps-product { grid-template-columns: 52px minmax(0, 1fr); min-height: 66px; gap: 10px; padding: 7px; }
  .saps-product__image { width: 52px; height: 52px; }
  .saps-product__content strong { font-size: 12px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .saps-product__meta { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; gap: 3px 8px; justify-content: space-between; width: 100%; min-width: 0; margin-top: -6px; white-space: normal; }
  .saps-product__price { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .saps-message.is-loading::before { animation-duration: 1.4s; }
  .saps-product { transition: none; }
}
