/* ------------------------------------------------------------------
   FormulaPrice design system
   Palette: "milk room" - light green-tinted paper, deep bottle green,
   honey reserved for the single best price. Type: Bricolage Grotesque
   display + Inter body/data (tabular numerals for prices).
------------------------------------------------------------------- */
:root {
  --paper: #F4F7F3;
  --card: #FFFFFF;
  --ink: #1B2A24;
  --pine: #14594A;
  --pine-deep: #0D3B31;
  --pine-tint: #E1EEE7;
  --honey: #B97E15;
  --honey-tint: #FBF1DC;
  --line: #DFE6E0;
  --muted: #64756D;
  --danger: #A5372C;
  --radius: 10px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--pine); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- header ---------------- */
.site-header { background: var(--pine-deep); color: #fff; }
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  color: inherit; text-decoration: none; letter-spacing: -0.01em;
}
.wordmark .mark {
  width: 22px; height: 26px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #FFFFFF 55%, var(--honey-tint));
  box-shadow: inset 0 -3px 0 rgba(13,59,49,.15);
}
.header-search { flex: 1 1 280px; display: flex; min-width: 220px; }
.header-search input {
  flex: 1; border: none; border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 14px; font: inherit; min-width: 0;
}
.header-search button {
  border: none; background: var(--honey); color: #fff; font-weight: 600;
  padding: 10px 18px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}
.header-nav { display: flex; gap: 18px; }
.header-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 500; }
.header-nav a:hover { color: #fff; }

/* ---------------- intro band ---------------- */
.intro-band { background: var(--pine); color: #fff; }
.intro-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding-top: 30px; padding-bottom: 26px; flex-wrap: wrap;
}
.intro-band h1 { margin: 0; max-width: 520px; }
.intro-stats { display: flex; gap: 34px; }
.intro-stats div { display: flex; flex-direction: column; }
.intro-stats strong {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.intro-stats span { font-size: .8rem; color: rgba(255,255,255,.75); }

/* ---------------- filters ---------------- */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 26px 0 20px; flex-wrap: wrap;
}
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 500;
}
.pill:hover { border-color: var(--pine); }
.pill.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.stage-select select {
  font: inherit; padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card);
}

