

#global-search-form {
  position: relative;
  min-width: 320px;
  max-width: 100%;
}

#global-search-form input {
  width: 100%;
  padding: 0.875rem 1rem;
  padding-right: 3rem;
  font-size: 1rem;
  color: var(--neutral-900, #171717);
  background: white;
  border: 2px solid var(--neutral-300, #d4d4d4);
  border-radius: 12px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

#global-search-form input:focus {
  outline: none;
  border-color: var(--brand-blue-500, #60a5fa);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#global-search-form input::placeholder {
  color: var(--neutral-400, #a3a3a3);
}


#global-search-form::after {
  content: '🔍';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  opacity: 0.5;
  pointer-events: none;
}


#global-search-form .dropdown-menu {
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

#global-search-form .dropdown-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  min-width: 420px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: white;
  border: 2px solid var(--neutral-200, #e5e5e5);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  z-index: 1000;
}


#global-search-form .dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

#global-search-form .dropdown-menu::-webkit-scrollbar-track {
  background: var(--neutral-100, #f5f5f5);
  border-radius: 4px;
}

#global-search-form .dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--neutral-300, #d4d4d4);
  border-radius: 4px;
}

#global-search-form .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400, #a3a3a3);
}


#global-search-form .dropdown-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  color: var(--neutral-700, #404040);
  text-decoration: none;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid var(--neutral-100, #f5f5f5);
}

#global-search-form .dropdown-item:last-child {
  border-bottom: none;
}

#global-search-form .dropdown-item:hover,
#global-search-form .dropdown-item:focus {
  background: var(--neutral-50, #fafafa);
  color: var(--brand-blue-700, #2563eb);
  padding-left: 1.25rem;
}

#global-search-form .dropdown-item:active {
  background: rgba(37, 99, 235, 0.05);
}


#global-search-form .dropdown-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--neutral-200, #e5e5e5);
  flex-shrink: 0;
}


#global-search-form .dropdown-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#global-search-form .dropdown-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--neutral-900, #171717);
}

#global-search-form .dropdown-item-subtitle {
  font-size: 0.8125rem;
  color: var(--neutral-500, #737373);
}

#global-search-form .dropdown-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--neutral-400, #a3a3a3);
}


#global-search-form .dropdown-header {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutral-500, #737373);
  background: var(--neutral-50, #fafafa);
  border-bottom: 1px solid var(--neutral-200, #e5e5e5);
}


#global-search-form .dropdown-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--neutral-500, #737373);
}

#global-search-form .dropdown-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}

#global-search-form .dropdown-empty-text {
  font-size: 0.9375rem;
  font-weight: 500;
}


#global-search-form .dropdown-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--brand-blue-600, #3b82f6);
}

#global-search-form .dropdown-loading::before {
  content: '';
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--brand-blue-700, #2563eb);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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


@media (max-width: 640px) {
  #global-search-form {
    min-width: 100%;
  }

  #global-search-form .dropdown-menu.show {
    min-width: 100%;
    max-width: 100vw;
    left: -1rem;
    right: -1rem;
    width: calc(100% + 2rem);
  }

  #global-search-form .dropdown-item {
    padding: 1rem;
  }

  #global-search-form .dropdown-item img {
    width: 40px;
    height: 40px;
  }
}


#global-search-form .dropdown-item.is-active {
  background: rgba(37, 99, 235, 0.08);
  border-left: 3px solid var(--brand-blue-600, #3b82f6);
}


#global-search-form .dropdown-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(249, 115, 22, 0.1);
  color: var(--accent-orange-700, #c2410c);
  border-radius: 9999px;
  border: 1px solid rgba(249, 115, 22, 0.2);
}


#global-search-form .dropdown-price {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--accent-orange-600, #ea580c);
  white-space: nowrap;
}


#global-search-form .dropdown-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

#global-search-form .dropdown-stock::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

#global-search-form .dropdown-stock.in-stock {
  color: #065f46;
}

#global-search-form .dropdown-stock.in-stock::before {
  background: #10b981;
}

#global-search-form .dropdown-stock.low-stock {
  color: #92400e;
}

#global-search-form .dropdown-stock.low-stock::before {
  background: #f59e0b;
}

#global-search-form .dropdown-stock.out-of-stock {
  color: #991b1b;
}

#global-search-form .dropdown-stock.out-of-stock::before {
  background: #ef4444;
}