/* app/static/css/app.css — Show us ya bits brand theme */
:root {
  --ink: #14110F;
  --steel: #2B2A28;
  --orange: #FF6A1A;
  --orange-700: #C24E0E;
  --sawdust: #F4EEE3;
  --card: #FFFFFF;
  --line: #E3DCCD;
  --muted: #6B6257;
  --good: #2E7D32;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(20, 17, 15, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sawdust);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, .wordmark {
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 0.4em;
}

a { color: var(--orange-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* skip-to-content: visually hidden until focused */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--orange);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 700;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-to-content:focus { left: 0; }

/* top nav */
.site-nav {
  background: var(--steel);
  color: var(--sawdust);
  border-bottom: 3px solid var(--orange);
}
.site-nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
}
.site-nav a { color: var(--sawdust); font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--orange); }
.site-nav .wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sawdust);
  font-size: 22px;
  margin: 0;
  margin-right: auto;
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-nav .wordmark img { height: 28px; width: auto; }

/* nav search box */
.nav-search { display: flex; align-items: center; gap: 6px; margin-right: auto; position: relative; }

/* live search type-ahead dropdown */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-width: 80vw;
  z-index: 50;
  display: none;
}
.nav-search:focus-within .search-suggest:not(:empty) { display: block; }
.search-suggest__list {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--steel);
  border: 1px solid #4a4845;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.search-suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--sawdust);
}
.search-suggest__item:hover,
.search-suggest__item:focus { background: rgba(255, 255, 255, 0.07); }
.search-suggest__thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
  background: var(--ink);
}
.search-suggest__thumb--ph { display: inline-block; }
.search-suggest__name { flex: 1 1 auto; font-size: 0.9rem; line-height: 1.2; }
.search-suggest__price { flex: 0 0 auto; font-weight: 600; color: var(--orange); }
.search-suggest__all {
  list-style: none;
  border-top: 1px solid #4a4845;
  margin-top: 4px;
}
.search-suggest__all a {
  display: block;
  padding: 8px 9px;
  font-size: 0.85rem;
  color: var(--orange);
  text-decoration: none;
}
.search-suggest__all a:hover { text-decoration: underline; }
.search-suggest__empty {
  background: var(--steel);
  border: 1px solid #4a4845;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--sawdust);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.search-suggest__empty a { color: var(--orange); }
.nav-search input[type="search"] {
  width: 220px;
  max-width: 42vw;
  margin: 0;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid #4a4845;
  background: var(--sawdust);
  color: var(--ink);
  font-size: 14px;
}
.nav-search input[type="search"]:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.nav-search button {
  background: var(--orange);
  border: 1px solid var(--orange);
  color: var(--ink);
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
}
.nav-search button:hover { background: var(--orange-700); border-color: var(--orange-700); color: var(--sawdust); }

/* free-shipping announcement banner */
.ship-banner {
  background: var(--orange);
  color: var(--ink);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  padding: 9px 16px;
}

/* layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* hero */
.hero {
  margin: 32px 0;
  padding: 48px 36px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--steel) 100%);
  color: var(--sawdust);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 220px;
  height: 220px;
  background: var(--orange);
  opacity: 0.08;
  border-radius: 50%;
}
.hero h1 {
  font-size: clamp(36px, 7vw, 72px);
  color: var(--sawdust);
  margin-bottom: 0.3em;
}
.hero h1 .accent { color: var(--orange); }
.hero p {
  font-size: 18px;
  color: var(--line);
  max-width: 46ch;
  margin: 0 0 1.5rem;
}
.hero .cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* buttons */
.btn {
  display: inline-block;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--sawdust);
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--sawdust); color: var(--sawdust); text-decoration: none; }

.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--orange-700);
  border-color: var(--orange-700);
  color: var(--sawdust);
  text-decoration: none;
}