/* ---------------- product grid ---------------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: 0 6px 20px rgba(13,59,49,.10); transform: translateY(-2px); }
.card-img { aspect-ratio: 1 / 1; background: #fff; display: grid; place-items: center; padding: 16px; }
.card-img img { max-height: 100%; object-fit: contain; }
.img-placeholder {
  width: 84px; height: 100px; display: grid; place-items: center;
  background: var(--pine-tint); color: var(--pine); border-radius: 14px 14px 40% 40%;
  font-family: var(--font-display); font-size: 2rem; font-weight: 800;
}
.img-placeholder.big { width: 150px; height: 180px; font-size: 3.4rem; }
.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pine);
}
.card .size { font-size: .8rem; color: var(--muted); }
.card-price { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 6px; }
.card-price .from { font-size: .78rem; color: var(--muted); }
.card-price strong {
  font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.card-price .store-count { font-size: .78rem; color: var(--muted); margin-left: auto; }

/* ---------------- product page ---------------- */
.crumbs { margin: 22px 0 6px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.product-top {
  display: grid; grid-template-columns: 280px 1fr; gap: 30px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 30px;
}
.product-media { display: grid; place-items: center; }
.product-media img { max-height: 280px; object-fit: contain; }
.product-info .desc { color: var(--muted); max-width: 60ch; }
.best-banner {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 14px;
  background: var(--honey-tint); border: 1px solid #EAD9B4; border-radius: var(--radius);
  padding: 10px 16px;
}
.best-banner strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.best-chip {
  display: inline-block; background: var(--honey); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}

/* offer table: the signature element */
.offers { margin-bottom: 40px; }
.offer-table {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.offer-head, .offer-row {
  display: grid;
  grid-template-columns: 64px 1.2fr 1fr 120px 130px 130px;
  gap: 10px; align-items: center; padding: 12px 16px;
}
.offer-head {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); background: #FAFCFA;
}
.offer-row { border-bottom: 1px solid var(--line); }
.offer-row:last-child { border-bottom: none; }
.offer-row.best { background: var(--honey-tint); box-shadow: inset 4px 0 0 var(--honey); }
.offer-row.unavail { color: var(--muted); }
.rank { font-family: var(--font-display); font-weight: 700; color: var(--muted); }
.store strong { display: block; }
.store small, .details small { color: var(--muted); font-size: .78rem; }
.details small.err { color: var(--danger); }
.checked { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.dot.fresh { background: #3E9B6C; box-shadow: 0 0 0 3px rgba(62,155,108,.18); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.price strong { font-size: 1.1rem; }
.price s { color: var(--muted); font-size: .8rem; margin-right: 6px; }
.go { text-align: right; }
.btn {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius);
  border: 1px solid var(--pine); color: var(--pine); background: var(--card);
  font: inherit; font-weight: 600; font-size: .85rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--pine-tint); }
.btn-best { background: var(--pine); color: #fff; }
.btn-best:hover { background: var(--pine-deep); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #F9ECEA; }
.btn[disabled] { opacity: .55; cursor: default; }
.table-note { font-size: .8rem; color: var(--muted); margin-top: 10px; }

/* history */
.history { margin-bottom: 40px; }
.history-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.spark { width: 100%; height: auto; }
.spark-line { stroke: var(--pine); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--pine-tint); }
.spark-dot { fill: var(--honey); }
.history-range { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: 6px; }

.related { margin-bottom: 48px; }

/* misc */
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.prose { max-width: 68ch; padding-top: 30px; padding-bottom: 60px; }
.site-footer { background: var(--pine-deep); color: rgba(255,255,255,.85); margin-top: 20px; }
.footer-inner { padding: 26px 20px; }
.footer-note { font-size: .8rem; color: rgba(255,255,255,.6); max-width: 70ch; }

/* ---------------- admin ---------------- */
body.admin { background: var(--paper); }
.admin-header { background: var(--card); border-bottom: 1px solid var(--line); }
.admin-header-inner { display: flex; align-items: center; gap: 22px; padding: 12px 20px; flex-wrap: wrap; }
.admin-header .wordmark { color: var(--ink); font-size: 1rem; }
.admin-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.admin-header nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 4px 2px; }
.admin-header nav a.on { color: var(--pine); box-shadow: inset 0 -2px 0 var(--pine); }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; margin-left: auto; }
body.admin main { padding-top: 26px; padding-bottom: 60px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .88rem; max-width: 80ch; }
.stat-row { display: flex; gap: 14px; margin: 18px 0 26px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 22px; display: flex; flex-direction: column; min-width: 130px;
}
.stat strong { font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }

.admin-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin: 14px 0 30px; font-size: .88rem;
}
.admin-table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: #FAFCFA; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table input:not([type=checkbox]) {
  width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
}
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.err { color: var(--danger); }
.ok { color: #2F7D57; }

.inline-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin: 16px 0;
}
.inline-form input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; flex: 1 1 160px; }
.inline-form input[size] { flex: 0 1 auto; }

.stacked-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin-bottom: 18px; }
.stacked-form.narrow { max-width: 460px; }
.stacked-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .85rem; }
.stacked-form label.check { flex-direction: row; align-items: center; gap: 8px; }
.stacked-form input:not([type=checkbox]), .stacked-form select, .stacked-form textarea {
  font: inherit; font-weight: 400; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; margin-top: 10px; }
.form-error { background: #F9ECEA; color: var(--danger); border-radius: 6px; padding: 10px 12px; }
.form-ok { background: var(--pine-tint); color: var(--pine-deep); border-radius: 6px; padding: 10px 12px; }

.run-entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.run-entry summary { display: flex; gap: 18px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; }
.run-entry pre { margin: 0; padding: 12px 16px; background: #FAFCFA; border-top: 1px solid var(--line); overflow-x: auto; font-size: .78rem; }

.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 36px; width: min(92vw, 380px); display: flex; flex-direction: column; gap: 14px;
}
.login-box .wordmark { color: var(--ink); }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .product-top { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
  .offer-head { display: none; }
  .offer-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "store price" "details checked" "rank go";
    row-gap: 6px;
  }
  .offer-row .rank { grid-area: rank; }
  .offer-row .store { grid-area: store; }
  .offer-row .details { grid-area: details; }
  .offer-row .checked { grid-area: checked; justify-content: flex-end; }
  .offer-row .price { grid-area: price; }
  .offer-row .go { grid-area: go; }
  .admin-table { display: block; overflow-x: auto; }
}

/* ================== v2 ================== */

