/* Super Bike SPA: reference CSS for every component.
   Each block goes into the <style> of the Astro component named in its header.
   Only the "Base", "Layout" and "Fallbacks" blocks go to the global stylesheet (src/styles/global.css), after tokens.css.
   HTML that arrives through set:html (Lexical content) gets :global() copies of the blocks it uses, under .sb-prose,
   in the component that renders it (register E6k, docs/design-system/setup.md).
   Values come from tokens.css only; specs and rules: docs/design-system/. */

/* ---------- Base (global.css) ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: var(--weight-heading); margin: 0; text-wrap: balance; }
p, ul, ol, dl, dd, figure { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
.sb-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sb-icon { width: var(--icon); height: var(--icon); flex: none; }
.sb-skip { position: absolute; left: var(--space-4); top: calc(-1 * var(--tap-lg)); z-index: var(--z-cookie); padding: var(--space-3) var(--space-4); background: var(--surface); color: var(--ink); border-radius: var(--radius-md); }
.sb-skip:focus { top: var(--space-2); outline: 2px solid transparent; box-shadow: var(--focus-ring); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---------- Layout (global.css) ---------- */
.sb-container {
  max-width: var(--content-max); margin-inline: auto;
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
}
.sb-section { padding-block: var(--space-7); }
.sb-section--alt { background: var(--surface-alt); }
.sb-section__head { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); max-width: var(--prose-max); }
.sb-section__head h2 { font-size: var(--text-heading); line-height: var(--leading-heading); }
.sb-section__head p { color: var(--ink-muted); }
.sb-prose { max-width: var(--prose-max); }
@media (min-width: 1024px) { .sb-section { padding-block: var(--space-8); } .sb-section__head { margin-bottom: var(--space-6); } }

/* ---------- Traco: Hero.astro only, once per page ---------- */
.sb-traco {
  display: block; width: var(--traco-width); height: var(--traco-height); border: 0; margin: 0;
  background: var(--orange); clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
}

/* ---------- Button and WhatsAppButton (Button.astro, WhatsAppButton.astro) ---------- */
.sb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: var(--space-2) var(--space-5);
  border: 2px solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: var(--weight-heading);
  font-size: var(--text-button); line-height: var(--leading-button); letter-spacing: var(--tracking-button);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color var(--duration-hover) var(--ease-out), border-color var(--duration-hover) var(--ease-out);
}
.sb-btn:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.sb-btn .sb-icon { width: var(--icon-lg); height: var(--icon-lg); }
.sb-btn span { text-wrap: balance; }
.sb-btn--whatsapp { background: var(--orange); color: var(--on-orange); }
.sb-btn--whatsapp:hover, .sb-btn--whatsapp:active { background: var(--orange-hover); }
.sb-btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.sb-btn--secondary:hover { background: var(--surface-alt); }
.sb-btn--solid { background: var(--ink); color: var(--surface); }
.sb-btn--solid:hover { background: var(--solid-hover); }
.sb-btn--on-band { background: transparent; color: var(--on-band); border-color: var(--on-band-muted); }
.sb-btn--on-band:hover { border-color: var(--on-band); }
.sb-btn--lg { min-height: var(--tap-lg); font-size: var(--text-button-lg); padding-inline: var(--space-6); }
.sb-btn--block { display: flex; width: 100%; }
.sb-btn[aria-disabled="true"], .sb-btn:disabled { cursor: not-allowed; background: var(--surface-alt); color: var(--ink-muted); border-color: var(--line); }
@media (max-width: 400px) { .sb-btn--lg { font-size: var(--text-button); padding-inline: var(--space-4); } }
.sb-cta-note { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }

