/* ====================================================================
   ArcMart — all styling lives in this one file.
   Colours come from the Har-Bach marks: steel blue, slate, and a touch
   of the star's red. Change a colour once here and it changes everywhere.
   ==================================================================== */

:root {
  --ink:         #1c232b;
  --ink-soft:    #46515d;
  --muted:       #6a7582;
  --line:        #d6dce3;
  --line-soft:   #e7ebf0;
  --page:        #f3f5f8;
  --panel:       #ffffff;

  --header:      #2c333e;   /* same slate as the quoting app header */
  --header-ink:  #e8eef5;

  --brand:       #2f5f8a;   /* Har-Bach steel blue */
  --brand-dark:  #234a6c;
  --brand-soft:  #e7eff7;
  --accent:      #d6303a;   /* Har-Bach star red — use sparingly */

  --ok:  #1c7346;  --ok-soft:   #e3f2e9;
  --warn:#8a5d00;  --warn-soft: #fbf1d9;
  --err: #a8261e;  --err-soft:  #fbe9e7;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(28, 35, 43, .06), 0 6px 18px rgba(28, 35, 43, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* ---------------------------------------------------------------- base */

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* "hidden" must win over any display rule */

body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--page);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(47, 95, 138, .45); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.15rem; }
p  { margin: 0 0 .6rem; }
img { display: block; max-width: 100%; height: auto; }

.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono  { font-family: var(--mono); font-size: .85em; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 28px; padding-bottom: 64px; min-height: 60vh; }

/* -------------------------------------------------------------- header */

.site-header { background: var(--header); color: var(--header-ink); }

.header-row {
  display: flex; align-items: center; gap: 24px;
  min-height: 64px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em;
}
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; }
.logo-mark path   { fill: none; stroke: var(--header-ink); stroke-width: 3; stroke-linecap: round; }
.logo-mark circle { fill: var(--accent); }

.search { flex: 1; display: flex; max-width: 560px; }
.search input {
  flex: 1; min-width: 0; padding: 9px 12px;
  font: inherit; border: 0; border-radius: var(--radius) 0 0 var(--radius);
}
.search button {
  padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--brand); color: #fff;
}
.search button:hover { background: var(--brand-dark); }

.header-nav { margin-left: auto; display: flex; gap: 18px; }
.header-nav a { color: var(--header-ink); font-weight: 500; }

/* -------------------------------------------------------------- footer */

.site-footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; padding: 22px 20px; font-size: .88rem; }

/* ------------------------------------------------------------- shared */

.btn {
  display: inline-block; padding: 9px 16px;
  font-weight: 600; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.btn:hover { text-decoration: none; border-color: #b8c1cc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 700;
}
.tag.ok   { background: var(--ok-soft);   color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.err  { background: var(--err-soft);  color: var(--err); }

.notice { padding: 14px 16px; border-radius: var(--radius); border: 1px solid; }
.notice.error { background: var(--err-soft); border-color: #efc6c2; color: var(--err); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h1 { color: var(--ink); }

.image-missing { display: block; aspect-ratio: 3 / 2; background: var(--line-soft); }

.section-title { margin: 32px 0 14px; }
.eyebrow {
  margin: 0 0 4px; font-size: .74rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------------------------------------------------------------- home */

.intro {
  padding: 30px 32px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand);
}
.intro h1 { font-size: 1.9rem; }
.intro p  { max-width: 62ch; color: var(--ink-soft); margin-bottom: 16px; }

.category-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.category-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink);
}
.category-card:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }
.category-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.category-card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.category-card-name { font-weight: 600; }

/* ---------------------------------------------------------------- shop */

.shop { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }

.filters {
  position: sticky; top: 16px;
  padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters > summary { display: none; }   /* only shown on narrow screens */

.filter-title {
  margin: 0 0 8px; font-size: .74rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.filter-list { list-style: none; margin: 0 0 20px; padding: 0; }
.filter-list a { display: flex; align-items: center; gap: 9px; padding: 5px 0; color: var(--ink-soft); }
.filter-list a.on { color: var(--brand); font-weight: 700; }
.filter-list img, .filter-list .image-missing { width: 36px; height: 24px; flex: none; border-radius: 3px; }

.check { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }

.category-banner {
  display: flex; gap: 20px; align-items: center; margin-bottom: 18px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.category-banner img, .category-banner .image-missing { width: 180px; flex: none; border-radius: 4px; }
.category-banner h1 { margin: 0; }

.results-title { margin-bottom: 12px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.sort select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); }

.product-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.card:hover { border-color: #b8c1cc; box-shadow: var(--shadow); }
.card-image img, .card-image .image-missing { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px; }
.card-body p { margin: 0 0 6px; }
.card-name { font-weight: 600; color: var(--ink); line-height: 1.35; margin-bottom: 4px; }
.price { font-size: 1.1rem; font-weight: 700; }
.price .muted { font-size: .85rem; font-weight: 400; }
.card-body .card-seller { margin-top: auto; font-size: .86rem; }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pager a {
  min-width: 36px; padding: 6px 10px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink);
}
.pager a.on { background: var(--header); border-color: var(--header); color: #fff; }

/* ------------------------------------------------------------- product */

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; font-size: .9rem; color: var(--muted); }
.crumb-with-image { display: inline-flex; align-items: center; gap: 6px; }
.crumb-with-image img { width: 30px; height: 20px; border-radius: 2px; }

.product { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.product-main { padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.product-image { width: 100%; border-radius: 4px; margin-bottom: 18px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.buy-box {
  position: sticky; top: 16px; padding: 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.buy-price { font-size: 1.9rem; font-weight: 700; margin: 0; }
.buy-box hr { border: 0; border-top: 1px solid var(--line-soft); margin: 16px 0; }

/* ------------------------------------------------------------- account */

.auth-form, .account {
  display: flex; flex-direction: column; gap: 14px; padding: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-form { max-width: 400px; margin: 0 auto; }
.account { max-width: 520px; align-items: flex-start; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
.auth-form input { font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); }
.auth-form .btn { align-self: flex-start; cursor: pointer; font: inherit; font-weight: 600; }
.btn:disabled { opacity: .6; cursor: wait; }
.auth-form .btn.primary { align-self: stretch; text-align: center; }
.auth-switch { margin: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: .9rem; color: var(--muted); }
.small-btn { padding: 4px 10px; font-size: .86rem; margin-left: 4px; }
.form-status { margin: 0; min-height: 1.5em; font-size: .92rem; }
.form-status:empty { display: none; }
.error-text { color: var(--err); }
.notice.ok { background: var(--ok-soft); border-color: #bfe0cc; color: var(--ok); margin-bottom: 18px; }

/* ----------------------------------------------------------- narrow screens */

@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .shop, .product { grid-template-columns: minmax(0, 1fr); }
  .filters, .buy-box { position: static; }
  .filters > summary {
    display: block; cursor: pointer; font-weight: 600;
    list-style: none; padding: 2px 0;
  }
  .filters > summary::after { content: " ▾"; color: var(--muted); }
  .filters[open] > summary { margin-bottom: 12px; }
  .filters[open] > summary::after { content: " ▴"; }
  .category-banner img { width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

