
/* Excel Mix components — plain CSS, class prefix xm-. Every value comes from tokens.css. Light-only. */

.xm-root, .xm-root * { box-sizing: border-box; }
.xm-root { font-family: var(--font-sans); font-size: 18px; line-height: 28px; color: var(--ink); background: var(--surface); }

/* ---------- Product line context: put one on any element, children read --xm-cat* ---------- */
.xm-line--adhesives { --xm-cat: var(--cat-adhesives); --xm-on-cat: var(--on-cat-adhesives); --xm-cat-tint: var(--cat-adhesives-tint); --xm-cat-text: var(--cat-adhesives-text); }
.xm-line--levelling { --xm-cat: var(--cat-levelling); --xm-on-cat: var(--on-cat-levelling); --xm-cat-tint: var(--cat-levelling-tint); --xm-cat-text: var(--cat-levelling-text); }
.xm-line--etics     { --xm-cat: var(--cat-etics);     --xm-on-cat: var(--on-cat-etics);     --xm-cat-tint: var(--cat-etics-tint);     --xm-cat-text: var(--cat-etics-text); }
.xm-line--grouts    { --xm-cat: var(--cat-grouts);    --xm-on-cat: var(--on-cat-grouts);    --xm-cat-tint: var(--cat-grouts-tint);    --xm-cat-text: var(--cat-grouts-text); }
.xm-line--mortars   { --xm-cat: var(--cat-mortars);   --xm-on-cat: var(--on-cat-mortars);   --xm-cat-tint: var(--cat-mortars-tint);   --xm-cat-text: var(--cat-mortars-text); }
.xm-line--special   { --xm-cat: var(--cat-special);   --xm-on-cat: var(--on-cat-special);   --xm-cat-tint: var(--cat-special-tint);   --xm-cat-text: var(--cat-special-text); }
.xm-line--gypsum    { --xm-cat: var(--cat-gypsum);    --xm-on-cat: var(--on-cat-gypsum);    --xm-cat-tint: var(--cat-gypsum-tint);    --xm-cat-text: var(--cat-gypsum-text); }
.xm-line--brand     { --xm-cat: var(--brand);         --xm-on-cat: var(--on-brand);         --xm-cat-tint: var(--brand-tint);         --xm-cat-text: var(--brand-text); }

/* ---------- Button ---------- */
.xm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: var(--space-3) var(--space-8);
  font-family: var(--font-display); font-size: 19px; line-height: 22px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  border: var(--border-control) solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color .12s, color .12s, border-color .12s;
}
.xm-btn:focus-visible { outline: var(--border-control) solid var(--focus-ring); outline-offset: 2px; }
.xm-btn--primary { background: var(--brand); color: var(--on-brand); }
.xm-btn--primary:hover { background: var(--brand-hover); }
.xm-btn--secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--rule-strong); }
.xm-btn--secondary:hover { background: var(--ink); color: var(--surface); }
.xm-btn--steel { background: transparent; color: var(--ink-on-steel); border-color: var(--ink-on-steel); }
.xm-btn--steel:hover { background: var(--ink-on-steel); color: var(--surface-steel); }
.xm-btn--link {
  min-height: 0; padding: 0 0 var(--space-1); background: none; color: var(--ink);
  border: 0; border-bottom: 3px solid var(--brand); border-radius: 0;
}
.xm-btn--link { overflow: visible; }
/* Arrow: the system's own SVG (24 × 24 viewBox, 2.25 stroke, mitred tip). Never the text glyph →, which sits off-centre. */
.xm-btn__arrow, .arr { display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -0.14em; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: butt; stroke-linejoin: miter; transition: transform .25s ease-out; }
.xm-btn--link:hover .xm-btn__arrow { transform: translateX(6px); }
.xm-btn--sm { min-height: var(--control-height-sm); padding: var(--space-2) var(--space-4); font-size: 16px; line-height: 20px; }
.xm-btn[disabled], .xm-btn[aria-disabled="true"] {
  background: var(--surface-sunken); color: var(--ink-disabled); border-color: transparent; cursor: not-allowed;
}
.xm-btn__arrow { font-family: var(--font-sans); font-weight: 600; }