/* Icon-only button (gallery arrows, pagination): always aria-label */
.sb-iconbtn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  border: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color var(--duration-hover) var(--ease-out);
}
.sb-iconbtn:hover { background: var(--surface-alt); }
.sb-iconbtn:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* ---------- Header (Header.astro) ---------- */
.sb-header { background: var(--band); color: var(--on-band); }
.sb-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-2); }
.sb-header__logo { display: block; flex: none; border-radius: var(--radius-full); }
.sb-header__logo img { display: block; width: var(--logo-header); height: var(--logo-header); }
.sb-header__logo:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.sb-nav { min-width: 0; overflow-x: auto; }
.sb-nav ul { display: flex; gap: var(--space-1); list-style: none; padding: 0; }
.sb-nav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: var(--space-3);
  color: var(--on-band); text-decoration: none; font-weight: var(--weight-strong); white-space: nowrap; border-radius: var(--radius-sm);
}
.sb-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.sb-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.sb-nav a:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* ---------- Hero (Hero.astro) ---------- */
.sb-hero { display: grid; gap: var(--space-6); padding-block: var(--space-6) var(--space-7); }
.sb-hero__text { display: grid; gap: var(--space-4); align-content: start; min-width: 0; }
.sb-hero h1 { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
.sb-hero__lead { font-size: var(--text-body-lg); line-height: var(--leading-body-lg); color: var(--ink-muted); max-width: 34em; }
.sb-hero__cta { display: grid; gap: var(--space-2); justify-items: start; margin-top: var(--space-2); }
.sb-hero__photo { display: block; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
@media (max-width: 767px) { .sb-hero__cta .sb-btn { display: flex; width: 100%; } }
@media (min-width: 1024px) {
  .sb-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; padding-block: var(--space-8); }
  .sb-hero h1 { font-size: var(--text-display-xl); line-height: var(--leading-display-xl); letter-spacing: var(--tracking-display-xl); }
}

/* ---------- InterestSelector (InterestSelector.astro) and FilterChips (FilterChips.astro, phase 1) ----------
   Interest chips wrap a real radio input. Filter chips are links, aria-current="true" on the active one,
   so every filter state stays a plain cacheable URL (register E6q). */
.sb-chips { border: 0; margin: 0; padding: 0; min-width: 0; }
.sb-chips legend, .sb-chips__label { padding: 0; margin-bottom: var(--space-3); font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--text-title); line-height: var(--leading-title); }
.sb-chips__list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sb-chips__list--scroll { flex-wrap: nowrap; overflow-x: auto; list-style: none; padding: var(--space-1); margin: calc(-1 * var(--space-1)); }
.sb-chips__list--scroll > li { flex: none; }
.sb-chip {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); padding-inline: var(--space-4);
  border: 2px solid var(--line-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--ink); font-weight: var(--weight-strong); cursor: pointer;
  transition: border-color var(--duration-hover) var(--ease-out), background-color var(--duration-hover) var(--ease-out);
}
.sb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sb-chip .sb-icon { display: none; width: var(--icon-sm); height: var(--icon-sm); color: var(--orange-text); }
.sb-chip:hover { border-color: var(--ink); }
.sb-chip:has(input:checked), .sb-chip[aria-current="true"] { border-color: var(--orange-text); background: var(--orange-soft); }
.sb-chip:has(input:checked) .sb-icon, .sb-chip[aria-current="true"] .sb-icon { display: block; }
.sb-chip:has(input:focus-visible) { box-shadow: var(--focus-ring); }
a.sb-chip { text-decoration: none; white-space: nowrap; }
a.sb-chip:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* ---------- TrustBlock (TrustSignals.astro) ---------- */
.sb-trust { display: grid; gap: var(--space-5); }
.sb-trust h2 { font-size: var(--text-heading); line-height: var(--leading-heading); }
.sb-trust__photos { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-2); }
.sb-trust__photos > * { aspect-ratio: 4 / 3; min-width: 0; }
.sb-trust__photos > :first-child { grid-row: span 2; aspect-ratio: auto; }
.sb-trust__photos img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.sb-trust__info { display: grid; gap: var(--space-5); align-content: start; }
.sb-trust__list { display: grid; gap: var(--space-4); list-style: none; padding: 0; }
.sb-trust__row { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr); gap: var(--space-3); }
.sb-trust__row > .sb-icon { margin-top: 2px; color: var(--ink); }
.sb-trust__row strong { display: block; font-weight: var(--weight-strong); }
.sb-trust__hours { list-style: none; padding: 0; font-variant-numeric: tabular-nums; }
.sb-trust__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.sb-trust__links a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); font-weight: var(--weight-strong); color: var(--link); }
.sb-trust__links a:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.sb-trust__links .sb-icon { width: var(--icon-sm); height: var(--icon-sm); }
@media (min-width: 1024px) {
  .sb-trust { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-8); }
  .sb-trust h2 { grid-column: 1 / -1; }
}

/* ---------- HowItWorks (HowItWorks.astro): numbers only because the order is real ----------
   Two to four steps (phase 1: the Payload howItWorks block, register E6i), one row from 1024 px. */
