/* Najbolj Jaki Popusti — trustworthy-utility design system */

:root {
  --bg: #f3f5f3;
  --surface: #ffffff;
  --border: #e4e7e4;
  --border-strong: #d4d8d4;
  --ink: #1d2420;
  --muted: #6a726c;
  --faint: #9aa19b;
  --accent: #2c6e49;
  --accent-ink: #1f5236;
  --accent-soft: #e8f1eb;
  --promo: #c0392b;
  --promo-soft: #fbeae8;
  --bio: #1f7a43;
  --bio-soft: #e6f3ea;

  --r: 8px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 24, .04), 0 1px 3px rgba(20, 30, 24, .06);
  --shadow-hover: 0 2px 6px rgba(20, 30, 24, .08), 0 4px 12px rgba(20, 30, 24, .06);
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  line-height: 1.5;
  font-size: 15px;
}

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

h1, h2, h3 { line-height: 1.25; color: var(--ink); }
h2 { font-size: 1.35rem; margin: .2rem 0 .8rem; font-weight: 700; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; font-weight: 600; }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .85rem; }

/* ── header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1140px; margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: 1.75rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand .logo { color: var(--accent); font-size: 1.25rem; }
.brand .dot { color: var(--accent); }
nav.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
nav.tabs a {
  color: var(--muted); font-weight: 500; font-size: .92rem;
  padding: .35rem .7rem; border-radius: var(--r-sm); position: relative;
}
nav.tabs a:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }
nav.tabs a.active { color: var(--accent-ink); font-weight: 600; }
nav.tabs a.active::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: -.72rem;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* ── layout ─────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.page-title { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.page-title .count { color: var(--muted); font-weight: 500; font-size: .95rem; }

/* ── footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 2.5rem;
  background: var(--surface);
}
.site-footer .inner {
  max-width: 1140px; margin: 0 auto; padding: 1.2rem 1.25rem;
  color: var(--faint); font-size: .82rem; display: flex; gap: 1rem;
  flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.freshness { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.freshness .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ── tables ─────────────────────────────────────────────── */
table {
  border-collapse: separate; border-spacing: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
  font-size: .92rem; margin-bottom: 1rem;
}
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th {
  background: #f7f9f7; color: var(--muted); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border-strong);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8faf8; }
td.num, th.num { text-align: right; white-space: nowrap; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .88rem; }
tr.best td { background: var(--accent-soft); }
tr.best:hover td { background: #def0e5; }

/* ── chain chips ────────────────────────────────────────── */
.chip {
  display: inline-block; padding: .1rem .5rem; border-radius: var(--r-sm);
  font-size: .76rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  text-transform: capitalize;
}
.chip-mercator { background: #fbeae8; color: #b3261e; }
.chip-spar     { background: #e6f3ea; color: #1f7a43; }
.chip-tus      { background: #fdeede; color: #b5651d; }
.chip-hofer    { background: #e7f0f4; color: #1f6f8b; }
.chip-lidl     { background: #e8eefc; color: #2453c4; }
.chip-eurospin { background: #f1eaf7; color: #7a3fb0; }

/* ── prices, promos, tags ───────────────────────────────── */
.promo { color: var(--promo); font-weight: 700; }
.was { color: var(--faint); text-decoration: line-through; margin-left: .35rem; font-weight: 400; font-size: .85em; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 4px;
  padding: 0 .35rem; vertical-align: middle;
}
.badge-discount { background: var(--promo-soft); color: var(--promo); margin-left: .35rem; }
.gap { font-weight: 700; color: var(--promo); font-family: var(--mono); }

.tag {
  display: inline-block; font-size: .72rem; background: #eef0ee; border-radius: 4px;
  padding: 0 .4rem; margin-left: .3rem; color: #586059;
}
.tag.bio { background: var(--bio-soft); color: var(--bio); }
.tag.pl  { background: #eef2f7; color: #4a6076; }
.pill {
  display: inline-block; background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; padding: .08rem .6rem; margin-right: .3rem; font-size: .8rem; font-weight: 500;
}
a.cmp { margin-left: .5rem; font-size: .78rem; color: var(--accent); white-space: nowrap; }
a.product { color: var(--ink); }
a.product:hover { color: var(--accent); }

/* mini price bar (deals / list viz) */
.bar-wrap { background: #eef1ee; border-radius: 4px; height: 7px; width: 100%; max-width: 160px; overflow: hidden; }
.bar { height: 100%; background: var(--accent); border-radius: 4px; }

/* ── forms ──────────────────────────────────────────────── */
form.bar-form, form.bar { display: flex; gap: .5rem; margin: 0 0 1.2rem; flex-wrap: wrap; align-items: center; }
form.bar-form input[type=text], form.bar input[type=text] { flex: 1 1 240px; }
form.bar-form button, form.bar button, form.bar-form select, form.bar select { flex: 0 0 auto; }
input[type=text], select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: .5rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); outline: none;
}
input[type=text] { min-width: 280px; }
input[type=text]:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
button {
  font-family: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
  padding: .5rem .9rem; border-radius: var(--r-sm);
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ── cards ──────────────────────────────────────────────── */
.cards { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: .65rem .9rem; text-decoration: none; color: var(--ink); min-width: 160px;
  box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-1px); text-decoration: none; }
.card b { display: block; margin-bottom: .15rem; }
.card .big { font-size: 1.35rem; font-weight: 700; font-family: var(--mono); }

/* ── browse / facet sidebar ─────────────────────────────── */
.browse { display: flex; gap: 1.5rem; align-items: flex-start; }
.browse aside {
  flex: 0 0 230px; font-size: .9rem; position: sticky; top: 72px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: .5rem; box-shadow: var(--shadow); max-height: calc(100vh - 90px); overflow: auto;
}
.browse aside a {
  display: flex; justify-content: space-between; gap: .5rem; align-items: baseline;
  padding: .25rem .5rem; border-radius: var(--r-sm); color: var(--ink);
}
.browse aside a:hover { background: var(--accent-soft); text-decoration: none; }
.browse aside a.active { background: var(--accent); color: #fff; }
.browse aside a.active .ct { color: #d9ecdf; }
.browse aside .ct { color: var(--faint); font-size: .8rem; font-family: var(--mono); }
.browse main { flex: 1; min-width: 0; }

.crumb { color: var(--muted); margin-bottom: .7rem; font-size: .9rem; }
.crumb a { color: var(--accent); }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 760px) {
  .browse { flex-direction: column; }
  .browse aside { position: static; flex-basis: auto; width: 100%; max-height: none; }
  nav.tabs { margin-left: 0; width: 100%; }
  input[type=text] { min-width: 0; flex: 1; }
}
