:root {
  --rail: #2c2416;
  --rail-soft: #5c4a3a;
  --accent: #c45c26;
  --accent-hover: #a34a1c;
  --amazon: #ff9900;
  --ebay: #e53238;
  --ebay-blue: #0064d2;
  --text: #222;
  --muted: #666;
  --bg: #faf8f5;
  --card: #fff;
  --border: #ddd6cb;
  --link: #1a4d7c;
  --link-hover: #0d3a5c;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--rail);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main.container {
  flex: 1 0 auto;
  padding-top: 1rem;
  padding-bottom: 3rem;
}

a {
  color: var(--link);
}
a:hover {
  color: var(--link-hover);
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--rail);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.logo a {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--rail);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo a:hover {
  color: var(--accent);
}

.tagline-mobile {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.primary-nav {
  background: var(--rail);
  overflow-x: auto;
}
.primary-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  flex-wrap: nowrap;
}
.primary-nav a {
  display: block;
  color: #f0ebe3;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.65rem 0.7rem;
  white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

.search-container {
  min-width: 200px;
  max-width: 320px;
}

/* Breadcrumbs */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: #aaa;
}
.breadcrumbs a {
  text-decoration: none;
}

/* Hero / home */
.hero {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  color: var(--rail);
  line-height: 1.2;
}
.hero-lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1rem;
}
.hero-note {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 40rem;
}
.hero-search {
  margin: 1rem 0;
  max-width: 28rem;
}

.categories-section h2,
.home-focus h2,
.section-label {
  font-size: 1.15rem;
  color: var(--rail);
  margin: 0 0 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 0.85rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(44, 36, 22, 0.08);
  color: var(--text);
}
.category-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--link);
}

.pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f3e0d4;
  color: var(--accent-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  width: fit-content;
}

.focus-list {
  padding-left: 1.25rem;
}
.focus-list li {
  margin-bottom: 0.4rem;
}

/* Categories */
.subcategory-list {
  columns: 2;
  column-gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
@media (min-width: 700px) {
  .subcategory-list {
    columns: 3;
  }
}
.subcategory-list li {
  break-inside: avoid;
  margin-bottom: 0.35rem;
}
.subcategory-list a {
  text-decoration: none;
  font-weight: 500;
}
.subcategory-list a:hover {
  text-decoration: underline;
}

.category-content {
  margin-bottom: 2rem;
  max-width: 70ch;
}
.category-content h2 {
  margin-top: 0;
  color: var(--rail);
}

.empty-products {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.product-image-link {
  text-decoration: none;
  color: inherit;
}
.product-image-container {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  background: #f3f0ea;
  border-radius: 4px;
}
.product-image {
  max-width: 90%;
  max-height: 100%;
  object-fit: contain;
}
.product-card h3 {
  font-size: 0.95rem;
  margin: 0.35rem 0;
  line-height: 1.3;
  color: var(--link);
}
.card-mfr {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.card-ctas {
  margin: auto 0 0;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
}
.badge-amazon {
  background: #ffe6b3;
  color: #8a5a00;
}
.badge-ebay {
  background: #fde0e2;
  color: #9b1c23;
}

.ebay-live {
  background: #fff8f8;
  border: 1px solid #f0c8cb;
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  margin: 0 0 2rem;
}
.ebay-live .section-label {
  border-bottom-color: #f0c8cb;
}
.ebay-live-copy {
  margin: 0 0 0.5rem;
  max-width: 45rem;
}
.ebay-live-query {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.ebay-live-query code {
  background: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.card-ebay-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ebay);
  text-decoration: none;
}
.card-ebay-link:hover {
  text-decoration: underline;
  color: #c42a30;
}
.ebay-query-hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.ebay-query-hint code {
  font-size: 0.8rem;
}

/* Product detail */
.product-layout {
  display: grid;
  gap: 2rem;
  margin: 1rem 0 2rem;
}
@media (min-width: 768px) {
  .product-layout {
    grid-template-columns: minmax(200px, 380px) 1fr;
    align-items: start;
  }
}
.product-image img {
  width: 100%;
  height: auto;
  background: #f3f0ea;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.product-info h1 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--rail);
  line-height: 1.25;
}
.product-meta {
  font-size: 0.95rem;
  color: var(--muted);
}
.buy-note {
  font-size: 0.9rem;
  color: var(--muted);
}

.affiliate-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-amazon {
  background: var(--amazon);
  color: #111 !important;
  border-color: #e68a00;
}
.btn-amazon:hover {
  filter: brightness(0.95);
  color: #111 !important;
}
.btn-ebay {
  background: var(--ebay);
  color: #fff !important;
}
.btn-ebay:hover {
  background: #c42a30;
  color: #fff !important;
}

.product-paths ul {
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.product-description {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  max-width: 70ch;
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  background: var(--rail);
  color: #d9d0c4;
  padding: 2rem 0;
  margin-top: 2rem;
}
.site-footer a {
  color: #f5efe6;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  justify-content: center;
}
.footer-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.disclosure-blurb,
.copyright {
  text-align: center;
  font-size: 0.8rem;
  max-width: 40rem;
  margin: 0.5rem auto;
  line-height: 1.5;
}
.copyright {
  opacity: 0.85;
}

/* Pagefind tweaks */
.pagefind-ui {
  --pagefind-ui-scale: 0.85;
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-border: var(--border);
}