.sb-steps { list-style: none; padding: 0; display: grid; gap: var(--space-4); counter-reset: passo; }
.sb-steps li { display: grid; grid-template-columns: var(--marker) minmax(0, 1fr); gap: var(--space-3); align-items: start; counter-increment: passo; }
.sb-steps li::before {
  content: counter(passo); display: grid; place-items: center; width: var(--marker); height: var(--marker);
  border: 2px solid var(--ink); border-radius: var(--radius-full);
  font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--text-title); line-height: 1;
}
.sb-steps p { padding-top: var(--space-2); }
@media (min-width: 1024px) { .sb-steps { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-6); } }

/* ---------- Highlight band (CallToAction.astro, the Payload callToAction block from phase 1, register E6j) ----------
   heading is the H2, text the paragraph, one WhatsApp action; at most one per page, never the last block. */
.sb-highlight { background: var(--band); color: var(--on-band); }
.sb-highlight__inner { display: grid; gap: var(--space-4); justify-items: start; padding-block: var(--space-7); }
.sb-highlight h2 { font-size: var(--text-heading); line-height: var(--leading-heading); }
.sb-highlight p { color: var(--on-band-muted); max-width: var(--prose-max); }
.sb-highlight a:not(.sb-btn) { color: var(--on-band); }

/* ---------- StickyWhatsApp (StickyWhatsApp.astro) ---------- */
.sb-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) max(var(--space-4), env(safe-area-inset-right, 0px)) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)) max(var(--space-4), env(safe-area-inset-left, 0px));
  background: var(--surface); box-shadow: var(--shadow-float);
}
.sb-sticky .sb-btn { flex: 1; min-height: var(--tap-lg); }
.sb-sticky__price { display: grid; min-width: 0; font-variant-numeric: tabular-nums; }
.sb-sticky__price span { font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-sticky__price strong { font-family: var(--font-heading); font-size: var(--text-title); line-height: var(--leading-title); white-space: nowrap; }
.sb-has-sticky { padding-bottom: calc(var(--tap-lg) + 2 * var(--space-3) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) { .sb-sticky--landing { display: none; } .sb-has-sticky--landing { padding-bottom: 0; } }
@media (min-width: 1024px) { .sb-sticky--product { display: none; } .sb-has-sticky--product { padding-bottom: 0; } }

/* ---------- Footer (Footer.astro) ---------- */
.sb-footer { background: var(--band); color: var(--on-band); }
.sb-footer__inner { display: grid; gap: var(--space-6); padding-block: var(--space-7) var(--space-6); }
.sb-footer h2 { font-size: var(--text-title); line-height: var(--leading-title); margin-bottom: var(--space-2); }
.sb-footer p, .sb-footer li { color: var(--on-band-muted); }
.sb-footer ul { list-style: none; padding: 0; font-variant-numeric: tabular-nums; }
.sb-footer a { color: var(--on-band); display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); }
.sb-footer a:focus-visible, .sb-footer button:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.sb-footer__legal {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-5);
  padding-top: var(--space-5); border-top: 1px solid var(--line-on-band);
  font-size: var(--text-small); line-height: var(--leading-small); color: var(--on-band-muted);
}
.sb-footer__legal a, .sb-footer__legal button { color: var(--on-band-muted); min-height: var(--tap); }
.sb-footer__legal button { font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 768px) { .sb-footer__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sb-footer__legal { grid-column: 1 / -1; } }

/* ---------- CookieBanner (layout reference; the DOM comes from vanilla-cookieconsent, 'bar inline' at the bottom, themed through #cc-main) ---------- */
.sb-cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-cookie);
  padding-block: var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
}
.sb-cookie__inner { display: grid; gap: var(--space-3); }
.sb-cookie h2 { font-size: var(--text-title); line-height: var(--leading-title); }
.sb-cookie p { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); max-width: var(--prose-max); }
.sb-cookie__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.sb-cookie__actions .sb-btn { flex: 1 1 160px; font-size: var(--text-body); }
.sb-cookie__prefs { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-small); font-weight: var(--weight-strong); color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sb-cookie__prefs:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
html.sb-consent-open .sb-sticky { display: none; }
@media (min-width: 1024px) {
  .sb-cookie__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-6); }
  .sb-cookie__actions .sb-btn { flex: 0 0 auto; }
}

