/* Structural layout only — visual design comes from Elementor controls. */

.w2i-psf {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.w2i-psf__field {
  display: flex;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.w2i-psf__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid #d8dee9;
  border-right-width: 0;
  border-radius: 12px 0 0 12px;
  background: #fff;
  color: #1a1f2c;
  font-size: 15px;
  line-height: 1.4;
  padding: 14px 16px;
}

.w2i-psf input.w2i-psf__input,
.w2i-psf input.w2i-psf__input:hover,
.w2i-psf input.w2i-psf__input:focus,
.w2i-psf input.w2i-psf__input:focus-visible,
.w2i-psf input.w2i-psf__input:active {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  box-sizing: border-box !important;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.w2i-psf__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1;
  gap: 6px;
  min-width: 56px;
  border: 1px solid #111827;
  border-radius: 0 12px 12px 0;
  background: #111827;
  color: #fff;
  padding: 14px 18px;
}

.w2i-psf button.w2i-psf__submit,
.w2i-psf button.w2i-psf__submit:hover,
.w2i-psf button.w2i-psf__submit:focus,
.w2i-psf button.w2i-psf__submit:focus-visible,
.w2i-psf button.w2i-psf__submit:active {
  height: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  outline: none;
}

.w2i-psf__icon {
  display: block;
  fill: currentColor;
  flex-shrink: 0;
}

.w2i-psf {
  --w2i-psf-results-offset: 8px;
}

.w2i-psf__results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + var(--w2i-psf-results-offset, 8px));
  z-index: 999999;
  overflow: auto;
  box-sizing: border-box;
  width: auto;
  max-height: 360px;
  padding: 8px;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px -8px rgba(17, 24, 39, 0.18);
}

/* Frontend: moved to body so parent overflow:hidden cannot clip it. */
body > .w2i-psf__results.is-portaled {
  position: fixed !important;
  right: auto !important;
  margin: 0;
}

.w2i-psf--results-form .w2i-psf__results {
  left: 0;
  right: 0;
  width: auto;
}

.w2i-psf--results-input .w2i-psf__results,
.w2i-psf--results-custom .w2i-psf__results {
  right: auto;
}

.w2i-psf__results[hidden] {
  display: none !important;
}

.w2i-psf__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.w2i-psf__item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.w2i-psf__item:hover,
.w2i-psf__item.is-active {
  background: #f4f6fa;
}

.w2i-psf__thumb {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 10px;
  background: #eef1f6;
}

.w2i-psf__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.w2i-psf__meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.w2i-psf__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.w2i-psf__sku {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.35;
}

.w2i-psf__mark {
  background: transparent;
  color: inherit;
  font-weight: 600;
  padding: 0;
}

.w2i-psf__empty,
.w2i-psf__loading {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 14px;
  color: #6b7280;
  font-size: 13px;
}

.w2i-psf__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  flex-shrink: 0;
  animation: w2i-psf-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .w2i-psf__spinner {
    animation: none;
  }
}