/* ---- logo wordmark ---- */
.wordmark { letter-spacing: -0.02em; font-size: 1.3rem; }
.logo-formula { color: #fff; font-weight: 800; }
.logo-price { color: var(--honey); font-weight: 800; }
.logo-tld { color: rgba(255,255,255,.55); font-weight: 600; font-size: .72em; margin-left: 2px; }
.wordmark:hover .logo-price { color: #d99b2e; }

/* ---- promo band ---- */
.promo-band {
  background: var(--honey-tint); color: var(--honey);
  font-weight: 600; font-size: .85rem;
  border-bottom: 1px solid var(--line);
  padding: 7px 0; text-align: center;
}
.promo-icon { margin-right: 4px; }

/* ---- category tiles ---- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin: 22px 0 6px;
}
.cat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .12s, box-shadow .12s;
}
.cat-tile:hover { border-color: var(--pine); box-shadow: 0 4px 14px rgba(13,59,49,.08); }
.cat-name { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.cat-count { font-size: .78rem; color: var(--muted); }
.clear-cat { font-size: .85rem; }

/* ---- predictive search ---- */
.header-search { position: relative; }
.search-suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(13,59,49,.15); overflow: hidden;
}
.suggest-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover, .suggest-item.active { background: var(--pine-tint); }
.suggest-item img, .suggest-ph { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.suggest-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.suggest-text strong { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-text small { font-size: .74rem; color: var(--muted); }

/* ---- unit price hints ---- */
.unit-hint { font-size: .72rem; color: var(--muted); display: block; width: 100%; }

/* ---- pack table ---- */
.pack-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pack-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.pack-table th, .pack-table td { padding: 10px 12px; text-align: left; }
.pack-table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600;
}
.pack-table tbody tr { border-bottom: 1px solid var(--line); }
.pack-table tbody tr:last-child { border-bottom: none; }
.pack-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pack-table .unit strong { color: var(--pine-deep); font-size: 1rem; }
.pack-table tr.best { background: var(--honey-tint); box-shadow: inset 4px 0 0 var(--honey); }
.pack-table tr.unavail { color: var(--muted); }
.pack-table .store-cell { vertical-align: top; font-weight: 600; }
.pack-table .store-cell small { display: block; font-weight: 400; color: var(--muted); }
.pack-table .oos { font-size: .8rem; color: var(--danger); }
.pack-table .go { text-align: right; }

/* ---- barcode ---- */
.barcode-box { margin-top: 14px; color: var(--ink); max-width: 240px; }
.barcode-box svg { width: 100%; height: auto; }

/* ---- stars & reviews ---- */
.stars { color: var(--honey); letter-spacing: 2px; }
.page-title { margin-top: 26px; }
.store-list { display: grid; gap: 10px; margin: 20px 0 40px; }
.store-card {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--ink);
}
.store-card:hover { border-color: var(--pine); }
.store-card h2 { margin: 0; font-size: 1.05rem; }
.store-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.store-page .store-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 22px 0; flex-wrap: wrap; }
.review {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.review header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.review header time { margin-left: auto; font-size: .78rem; }
.review p { margin: 4px 0; }
.verified { font-size: .72rem; color: var(--pine); background: var(--pine-tint); border-radius: 5px; padding: 2px 6px; }
.store-reply {
  margin-top: 10px; padding: 10px 12px; background: var(--pine-tint);
  border-radius: 8px; font-size: .9rem;
}
.store-reply p { margin: 4px 0 0; }

/* ---- forms ---- */
.review-form-box, .stack-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 20px 0 30px;
}
.review-form label, .stack-form label, .reply-form label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 10px; }
.review-form input[type="text"], .review-form textarea,
.stack-form input, .reply-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400;
  background: var(--paper);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute !important; left: -9999px !important; height: 0; width: 0; opacity: 0; }
