/* hipobuyspreadsheet.be - handwritten stylesheet
   Warm white ground, charcoal ink, deep olive interactive.
   Typography scale fixed per production spec §17; spacing per §18. */

:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #f1ede3;
  --ink: #26241f;
  --ink-soft: #443f37;
  --muted: #605b51;
  --olive: #49521f;
  --olive-dark: #363d14;
  --olive-tint: #e9ecd8;
  --border: #e0d9cc;
  --border-strong: #cdc4b3;
  --focus: #7a5a00;
  --maxw: 1240px;
  --radius: 8px;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; }

main { display: block; }

/* one section-owner for vertical rhythm (spec §18) */
.stack > * + * { margin-top: 56px; }
@media (max-width: 760px) { .stack > * + * { margin-top: 40px; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--olive); text-underline-offset: 2px; }
a:hover { color: var(--olive-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

img { max-width: 100%; display: block; }

/* ---------- typography ---------- */
h1, h2, h3 { color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: 48px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 28px; font-weight: 700; line-height: 1.3; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.4; }
p { margin: 0; }
small, .small { font-size: 14px; }
.muted { color: var(--muted); }

@media (max-width: 760px) {
  body { font-size: 15px; line-height: 1.6; }
  h1 { font-size: 32px; line-height: 1.2; }
  h2 { font-size: 22px; }
  h3 { font-size: 16px; }
  small, .small { font-size: 13px; }
}

.lede { font-size: 18px; color: var(--ink-soft); line-height: 1.6; max-width: 62ch; }
@media (max-width: 760px) { .lede { font-size: 16px; } }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px;
}
.brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand b { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: var(--muted); font-weight: 500; }

.nav-desktop { display: flex; gap: 22px; align-items: center; }
.nav-desktop a { font-size: 14px; font-weight: 500; color: var(--ink-soft); text-decoration: none; }
.nav-desktop a:hover, .nav-desktop a[aria-current="page"] { color: var(--olive-dark); }
.nav-desktop a[aria-current="page"] { font-weight: 600; }

.nav-mobile { display: none; position: relative; }
.nav-mobile > summary {
  list-style: none; cursor: pointer; font-size: 14px; font-weight: 600;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--ink); background: var(--surface);
}
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile[open] > summary { border-color: var(--olive); }
.nav-mobile .menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 8px; min-width: 220px;
  box-shadow: 0 12px 28px rgba(30,26,18,0.14); display: grid; gap: 2px;
}
.nav-mobile .menu-panel a {
  display: block; padding: 10px 12px; font-size: 15px; font-weight: 500;
  color: var(--ink); text-decoration: none; border-radius: 6px;
}
.nav-mobile .menu-panel a:hover { background: var(--surface-2); }

@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
}

/* ---------- buttons & search ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none;
  padding: 11px 18px; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; background: var(--olive); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--olive-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--olive-dark); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--olive-dark); }
@media (max-width: 760px) { .btn { font-size: 14px; padding: 10px 15px; } }

.search {
  display: flex; gap: 8px; width: 100%; max-width: 640px;
}
.search .field { flex: 1 1 auto; min-width: 0; }
.search input[type="text"] {
  width: 100%; font-family: var(--font); font-size: 16px;
  padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.search input::placeholder { color: #8b857a; }
.search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.search .btn { flex: 0 0 auto; }
.search-note { font-size: 13px; color: var(--muted); margin-top: 8px; }
@media (max-width: 520px) {
  .search { flex-wrap: wrap; }
  .search .btn { width: 100%; }
}

/* ---------- hero ---------- */
.hero { padding-top: 44px; }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-top: 14px; }
.hero .search-block { margin-top: 24px; }

/* ---------- catalogue layout: rail + grid ---------- */
.catalogue { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .catalogue { grid-template-columns: 1fr; gap: 20px; } }