/* ---------- Badge (Badge.astro) ---------- */
.sb-badge {
  display: inline-flex; align-items: center; height: 24px; padding-inline: var(--space-2);
  border-radius: var(--radius-sm); white-space: nowrap;
  font-size: var(--text-caption); line-height: var(--leading-caption); font-weight: var(--weight-strong); letter-spacing: var(--tracking-caption);
  background: var(--surface-alt); color: var(--ink);
}
.sb-badge--nova { background: var(--ink); color: var(--surface); }
.sb-badge--usada { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.sb-badge--estoque { background: var(--success-soft); color: var(--success); }
.sb-badge--indisponivel { background: var(--surface-alt); color: var(--ink-muted); }
.sb-badge--vendida { background: var(--orange-soft); color: var(--orange-text); }
.sb-badge--oferta { background: var(--orange); color: var(--on-orange); }

/* ---------- Price (Price.astro) ---------- */
.sb-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); font-variant-numeric: tabular-nums; }
.sb-price__now { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--text-price); line-height: var(--leading-price); color: var(--ink); white-space: nowrap; }
.sb-price__was { color: var(--ink-muted); text-decoration: line-through; white-space: nowrap; }
.sb-price--card .sb-price__now { font-size: var(--text-title); line-height: var(--leading-title); }
.sb-price--card .sb-price__was { font-size: var(--text-small); line-height: var(--leading-small); }
.sb-sold { font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--text-title); line-height: var(--leading-title); }

/* ---------- ProductCard (ProductCard.astro) and grid ----------
   <article class="sb-card"> holds two sibling links, never nested: .sb-card__link (photo, badges, title, meta, price)
   and the secondary WhatsApp link .sb-card__wa (register E3). */
