/* ── Variables ── */
:root {
  --bg: #f8fafb;
  --surface: #eef1f3;
  --border: #d5dadf;
  --text: #2d3748;
  --text-muted: #6b7280;
  --accent: #0d9488;
  --accent-glow: rgba(13, 148, 136, 0.15);
  --highlight: #111827;
  --radius: 4px;
  --row-height: 3.25rem;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-gutter: stable; 
}

/* ── Base ── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-glow);
  color: var(--highlight);
}
mark {
  background: var(--accent-glow);
  color: inherit;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 0.1em;
  box-shadow: 0 1px 0 var(--accent);
}

/* ── Hidden SVG Defs ── */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ── Header ── */
.site-header {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1rem 0;
}
.header-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--highlight);
  letter-spacing: -0.04em;
}
.tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

/* ── Search ── */
#search-box {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--highlight);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
#search-box::placeholder {
  color: var(--text-muted);
}
#search-box:focus {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Results Meta ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}
.results-meta {
  padding: 1.5rem 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ── Product List ── */
.product-list {
  list-style: none;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

/* ── Animations ── */
@keyframes slideFade {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Product Row ── */
.product-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--row-height);
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  margin-bottom: 0.25rem;
  

  animation: slideFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  will-change: transform, opacity;
}
.product-row:hover,
.product-row:focus-within,
.product-row.is-selected {
  background: var(--bg);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* ── Category Icon ── */
.product-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px;
  border-radius: 6px;
}

/* ── Product Info ── */
.product-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--highlight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Category Label ── */
.product-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: lowercase;
  font-weight: 600;
}

/* ── Price ── */
.product-price {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--highlight);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 5rem;
  text-align: right;
}

/* ── Empty State ── */
.no-results {
  padding: 3rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  display: none; 
}

.no-results.is-hidden,
.product-row.is-hidden {
  display: none !important;
}

.no-results.is-visible {
  display: block;
  animation: slideFade 0.2s ease forwards;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .product-category { display: none; }
  .product-price { min-width: auto; }
}