.rail { position: sticky; top: 76px; }
.rail h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail a {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 9px 12px; border-radius: 6px; text-decoration: none;
  color: var(--ink-soft); font-size: 15px; font-weight: 500;
}
.rail a:hover { background: var(--surface-2); }
.rail a[aria-current="page"] { background: var(--olive-tint); color: var(--olive-dark); font-weight: 600; }
.rail .count { font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .rail { position: static; }
  .rail ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .rail a { border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; }
  .rail a .count { display: none; }
}

/* ---------- product grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px;
}
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card .thumb {
  display: block; aspect-ratio: 1 / 1; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-width: 0; }
.card .cat { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.card h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--olive-dark); text-decoration: underline; }
.card .price { margin-top: auto; }
.card .price .eur { font-weight: 700; font-size: 16px; color: var(--ink); }
.card .price .cny { font-size: 13px; color: var(--muted); }
.card .actions { display: grid; gap: 8px; margin-top: 4px; }
.card .actions .btn { padding: 9px 12px; font-size: 14px; }
@media (max-width: 760px) {
  .card .body { padding: 11px; gap: 6px; }
  .card h3 { font-size: 14px; }
}

/* ---------- generic sections & prose ---------- */
.section-head { max-width: 70ch; }
.section-head h2 + p { margin-top: 12px; }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--olive); }

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 40px; }
.prose h3 { margin-top: 28px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li { line-height: 1.6; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.panel-tint { background: var(--olive-tint); border-color: #d4d9be; }
.panel-warn { background: #fbf3e2; border-color: #ecd9ad; }
@media (max-width: 760px) { .panel { padding: 16px; } }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.cols > * { min-width: 0; }

.linkcard {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink);
}
.linkcard:hover { border-color: var(--border-strong); background: var(--surface-2); }
.linkcard h3 { color: var(--ink); }
.linkcard p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* breadcrumb */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 18px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: "/"; margin-left: 6px; color: var(--border-strong); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--olive-dark); text-decoration: underline; }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 820px) { .pdp { grid-template-columns: 1fr; gap: 22px; } }
.pdp .figure { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pdp .figure img { width: 100%; height: auto; }
.pdp .figcap { font-size: 12px; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--border); }
.pdp .meta { display: flex; flex-direction: column; gap: 18px; }
.price-block .eur { font-size: 28px; font-weight: 800; color: var(--ink); }
.price-block .cny { font-size: 15px; color: var(--muted); }
.price-block .disc { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 52ch; }
.spec { border-collapse: collapse; width: 100%; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec th { color: var(--muted); font-weight: 500; width: 40%; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- FAQ ---------- */
.qa { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.qa + .qa { margin-top: 12px; }
.qa summary {
  cursor: pointer; list-style: none; padding: 16px 18px; font-weight: 600; font-size: 17px;
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--olive); font-weight: 700; font-size: 20px; }
.qa[open] summary::after { content: "\2212"; }
.qa .answer { padding: 0 18px 18px; color: var(--ink-soft); }
.qa .answer > * + * { margin-top: 12px; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 72px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding: 40px 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.footer-grid a:hover { color: var(--olive-dark); text-decoration: underline; }
.footer-about p { font-size: 14px; color: var(--muted); max-width: 40ch; }
.footer-about .id-note { margin-top: 12px; font-size: 13px; }
.footer-legal { border-top: 1px solid var(--border); padding: 18px 0 40px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* status / notice banner */
.notice { background: var(--olive-tint); border-bottom: 1px solid #d4d9be; font-size: 13px; color: var(--olive-dark); }
.notice .wrap { padding-top: 8px; padding-bottom: 8px; }

/* utility */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--olive-tint); color: var(--olive-dark); }
.divider { border: 0; border-top: 1px solid var(--border); }
.mt-s { margin-top: 10px; } .mt-m { margin-top: 20px; }
.list-plain { list-style: none; padding: 0; margin: 0; }

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