.sb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); list-style: none; padding: 0; }
@media (min-width: 1024px) { .sb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sb-card { display: grid; grid-template-rows: 1fr auto; gap: var(--space-3); height: 100%; min-width: 0; }
.sb-card__link { display: grid; align-content: start; gap: var(--space-3); min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
.sb-card .sb-card__wa { width: 100%; padding-inline: var(--space-3); font-size: var(--text-body); }
.sb-card__media { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); }
.sb-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-card__body { display: grid; gap: var(--space-1); min-width: 0; }
.sb-card__badges { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.sb-card__title { font-weight: var(--weight-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-card__meta { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.sb-card__link:hover .sb-card__title { text-decoration: underline; text-underline-offset: 3px; }
.sb-card__link:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.sb-card--sold .sb-card__media { opacity: 0.6; }

/* Photo placeholder: no real photo yet, same aspect ratio as the photo it stands for */
.sb-photo {
  display: grid; place-items: center; padding: var(--space-3); width: 100%; height: 100%; min-height: 100%;
  background: var(--surface-alt); color: var(--ink-muted); border-radius: var(--radius-sm);
  font-size: var(--text-caption); line-height: var(--leading-caption); text-align: center;
}

/* ---------- EmptyState (EmptyState.astro): listings and search with no results ---------- */
.sb-empty { display: grid; gap: var(--space-3); justify-items: start; padding-block: var(--space-6); border-top: 1px solid var(--line); }
.sb-empty h2 { font-size: var(--text-title); line-height: var(--leading-title); }
.sb-empty p { color: var(--ink-muted); max-width: var(--prose-max); }

/* ---------- Gallery (ProductGallery.astro): no autoplay, no zoom on hover; markup and behaviour: web-product-page 7.3 ---------- */
.sb-gallery { display: grid; gap: var(--space-2); min-width: 0; }
.sb-gallery__main { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); }
.sb-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-gallery__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sb-gallery__count { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sb-gallery__arrows { display: flex; gap: var(--space-2); }
.sb-gallery__thumbs { display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; list-style: none; padding: var(--space-1); margin: calc(-1 * var(--space-1)); }
.sb-gallery__thumb { flex: none; width: var(--thumb); aspect-ratio: 4 / 3; padding: 0; scroll-snap-align: start; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface-alt); overflow: hidden; cursor: pointer; }
.sb-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-gallery__thumb[aria-current="true"] { border-color: var(--ink); }
.sb-gallery__thumb:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
/* Zoom: the main photo sits in a button that opens the zoom size in a native <dialog> on an opaque backdrop,
   closed by Esc, a tap outside or the sb-iconbtn "Fechar" above the photo; no library.
   The photo's max-height keeps that button on screen. */
.sb-gallery__zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.sb-gallery__zoom:focus-visible { outline: 2px solid transparent; outline-offset: -4px; }
.sb-gallery__main:has(.sb-gallery__zoom:focus-visible) { box-shadow: var(--focus-ring); }
.sb-gallery__dialog { padding: var(--space-3); border: 0; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.sb-gallery__dialog::backdrop { background: var(--band); }
.sb-gallery__dialog .sb-iconbtn { display: grid; margin: 0 0 var(--space-3) auto; }
.sb-gallery__dialog img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - var(--tap) - 2 * var(--space-8)); }

/* ---------- SpecsTable (SpecsTable.astro) ---------- */
.sb-specs { width: 100%; border-collapse: collapse; }
.sb-specs caption { text-align: left; font-family: var(--font-heading); font-weight: var(--weight-heading); font-size: var(--text-title); line-height: var(--leading-title); padding-bottom: var(--space-3); }
.sb-specs tr { border-bottom: 1px solid var(--line); }
.sb-specs tr:first-child { border-top: 1px solid var(--line); }
.sb-specs th {
  width: 40%; padding: var(--space-3) var(--space-4) var(--space-3) 0; text-align: left; vertical-align: top;
  font-size: var(--text-label); line-height: var(--leading-body); font-weight: var(--weight-heading); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-muted);
}
.sb-specs td { padding-block: var(--space-3); }

/* ---------- Breadcrumbs (Breadcrumbs.astro) ---------- */
.sb-crumbs { min-width: 0; overflow: hidden; }
.sb-crumbs ol { list-style: none; padding: 0; display: flex; align-items: center; gap: var(--space-1); min-width: 0; white-space: nowrap; font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.sb-crumbs li { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.sb-crumbs li + li::before { content: "/"; color: var(--line-strong); }
.sb-crumbs a { display: inline-block; padding-block: var(--space-3); color: var(--ink-muted); }
.sb-crumbs [aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.sb-crumbs li:last-child { flex: 1; }

/* ---------- FormField (FormField.astro) ---------- */
.sb-form { display: grid; gap: var(--space-5); max-width: 32rem; }
.sb-field { display: grid; gap: var(--space-1); min-width: 0; }
.sb-field__label { font-weight: var(--weight-strong); }
.sb-field__hint { font-size: var(--text-small); line-height: var(--leading-small); color: var(--ink-muted); }
.sb-input {
  font: inherit; font-size: var(--text-body); width: 100%; min-height: var(--tap); padding-inline: var(--space-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  transition: border-color var(--duration-hover) var(--ease-out);
}
textarea.sb-input { min-height: 120px; padding: var(--space-3); resize: vertical; }
.sb-input:hover { border-color: var(--ink); }
.sb-input:focus-visible { outline: 2px solid transparent; border-color: var(--ink); box-shadow: var(--focus-ring); }
.sb-input[aria-invalid="true"] { border: 2px solid var(--danger); }
.sb-select { position: relative; }
.sb-select select { appearance: none; padding-right: 44px; }
.sb-select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg);
}
.sb-field__error { display: flex; gap: var(--space-1); align-items: flex-start; font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-strong); color: var(--danger); }
.sb-field__error .sb-icon { width: var(--icon-sm); height: var(--icon-sm); margin-top: 1px; }
.sb-form-alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--ink); }
.sb-form-alert strong { color: var(--danger); }
.sb-form-done { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--success-soft); color: var(--ink); }
.sb-form-done strong { color: var(--success); }
.sb-code { font-family: var(--font-mono); font-size: var(--text-small); line-height: var(--leading-small); }

/* ---------- Fallbacks (global.css) ---------- */
@media (forced-colors: active) {
  .sb-traco { background: CanvasText; }
  .sb-chip:has(input:checked), .sb-chip[aria-current="true"] { outline: 2px solid CanvasText; outline-offset: 2px; }
  .sb-badge { border: 1px solid CanvasText; }
}
@media print {
  .sb-sticky, .sb-cookie, .sb-skip { display: none !important; }
  .sb-header, .sb-footer, .sb-highlight { --band: var(--surface); --on-band: var(--ink); --on-band-muted: var(--ink-muted); --line-on-band: var(--line); }
  .sb-has-sticky { padding-bottom: 0; }
}
