*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: #fff;
  color: #202124;
  min-height: 100vh;
}

/* ── Tab navigation ─────────────────────────────────────── */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  align-items: stretch;
  padding: 0 1.5rem;
  gap: 1rem;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #202124;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.02em;
  padding-right: 1rem;
}

.tab-links {
  display: flex;
}

.tab-link {
  padding: 1rem 1rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5f6368;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  white-space: nowrap;
}
.tab-link:hover { color: #202124; }
.tab-link.active { color: #1a73e8; border-bottom-color: #1a73e8; }

/* ── Tab panes ──────────────────────────────────────────── */
.tab-pane[hidden] { display: none; }

/* ── Search hero ────────────────────────────────────────── */
.search-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 49px);
  padding: 2rem 1.5rem 18vh;
  transition: min-height 0.25s ease, padding 0.25s ease;
}

.hero-logo {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #202124;
  margin-bottom: 2.5rem;
  user-select: none;
  transition: font-size 0.25s ease, margin 0.25s ease;
}
.hero-logo {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.basket-icon {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
  stroke-width: 2;
}

.hero-logo .logo-find { color: #3567e8; }
.hero-logo .logo-out  { color: #0d7a74; }
.hero-logo .logo-sold { color: #e8553e; }

.search-bar-wrap {
  position: relative;
  width: 100%;
  max-width: 584px;
  display: flex;
  align-items: center;
}

.search-bar-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: #9aa0a6;
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 1.2rem 0 2.75rem;
  font-size: 1rem;
  color: #202124;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 24px;
  outline: none;
  box-shadow: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search-input:hover {
  box-shadow: 0 1px 6px rgba(32,33,36,0.12);
  border-color: rgba(223,225,229,0);
}
.search-input:focus {
  box-shadow: 0 1px 6px rgba(32,33,36,0.18);
  border-color: rgba(223,225,229,0);
}

.hero-sub {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #70757a;
  transition: opacity 0.2s, max-height 0.25s;
}

/* ── Compact mode when typing ───────────────────────────── */
#pane-search.has-query .search-hero {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-height: auto;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e8eaed;
  justify-content: flex-start;
}
#pane-search.has-query .hero-logo {
  font-size: 1.5rem;
  margin-bottom: 0;
  flex-shrink: 0;
}
#pane-search.has-query .hero-sub { display: none; }
#pane-search.has-query .search-bar-wrap {
  flex: 1;
  min-width: 180px;
  max-width: 500px;
}

/* ── Search results ─────────────────────────────────────── */
.search-results {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
}

.search-result-item {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid #f1f3f4;
  text-decoration: none;
  color: inherit;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover .result-title { text-decoration: underline; }

.result-brand {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #70757a;
  margin-bottom: 0.2rem;
}
.result-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: #1558d6;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}
.result-meta {
  font-size: 0.82rem;
  color: #70757a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.result-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
}
.result-badge.partial {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.search-empty {
  text-align: center;
  color: #9aa0a6;
  padding: 4rem 0;
  font-size: 0.95rem;
}

/* ── Explore tab ────────────────────────────────────────── */
.explore-main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

#loading, #empty {
  text-align: center;
  color: #9aa0a6;
  margin-top: 3rem;
  font-size: 1rem;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #70757a;
  margin: 2rem 0 0.75rem;
}
.section-title:first-child { margin-top: 0; }

/* ── Sold-out block ─────────────────────────────────────── */
.soldout-block {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.soldout-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }

.soldout-block .block-header {
  padding: 0.3rem 1rem;
  background: #fef2f2;
  font-size: 0.68rem;
  font-weight: 700;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.soldout-block .block-header.partial {
  background: #fffbeb;
  color: #b45309;
}

.product-row {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  align-items: center;
}

.product-card.sold-out-product {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.product-card.sold-out-product a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
}
.product-card.sold-out-product a:hover .title { text-decoration: underline; }
.product-card.sold-out-product .brand {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa0a6;
}
.product-card.sold-out-product .title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: #202124;
}
.product-card.sold-out-product .out-of-stock-label {
  font-size: 0.75rem;
  color: #b91c1c;
  margin-top: 0.1rem;
}

.divider {
  display: flex;
  align-items: center;
  padding: 0 0.25rem;
  color: #dadce0;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.listings-wrap { flex: 1; }

.listings-site {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa0a6;
  margin-bottom: 0.35rem;
}

.listings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.listings-list a {
  font-size: 0.9rem;
  color: #1a73e8;
  text-decoration: none;
}
.listings-list a:hover { text-decoration: underline; }
.listings-list a::after { content: " ↗"; font-size: 0.72em; opacity: 0.5; }

.no-suggestions { font-size: 0.85rem; color: #bbb; }

/* ── In-stock grid (kept for compat) ────────────────────── */
.instock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.instock-grid .product-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 0.75rem;
  flex: unset;
  text-align: center;
}
.product-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 6px;
  background: #f9f9f9;
  border: 1px solid #eee;
}
.product-card .no-img {
  width: 120px;
  height: 120px;
  background: #f0f0f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto;
}
.product-card .title {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}
.product-card .price { font-size: 0.8rem; color: #5f6368; margin-top: 0.25rem; }
.product-card a { color: inherit; text-decoration: none; }
.product-card.sold-out img,
.product-card.sold-out .no-img { opacity: 0.45; filter: grayscale(60%); }
.product-card.sold-out .title { color: #9aa0a6; }
