/* Home hero — live product search */

.page-home .hero-search {
  position: relative;
  z-index: 100;
  isolation: isolate;
  margin-top: 1.5rem;
  width: 100%;
  max-width: min(100%, 38rem);
}

.page-home .hero-full:has(.hero-search.is-open) .hero-dock {
  z-index: 1;
}

.page-home .hero-full:has(.hero-search.is-open) .hero-dock-chip {
  z-index: 1 !important;
}

.page-home .hero-search__shell {
  position: relative;
  z-index: 1;
}

.page-home .hero-search__aura {
  position: absolute;
  inset: -12px -8px;
  border-radius: 22px;
  background: radial-gradient(
    ellipse at 50% 0%,
    color-mix(in srgb, var(--accent) 22%, transparent),
    transparent 68%
  );
  opacity: 0;
  filter: blur(18px);
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.page-home .hero-search.is-open .hero-search__aura,
.page-home .hero-search:has(.hero-search__field:focus-within) .hero-search__aura {
  opacity: 1;
}

.page-home .hero-search__field {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.55rem 0.42rem 0.65rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, rgba(255, 255, 255, 0.22) 55%, var(--accent) 22%);
  background: color-mix(in srgb, var(--glass-bg-strong) 38%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 12px 34px color-mix(in srgb, #000 28%, transparent);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
  transition:
    border-color 0.3s ease,
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.35s ease;
}

.page-home .hero-search__field::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.04) 28%,
    transparent 52%,
    rgba(255, 255, 255, 0.03) 100%
  );
  pointer-events: none;
}

.page-home .hero-search__field::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.page-home .hero-search__field > * {
  position: relative;
  z-index: 1;
}

.page-home .hero-search__field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 52%, rgba(255, 255, 255, 0.28));
  background: color-mix(in srgb, var(--glass-bg-strong) 48%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent),
    0 18px 44px color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}

.page-home .hero-search__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transition: color 0.25s ease, background 0.25s ease, transform 0.35s ease;
}

.page-home .hero-search__icon svg {
  width: 1rem;
  height: 1rem;
}

.page-home .hero-search__field:focus-within .hero-search__icon {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  transform: scale(1.04);
}

.page-home .hero-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: none;
}

.page-home .hero-search__input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 88%, transparent);
  font-weight: 500;
}

.page-home .hero-search__input::-webkit-search-cancel-button,
.page-home .hero-search__input::-webkit-search-decoration {
  display: none;
}

.page-home .hero-search__hint {
  flex-shrink: 0;
  margin-right: 0.15rem;
}

.page-home .hero-search__hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--glass-border) 90%, transparent);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
}

.page-home .hero-search__clear {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.page-home .hero-search__clear svg {
  width: 0.95rem;
  height: 0.95rem;
}

.page-home .hero-search__clear:hover {
  transform: scale(1.06);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Dropdown panel */
.page-home .hero-search__panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.32s ease;
  pointer-events: none;
}

.page-home .hero-search.is-open .hero-search__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.page-home .hero-search__panel-inner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, rgba(255, 255, 255, 0.2) 50%, var(--accent) 24%);
  background: color-mix(in srgb, var(--glass-bg-strong) 42%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 28px 60px color-mix(in srgb, #000 42%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
}

.page-home .hero-search__panel-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.03) 24%,
    transparent 48%,
    rgba(255, 255, 255, 0.02) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.page-home .hero-search__panel-inner::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(18px - 1px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
  z-index: 0;
}

.page-home .hero-search__panel-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      420px circle at 50% -20%,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 58%
    ),
    radial-gradient(
      280px circle at 100% 100%,
      color-mix(in srgb, var(--accent-2) 10%, transparent),
      transparent 62%
    );
  opacity: 0.9;
}

.page-home .hero-search__panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--glass-border) 70%, transparent);
}

.page-home .hero-search__panel-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-home .hero-search__panel-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.page-home .hero-search__results {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: min(22rem, 48vh);
  overflow: auto;
  padding: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 35%, transparent) transparent;
}

