/*! aerofitting-v2-wheels.css — wheel lab (#laboratorium), /sabre/ and /en/sabre/.
   Prefix: .av2-lab-. Tokens reused from aerofitting-v2.css (--gold, --brg, --av2-radius, --av2-ease, --nav-height). */

.sb-laboratorium {
  background-color: #080C0A;
  background-image: radial-gradient(circle at 30% 35%, rgba(180, 126, 0, 0.08) 0%, rgba(0, 36, 20, 0.25) 45%, transparent 75%);
  color: #FFFFFF;
}
.sb-laboratorium .av2-lab { margin-top: 56px; padding-top: 48px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sb-laboratorium .av2-lab-title { color: #FFFFFF; }
.sb-laboratorium .av2-lab-lead { color: rgba(255, 255, 255, 0.72); }

.av2-lab { margin-top: 56px; padding-top: 48px; border-top: 1px solid var(--border); }
.av2-lab-head { max-width: 640px; }
.av2-lab-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.av2-lab-title { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--text-primary); margin-bottom: 12px; }
.av2-lab-lead { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }

.av2-lab-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-top: 40px; }

/* --- Stage (sticky wheel + HUD) ---
   .av2-lab-stage-col is the grid item: it stretches to the row's full height
   (matched to the tall steps column) so its child, .av2-lab-stage-sticky,
   has a tall enough containing block to actually stay pinned while the page
   scrolls past. The sticky element's own height stays content-sized. */
.av2-lab-stage-col { position: relative; }
.av2-lab-stage-sticky { position: sticky; top: calc(var(--nav-height) + var(--av2-subnav-height, 48px)); z-index: 40; }

.av2-lab-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

.av2-lab-wheel {
  position: absolute;
  inset: 5%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transform: rotate(var(--av2-lab-rotate, 0deg));
  transform-origin: 50% 50%;
  will-change: transform;
  transition: none;
}
.av2-lab-wheel img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 28px rgba(0,0,0,0.22)); }

/* The photo and measurement ring share one transform; callouts/HUD stay still. */
.av2-lab-ring { position: absolute; inset: -2%; width: 104%; height: 104%; pointer-events: none; }
.av2-lab-ring circle { fill: none; stroke: var(--gold); stroke-width: 0.5; opacity: 0.45; }
.av2-lab-ring circle:first-child { stroke-width: 2.5; stroke-dasharray: 0.6 4.3; opacity: 0.55; }
.av2-lab-ring .av2-lab-ring-marker { stroke: var(--gold-light); stroke-width: 2; stroke-linecap: round; }

.av2-lab-callouts { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.av2-lab-callout { opacity: 0; transition: opacity 400ms var(--av2-ease); }
.av2-lab-callout line { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: var(--callout-len, 56); stroke-dashoffset: var(--callout-len, 56); transition: stroke-dashoffset 700ms var(--av2-ease); }
.av2-lab-callout-dot { fill: var(--gold); stroke: #080C0A; stroke-width: 1.5; }
.av2-lab-callout.is-active { opacity: 1; }
.av2-lab-callout.is-active line { stroke-dashoffset: 0; }

.av2-lab-callout-label {
  position: absolute;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  background: rgba(10, 10, 10, 0.92);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 400ms var(--av2-ease);
  white-space: nowrap;
  pointer-events: none;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 10;
}
.av2-lab-callout-label.is-active { opacity: 1; }
[data-callout-label-for="profil"] { top: 0; left: 50%; transform: translateX(-50%); }
[data-callout-label-for="masa"] { top: 14%; right: -8px; }
[data-callout-label-for="bezwladnosc"] { bottom: 0; left: 50%; transform: translateX(-50%); }
[data-callout-label-for="cda"] { top: 14%; left: -8px; }
[data-callout-label-for="wyscig"] { bottom: 6%; right: -8px; }

.av2-lab-hud { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }
.av2-lab-hud-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.av2-lab-hud-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.6); margin-bottom: 4px; }
.av2-lab-hud-value { display: block; font-size: 18px; font-weight: 700; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.av2-lab-hud-item--highlight {
  grid-column: 1 / -1;
  background: var(--brg);
  border-color: rgba(180, 126, 0, 0.5);
  box-shadow: inset 0 0 20px rgba(180, 126, 0, 0.08);
}
.av2-lab-hud-item--highlight .av2-lab-hud-label { color: rgba(255, 255, 255, 0.75); }
.av2-lab-hud-item--highlight .av2-lab-hud-value { color: var(--gold-light); font-size: 26px; }

.av2-lab-scroll-hint { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); }

/* --- Step Tabs --- */
.av2-lab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 4px;
}
.av2-lab-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s var(--av2-ease), border-color 0.2s var(--av2-ease);
}
.av2-lab-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}
.av2-lab-tab.is-active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}
.av2-lab-tab-num {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}
.av2-lab-tab.is-active .av2-lab-tab-num {
  opacity: 1;
  color: var(--gold);
}