/* ---------- Eyebrow + SectionHeader ---------- */
.xm-eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-sans); font-size: 14px; line-height: 18px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text);
}
.xm-eyebrow::before { content: ""; width: 32px; height: 4px; background: var(--brand); }
.xm-section-head { border-top: var(--border-heavy) solid var(--rule-strong); padding-top: var(--space-6); }
.xm-section-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.xm-section-head__title {
  margin: var(--space-3) 0 0; font-family: var(--font-display); font-weight: 700;
  font-size: 42px; line-height: 46px; text-transform: uppercase; color: var(--ink);
}
.xm-section-head__lead { margin: var(--space-3) 0 0; max-width: 60ch; font-size: 20px; line-height: 30px; color: var(--ink-muted); }

/* ---------- LineChip (line tag) ---------- */
.xm-chip {
  display: inline-flex; align-items: center; padding: var(--space-1) var(--space-3);
  background: var(--xm-cat, var(--ink)); color: var(--xm-on-cat, var(--surface)); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
a.xm-chip:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--xm-on-cat, var(--surface)); }

/* ---------- Badge ---------- */
.xm-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.xm-badge--new { background: var(--brand); color: var(--on-brand); }
.xm-badge--warning { background: var(--status-warning); color: var(--ink-on-warning); }
.xm-badge--success, .xm-badge--danger, .xm-badge--info { padding-left: 0; padding-right: 0; }
.xm-badge--success { color: var(--status-success); }
.xm-badge--danger { color: var(--status-danger); }
.xm-badge--info { color: var(--status-info); }
.xm-badge--success::before, .xm-badge--danger::before, .xm-badge--info::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor;
}

/* ---------- CategoryTile: the full-colour product-line entry ---------- */
.xm-cat {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6);
  min-height: var(--tile-min-height); padding: var(--space-8);
  background: var(--xm-cat, var(--brand)); color: var(--xm-on-cat, var(--on-brand));
  text-decoration: none; overflow: hidden;
}
.xm-cat__title {
  margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 32px; font-weight: 700;
  text-transform: uppercase; hyphens: auto; overflow-wrap: break-word; max-width: 14ch;
}
.xm-cat__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.xm-cat__count { font-family: var(--font-mono); font-size: 16px; line-height: 24px; font-weight: 500; }
.xm-cat__arrow {
  display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  background: var(--surface-raised); color: var(--ink); font-size: 22px; font-weight: 600;
  transition: transform .15s;
}
.xm-cat:hover .xm-cat__arrow { transform: translateX(6px); }
.xm-cat:focus-visible { outline: var(--border-control) solid var(--focus-ring); outline-offset: 3px; }
.xm-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }

/* ---------- CategoryBanner: top of a category page ---------- */
.xm-banner { background: var(--xm-cat, var(--brand)); color: var(--xm-on-cat, var(--on-brand)); padding: var(--space-12) var(--space-8); }
.xm-banner__crumbs { font-size: 14px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.xm-banner__crumbs a { color: inherit; }
.xm-banner__title { margin: var(--space-4) 0 0; font-family: var(--font-display); font-size: 76px; line-height: .95; font-weight: 700; text-transform: uppercase; max-width: 16ch; }
.xm-banner__lead { margin: var(--space-4) 0 0; max-width: 56ch; font-size: 22px; line-height: 32px; }
.xm-banner__meta { margin-top: var(--space-6); font-family: var(--font-mono); font-size: 16px; line-height: 24px; font-weight: 500; }

/* ---------- ProductCard ---------- */
.xm-product {
  display: flex; flex-direction: column; background: var(--surface-raised); color: var(--ink);
  border-top: var(--border-line) solid var(--xm-cat, var(--ink)); text-decoration: none;
}
.xm-product__media {
  position: relative; aspect-ratio: 1 / 1; background: var(--xm-cat-tint, var(--surface-sunken));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.xm-product__media img { width: 78%; height: 86%; object-fit: contain; transition: transform .2s; }
.xm-product__placeholder { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); color: var(--xm-cat-text, var(--ink-muted)); font-family: var(--font-mono); font-size: 14px; line-height: 20px; }
.xm-product__placeholder::before { content: ""; width: 96px; height: 128px; border: 3px solid currentColor; border-radius: var(--radius-sm); }
.xm-product__badges { position: absolute; top: var(--space-4); right: var(--space-4); display: flex; gap: var(--space-2); }
.xm-product__chip { position: absolute; top: var(--space-4); left: var(--space-4); }
.xm-product__body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); flex: 1; }
.xm-product__name { margin: 0; font-size: 24px; line-height: 28px; font-weight: 700; }
.xm-product__desc { margin: 0; font-size: 16px; line-height: 24px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xm-product__specs {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 500;
}
.xm-product__specs li { padding: 2px var(--space-2); background: var(--surface-sunken); }
.xm-product__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: auto; padding-top: var(--space-3); }
.xm-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-6); }

