/* The catalogue (phase 4): A4 sheets in the company's tokens (/identity.css), two designs from the approved demo:
   html[data-design="lux"] (dark cover and dividers framed in the second colour) and "classic" (light paper, primary accent).
   Every size inside a sheet is in em of .in, whose font follows the sheet's width (cqw): the same sheet scales on a phone
   and prints at exactly 210 x 297 mm. No colour is written here except the QR code's black on white. */
*, *::before, *::after { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html { -webkit-text-size-adjust: 100%; }
.cat-doc { margin: 0; background: color-mix(in srgb, var(--ink) 9%, var(--bg)); color: var(--ink); font-family: var(--f); line-height: 1.6; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--p-text); outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-btn); text-decoration: none; border: 1px solid transparent; line-height: 1.3; }
.btn-p { color: var(--onp); }
.btn-o { border-color: var(--ln); color: var(--ink); }
.btn:hover { filter: brightness(1.06); }

/* the bar (screen only) */
.bar { position: sticky; top: 0; z-index: 5; background: var(--sf); border-bottom: 1px solid var(--ln); }
.bar-in { max-width: 1240px; margin-inline: auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: .92rem; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.back img { width: 28px; height: 28px; object-fit: contain; border-radius: 0; background: none; }
.seg { display: inline-flex; border: 1px solid var(--ln); border-radius: var(--r-btn); overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--mut); text-decoration: none; }
.seg a[aria-current] { background: var(--p); color: var(--onp); }
.bar .lang { color: var(--mut); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.acts .btn { padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 600; background: transparent; }
.acts .btn-p { background: var(--p); }
.acts .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.toast { position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: 90vw; background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: var(--r-btn); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

/* the sheets */
.desk { display: grid; justify-items: center; gap: 28px; padding: 28px 16px 64px; }
.sheet { width: min(210mm, 100%); aspect-ratio: 210 / 297; container-type: inline-size; position: relative; overflow: hidden;
  background: var(--cat-light); color: var(--cat-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 18px 40px rgb(0 0 0 / .16); }
.sheet.dark { background: var(--cat-dark); color: var(--cat-light); }
.in { position: absolute; inset: 0; font-size: 1.75cqw; line-height: 1.5; font-family: var(--f); padding: 3.4em 3.2em 2.4em;
  display: flex; flex-direction: column; gap: 1.1em; }
.sheet h1, .sheet h2 { margin: 0; font-weight: 600; line-height: 1.15; text-wrap: balance; }
.sheet p { margin: 0; }
.sheet a { color: inherit; text-decoration: none; }
.sheet .pic { display: block; width: 100%; flex: none; object-fit: cover; min-height: 0; border-radius: var(--r); background: color-mix(in srgb, currentColor 10%, transparent); }
.num { font-variant-numeric: tabular-nums; }

/* lux: a thin frame in the second colour on every sheet, square pictures framed the same way */
[data-design="lux"] .in::before { content: ""; position: absolute; inset: 1.4em; border: 1px solid var(--s); pointer-events: none; }
[data-design="lux"] .sheet .pic { border-radius: 0; border: 1px solid var(--s); }

/* the logo and the small words */
.brand { display: inline-flex; align-items: center; gap: .6em; font-weight: 700; }
.brand .mark { display: inline-flex; }
.sheet .mark img, .mini .mark img { display: block; width: auto; height: 2.2em; object-fit: contain; border-radius: 0; background: none; }
.mark.tile { background: var(--cat-light); padding: .3em; border-radius: .35em; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding-bottom: .8em; border-bottom: 1px solid color-mix(in srgb, currentColor 16%, transparent); }
.tag { font-size: .78em; letter-spacing: .08em; font-weight: 600; color: var(--cat-accent); }
.dark .tag { color: var(--s); }
html[lang="en"] .tag { text-transform: uppercase; }
.foot { margin-top: auto; display: flex; align-items: center; gap: 1em; font-size: .8em; color: color-mix(in srgb, currentColor 72%, transparent); }
.pg-no { margin-inline-start: auto; font-weight: 600; font-size: 1.15em; color: var(--cat-ink); }
.dark .pg-no { color: var(--cat-light); }

/* QR codes: black on white whatever the sheet, so every phone reads them */
.qr { display: block; flex: none; }
.qr .qr-bg { fill: #fff; }
.qr .qr-fg { fill: #111; }
.qr-link { display: flex; align-items: center; gap: .9em; }
.qr-link .qr { width: 5.6em; height: 5.6em; }
.qrs { display: flex; flex-wrap: wrap; gap: 2.6em; margin-top: auto; }
.qr-tile { display: grid; gap: .5em; justify-items: center; font-size: .85em; font-weight: 600; }
.qr-tile .qr { width: 11em; height: 11em; }

/* the cover */
.cover .in { gap: 2em; }
.cover h1 { font-size: 3.5em; }
[data-design="lux"] .cover .in { padding: 4.4em 4em 3.4em; }
[data-design="lux"] .cover h1 { margin-top: auto; }
[data-design="lux"] .cover h1 i { display: block; font-style: normal; font-weight: 400; color: var(--s); font-size: .34em; margin-top: .7em; letter-spacing: .04em; }
.cover .pic { aspect-ratio: 4 / 3; }
.cover .foot { justify-content: space-between; letter-spacing: .06em; }
.cover .sub { color: var(--cat-accent); font-size: 1.25em; margin-top: -1em; }
[data-design="classic"] .cover h1 { margin-top: 1.4em; }
.foot.strip { background: var(--p); color: var(--onp); font-size: .85em; margin: 0 calc(-3.2em / .85) calc(-2.4em / .85); padding: 1.4em calc(3.2em / .85); }

/* about */
.about h2 { font-size: 2.3em; }
.about .pic { flex: 1 1 0; }
.about .text { display: grid; gap: .8em; font-size: 1.05em; }
.stats { display: flex; flex-wrap: wrap; gap: 2.2em; }
.stats div { display: grid; }
.stats b { font-size: 2.2em; line-height: 1.1; font-weight: 600; color: var(--cat-accent); }
.stats span { font-size: .85em; opacity: .75; }

/* a category's divider */
.divider h2 { font-size: 3.2em; }
.divider .title { display: grid; gap: .6em; }
.divider .title p { max-width: 46ch; opacity: .85; }
.divider .count { font-size: .9em; opacity: .75; }
.divider .pic { flex: 1 1 0; max-height: 58%; }
[data-design="lux"] .divider .in { padding: 4.4em 4em 3.4em; }
[data-design="lux"] .divider .title { margin-block: auto 1em; }
[data-design="classic"] .divider .title { background: var(--p); color: var(--onp); margin-inline: -3.2em; padding: 3em 3.2em; }
[data-design="classic"] .divider .title .tag { color: var(--onp); opacity: .8; }

/* one product */
.product .pic { flex: 1 1 0; }
.product h2 { font-size: 2.05em; }
.specs { margin: 0; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: .45em 1.2em; font-size: .95em; }
.specs dt { opacity: .62; }
.specs dd { margin: 0; }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em 1em; font-size: .9em; }
.feats li { display: flex; align-items: center; gap: .6em; }
.feats svg { width: 1.9em; height: 1.9em; flex: none; color: var(--cat-accent); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; opacity: .88; }

/* the grid: categories flow one after another, rows of two that share the sheet's height (at most a third each), so a
   sheet is full whatever it holds; lib/catalogue.js puts at most three rows on a sheet */
.flow { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 1.4em; }
.flow h3 { flex: none; margin: 0; font-size: 1.5em; font-weight: 600; line-height: 1.2; padding-top: .3em; }
.row { flex: 1 1 0; min-height: 0; max-height: 33%; display: grid; grid-template-columns: 1fr 1fr; gap: 1.4em; }
.card { display: flex; flex-direction: column; gap: .35em; min-height: 0; }
.card .pic { flex: 1 1 0; }
.card b { font-size: 1.05em; font-weight: 600; line-height: 1.3; }
.card span { font-size: .82em; opacity: .7; }

/* contact */
.contact h2 { font-size: 3em; margin-top: auto; }
[data-design="lux"] .contact .in { padding: 4.4em 4em 3.4em; }
.lines { margin: 0; display: grid; gap: 1em; }
.lines dt { font-size: .8em; opacity: .7; }
.lines dd { margin: 0; font-size: 1.35em; font-weight: 600; }
.lines a { direction: ltr; unicode-bidi: isolate; }
.empty .note { margin-block: auto; text-align: center; font-size: 1.3em; opacity: .75; }

/* print: only the sheets, one per A4 page, nothing around them */
@page { size: A4; margin: 0; }
@media print {
  .bar, .toast { display: none !important; }
  html, body.cat-doc { background: none; }
  .desk { display: block; padding: 0; }
  .sheet { width: 210mm; height: 297mm; aspect-ratio: auto; box-shadow: none; break-after: page; }
  .sheet:last-child { break-after: auto; }
}
@media (max-width: 560px) {
  .bar-in { gap: 8px 10px; }
  .acts { margin-inline-start: 0; }
  .desk { gap: 16px; padding: 16px 8px 48px; }
}