/* --- Steps --- */
.av2-lab-steps { display: flex; flex-direction: column; }
.av2-lab-step {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  scroll-margin-top: calc(var(--nav-height) + var(--av2-subnav-height) + 16px);
}
.av2-lab-step:first-of-type { border-top: none; padding-top: 0; }
.av2-lab-step-number { font-size: 12px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.av2-lab-step-eyebrow { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.55); margin-top: 6px; }
.av2-lab-step-title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -0.01em; color: #FFFFFF; margin: 8px 0 6px; }
.av2-lab-step-kicker { font-size: 14px; font-weight: 700; color: var(--gold-light); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.av2-lab-step-kicker-note { font-size: 13px; color: rgba(255, 255, 255, 0.65); margin: -12px 0 16px; }
.av2-lab-step-body { font-size: 16px; line-height: 1.7; color: rgba(255, 255, 255, 0.82); margin-bottom: 12px; max-width: 60ch; }
.av2-lab-step-note { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.65); margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, 0.15); max-width: 60ch; }

/* --- Mini bar charts (mass / inertia / race kJ) --- */
.av2-lab-bars { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; max-width: 520px; }
.av2-lab-bar-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; }
.av2-lab-bar-label { font-size: 13px; font-weight: 700; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.av2-lab-bar-track { position: relative; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.av2-lab-bar-fill { position: absolute; inset: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 900ms var(--av2-ease); }
/* Once a step's data has been shown it stays drawn; only the entrance animates. */
.av2-lab-step.is-active .av2-lab-bar-fill,
.av2-lab-step.has-shown .av2-lab-bar-fill { width: var(--av2-lab-bar-pct, 0%); }
.av2-lab-bar-row--winner .av2-lab-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }
.av2-lab-bar-value { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Figure (CdA vs yaw) --- */
.av2-lab-figure { margin: 16px 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--av2-radius, 16px); overflow: hidden; background: rgba(0, 0, 0, 0.4); }
.av2-lab-figure img { width: 100%; height: auto; display: block; }
.av2-lab-figure figcaption { padding: 12px 16px; font-size: 12px; color: rgba(255, 255, 255, 0.65); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.av2-lab-link { display: inline-flex; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--gold-light); text-decoration: none; }
.av2-lab-link:hover { text-decoration: underline; color: #FFFFFF; }

/* --- Race hero number --- */
.av2-lab-hero-number { display: flex; align-items: baseline; gap: 14px; margin: 20px 0 8px; padding: 16px 20px; border-radius: var(--av2-radius, 16px); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.av2-lab-hero-number-value { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold-light); }
.av2-lab-hero-number-label { font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, 0.85); max-width: 26ch; }

@media (min-width: 640px) {
  .av2-lab-hud { grid-template-columns: repeat(3, 1fr); }
  .av2-lab-hud-item--highlight { grid-column: auto; }
}

@media (max-width: 1023px) {
  .av2-lab-grid { display: block; }
  .av2-lab-stage-col {
    position: static;
    background: #080C0A;
    padding-block: 12px;
  }
  .av2-lab-stage-sticky {
    position: static;
  }
  .av2-lab-frame {
    max-width: 240px;
    margin-inline: auto;
  }
  .av2-lab-hud-item:not(.av2-lab-hud-item--highlight) {
    display: none;
  }
  .av2-lab-hud {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }
  .av2-lab-scroll-hint {
    display: none;
  }
}

@media (min-width: 1024px) {
  .av2-lab-grid { grid-template-columns: 0.85fr 1.15fr; gap: 64px; }
  .av2-lab-hud { grid-template-columns: repeat(3, 1fr); }
  .av2-lab-hud-item--highlight { grid-column: 1 / -1; }
}

@media (max-width: 639px) {
  .av2-lab-bar-row { grid-template-columns: 52px 1fr auto; gap: 8px; }
  .av2-lab-bar-value { font-size: 12px; }
  .av2-lab-hero-number { flex-direction: column; gap: 4px; }
}


/* --- Reusable line reveal (.av2-draw-line) for wheel description blocks --- */
.av2-draw-line {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--gold);
  opacity: 0.6;
  margin: 14px 0;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms var(--av2-ease);
}
.av2-draw-line.is-visible {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .av2-lab-wheel,
  .av2-lab-ring,
  .sb-product-cutout,
  .sb-product-media > img { transition: none !important; animation: none !important; transform: none !important; }
  .av2-lab-callout,
  .av2-lab-callout line,
  .av2-lab-callout-label,
  .av2-lab-bar-fill,
  .av2-lab-step,
  .av2-draw-line { transition: none !important; }
  .av2-lab-callout line { stroke-dashoffset: 0 !important; }
  .av2-draw-line { transform: none !important; }
}
