/* ==========================================================================
   Rongsense — product centre  (pages/products.py · templates/products*.html)
   Builds on the tokens and components of site.css; classes are prefixed "products-".
   1 cards · 2 tab / filter bar · 3 hub · 4 series page · 5 product detail
   ========================================================================== */

/* 1 ── product cards (core .card markup, see templates/products_macros.html) ── */
.products-card__spec{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* product grids: 4 columns (desktop) · 3 (tablets, 768–1024 px) · 2 (phones) — 12 cards per page = 4 rows.
   The related products of a detail page take the same card size: on tablets 3 of the 4, in one row (QA visual-08) */
@media (min-width:768px) and (max-width:1024px){
  .products-all .cards,.products-list .cards,.products-related .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  .products-related .cards>:nth-child(n+4){display:none}
}
.products-card .card__meta{font-family:var(--font);letter-spacing:var(--ls-label)}
html[lang="en"] .products-card .card__meta{font-size:12px;text-transform:uppercase}
/* two-line names end with more than one character (加州鱿鱼切丝&鱿鱼头拼 / 盘 at 768 px) */
.products-card .card__title{text-wrap:balance}
/* Japanese product names keep the core's phrase breaking (word-break:auto-phrase: before （…）, between phrases).
   Where that leaves one kana alone — a katakana compound wider than its line (フレッシュタコスライ / ス), or とびこ…
   read as と + びこ — products.js marks the name, which then breaks like body text, balanced */
html[lang="ja"] .products-page .is-rebroken{word-break:normal;text-wrap:balance}
/* the detail h1 at the size of the English one, so that 12-character compounds stay on one line on desktops */
html[lang="ja"] .products-detail__title{font-size:clamp(24px,2.2vw,32px)}

/* 2 ── series tab bar (links) and series filter bar (buttons) ───────────────
   phones: one row that scrolls sideways (core behaviour);
   from 768 px: the bar wraps instead, every row keeps its hairline */
@media (min-width:768px){
  .products-tabs{flex-wrap:wrap;overflow:visible;border-bottom:0;
    background:linear-gradient(to bottom,transparent 46px,var(--line) 46px) 0 0/100% 47px repeat-y}
  .products-tabs .filter-bar__btn{line-height:21px}
  .products-tabs .filter-bar__btn:last-child{margin-right:clamp(20px,2.8vw,40px)}   /* (the rows break as before) */
}
/* (the counts at full colour and the 44 px hit area of the one-word "all" tab on touch screens are core rules now:
   site.css §20 .filter-bar__count / .filter-bar__btn:first-child::before) */

/* 3 ── hub ───────────────────────────────────────────────────────────────── */
/* zh: short centred texts (taglines, hero intros, group intros) break only between the phrases the page module
   marks with zero-width spaces (after 、，；与及和的等), never inside a word (印 / 度尼西亚, 炙 / 烤) */
html[lang="zh-CN"] .products-page .mosaic__tagline,html[lang="zh-CN"] .products-page .hero-page__subtitle,
html[lang="zh-CN"] .products-page .hero-page__intro,html[lang="zh-CN"] .products-group .photo-box__box p{word-break:keep-all;overflow-wrap:break-word}
/* short descriptive paragraphs: no single character / word alone on the last line where supported */
.products-page .mosaic__text,.products-page .hero-page__intro,.products-page .photo-box__box p,.products-page .split__content p,
.products-detail__note{text-wrap:pretty}
/* (phones: at least 45vw of hero photo above the box — QA visual-13 — is the core rule of every photo hero now,
   site.css §10, screen only, so the print layout of the hero is not affected) */

/* the pale intro box of the second group: readable eyebrow */
.products-group.photo-box--pale .photo-box__box .eyebrow{color:var(--deep)}

/* without JS every card stays visible: the (inert) filter buttons are not shown */
.no-js .products-all .filter-bar{display:none}

/* series tiles (hub index, "other series"): 4 squares per row on desktop; where the grid drops to 2 columns
   (tablets, large phones) the squares would be ~480 px each — a landscape crop keeps the index compact */
@media (min-width:560px) and (max-width:1024px){
  .products-tiles .tile::before{padding-top:62%}
}

.products-all__count{margin:var(--s-4) 0 0;font-size:14px;line-height:1.4;letter-spacing:var(--ls-label);color:var(--muted)}
.products-all__count b{font-weight:500;color:var(--deep)}

/* the 2026 brochure: the cover is a 520 px scan — shown as an object on a pale field, never as a cover crop */
.products-brochure__actions{align-items:center}
/* the gap sits on the button, so that a wrapped text link lines up with it */
.products-brochure__actions .btn{margin-right:20px}
.products-brochure__media{display:flex;align-items:center;justify-content:center;min-height:0;padding:clamp(40px,6vw,88px) var(--gutter);background:var(--pale)}
.products-brochure__media::before{display:none}
.products-brochure__cover{display:block;width:min(100%,280px);transition:transform .6s var(--ease)}
.products-brochure__cover img{position:static;width:100%;height:auto}
.products-brochure__cover:hover,.products-brochure__cover:focus{transform:translateY(-6px)}
/* last block of the page: up to 1024 px the footer (not only its form card) reaches var(--footer-overlap) into it
   (docs/CORE_REQUESTS.md) — keep the cover clear of that strip */
@media (max-width:1024px){
  main>.products-brochure:last-child .products-brochure__media{padding-bottom:calc(clamp(40px,6vw,88px) + var(--footer-overlap))}
}
@media (max-width:899px){
  .products-brochure__media{padding:40px var(--gutter) 48px}
  .products-brochure__cover{width:min(100%,200px)}
  main>.products-brochure:last-child .products-brochure__media{padding-bottom:calc(48px + var(--footer-overlap))}
}

/* 4 ── series page ───────────────────────────────────────────────────────── */
/* (the series hero has the standard inner-page geometry of the core — QA visual-07, core-design fix round: the
   page's own min-height clamp(460px,64vh,600px) pinned the box under the header) */
/* the tab bar sits close under the hero, as the old site's list did */
.products-list{padding-top:clamp(36px,4.4vw,64px)}

/* 5 ── product detail ────────────────────────────────────────────────────── */
/* full-bleed block: photo on a mist field (58 %) + deep-blue info panel (42 %) */
.products-detail{display:grid;grid-template-columns:58% 42%}
.products-detail__stage{display:flex;align-items:center;justify-content:center;min-width:0;
  padding:clamp(32px,4.4vw,64px) clamp(24px,4vw,56px) clamp(32px,4.4vw,64px) max(var(--gutter),calc(86.207% - 640px));
  background:var(--mist)}
/* photos are never shown larger than their pixel size (inline max-width on the link) */
.products-figure{width:100%}
.products-figure .figure__link,.products-figure__frame{margin:0 auto}   /* (frame: the placeholder, no zoom link) */
.products-detail__panel{display:flex;align-items:center;min-width:0;
  padding:clamp(40px,5.4vw,80px) max(var(--gutter),calc(119.048% - 640px)) clamp(40px,5.4vw,80px) clamp(28px,5vw,72px);
  background:var(--deep);color:var(--on-deep)}
.products-detail__info{width:100%;max-width:520px}
.products-detail__series{margin-bottom:var(--s-3)}
.products-detail__series a{transition:color .2s}
.products-detail__series a:hover,.products-detail__series a:focus{color:#fff;text-decoration:underline;text-underline-offset:5px;text-decoration-thickness:1px}
/* touch screens: the series link is a 44 px tap target like the core's text links and breadcrumbs — padding with
   negative margins, the layout does not move (it was 18–20 px high, QA INT-07); position:relative keeps its lower
   padding above the h1, which starts 12 px under the label */
@media (max-width:1024px){
  .products-detail__series a{position:relative;display:inline-block;padding:13px 0;margin:-13px 0}
}
.products-detail__title{font-size:clamp(26px,2.5vw,36px);color:#fff;overflow-wrap:break-word}
html[lang="en"] .products-detail__title{font-size:clamp(24px,2.2vw,32px);line-height:1.16}
.products-detail__facts{margin-top:clamp(24px,2.8vw,40px)}
.products-detail__facts dd{color:#fff}
.products-detail__facts a{text-decoration:underline;text-decoration-color:var(--line-on-deep);text-underline-offset:5px;text-decoration-thickness:1px;transition:text-decoration-color .2s}
.products-detail__facts a:hover,.products-detail__facts a:focus{text-decoration-color:#fff}
.products-detail__note{margin:var(--s-4) 0 0;font-size:14px;line-height:1.7}
.products-detail__actions{align-items:center;margin-top:clamp(20px,2.4vw,32px)}
.products-detail__actions .btn{margin-right:20px}

/* below the block: body images, previous / next, related products */
.products-more>.container>.pager:first-child{margin-top:0;padding-top:0;border-top:0}
.products-sheets__heading{color:var(--deep)}
.products-sheets__note{margin:var(--s-3) 0 0;font-size:14px}
.products-sheets__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-gap:clamp(20px,2.6vw,36px);max-width:1140px;margin:clamp(28px,3.4vw,44px) auto 0}
.products-sheets__item .figure__link{border:1px solid var(--line)}
.products-related{margin-top:clamp(48px,6vw,88px);padding-top:clamp(48px,6vw,88px);border-top:1px solid var(--line)}

@media (max-width:899px){
  .products-detail{grid-template-columns:minmax(0,1fr)}
  .products-detail__stage{padding:var(--gutter)}
  .products-detail__panel{padding:clamp(40px,8vw,64px) var(--gutter)}
  .products-detail__info{max-width:none}
}
@media (max-width:639px){
  .products-sheets__grid{grid-template-columns:minmax(0,1fr)}
}
