.rwa-header-search {
  position: relative;
}

.rwa-header__search {
  padding: 0;
  border: 0;
  background: transparent;
}

.rwa-product-search-panel {
  position: absolute;
  z-index: 110;
  top: calc(100% + 1rem);
  right: 0;
  width: min(31rem, calc(100vw - 2.5rem));
  max-height: min(35rem, calc(100dvh - 7.5rem));
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid rgba(244, 239, 230, 0.18);
  border-radius: var(--rwa-radius-md);
  background:
    linear-gradient(90deg, rgba(244, 239, 230, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(244, 239, 230, 0.02) 1px, transparent 1px),
    rgba(12, 12, 9, 0.98);
  background-size: 2.25rem 2.25rem;
  box-shadow: var(--rwa-shadow);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.rwa-product-search-panel[hidden] {
  display: none !important;
}

.rwa-product-search-form {
  min-height: 3.25rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(229, 193, 142, 0.28);
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.045);
}

.rwa-product-search-form__icon {
  display: grid;
  place-items: center;
  color: var(--rwa-gold-light);
}

.rwa-product-search-form input[type="search"] {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--rwa-ivory);
}

.rwa-product-search-form input[type="search"]::placeholder {
  color: var(--rwa-text-muted);
}

.rwa-product-search-form__close {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rwa-text-secondary);
}

.rwa-product-search-form__close:hover {
  background: rgba(244, 239, 230, 0.08);
  color: var(--rwa-gold-light);
}

.rwa-product-search-status {
  min-height: 1.25rem;
  margin: 0.55rem 0.65rem 0;
  color: var(--rwa-text-muted);
  font-size: 0.75rem;
}

.rwa-product-search-results {
  display: grid;
  gap: 0.3rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.rwa-product-search-result {
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding: 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
}

.rwa-product-search-result:hover,
.rwa-product-search-results [role="option"].is-active .rwa-product-search-result {
  border-color: rgba(200, 166, 117, 0.34);
  background: rgba(200, 166, 117, 0.08);
}

.rwa-product-search-result img,
.rwa-product-search-result__placeholder {
  width: 3.75rem;
  height: 3.75rem;
  display: block;
  object-fit: cover;
  border-radius: 0.55rem;
  background: var(--rwa-surface);
}

.rwa-product-search-result__copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.rwa-product-search-result__copy strong {
  overflow: hidden;
  color: var(--rwa-ivory);
  font-family: var(--rwa-font-display);
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rwa-product-search-result__copy span {
  overflow: hidden;
  color: var(--rwa-text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

html[dir="rtl"] .rwa-product-search-panel {
  right: auto;
  left: 0;
}

@media (max-width: 64rem), (hover: none) and (pointer: coarse) {
  .rwa-header__actions {
    position: absolute;
    z-index: 105;
    top: 50%;
    right: 4.25rem;
    display: flex;
    transform: translateY(-50%);
  }

  .rwa-header__actions .rwa-header__cta {
    display: none;
  }

  .rwa-product-search-panel {
    position: fixed;
    top: 5.75rem;
    right: 1.25rem;
    left: 1.25rem;
    width: auto;
    max-height: calc(100dvh - 7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rwa-product-search-panel,
  .rwa-product-search-result {
    transition: none;
  }
}
