/* ============================================================
   JK Kauppa — Foxway-tukkukauppa
   Pohjustus: paperi, syvä vihreä, amber-huomio
   ============================================================ */

:root {
  --paper:      #F6F3EC;
  --paper-2:    #EFEBE0;
  --surface:    #FFFFFF;
  --ink:        #10201C;
  --ink-soft:   #2C3B35;
  --muted:      #5F6B64;
  --line:       #DED9CC;

  --accent:     #14604A;
  --accent-deep:#0D4536;
  --accent-ink: #FFFFFF;
  --accent-soft:#DDEBE4;

  --hi:         #C9772A;
  --hi-soft:    #F6E7D4;

  --new-bg:     #EAF1EE;
  --new-ink:    #0D4536;
  --used-bg:    #F2EDE1;
  --used-ink:   #5B5344;

  --font-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 78rem;
  --pad: clamp(1rem, 4vw, 3rem);
  --radius: 5px;
  --shadow: 0 1px 2px rgba(16,32,28,.06), 0 18px 40px -24px rgba(16,32,28,.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; text-wrap: pretty; margin: 0 0 .5em; }
p { text-wrap: pretty; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

/* --- Yläpalkki ------------------------------------------------------ */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand {
  font-family: var(--font-head); font-weight: 800; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -.02em; white-space: nowrap;
}
.brand span { color: var(--accent); }
.topnav { display: flex; gap: 1.25rem; margin-left: auto; }
.topnav a {
  color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.topnav a:hover { color: var(--accent); }

/* --- Napit ---------------------------------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.15rem; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .92rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.pill-accent { background: var(--accent); color: var(--accent-ink); }
.pill-accent:hover { background: var(--accent-deep); transform: translateY(-1px); }
.pill-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.pill-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* --- Sankkari -------------------------------------------------------- */

.hero {
  background:
    radial-gradient(120% 90% at 85% 0%, var(--accent-soft) 0%, transparent 55%),
    linear-gradient(var(--paper), var(--paper));
  border-bottom: 1px solid var(--line);
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 6%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(115deg, #000 0%, transparent 60%);
}
.hero-in {
  position: relative;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem);
  align-items: end;
}
.eyebrow {
  font-family: var(--font-head); font-size: .8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 800; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 40ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.hero-side { display: grid; gap: 1rem; }
.stats {
  margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg, 8px);
  overflow: hidden;
}
.stats > div { background: var(--surface); padding: 1rem 1.1rem; }
.stats dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats dd { margin: .15rem 0 0; font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }
.hero-note {
  margin: 0; font-size: .9rem; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--hi); border-radius: var(--radius); padding: .9rem 1.1rem;
}
.dot { color: var(--accent); }

/* --- Ilmoitusbandi -------------------------------------------------- */

.band { background: var(--accent); color: #fff; }
.band-in {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: color-mix(in srgb, #fff 22%, transparent);
}
.band-item {
  padding: 1rem 1.25rem; font-size: .95rem; font-weight: 500;
  display: flex; align-items: baseline; gap: .6rem;
}
.band-k {
  font-family: var(--font-head); font-weight: 700; font-size: .75rem;
  letter-spacing: .1em; text-transform: uppercase;
  background: color-mix(in srgb, #fff 20%, transparent);
  border-radius: 999px; padding: .15rem .55rem; white-space: nowrap;
}

/* --- Osio ----------------------------------------------------------- */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.section-head { max-width: 60ch; margin-bottom: 1.75rem; }
.section-sub { color: var(--ink-soft); margin: 0; }

/* --- Työkalupakki ---------------------------------------------------- */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)) auto;
  gap: .75rem; align-items: end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.field { display: grid; gap: .3rem; min-width: 0; }
.field > span {
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.field input, .field select {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.toolbar-actions { display: flex; gap: .5rem; }

.countline { font-size: .9rem; color: var(--muted); margin: 0 0 .75rem; }

/* --- Tuotetaulu ------------------------------------------------------ */

.table-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.products { width: 100%; border-collapse: collapse; font-size: .95rem; }
.products thead th {
  text-align: left; font-family: var(--font-head); font-size: .78rem;
  font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--paper);
  border-bottom: 1px solid var(--line); padding: .7rem 1rem;
}
.products tbody tr { border-bottom: 1px solid var(--line); }
.products tbody tr:last-child { border-bottom: 0; }
.products tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 55%, #fff); }
.products td { padding: .75rem 1rem; vertical-align: top; }
.col-qty { width: 7rem; }
.col-price { width: 8rem; text-align: right; }

.p-name { font-weight: 600; color: var(--ink); }
.p-name .state-chip { margin-right: .45rem; }
.p-sku { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; font-variant-numeric: tabular-nums; }
.p-specs { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }

.chip {
  display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1;
  padding: .28rem .5rem; border-radius: 3px; background: var(--paper-2); color: var(--ink-soft);
  white-space: nowrap;
}
.chip.grade { background: var(--accent-soft); color: var(--accent-deep); }
.chip.warn { background: var(--hi-soft); color: #7a4a17; }

.state-chip {
  display: inline-block; font-family: var(--font-head); font-size: .68rem; font-weight: 700;
  line-height: 1; letter-spacing: .06em; text-transform: uppercase;
  padding: .3rem .5rem; border-radius: 3px;
}
.state-used { background: var(--used-bg); color: var(--used-ink); }
.state-new { background: var(--new-bg); color: var(--new-ink); }

.t-spec { color: var(--ink-soft); font-size: .9rem; }
.t-qty { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.t-price {
  font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  color: var(--accent-deep); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.t-price small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .72rem; color: var(--muted); }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 1rem; }

.more-row { display: flex; justify-content: center; margin-top: 1.25rem; }

/* --- Infokortit ------------------------------------------------------ */

.info-grid {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1rem; margin-top: 1.5rem;
}
.info-lead, .info-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
}
.info-lead { border-top: 3px solid var(--accent); }
.info-card { border-top: 3px solid var(--hi); }
.info-grid h3 { font-size: 1.15rem; font-weight: 700; }
.info-grid p { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .97rem; }
.info-grid p:last-child { margin-bottom: 0; }

/* --- Tilaaminen ------------------------------------------------------ */

.steps {
  list-style: none; counter-reset: askel; margin: 1.5rem 0 2rem; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.steps li {
  counter-increment: askel; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.25rem 1.25rem 3.4rem; position: relative;
  color: var(--ink-soft); font-size: .97rem;
}
.steps li::before {
  content: counter(askel); position: absolute; left: 1.1rem; top: 1.1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: .95rem;
  display: grid; place-items: center;
}
.steps a { color: var(--accent); font-weight: 600; }
.big-cta { font-size: 1rem; padding: .8rem 1.5rem; }

/* --- Alatunniste ----------------------------------------------------- */

.footer { background: var(--ink); color: #D7DDD9; padding-block: 2.5rem; }
.footer-in {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem;
  font-size: .9rem;
}
.footer-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: #fff; margin: 0 0 .3rem; }
.footer a { color: #fff; }
.footer-src { color: #9AA8A2; font-size: .85rem; }
.footer-src p { margin: 0; }

/* --- Responsiivisuus ------------------------------------------------- */

@media (max-width: 64rem) {
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .info-grid, .steps { grid-template-columns: 1fr; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 48rem) {
  .topnav { display: none; }
  .hero-in { grid-template-columns: 1fr; align-items: start; }
  .band-in { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .products thead { display: none; }
  .products, .products tbody, .products tr, .products td { display: block; width: 100%; }
  .products tr { padding: .9rem 1rem; }
  .products td { padding: .15rem 0; }
  .col-price { text-align: left; }
  .t-price { display: inline-block; margin-left: 1rem; }
  .t-qty { display: inline-block; }
}

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