/* legacy class aliases used by _product_card.html */
.btn--primary { background: var(--orange); border-color: var(--orange); color: var(--ink); font-weight: 700; }
.btn--primary:hover { background: var(--orange-700); border-color: var(--orange-700); color: var(--sawdust); }
.btn--ghost { border-color: var(--line); color: var(--sawdust); background: transparent; }
.btn--ghost:hover { border-color: var(--sawdust); }
.btn--add {
  display: inline-block;
  border: 2px solid var(--orange);
  background: var(--orange);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.btn--add:hover { background: var(--orange-700); border-color: var(--orange-700); color: var(--sawdust); }
.btn--preorder {
  display: inline-block;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--sawdust);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.btn--preorder:hover { background: #2a2520; border-color: #2a2520; }

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* product grid + cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: 0 4px 14px rgba(20, 17, 15, 0.14); }
.product-card__link { text-decoration: none; color: var(--ink); }
.product-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--sawdust);
}
.product-card__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.product-card__name {
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin: 0;
}
.product-card__price {
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.badge-stock { color: var(--good); font-weight: 600; font-size: 13px; }
.price {
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

/* section headings */
.container h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin: 28px 0 4px;
}

/* home grid */
.home-grid__title {
  font-size: clamp(22px, 3vw, 30px);
  margin: 28px 0 4px;
}

/* search / browse / facets */
.results-header { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.facet-group { margin-bottom: 18px; }
.facet-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}
.facet-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 2px 0;
}

/* forms */
label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 15px;
  background: var(--card);
  color: var(--ink);
  margin-bottom: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
  border-color: var(--orange);
}

/* cart / checkout */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.cart-total { font-weight: 700; font-size: 18px; }

/* admin pricing page */
.pricing-note { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.pricing-cards { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.pricing-card {
  flex: 1 1 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.pricing-card h3 { font-size: 14px; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.pricing-card p { margin: 3px 0; font-size: 15px; }
.pricing-card strong { font-family: 'Oswald', sans-serif; font-size: 17px; }
.pricing-card--accent { border-color: var(--orange); }
.pricing-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pricing-table th, .pricing-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pricing-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pricing-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pricing-table tfoot th { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: none; }
.pricing-table .adams-col { color: var(--muted); }
.pricing-table tr.row-loss { background: #fdecea; }
.pricing-table tr.row-loss td { color: var(--orange-700); }
.form-inline { display: inline; }
.section-gap { margin-top: 2rem; }
.totp-qr { width: 220px; height: 220px; display: block; margin: 1rem 0; }
.price-cell { padding: 4px 6px !important; }
.price-input {
  width: 80px; text-align: right; border: 1px solid var(--line);
  border-radius: 4px; padding: 4px 6px; font-size: 14px;
  font-variant-numeric: tabular-nums; background: var(--sawdust);
}
.price-input:focus { outline: 2px solid var(--orange); border-color: transparent; }
.reorder-input { width: 56px; }

/* footer */
.site-footer {
  background: var(--ink);
  color: var(--line);
  margin-top: 48px;
  padding: 28px 20px;
}
.site-footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: var(--sawdust); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer .tagline { color: var(--orange); font-weight: 600; font-size: 15px; }
.footer-meta { font-size: 13px; color: var(--muted); }

/* legacy header styles (admin pages may use) */
.site-header {
  background: var(--steel);
  color: var(--sawdust);
  border-bottom: 3px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 24px;
}
.brand {
  font-family: 'Oswald', 'Inter', Impact, 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--sawdust);
  text-decoration: none;
}
.site-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 20px; }

/* admin nav compat */
.site-nav a.footer-nav, .footer-nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--line);
}
.site-nav a.footer-nav:hover, .footer-nav a:hover { color: var(--orange); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* mobile */
@media (max-width: 640px) {
  .site-nav .nav-inner { flex-wrap: wrap; gap: 12px; }
  .hero { padding: 32px 20px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .site-footer .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---- shop-by-category tiles (home) ---- */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0 12px;
}
.category-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 17, 15, 0.14);
  border-color: var(--orange);
  text-decoration: none;
}
.category-tile__name {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--ink);
}
.category-tile__desc { color: var(--muted); font-size: 14px; margin: 0; }
.category-tile__arrow { color: var(--orange-700); font-weight: 700; }

/* ---- sold-out badge on product cards ---- */
.product-card__soldout {
  align-self: flex-start;
  background: var(--sawdust);
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

/* ---- breadcrumb ---- */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 22px 0 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--orange-700); }