.page-home .hero-search__results[hidden] {
  display: none !important;
}

.page-home .hero-search__results::-webkit-scrollbar {
  width: 6px;
}

.page-home .hero-search__results::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

.page-home .hero-search__item {
  --hero-search-i: 0;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.72rem;
  padding: 0.55rem 0.62rem;
  border-radius: 14px;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  background: transparent;
  opacity: 0;
  transform: translateY(8px);
  animation: heroSearchItemIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--hero-search-i) * 45ms);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.page-home .hero-search__item.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px color-mix(in srgb, var(--accent) 14%, transparent);
}

.page-home .hero-search__item:hover,
.page-home .hero-search__item:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, rgba(255, 255, 255, 0.03));
  transform: translateX(3px);
}

@keyframes heroSearchItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-home .hero-search__thumb {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--glass-border) 90%, transparent);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.page-home .hero-search__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-home .hero-search__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 16%, transparent),
    color-mix(in srgb, var(--accent-2) 10%, transparent)
  );
}

.page-home .hero-search__thumb-placeholder svg {
  width: 1.15rem;
  height: 1.15rem;
}

.page-home .hero-search__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.page-home .hero-search__name {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .hero-search__name mark {
  background: none;
  color: var(--accent-2);
  font-weight: 800;
}

.page-home .hero-search__sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .hero-search__price {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-2);
  white-space: nowrap;
}

.page-home .hero-search__arrow {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  transition: transform 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.page-home .hero-search__arrow svg {
  width: 0.95rem;
  height: 0.95rem;
}

.page-home .hero-search__item:hover .hero-search__arrow,
.page-home .hero-search__item.is-active .hero-search__arrow {
  transform: translateX(2px);
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.page-home .hero-search__empty {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.65rem 1rem 1.35rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.page-home .hero-search__empty[hidden],
.page-home .hero-search__footer[hidden],
.page-home .hero-search__panel-count[hidden] {
  display: none !important;
}

.page-home .hero-search__empty strong {
  color: var(--text);
  font-size: 0.92rem;
}

.page-home .hero-search__empty-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  margin-bottom: 0.25rem;
  animation: heroSearchPulse 2.4s ease-in-out infinite;
}

.page-home .hero-search__empty-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

@keyframes heroSearchPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 1; }
}

.page-home .hero-search__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 0.9rem;
  border-top: 1px solid color-mix(in srgb, rgba(255, 255, 255, 0.1) 60%, var(--glass-border));
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: color-mix(in srgb, var(--accent) 5%, rgba(255, 255, 255, 0.02));
  transition: background 0.25s ease, color 0.25s ease;
}

.page-home .hero-search__footer svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.25s ease;
}

.page-home .hero-search__footer:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-2);
}

.page-home .hero-search__footer:hover svg {
  transform: translateX(3px);
}

.page-home .hero-search.is-loading .hero-search__icon {
  animation: heroSearchSpin 0.8s linear infinite;
}

@keyframes heroSearchSpin {
  to { transform: rotate(360deg); }
}

[data-theme="light"] .page-home .hero-search__field {
  background: color-mix(in srgb, #fff 52%, transparent);
  border-color: color-mix(in srgb, var(--accent) 16%, rgba(15, 23, 42, 0.1));
}

[data-theme="light"] .page-home .hero-search__field::before {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.2) 30%,
    transparent 55%
  );
}

[data-theme="light"] .page-home .hero-search__panel-inner {
  background: color-mix(in srgb, #fff 58%, transparent);
  border-color: color-mix(in srgb, var(--accent) 14%, rgba(15, 23, 42, 0.08));
}

[data-theme="light"] .page-home .hero-search__input {
  color: #0f172a;
}

@media (max-width: 900px) {
  .page-home .hero-search {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .hero-search__panel,
  .page-home .hero-search__item,
  .page-home .hero-search__empty-icon,
  .page-home .hero-search__field {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .page-home .hero-search__item {
    opacity: 1;
    transform: none;
  }
}
