/* Page CSS on top of the design kit (public/assets, never edited). The kit's system.css, cards.css,
   motion.css and layout.css carry the tokens, the grid, the type scale, buttons, cards, rows, the
   nav and the footer; this file adds only what the catalogue's own pages and visuals need, in the
   kit's tokens. */

/* ---------- inner pages (catalogue, section, product, contacts, not found): a plain flow under the fixed header */
.page { padding: calc(var(--nav) + var(--s-7)) 0 var(--s-9); min-height: 60vh; }
.page__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-5) var(--s-7); margin-bottom: var(--s-6); }
.page__head > .t-lead { flex-basis: 100%; }
.page__split { row-gap: var(--s-7); }
.page__block { margin-top: var(--s-9); }
.page__block > :is(h2, .section-head) { margin-bottom: var(--s-6); }
.page__count { margin-bottom: var(--s-4); }
.prose { white-space: pre-line; }
@media (max-width: 639px) { .page { padding-top: calc(var(--nav) + var(--s-6)); padding-bottom: var(--s-8); } .page__block { margin-top: var(--s-8); } }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin-bottom: var(--s-5); font-size: var(--t-small); color: var(--muted); }
.crumbs > span { display: inline-flex; align-items: center; gap: var(--s-2); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.crumbs a:hover { text-decoration-color: currentColor; }

/* search: one field and its button on one line */
.search { display: flex; align-items: end; gap: var(--s-3); width: min(100%, 520px); }
.search > .field { flex: 1; }

/* the catalogue's sections as a row of links */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); }
.chips a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-btn); font-weight: 500; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.chips a:hover { background: color-mix(in oklab, var(--bg) 94%, var(--ink)); }
.chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips a[aria-current="page"] .muted { color: inherit; }

/* product cards in a listing: four across, the photograph never larger than its own pixels */
.pgrid > .pcard { grid-column: span 3; }
@media (max-width: 1023px) { .pgrid > .pcard { grid-column: span 6; } }
.pcard { gap: var(--s-2); }
.pcard__media { position: relative; aspect-ratio: 1; margin-bottom: var(--s-2); border-radius: var(--r-md); overflow: clip; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.pcard__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; }
.pcard__media > svg { width: 40%; }
.pcard > .t-card { font-size: var(--t-body); line-height: 1.4; }
.pcard__moq, .pcard__price { font-weight: 500; }
@media (max-width: 639px) { .pcard { padding: var(--s-3); } }

/* a product as an open tile (the home page's line-up): its photograph stands whole inside the tile's frame */
.ptile > .tile__media > img { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; object-fit: contain; }

/* pagination */
.pager { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-7); }
.pager :is(a, span) { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-btn); font-weight: 500; font-variant-numeric: tabular-nums; }
.pager a:hover { background: color-mix(in oklab, var(--bg) 94%, var(--ink)); }
.pager [aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* the product page */
.gal { display: grid; gap: var(--s-4); min-width: 0; }
.gal__main { min-width: 0; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--r-lg); background: var(--surface); color: var(--muted); overflow: clip; }
.gal__main > img { height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.gal__main > svg { width: 30%; }
.gal__thumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.gal__thumbs button { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: clip; background: var(--surface); cursor: pointer; }
.gal__thumbs button[aria-pressed="true"] { border: 2px solid var(--action); }
.gal__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy { display: grid; gap: var(--s-5); padding-block: var(--s-5); border-block: 1px solid var(--line); }
.buy .stats > div { flex-direction: column; justify-content: flex-start; }
.buy .stats dd { font-family: var(--font-display); }

/* the export carton: its dimension drawing beside its figures, the calculator under them */
.carton { --carton-line: var(--ink); --carton-ink: var(--ink); --carton-top: var(--bg); --carton-side: color-mix(in oklab, var(--bg) 88%, var(--ink)); --carton-front: color-mix(in oklab, var(--bg) 78%, var(--ink)); padding: var(--s-6); gap: var(--s-6); }
.carton__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: center; }
.carton__grid > .rows:only-child { grid-column: 1 / -1; }
.carton__box > svg { width: min(100%, 320px); margin-inline: auto; }
.calc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-5) var(--s-7); align-items: end; padding-top: var(--s-6); border-top: 1px solid var(--line); }
.calc > :is(.calc__bar, p) { grid-column: 1 / -1; }
.calc .stats > div { flex-direction: column; justify-content: flex-start; }
.calc__bar { height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 12%, transparent); overflow: clip; }
.calc__bar > i { display: block; height: 100%; background: var(--action); transform-origin: left; transition: transform var(--dur) var(--ease); }
@media (max-width: 767px) { .carton { padding: var(--s-5); } .carton__grid, .calc { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } }

/* the form's own surface (the kit's booking form sits on the alternate ground) */
.formbox { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-7); }
.formbox > h2 { margin-bottom: var(--s-5); }
@media (max-width: 639px) { .formbox { padding: var(--s-5); } }

/* legal pages: plain text set as paragraphs and headings */
.legal { display: grid; gap: var(--s-4); max-width: 72ch; }
.legal h2 { font-size: var(--t-h3); margin-top: var(--s-5); }
.legal p { white-space: pre-line; }