/* ---- product detail ---- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  margin: 8px 0 16px;
  align-items: start;
}
.product-detail__media {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  position: sticky;
  top: 20px;
}
.product-detail__main-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}
.product-detail__placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sawdust);
  color: var(--muted);
  border-radius: 10px;
}
.product-detail__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.product-detail__thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.product-detail__info { min-width: 0; }
.product-detail__name { font-size: clamp(26px, 4vw, 38px); margin-bottom: 8px; }
.product-detail__price {
  font-family: 'Oswald', 'Inter', sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.product-detail__gst { color: var(--muted); font-size: 13px; margin: 2px 0 18px; }
.product-detail__description { margin: 18px 0; color: var(--steel); }
.product-detail__specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 20px;
  background: var(--card);
}
.product-detail__specs dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--sawdust);
}
.product-detail__specs dd {
  margin: 0;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.product-detail__specs dt:last-of-type,
.product-detail__specs dd:last-of-type { border-bottom: none; }
.product-detail__stock { font-weight: 700; font-size: 14px; margin: 0 0 14px; }
.product-detail__stock--in { color: var(--good); }
.product-detail__stock--out { color: var(--orange-700); }
.product-detail__stock--preorder { color: var(--orange-700); font-weight: 600; }
.product-detail__add { display: flex; align-items: flex-end; gap: 12px; }
.product-detail__add label { margin: 0; }
.product-detail__add input[type="number"] { width: 80px; margin: 0; }

/* ---- shop filter bar (dropdowns) ---- */
.shop__title { margin: 22px 0 12px; }
.shop__filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
}
.filters__field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.filters__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-size: 11px;
}
.filters__select {
  width: auto;
  min-width: 160px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
}
.filters__clear {
  margin-left: auto;
  align-self: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--orange-700);
}
.results__count { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.results__empty { color: var(--muted); }

@media (max-width: 640px) {
  .filters__field { flex: 1 1 45%; }
  .filters__select { min-width: 0; width: 100%; }
  .filters__clear { margin-left: 0; }
}

/* ---- dimensions diagram ---- */
.bit-dims { margin: 32px 0 8px; }
.bit-dims__svg {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.bit-diagram {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- related bits ---- */
.related { margin: 40px 0 8px; }

@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; gap: 20px; }
  .product-detail__media { position: static; }
}

/* ---- Policies page ------------------------------------------------------ */
.policies { max-width: 760px; margin: 0 auto; }
.policies__intro { color: #444; font-size: 1.05rem; }
.policies__toc {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  padding: 14px 18px; margin: 18px 0 8px;
  background: #f6f6f4; border-radius: 10px; font-weight: 600;
}
.policies__toc a { white-space: nowrap; }
.policy { padding: 18px 0; border-top: 1px solid #ececec; scroll-margin-top: 90px; }
.policy h2 { font-family: "Oswald", sans-serif; margin-bottom: 8px; }
.policy ul, .policy ol { padding-left: 20px; line-height: 1.55; }
.policy li { margin: 4px 0; }
.policy__note {
  background: #fff7e6; border-left: 3px solid #e0a100;
  padding: 10px 14px; border-radius: 6px; color: #5a4a14; font-size: 0.95rem;
}
.policies__footer { margin-top: 26px; color: #777; font-size: 0.9rem; text-align: center; }

/* free-shipping nudge in the cart */
.ship-nudge {
  background: #eef7ee; border: 1px dashed #6aa86a;
  color: #2f5d2f; padding: 8px 12px; border-radius: 8px;
  font-size: 0.92rem; display: inline-block;
}

/* category tile count badge */
.category-tile__count {
  display: inline-block; margin-left: 6px;
  background: #1a1a1a; color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 1px 8px; border-radius: 999px; vertical-align: middle;
}

/* Admin product list — toggle + row states */
.btn-toggle {
  font-size: 0.78rem; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; border: none; cursor: pointer;
}
.btn-toggle--on  { background: #d4edda; color: #155724; }
.btn-toggle--off { background: #f0f0f0; color: #666; }
.row--inactive td { opacity: 0.45; }
.row--warning  td { background: #fffbe6; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.badge--warn { background: #fff3cd; color: #856404; }
