/* DogTrail-kauppiasportaali. Palette and type from dogtrail.fi (research/DOGTRAIL-STYLE.md):
   black, white and greys, Manrope. Order tables use 16 px / 400 instead of the site's 18 to 22 px / 300. */
@font-face { font-family: Manrope; src: url(/static/Manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --text: #111111; --muted: #686868; --bg: #ffffff; --soft: #f8f8f8; --cream: #fbfaf3;
  --border: #1212121a; --border-strong: #43454b; --dark: #111111; --dark-2: #2a2a2a;
  --ok: #007518; --amber: #b26b00; --grey: #9a9a9a; --error: #cc1818;
  --radius: 0.25rem; --gutter: clamp(1rem, 4vw, 2.5rem);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* type as on dogtrail.fi (its global styles, read 26.10): body 300 / line-height 1.4, headings 400 / 1.125, menu and
   buttons inherit 300, product titles in lists 300, product page title 600, prices 700, category list 700 / 600 */
body { margin: 0; font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1rem; font-weight: 300;
  line-height: 1.4; color: var(--text); background: var(--bg); letter-spacing: -0.1px;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; }   /* footer stays at the bottom on short pages */
a { color: inherit; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.125; letter-spacing: -0.1px; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); margin: 0.6em 0 0.4em; }
h2 { font-size: 1.35rem; margin: 1.2em 0 0.5em; }
h1 small { font-size: 0.5em; }
.wrap { max-width: 77.5rem; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); } .small { font-size: 0.875rem; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* header */
/* Header stays on screen (search always at hand). --hdr is its measured height, set in base.html. */
:root { --hdr: 4.5rem; }
html { scroll-padding-top: calc(var(--hdr) + 0.5rem); }
.top { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.logo img { display: block; height: 2.375rem; width: auto; }
.top-search { flex: 1 1 16.25rem; display: flex; order: 3; min-width: 0; position: relative; }
.top-search input { flex: 1; min-width: 0; padding: 0.625rem 0.75rem; border: 0; border-radius: var(--radius) 0 0 var(--radius); font: inherit; }
.top-search button { border: 0; background: #363636; color: #fff; padding: 0 1rem; font: inherit; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
@media (min-width: 56.25em) { .top-search { order: 0; max-width: 32.5em; } }
/* main menu: its own row under the search on narrower screens, centred between search and VAT switch on wide ones */
.main-nav { order: 4; flex: 1 1 100%; display: flex; gap: 0.25rem 1.5rem; overflow-x: auto; scrollbar-width: none; }
.main-nav a { color: #ddd; text-decoration: none; font-weight: inherit; white-space: nowrap; padding: 0.25rem 0;
  border-bottom: 2px solid transparent; }
.main-nav a:hover { color: #fff; }
.main-nav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
@media (min-width: 75em) { .main-nav { order: 0; flex: 1 1 auto; justify-content: center; } .top-nav { margin-left: 0; } }
.vat-toggle button { display: inline-flex; border: 1px solid #555; background: transparent; color: #bbb; padding: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.8rem; }
.vat-toggle span { padding: 0.375rem 0.625rem; border-radius: 999px; }
.vat-toggle span.on { background: #fff; color: var(--text); }
.basket-link { text-decoration: none; font-weight: inherit; white-space: nowrap; }
.badge { display: inline-block; min-width: 1.5em; padding: 0 0.375rem; border-radius: 999px; background: #fff; color: var(--text); text-align: center; font-size: 0.8rem; }
.demo-bar { background: var(--cream); border-bottom: 1px solid #e5e0c8; color: #5b5636; text-align: center; padding: 0.5rem var(--gutter); font-size: 0.875rem; }
.warn-bar { background: #fde8e8; color: var(--error); text-align: center; padding: 0.5rem var(--gutter); }

/* buttons, forms */
.btn { display: inline-block; background: var(--dark); color: #fff; border: 0; padding: 0.75rem 1.375rem; font: inherit; font-weight: inherit;
  text-decoration: none; cursor: pointer; border-radius: 0; min-height: 2.75rem; }
.btn:hover { background: color-mix(in srgb, #111 85%, transparent); }
.btn:disabled { opacity: 0.5; }
/* every button is black with white text (Joona 26.10); .btn-ghost is kept as a class name only */
.btn-ghost { background: var(--dark); color: #fff; border: 0; }
.btn-ghost:hover { background: var(--dark-2); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn small { font-weight: 400; opacity: 0.8; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.875rem; padding: 0.25rem; }
input, textarea { font: inherit; padding: 0.625rem 0.75rem; border: 1px solid #c8c8c8; border-radius: var(--radius); background: #fff; width: 100%; }
input[type=number] { width: 5.2em; text-align: center; }
input[type=radio], input[type=checkbox] { width: auto; }
.stack { display: grid; gap: 0.875rem; }
.stack label { display: grid; gap: 0.375rem; font-weight: 600; font-size: 0.9rem; }
.radio { display: flex !important; align-items: center; gap: 0.5rem; font-weight: 400 !important; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.375rem; }
legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.error, .warn, .ok { padding: 0.625rem 0.875rem; border-radius: var(--radius); }
.error { background: #fde8e8; color: var(--error); }
.warn { background: var(--cream); color: #5b5636; border: 1px solid #e5e0c8; }
.ok { background: #e7f4ea; color: var(--ok); }

/* login */
.login { max-width: 23.75rem; margin: 6vh auto; }
.demo-login { margin-top: 0.75rem; }
.demo-login .btn { width: 100%; }

/* home */
.welcome { margin-top: 1em; }
/* store notice from Hallinta, at the very top of the front page: light grey box, text left, its link as a button right */
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  border: 0; padding: 1rem 1.25rem; margin: 1.5rem 0 0; background: var(--soft); }
.notice-text { flex: 1 1 20rem; min-width: 0; }
.notice-text strong { font-size: 1.05rem; }
.notice p { margin: 0.25rem 0 0; }
/* the one exception to black buttons: an outline button, so the top of the page stays calm (Joona 26.10) */
.notice-btn.btn { flex: none; display: inline-flex; align-items: center; background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--dark); }
.notice-btn.btn:hover { background: var(--dark); color: #fff; }
@media (max-width: 37.5em) { .notice-btn { width: 100%; justify-content: center; } }
.section-h { margin-top: 1.4em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr)); gap: 0.75rem; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 6.875rem; padding: 1.125rem; background: var(--soft);
  text-decoration: none; border: 1px solid var(--border); font-size: 1.15rem; }
.tile:hover { background: #f0f0f0; }
.tile small { color: var(--muted); font-size: 0.85rem; }
.tile-all { background: var(--dark); color: #fff; }
.tile-all:hover { background: var(--dark-2); }
.tile-all small { color: #bbb; }
.brands { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.125rem 0; }
.shipping { color: var(--muted); }

/* list */
.crumbs { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }
.crumbs a { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.625rem; align-items: center; margin: 0.5rem 0 1.125rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip { display: inline-block; padding: 0.375rem 0.75rem; border: 1px solid var(--border-strong); border-radius: 999px; text-decoration: none; font-size: 0.875rem; }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.sort { display: flex; gap: 0.75rem; font-size: 0.875rem; }
.sort a { color: var(--muted); }
.sort a.on { color: var(--text); font-weight: 600; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 45em) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1em; } }
@media (min-width: 67.5em) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; border: 1px solid var(--border); background: #fff; }
.card.soldout { opacity: 0.55; }
.card-img { display: block; aspect-ratio: 1 / 1; background: transparent; }
.card-img img, .card-img .noimg { width: 100%; height: 100%; object-fit: contain; display: flex; align-items: center; justify-content: center; }
.noimg { color: var(--grey); font-size: 0.8rem; background: transparent; }
.card-body { padding: 0.625rem 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.375rem; flex: 1; }
.card-name { text-decoration: none; font-weight: inherit; line-height: 1.3; font-size: 0.95rem; }
.card-code { color: var(--muted); font-size: 0.78rem; }
.card-price { margin-top: auto; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.vatnote { display: block; color: var(--muted); font-size: 0.72rem; }
.card .btn { padding: 0.625rem 0.75rem; font-size: 0.9rem; }
.card-add { display: flex; gap: 0.375rem; }
.card-add input { width: 3.6em; padding: 0.5rem 0.25rem; }
.card-add .btn { flex: 1; }
.stock { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8rem; white-space: nowrap; }
.stock i { width: 0.5rem; height: 0.5rem; border-radius: 50%; display: inline-block; }
.stock.in_stock i { background: var(--ok); } .stock.low_stock i { background: var(--amber); } .stock.out_of_stock i { background: var(--grey); }
.stock.out_of_stock { color: var(--muted); }

/* product */
.product { display: grid; gap: 1.5rem; margin-bottom: 2.5rem; }
@media (min-width: 56.25em) { .product { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5em; } }
.product-img { background: transparent; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
.product-img img, .product-img .noimg { max-width: 100%; max-height: 100%; object-fit: contain; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.product-info h1 { margin-top: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0 0 0.875rem; font-size: 0.9rem; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; }
.desc { white-space: pre-line; color: #333; }
.order-form { display: grid; gap: 0.875rem; margin-top: 1.125rem; }
.plain-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 0.875rem; background: var(--soft); }
.qty { display: grid; gap: 0.25rem; font-size: 0.85rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.variants { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.variants th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--border-strong); padding: 0.5rem; white-space: nowrap; }
.variants td { border-bottom: 1px solid var(--border); padding: 0.5rem; vertical-align: middle; }
.variants tr.soldout td { color: var(--muted); }
.variants td.code { font-size: 0.8rem; color: var(--muted); }
.variants .vatnote { display: none; }

/* basket */
.basket { display: grid; gap: 1.5rem; margin-bottom: 5.625rem; }
@media (min-width: 61.25em) { .basket { grid-template-columns: minmax(0, 1fr) 22.5em; align-items: start; margin-bottom: 2.5em; } }
.brow { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; grid-template-areas: "img main main" "img qty total" "img rm rm"; gap: 0.375rem 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border); align-items: center; }
@media (min-width: 40em) { .brow { grid-template-columns: 4em minmax(0, 1fr) auto 7.5em auto; grid-template-areas: "img main qty total rm"; } }
.brow-img { grid-area: img; width: 3.5rem; height: 3.5rem; background: transparent; }
.brow-img img, .brow-img .noimg { width: 100%; height: 100%; object-fit: contain; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; }
.brow-main { grid-area: main; min-width: 0; } .brow-qty { grid-area: qty; } .brow-total { grid-area: total; font-weight: 700; } .brow .link { grid-area: rm; justify-self: start; }
.brow-name { font-weight: 600; text-decoration: none; }
.basket-rows > .btn { margin-top: 0.75rem; }
.summary { background: var(--soft); padding: 1.125rem; }
@media (min-width: 61.25em) { .summary { position: sticky; top: calc(var(--hdr) + 1rem); } }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 0.375rem 1rem; margin: 0 0 0.5rem; }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--border-strong); padding-top: 0.5rem; }
.totals.narrow { max-width: 22.5rem; margin: 1rem 0 1rem auto; }
.sticky-total { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  padding: 0.625rem var(--gutter); background: #fff; border-top: 1px solid var(--border-strong); }
@media (min-width: 61.25em) { .sticky-total { display: none; } }

/* admin */
.panel { background: var(--soft); padding: 1.125rem; margin: 1rem 0; max-width: 45rem; }

/* footer */
.foot { background: var(--dark); color: #ccc; margin-top: 3.75rem; padding: 1.375rem 0; font-size: 0.875rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.625rem; }
.foot a { color: #fff; }
.foot-small { color: #888; font-size: 0.78rem; margin-top: 0.375rem; }
@media (max-width: 37.5em) {
  .variants th.code, .variants td.code { display: none; }
  .variants th, .variants td { padding: 0.5rem 0.25rem; }
  .variants input[type=number] { width: 3.6em; padding: 0.5rem 2px; }
  .variants .stock { font-size: 0.72rem; }
}

/* subgroup tiles (Erply product groups inside a category) */
.subgroups { display: flex; gap: 0.625rem; overflow-x: auto; padding: 2px 2px 0.75rem; margin: 0.25rem 0 0.5rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
@media (min-width: 56.25em) { .subgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); overflow: visible; } }
.sg { flex: 0 0 9rem; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; padding: 0.5rem;
  border: 1px solid var(--border); background: #fff; font-size: 0.9rem; line-height: 1.25; }
.sg:hover { border-color: var(--border-strong); }
.sg.on { border: 2px solid var(--dark); padding: 0.4375rem; }
.sg-img { display: flex; align-items: center; justify-content: center; height: 6.5rem; background: transparent; overflow: hidden; }
.sg-img img { width: 100%; height: 100%; object-fit: contain; }
/* "Kaikki" in the tile layout: black box, text and count centred, no picture */
.sg.sg-allbox { background: var(--dark); color: #fff; border-color: var(--dark); justify-content: center; align-items: center; text-align: center; gap: 0.35rem; }
.sg.sg-allbox .sg-name { font-size: 1.05rem; }
.sg.sg-allbox small { color: #ccc; }
.sg.sg-allbox.on { outline: 2px solid var(--dark); outline-offset: 2px; padding: 0.5rem; border: 1px solid var(--dark); }
.sg-name { font-weight: 600; font-size: 0.9rem; }
.sg small { color: var(--muted); font-size: 0.8rem; }

/* Sidebar layout (default): wide page and a category panel on the left from 64em up;
   below that the same tree opens as a full-screen selector. */
.side { display: none; }
.catsel-open { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 0.75rem; margin: 0 0 1rem;
  padding: 0.85rem 1rem; border: 0; background: var(--dark); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.catsel-open span { color: #bbb; font-size: 0.85rem; }
.catsel-open strong { font-weight: 600; }
.catsel-open::after { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: auto; flex: none; }
.catsel { padding: 0; border: 0; }
.catsel:modal { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; }
.catsel::backdrop { background: rgb(0 0 0 / 0.4); }
.catsel-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: #fff; border-bottom: 1px solid var(--border); }
.catsel-head .btn { min-height: 2.5rem; padding: 0.5rem 1rem; }
.catsel-tree { display: block; padding: 0.75rem 1rem 2rem; font-size: 1rem; }
.catsel-tree a { padding: 0.65rem 0.5rem; }
@media (min-width: 64em) {
  .layout-sivu .wrap { max-width: 112rem; }
  .layout-sivu .lay { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .layout-sivu .side { display: block; position: sticky; top: var(--hdr); max-height: calc(100vh - var(--hdr)); overflow-y: auto; padding: 1.25rem 0 2rem; font-size: 0.92rem; }
  .layout-sivu .grid { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
  .catsel-open, .catsel { display: none; }
}
.side ul { list-style: none; margin: 0; padding: 0; }
.side ul ul { margin: 0.25rem 0 0.5rem 0.75rem; padding-left: 0.75rem; border-left: 1px solid var(--border); }
.side a { display: flex; justify-content: space-between; gap: 0.5rem; text-decoration: none; padding: 0.35rem 0.5rem; border-radius: var(--radius); }
.side a:hover { background: var(--soft); }
.side a.on { background: var(--dark); color: #fff; }
.side a.on small { color: #ccc; }
.side small { color: var(--muted); font-variant-numeric: tabular-nums; }
.side-all, .side-cat { font-weight: 700; }
.side-grp { font-weight: 600; }
.side-all { margin-bottom: 0.25rem; }

/* type-ahead panel under the header search */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 0.375rem); z-index: 30; background: #fff; color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18); max-height: min(70vh, 34rem); overflow-y: auto; }
.sug-h { padding: 0.6rem 0.875rem 0.25rem; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sug-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.875rem; text-decoration: none; }
.sug-row:hover, .sug-row.active { background: var(--soft); }
.sug-cat { justify-content: space-between; font-weight: 600; font-size: 0.92rem; }
.sug-cat em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 0.8rem; margin-left: 0.25rem; }
.sug-cat small, .sug-main small { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.sug-cat small { white-space: nowrap; flex: none; }
.sug-img .noimg { visibility: hidden; }
.sug-img { flex: none; width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; }
.sug-img img, .sug-img .noimg { width: 100%; height: 100%; object-fit: contain; font-size: 0.55rem; text-align: center; }
.sug-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sug-name { font-size: 0.92rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-price { flex: none; font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sug-all { justify-content: center; font-weight: 600; font-size: 0.9rem; border-top: 1px solid var(--border); }
.sug-none { padding: 0.875rem; color: var(--muted); font-size: 0.9rem; }

/* product gallery and zoom */
.gallery { min-width: 0; }
.thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; }
.thumb { flex: none; width: 4.5rem; height: 4.5rem; padding: 0.25rem; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.on { border: 2px solid var(--dark); padding: calc(0.25rem - 1px); }
.zoom { padding: 0; border: 0; background: #fff; }
.zoom:modal { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; }
.zoom::backdrop { background: rgb(0 0 0 / 0.5); }
.zoom-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.zoom-stage img { max-width: 92%; max-height: 92%; object-fit: contain; transition: transform 0.15s ease-out; }
.zoom-stage.on { cursor: zoom-out; }
.zoom-stage.on img { transform: scale(2.5); }
.zoom-close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; background: #fff; min-height: 2.5rem; padding: 0.5rem 1rem; }
.zoom-nav, .cimg { border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.zoom-nav { position: absolute; top: 50%; z-index: 2; width: 3rem; height: 3rem; margin-top: -1.5rem; background: rgb(255 255 255 / 0.9); border: 1px solid var(--border-strong); }
.zoom-nav.prev { left: 0.75rem; } .zoom-nav.next { right: 0.75rem; }
.zoom-nav::before, .cimg::before { content: ""; width: 0.6rem; height: 0.6rem; border-left: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.zoom-nav.prev::before, .cimg.prev::before { transform: rotate(45deg); margin-left: 0.25rem; }
.zoom-nav.next::before, .cimg.next::before { transform: rotate(-135deg); margin-right: 0.25rem; }
.zoom-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 0.85rem; }
/* card picture browsing */
.card-imgwrap { position: relative; }
.cimg { position: absolute; top: 50%; width: 2.25rem; height: 2.25rem; margin-top: -1.125rem; background: rgb(255 255 255 / 0.92); border: 1px solid var(--border); opacity: 0; transition: opacity 0.15s; }
.cimg.prev { left: 0.375rem; } .cimg.next { right: 0.375rem; }
.cimg-count { position: absolute; bottom: 0.375rem; right: 0.5rem; font-size: 0.7rem; color: var(--muted); background: rgb(255 255 255 / 0.85); padding: 0 0.3rem; opacity: 0; transition: opacity 0.15s; }
.card:hover .cimg, .card:hover .cimg-count, .cimg:focus-visible { opacity: 1; }
@media (hover: none) { .cimg, .cimg-count { opacity: 1; } }

/* front-page showcase (new products or a campaign, edited in Hallinta) */
/* one scrollable row: under 2 cards on a phone (the next one peeks in), 3 on a tablet, 5 on a desktop */
.sc-strip { --sc-gap: 0.75rem; --sc-n: 1.75; display: grid; grid-auto-flow: column; gap: var(--sc-gap);
  grid-auto-columns: calc((100% - (var(--sc-n) - 1) * var(--sc-gap)) / var(--sc-n));
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0;
  padding-bottom: 0.75rem; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sc-strip > .card { scroll-snap-align: start; }
@media (min-width: 45em) { .sc-strip { --sc-gap: 1rem; --sc-n: 3.2; } }
@media (min-width: 64em) { .sc-strip { --sc-n: 5; } }
.sc-nav { display: none; }
@media (min-width: 45em) { .sc-nav:not([hidden]) { display: flex; } }
.sc-btn { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--dark); color: #fff;
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 0.15em; }
.sc-btn:hover:not(:disabled) { background: var(--dark-2); }
.sc-btn:disabled { opacity: 0.25; cursor: default; }
.sc-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }

/* Hallinta: hintakatsaus */
.pr-help { max-width: 45rem; }
.pr-lists ul { margin: 0.25rem 0; padding-left: 1.25rem; }
.pr-tools { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.pr-table td.pr-code { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.pr-table tr.pr-low td { background: #f7efd2; }
.pr-table tr.pr-low td:last-child { font-weight: 700; }
@media (max-width: 37.5em) { .pr-table .pr-list { display: none; } }

/* front page: category cards in one flexible row, pictures crossfade slowly */
/* fixed columns (4 on a desktop, 2 on a tablet, 1 on a phone) so the four categories fill the row exactly and a
   brand card is as wide as a category card */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 64em) { .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat { display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--border); background: #fff; }
.cat:hover { border-color: var(--border-strong); }
.cat:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.cat-img { position: relative; display: block; aspect-ratio: 4 / 3; margin: 0.75rem 0.75rem 0; }
.cat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.6s ease; }
.cat-img img.on { opacity: 1; }
.cat-text { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.125rem; padding: 0.75rem 1rem 1rem; }
.cat-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.cat small { color: var(--muted); font-size: 0.85rem; }
@media (prefers-reduced-motion: reduce) { .cat-img img { transition: none; } }
/* phones: one card per row, picture beside the text, so four categories do not fill several screens */
@media (max-width: 37.5em) {
  .cats { grid-template-columns: 1fr; }
  .cat { flex-direction: row; align-items: center; }
  .cat-img { width: 5.5rem; flex: none; aspect-ratio: 1; margin: 0.5rem 0 0.5rem 0.5rem; }
  .cat-text { padding: 0.75rem 1rem; align-items: flex-start; text-align: left; }   /* beside the picture on a phone */
}

/* Osastot: one column per category (4 on a desktop, 2 on a tablet, 1 on a phone), as on the front page */
.dept-intro { max-width: 40rem; }
.depts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 1.5rem; align-items: start; margin-top: 1.5rem; }
@media (min-width: 45em) { .depts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .depts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dept { min-width: 0; }
.dept h2 { font-size: 1.15rem; line-height: 1.25; margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-strong); }
.dept h2 a { text-decoration: none; font-weight: 700; }
.dept h2 a:hover { text-decoration: underline; }
.dept h2 small { display: block; margin-top: 0.125rem; font-weight: 400; font-size: 0.85rem; }
.dept ul { list-style: none; margin: 0; padding: 0; }
.dept li a { display: flex; align-items: center; gap: 0.75rem; padding: 0.375rem 0; text-decoration: none; border-bottom: 1px solid var(--border); }
.dept li a:hover .dept-name { text-decoration: underline; }
.dept-thumb { width: 2.75rem; height: 2.75rem; flex: none; display: grid; place-items: center; }
.dept-thumb img { width: 100%; height: 100%; object-fit: contain; }
.dept-thumb .noimg { font-size: 0.6rem; color: var(--muted); text-align: center; line-height: 1.1; }
.dept-name { flex: 1; min-width: 0; font-weight: 600; }
.dept li small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Hallinta: front-page rows */
.fp-row { border-top: 1px solid var(--border-strong); padding-top: 1rem; margin-top: 1rem; }
.fp-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.fp-row-head strong { flex: 1 1 auto; }
.fp-hidden { color: var(--error); }
.fp-move { display: flex; gap: 0.25rem; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; }
.fp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fp-new { margin-top: 1.25rem; border-top: 1px solid var(--border-strong); padding-top: 1rem; }
.fp-new summary { cursor: pointer; font-weight: 600; margin-bottom: 0.75rem; }

/* front page: every section has the same header (title and optional text left, controls right, a thin rule
   below, no background) and the same spacing */
.fp-sec { margin-top: 2.5rem; }
.fp-sec:first-of-type { margin-top: 1.5rem; }
.fp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.5rem 1rem;
  padding-bottom: 0.625rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-strong); }
.fp-title h2 { margin: 0; font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.65rem); line-height: 1.2; }
.fp-title p { margin: 0.25rem 0 0; color: var(--muted); }
.fp-tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }
/* the arrows are for mouse users: hidden on phones (swipe) and whenever the row does not overflow ([hidden]) */
.fp-tools.sc-nav { display: none; }
@media (min-width: 45em) { .fp-tools.sc-nav:not([hidden]) { display: flex; } }

/* Ohjeet */
.help-intro { max-width: 40rem; }
.help { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.5rem; }
@media (min-width: 45em) { .help { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64em) { .help { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.help h2 { font-size: 1.15rem; margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-strong); }
.help p { margin: 0 0 0.625rem; }

/* product page title: 600, as dogtrail.fi's .product-template-default .wp-block-post-title */
.product-title { font-weight: 600; }

/* Merkit: the brands' own logos (from dogtrail.fi), side by side when a price list has two brands */
.brand-logos { display: flex; align-items: center; justify-content: center; gap: 1rem; aspect-ratio: 4 / 3; margin: 0.75rem 0.75rem 0; }
.brand-logos img { flex: 1 1 0; min-width: 0; max-width: 100%; max-height: 70%; object-fit: contain; }
.brand-logos img:only-child { flex: none; max-width: 70%; }
.brand-noimg { flex: 1 1 0; text-align: center; font-weight: 700; font-size: 1.1rem; color: var(--muted); }
@media (max-width: 37.5em) {
  .brand-logos { width: 5.5rem; flex: none; aspect-ratio: 1; margin: 0.5rem 0 0.5rem 0.5rem; gap: 0.25rem; flex-direction: column; }
  .brand-logos img { max-width: 100%; max-height: 45%; }
  .brand-logos img:only-child { max-width: 100%; max-height: 100%; }
  .brand-noimg { font-size: 0.7rem; }
}

/* Brand cards (Brändit page and the front page's Brändit row): 3 to 5 per row on every screen (--cols from
   service.brand_columns), a flex row that fills the width; the logo stays above the name, also on a phone. */
.brands-flex .cats { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.brands-flex .cat { flex: 1 1 calc((100% - (var(--cols) - 1) * 0.75rem) / var(--cols)); min-width: 0; flex-direction: column; align-items: stretch; }
.brands-flex .cat-text { margin-top: auto; }   /* names line up at the bottom whatever the logos' height */
.brands-flex .brand-logos { flex: none; }
@media (max-width: 37.5em) {
  .brands-flex .cats { gap: 0.5rem; }
  .brands-flex .cat { flex-basis: calc((100% - (var(--cols) - 1) * 0.5rem) / var(--cols)); }
  .brands-flex .brand-logos { width: auto; aspect-ratio: 1; margin: 0.5rem 0.5rem 0; flex-direction: column; }
  .brands-flex .cat-text { align-items: center; text-align: center; padding: 0.5rem 0.375rem 0.75rem; }
  .brands-flex .cat-name { font-size: 0.85rem; }
  .brands-flex .cat small { font-size: 0.72rem; }
}