/* ---------- SpecTable ---------- */
.xm-spec { width: 100%; border-collapse: collapse; border-top: var(--border-heavy) solid var(--rule-strong); background: var(--surface-raised); }
.xm-spec caption {
  caption-side: top; text-align: left; padding-bottom: var(--space-3);
  font-family: var(--font-display); font-size: 30px; line-height: 32px; font-weight: 700; text-transform: uppercase; color: var(--ink);
}
.xm-spec th, .xm-spec td { padding: var(--space-3) var(--space-4); border-bottom: var(--border-hair) solid var(--rule); vertical-align: baseline; }
.xm-spec th { text-align: left; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink-muted); }
.xm-spec td { text-align: right; font-family: var(--font-mono); font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.xm-spec thead th { background: var(--xm-cat-tint, var(--surface-sunken)); font-size: 14px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.xm-spec thead th:last-child { text-align: right; }

/* ---------- Input + SearchBar ---------- */
.xm-field { display: flex; flex-direction: column; gap: var(--space-2); }
.xm-field__label { font-size: 14px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.xm-field__hint { font-size: 16px; line-height: 24px; color: var(--ink-muted); }
.xm-field__error { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--status-danger); }
.xm-input {
  width: 100%; min-height: var(--control-height); padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans); font-size: 18px; line-height: 24px; color: var(--ink);
  background: var(--surface-raised); border: var(--border-control) solid var(--control-border); border-radius: var(--radius-sm);
}
.xm-input::placeholder { color: var(--ink-muted); }
.xm-input:hover { border-color: var(--ink-muted); }
.xm-input:focus { outline: var(--border-control) solid var(--focus-ring); outline-offset: 2px; border-color: var(--rule-strong); }
.xm-input[aria-invalid="true"] { border-color: var(--status-danger); }
.xm-search { display: flex; }
.xm-search .xm-input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.xm-search .xm-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ---------- Dropdown (sort, select) ---------- */
.xm-dd { position: relative; display: inline-block; }
.xm-dd__btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 var(--space-4); border: var(--border-control) solid var(--ink); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 22px; font-weight: 700; cursor: pointer; }
/* label + value on one shared baseline; as separate flex items the small label sat 2.5px high */
.xm-dd__txt { display: inline-flex; align-items: baseline; gap: 8px; line-height: 1; position: relative; top: -1px; }
.xm-dd__btn small { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.xm-dd__btn svg { width: 18px; height: 18px; transition: transform .25s ease-out; }
.xm-dd__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.xm-dd__btn:focus-visible { outline: var(--border-control) solid var(--focus-ring); outline-offset: 2px; }
.xm-dd__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 100%; width: max-content; margin: 0; padding: 6px 0; list-style: none; background: var(--surface-raised); border: var(--border-control) solid var(--ink); box-shadow: var(--shadow-pop); }
.xm-dd__opt { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding: 12px var(--space-4); background: none; border: 0; font: inherit; font-size: 17px; line-height: 22px; color: var(--ink); text-align: left; cursor: pointer; }
.xm-dd__opt:hover { background: var(--surface); }
.xm-dd__opt[aria-selected="true"] { font-weight: 700; }
.xm-dd__opt svg { width: 18px; height: 18px; }