/* where the buyer writes to the supplier: the WeChat code large, the ID to copy, the email button */
.write { display: grid; gap: var(--s-6); align-content: start; }
.write__wechat { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s-6); align-items: center; }
.write__wechat > img { width: 200px; height: 200px; border-radius: var(--r-md); background: #fff; }
.write__wechat > .write__id:only-child { grid-column: 1 / -1; }
.write__id { display: grid; gap: var(--s-2); justify-items: start; }
.write__id > .btn { margin-block: var(--s-2); }
.write__value { overflow-wrap: anywhere; user-select: all; }
.write__sku { font-weight: 500; user-select: all; }
.write__mail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
.write .rows__value { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 639px) { .write__wechat { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the home page's visuals */
/* picture-develops: the section's one photograph, on the split's right column, as the kit's page model sets it */
.develop { margin: 0; border-radius: var(--r-lg); overflow: hidden; height: min(708px, var(--ly-fit)); }
.develop > img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) { .develop { height: auto; aspect-ratio: 4 / 3; margin-top: var(--s-7); } }
/* the same moment across the wrap: the second screen of the carton section */
.develop--wide { height: 100%; }
@media (max-width: 1279px) { .develop--wide { height: auto; aspect-ratio: 16 / 9; margin-top: var(--s-7); } }
/* the split's photograph or contact block runs down to the screen's foot, like the photograph above */
@media (min-width: 1280px) { .frame.tall { height: min(708px, var(--ly-fit)); } .frame.tall::before { display: none; } .write.tall { min-height: min(708px, var(--ly-fit)); } }
.ptile { --tile-ratio: 1; }
.ptile h3 { min-width: 0; overflow-wrap: anywhere; }
/* the goods list: the row on show keeps its link on the right */
#goods .rows > li { cursor: default; }
/* the ordering steps: the number beside its step */
.steps > li { grid-template-columns: 32px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.steps > li > div { display: grid; gap: var(--s-1); }
.menu-card .panel { --p-h: 180px; }
.credits-list { max-width: 760px; }
.credits-list .rows__value { white-space: normal; }
/* the hero's second sentence is cut on a phone, where the first screen holds the photograph, the h1 and both buttons */
@media (max-width: 639px) { .from-tablet { display: none; } }
/* a tablet held upright keeps each split side by side and the three product tiles across, so every section stays one screen */
@media (min-width: 640px) and (max-width: 1023px) {
  #goods > .wrap > .span-5, #write > .wrap > .span-5 { grid-column: span 6; }
  :is(#goods, #write) > .wrap > :is(.frame, .write) { grid-column: span 6; margin-top: 0; }
  /* each visual is sized from the screen (--ly-fit), so the section fills its one screen at 768x1024 and at 820x1180 */
  :is(#goods, #write) > .wrap > .frame { min-height: calc(var(--ly-fit) * 0.64); }
  :is(#goods, #write) > .wrap > .frame::before { display: none; }
  #lineup .ptile { grid-column: span 4; }
  #lineup .ptile > .tile__media { aspect-ratio: auto; height: calc(var(--ly-fit) * 0.64 - 250px); }
}
/* a phone: each split is two screens, its words on the first and its visual filling the second (.g2m);
   the line-up keeps two of its tiles, and the steps set their number above the step */
@media (max-width: 639px) {
  :is(#goods, #write) > .wrap { grid-template-columns: minmax(0, 1fr); }
  :is(#goods, #write) > .wrap > * { grid-column: 1; }
  :is(#goods, #write) > .wrap > .frame { height: 100%; }
  :is(#goods, #write) > .wrap > .frame::before { display: none; }
  #goods .rows > li > p { display: none; }
  #lineup .ptile:nth-of-type(n + 3) { display: none; }
  #lineup .section-head--row > .link { width: 100%; justify-content: space-between; }
  .steps > li { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
}

/* the contact window the main action opens (the owner's request): one surface in the kit's tokens */
.cdialog { width: min(480px, 100% - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--p-bg); color: var(--p-ink); overflow: auto; }
.cdialog::backdrop { background: color-mix(in oklab, var(--p-ink) 60%, transparent); }
.cdialog__in { display: grid; gap: var(--s-5); padding: var(--s-7); }
.cdialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.cdialog__close { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin: -10px -10px -10px 0; border: 1px solid var(--line-strong); border-radius: var(--r-btn); background: transparent; color: inherit; cursor: pointer; }
.cdialog__close:hover { background: color-mix(in oklab, var(--bg) 94%, var(--ink)); }
.cdialog__wechat { display: grid; gap: var(--s-4); justify-items: start; }
.cdialog__wechat > img { width: 240px; height: 240px; padding: var(--s-3); border-radius: var(--r-md); background: #fff; }
.cdialog__row, .cdialog__mail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.cdialog__value { font-weight: 500; overflow-wrap: anywhere; user-select: all; }
.cdialog__value .muted { font-weight: 400; user-select: none; }
.cdialog__others { display: grid; gap: var(--s-2); }
.cdialog__save { display: none; }
html:has(.cdialog[open]) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .cdialog[open] { animation: cdialog-in 220ms var(--ease); }
  .cdialog[open]::backdrop { animation: cdialog-fade 220ms var(--ease); }
}
@keyframes cdialog-in { from { opacity: 0; transform: scale(.96); } }
@keyframes cdialog-fade { from { opacity: 0; } }
/* a phone: a sheet from the foot, as wide as the screen; the code can be saved, since a phone cannot scan its own screen */
@media (max-width: 639px) {
  .cdialog { width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .cdialog__in { padding: var(--s-5) var(--gut) calc(var(--s-6) + env(safe-area-inset-bottom)); }
  .cdialog__wechat { justify-items: center; }
  .cdialog__save { display: inline-flex; }
  .cdialog__mail > .btn { width: 100%; }
  @keyframes cdialog-in { from { opacity: 0; transform: translateY(24px); } }
}