.star-input { border: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input legend { font-size: .85rem; font-weight: 600; margin-bottom: 4px; float: left; margin-right: 12px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 1.6rem; color: var(--line); cursor: pointer; margin: 0; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--honey); }
.star-input input:focus-visible + label { outline: 2px solid var(--pine); border-radius: 4px; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: .9rem; }
.flash.ok { background: var(--pine-tint); color: var(--pine-deep); }
.flash.err { background: #F9ECEA; color: var(--danger); }
.narrow { max-width: 460px; }
.reply-form { margin-top: 10px; }
.footer-links { font-size: .8rem; }
.footer-links a { color: inherit; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .store-page .store-head { flex-direction: column; }
}

/* ---- admin v2 bits ---- */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.inline-form select, .inline-form input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.check-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.admin-review .review-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---- kaina24-style category blocks ---- */
.cat-blocks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin: 24px 0 10px;
}
.cat-block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.cat-block h2 {
  font-size: .95rem; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px;
}
.cat-block h2 a { color: var(--pine-deep); text-decoration: none; }
.cat-block h2 a:hover { text-decoration: underline; }
.cat-block .cat-count {
  font-size: .72rem; font-weight: 400; color: var(--muted);
  background: var(--paper); border-radius: 99px; padding: 1px 8px;
}
.cat-block ul { list-style: none; margin: 0; padding: 0; }
.cat-block li { margin: 0 0 4px; line-height: 1.3; }
.cat-block li a {
  font-size: .82rem; color: var(--ink); text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-block li a:hover { color: var(--pine); text-decoration: underline; }
.all-products-title { margin: 26px 0 4px; }

/* ---- per-store shipping badge ---- */
.ship-badge {
  display: inline-block; margin-top: 6px;
  font-size: .72rem; font-weight: 600; color: var(--honey);
  background: var(--honey-tint); border-radius: 6px; padding: 3px 8px;
}

/* ---- admin category checkboxes ---- */
.cat-checkboxes { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.cat-checkboxes legend { font-size: .85rem; font-weight: 600; padding: 0 6px; }
.cat-checkboxes .check { display: inline-flex; align-items: center; gap: 6px; margin: 3px 14px 3px 0; font-weight: 400; font-size: .85rem; }

/* ---- v4: brand blocks, qty selector, cleaner product page ---- */
.brand-blocks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; margin: 24px 0 10px;
}
.cat-block li { display: flex; align-items: baseline; gap: 6px; }
.cat-block li a { flex: 1; }
.cat-block .li-count { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.ean-line { font-size: .8rem; color: var(--muted); margin: 2px 0 6px; }
.ean-line .mono { letter-spacing: 1px; }

.qty-select { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.qty-label { font-size: .82rem; font-weight: 600; color: var(--muted); margin-right: 4px; }
.qty-pill {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 14px;
}
.qty-pill:hover { border-color: var(--pine); }
.qty-pill.on { background: var(--pine); border-color: var(--pine); color: #fff; }

.pack-table { min-width: 640px; }
.pack-table .conv { display: block; font-size: .75rem; color: var(--muted); }
.save-chip {
  font-size: .75rem; font-weight: 700; color: var(--pine-deep);
  background: var(--pine-tint); border-radius: 6px; padding: 2px 7px;
}
.pack-table tr[hidden] { display: none; }

/* ---- admin products toolbar, bulk select, modal ---- */
.products-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.filter-input {
  flex: 0 1 320px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff;
}
.new-product { margin-left: auto; position: relative; }
.new-product summary { list-style: none; cursor: pointer; display: inline-block; }
.new-product summary::-webkit-details-marker { display: none; }
.new-product[open] .inline-form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: 0 10px 30px rgba(13,59,49,.15); min-width: 520px;
}
.check-col { width: 34px; text-align: center; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { display: inline; }
tr[hidden] { display: none; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(13,42,36,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: var(--radius); padding: 22px 24px;
  max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* row action buttons: single tidy horizontal line */
.row-actions { flex-wrap: nowrap; align-items: center; }
.row-actions .btn { padding: 5px 10px; font-size: .78rem; white-space: nowrap; }
.admin-table td { vertical-align: middle; }

/* ---- admin product editor v2 ---- */
.narrow-admin { max-width: 640px; }
.new-product-btn { margin-left: auto; }
.image-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.image-preview {
  flex: 0 0 110px; width: 110px; height: 110px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden;
}
.image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-fields { flex: 1; }
.packs-grid { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin-bottom: 12px; }
.packs-grid legend { font-size: .85rem; font-weight: 600; padding: 0 6px; }
.pack-check { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 6px 0 0; font-size: .78rem; }
.pack-check input { margin: 0; }
.link-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 10px 12px; margin-bottom: 10px;
}
.link-card-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.link-card-head .muted { margin-left: auto; font-size: .78rem; }
.link-edit-form { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.link-edit-form input { flex: 1 1 260px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: .82rem; }
.link-edit-form .vm { flex: 0 1 130px; }
.matrix input { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-align: right; }
.matrix input::placeholder { color: var(--muted); }