/* ---------- RangeStepper: +/− stacked left of a large value, next to a range input ---------- */
.xm-readout { display: flex; align-items: center; gap: 20px; }
.xm-readout__value { font-family: var(--font-display); font-weight: 700; font-size: 104px; line-height: .85; }
.xm-readout__value small { font-size: 36px; }
/* translateY centres the pair optically on the 104px digits (Barlow figures sit low in a .85 line box) */
.xm-stepper { display: flex; flex-direction: column; gap: 0; flex: none; transform: translateY(10px); }
.xm-stepper__btn { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.xm-stepper__btn:focus-visible { outline: var(--border-control) solid var(--focus-ring); outline-offset: 0; }
.xm-stepper__btn[disabled] { opacity: .3; cursor: default; }
.xm-stepper__btn svg { width: 40px; height: 40px; }
.xm-range { width: 100%; height: 32px; accent-color: var(--ink); cursor: pointer; }

/* ---------- Rail: horizontal list moved one card per step, with arrows, a thumb bar and a count ---------- */
.xm-rail { --rail-per: 3; --rail-gap: 16px; }
.xm-rail--4 { --rail-per: 4; }
.xm-rail--5 { --rail-per: 5; --rail-gap: 12px; }
.xm-rail--6 { --rail-per: 6; --rail-gap: 12px; }
.xm-rail__view { overflow: hidden; }
.xm-rail__track { display: flex; gap: var(--rail-gap); transition: transform .6s var(--ease-out); }
.xm-rail__track > * { flex: 0 0 calc((100% - (var(--rail-per) - 1) * var(--rail-gap)) / var(--rail-per)); min-width: 0; }
.xm-rail__ui { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.xm-rail__btn { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; padding: 0; border: var(--border-control) solid var(--ink); border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--ink); cursor: pointer; transition: background-color .2s, color .2s; }
.xm-rail__btn:hover { background: var(--ink); color: var(--surface-raised); }
.xm-rail__btn:focus-visible { outline: var(--border-control) solid var(--focus-ring); outline-offset: 2px; }
.xm-rail__btn[disabled] { opacity: .35; cursor: default; background: var(--surface-raised); color: var(--ink); }
.xm-rail__btn svg { width: 22px; height: 22px; }
.xm-rail__bar { position: relative; flex: 1; height: 4px; margin: 0 var(--space-4); background: var(--rule); }
.xm-rail__thumb { position: absolute; top: -2px; height: 8px; background: var(--ink); transition: left .6s var(--ease-out), width .3s var(--ease-out); }
.xm-rail__count { min-width: 72px; font-family: var(--font-mono); font-size: 16px; line-height: 20px; text-align: right; }
.xm-rail--steel .xm-rail__btn { border-color: var(--ink-on-steel); background: transparent; color: var(--ink-on-steel); }
.xm-rail--steel .xm-rail__btn:hover { background: var(--ink-on-steel); color: var(--surface-steel); }
.xm-rail--steel .xm-rail__bar { background: #4a4945; }
.xm-rail--steel .xm-rail__thumb { background: var(--ink-on-steel); }

/* ---------- RichText: the only place long-form copy is styled ---------- */
.xm-rt { font-size: 19px; line-height: 30px; }
.xm-rt > * { margin: 0; }
.xm-rt > * + * { margin-top: var(--space-4); }
.xm-rt h2 { font-family: var(--font-display); font-weight: 700; font-size: 56px; line-height: .95; text-transform: uppercase; }
.xm-rt h3 { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 32px; text-transform: uppercase; }
.xm-rt * + h3 { margin-top: var(--space-8); }
.xm-rt .lead { font-size: 22px; line-height: 33px; font-weight: 500; }
.xm-rt ul, .xm-rt ol { padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.xm-rt li { position: relative; padding: 10px 0 10px 32px; border-bottom: 1px solid var(--rule); }
.xm-rt ul li::before { content: ""; position: absolute; left: 0; top: 21px; width: 12px; height: 12px; background: var(--brand); }
.xm-rt ol { counter-reset: xmrt; }
.xm-rt ol li::before { counter-increment: xmrt; content: counter(xmrt, decimal-leading-zero); position: absolute; left: 0; font-family: var(--font-mono); font-size: 15px; color: var(--brand-text); }
.xm-rt a:not(.xm-btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.xm-rt blockquote { padding-left: var(--space-6); border-left: 6px solid var(--brand); font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 34px; text-transform: uppercase; }
.xm-rt--cols { columns: 2; column-gap: var(--space-12); }
.xm-rt--cols > * { break-inside: avoid; }

/* ---------- MediaText: image on one side, RichText on the other; --rev puts the image right ---------- */
.xm-mt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); align-items: center; }
.xm-mt__media { margin: 0; position: relative; overflow: hidden; background: var(--surface-sunken); }
.xm-mt__media img { display: block; width: 100%; height: 560px; object-fit: cover; }
.xm-mt__media figcaption { position: absolute; left: 0; bottom: 0; padding: 8px 14px; background: var(--surface-steel); color: var(--ink-on-steel); font-size: 14px; line-height: 20px; }
.xm-mt--rev .xm-mt__media { order: 2; }
.xm-mt__copy { max-width: 60ch; }
@media (max-width: 760px) {
  .xm-mt { grid-template-columns: 1fr; gap: var(--space-6); }
  .xm-mt--rev .xm-mt__media { order: 0; }
  .xm-mt__media img { height: 320px; }
  .xm-rt--cols { columns: 1; }
  .xm-readout__value { font-size: 80px; }
}
