/* /laboratorio (DEV-2887; home-a: station menu; embed slice: live screens; round 3: guided tour, carousel live overlay,
   WhatsApp CTA card). Tokens --a-* only, no literal colors: the stage, the labels, the panel and the
   carousel follow the site theme (light and .dark); only the 3D picture itself (poster, canvas, stills) is fixed. */
.lab { padding: 48px 0 56px; }
.lab .a-h1 { font-size: 46px; }
.lab .a-sub { max-width: 40em; }
.lab-wrap { margin-top: 28px; }
.lab-fine { font-size: 14px; color: var(--a-ink-2); margin-top: 10px; }

.lab-stage {
  position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--a-line-2);
  background: var(--a-l0); box-shadow: var(--a-shadow-lg);
  aspect-ratio: 16 / 9; max-height: 78vh; width: 100%;
}
.lab-poster, .lab-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.lab-canvas { touch-action: pan-y; cursor: grab; }
.lab-canvas:active { cursor: grabbing; }
.lab-stage[data-state="loading"] .lab-poster { filter: saturate(0.6) blur(2px); }
.lab-stage[data-state="ready"] .lab-poster, .lab-stage[data-state="focus"] .lab-poster { display: none; }

.lab-start, .lab-progress, .lab-error {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 24px; text-align: center;
}
.lab-progress, .lab-error { background: var(--a-veil); }
.lab-start-in {
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 24em; padding: 20px 22px;
  border-radius: 16px; background: var(--a-surface); border: 1px solid var(--a-line-2); box-shadow: var(--a-shadow-pop);
}
.lab-start[hidden], .lab-progress[hidden], .lab-error[hidden] { display: none; }
.lab-progress p, .lab-error p { font-size: 16px; font-weight: 500; max-width: 28em; }
.lab-progress progress { width: min(320px, 70%); height: 8px; accent-color: var(--a-ink); }
.lab-start .lab-fine { margin-top: 4px; }
.lab-start-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lab-alt { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; color: var(--a-ink-2); text-decoration: underline; text-underline-offset: 3px; }
.lab-alt:hover { color: var(--a-ink); }
.lab-error { gap: 16px; }

.lab-labels { position: absolute; inset: 0; pointer-events: none; }
.lab-labels[hidden] { display: none; }
.lab-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--a-line-strong);
  background: var(--a-surface); color: var(--a-ink); font: 600 14px/1 var(--a-font); cursor: pointer;
  box-shadow: var(--a-shadow-pop); transition: opacity 0.2s;
}
.lab-label b {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--a-ink); color: var(--a-on-ink); font-size: 14px;
}
.lab-label:hover { border-color: var(--a-ink); }
.lab-label:focus-visible, .lab-stage button:focus-visible, .lab-track:focus-visible { outline: 3px solid var(--a-cta); outline-offset: 2px; }
.lab-stage[data-state="focus"] .lab-label { opacity: 0; pointer-events: none; visibility: hidden; }

.lab-panel {
  position: absolute; left: 16px; top: 16px; width: min(380px, calc(100% - 32px)); padding: 16px 18px;
  border-radius: 14px; border: 1px solid var(--a-line-2); background: var(--a-surface); color: var(--a-ink);
  box-shadow: var(--a-shadow-pop);
}
.lab-panel[hidden] { display: none; }
.lab-panel h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.lab-panel p { font-size: 15px; line-height: 1.5; color: var(--a-ink-2); margin-top: 6px; }
.lab-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lab-panel-actions [hidden] { display: none; }

.lab-onboard {
  position: absolute; left: 50%; top: 72px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; background: var(--a-ink); color: var(--a-on-ink);
  font-size: 14px; font-weight: 500; text-align: center; pointer-events: none;
}
.lab-onboard[hidden] { display: none; }

/* station menu: stations grouped by room (scales past the floating labels, which phones do not show) */
.lab-nav { position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 32px); z-index: 2; } /* the menu opens over the panel */
.lab-nav[hidden], .lab-menu[hidden] { display: none; }
.lab-menu-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--a-line-strong); background: var(--a-surface); color: var(--a-ink); font: 600 15px/1 var(--a-font);
  cursor: pointer; box-shadow: var(--a-shadow-pop);
}
.lab-menu-btn svg { width: 20px; height: 20px; }
.lab-nav { display: flex; gap: 8px; align-items: flex-end; } /* menu button + tour button ([hidden] above still wins) */
.lab-tour-btn[aria-pressed="true"] { border-color: var(--a-ink); background: var(--a-l0); }
.lab-menu-btn:hover { border-color: var(--a-ink); }
.lab-room { padding: 4px 8px; border-radius: 999px; background: var(--a-l0); color: var(--a-ink-2); font-size: 13px; font-weight: 500; }
.lab-menu {
  position: absolute; left: 0; bottom: calc(100% + 8px); width: min(320px, calc(100vw - 48px)); max-height: min(440px, 56vh);
  overflow-y: auto; padding: 8px; border-radius: 14px; border: 1px solid var(--a-line-2); background: var(--a-surface);
  color: var(--a-ink); box-shadow: var(--a-shadow-pop); overscroll-behavior: contain;
}
.lab-menu-h { padding: 10px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a-ink-2); }
.lab-menu ul { list-style: none; margin: 0; padding: 0; }
.lab-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0;
  border-radius: 10px; background: transparent; color: var(--a-ink); font: 500 15px/1.25 var(--a-font); text-align: left; cursor: pointer;
}
.lab-menu button b {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--a-l0); color: var(--a-ink); font-size: 13px;
}
.lab-menu button:hover { background: var(--a-l0); }
.lab-menu button[aria-current="true"] { background: var(--a-l0); font-weight: 600; }
.lab-menu button[aria-current="true"] b { background: var(--a-ink); color: var(--a-on-ink); }
.lab-menu button:focus-visible { outline: 3px solid var(--a-cta); outline-offset: -3px; }

/* room switch: always-visible pill, top-right of the stage (same family as .lab-menu-btn) */
.lab-goroom {
  position: absolute; right: 16px; top: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--a-line-strong); background: var(--a-surface);
  color: var(--a-ink); font: 600 15px/1 var(--a-font); cursor: pointer; box-shadow: var(--a-shadow-pop);
}
.lab-goroom[hidden], .lab-goroom-s { display: none; }
.lab-goroom svg { width: 20px; height: 20px; flex: none; }
.lab-goroom:hover { border-color: var(--a-ink); }
.lab-goroom[aria-disabled="true"] { opacity: 0.6; cursor: progress; }

/* live screens: the product demo over the projected 3D screen (the scene sets the box and the frame's scale). The frame
   stays invisible until the app says `ready`; the note carries loading and fallback ("Tentar de novo") */
.lab-live { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; visibility: hidden; pointer-events: none; }
.lab-live[hidden], .lab-live-retry[hidden] { display: none; }
.lab-live.is-on { visibility: visible; pointer-events: auto; }
.lab-live-frame { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; visibility: hidden; }
.lab-live[data-live="ready"] .lab-live-frame { visibility: inherit; }
.lab-live-note {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100% - 16px); padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--a-line-2);
  background: var(--a-surface); color: var(--a-ink); box-shadow: var(--a-shadow-pop); font-size: 13px; font-weight: 500; line-height: 1.3;
}
.lab-live[data-live="ready"] .lab-live-note, .lab-live[data-live="idle"] .lab-live-note { display: none; }
.lab-live[data-live="loading"] .lab-live-note { padding-right: 14px; }
.lab-live-retry {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--a-line-strong);
  background: var(--a-surface); color: var(--a-ink); font: 600 13px/1 var(--a-font); cursor: pointer;
}
.lab-live-retry:hover { border-color: var(--a-ink); }
.lab-live-retry:focus-visible { outline: 3px solid var(--a-cta); outline-offset: 2px; }

/* guided tour: the caption box takes the station panel's place; the chip sits over the Retaguarda screen */
.lab-tour {
  position: absolute; left: 16px; top: 16px; width: min(380px, calc(100% - 32px)); padding: 14px 18px 16px;
  border-radius: 14px; border: 1px solid var(--a-line-2); border-left: 4px solid var(--a-sky); background: var(--a-surface);
  color: var(--a-ink); box-shadow: var(--a-shadow-pop); z-index: 1;
}
.lab-tour[hidden], .lab-tour-chip[hidden] { display: none; }
.lab-tour-n { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--a-ink-2); }
.lab-tour-p { font-size: 17px; font-weight: 500; line-height: 1.45; margin-top: 4px; }
.lab-tour .a-btn { margin-top: 12px; height: 44px; padding: 0 16px; font-size: 14px; }
.lab-tour-chip {
  position: absolute; left: 0; top: 0; z-index: 1; max-width: 60%; padding: 10px 16px; border-radius: 999px;
  background: var(--a-ink); color: var(--a-on-ink); font-size: 15px; font-weight: 600; text-align: center;
  box-shadow: var(--a-shadow-pop); pointer-events: none;
}

/* equipment controls of a live screen (station panel): scale, card terminal, pump, restart */
.lab-equip { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--a-line-2); }
.lab-equip[hidden], .lab-equip-row[hidden], .lab-equip-restart[hidden] { display: none; }
.lab-equip-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.lab-equip-k { font-size: 14px; font-weight: 500; color: var(--a-ink-2); }
.lab-equip-btns { display: inline-flex; gap: 8px; }
.lab-equip .a-btn { height: 44px; padding: 0 14px; font-size: 14px; }
.lab-equip .a-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.lab-equip .a-btn[aria-pressed="true"] { border-color: var(--a-ink); background: var(--a-l0); }
.lab-equip-restart {
  justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--a-ink-2);
  font: 500 14px/1 var(--a-font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.lab-equip-restart:hover { color: var(--a-ink); }

/* fallback: station carousel, same media */
.lab-carousel[hidden] { display: none; }
.lab-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch; border-radius: 16px;
}
.lab-slide {
  flex: 0 0 min(100%, 760px); scroll-snap-align: start; margin: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--a-line-2); background: var(--a-surface); box-shadow: var(--a-shadow);
}
.lab-slide img, .lab-slide video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--a-l0); }
.lab-slide figcaption { padding: 14px 18px 18px; }
.lab-slide h2 { font-size: 20px; font-weight: 600; }
.lab-slide p { font-size: 15px; line-height: 1.5; color: var(--a-ink-2); margin-top: 6px; }
.lab-slide figcaption .lab-slide-live { margin-top: 12px; height: 44px; padding: 0 16px; font-size: 14px; }
.lab-slide-live[aria-busy="true"] { cursor: progress; }
.lab-carousel-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-size: 15px; color: var(--a-ink-2); }

/* carousel live overlay: the product demo fullscreen under a top bar (name, equipment, Fechar). Below the cookie banner
   (z-index 60), which must stay reachable from the consent hint; above the header (40) and the sticky bar (50) */
.lab-cl-open, .lab-cl-open body { overflow: hidden; }
.lab-cl { position: fixed; inset: 0; z-index: 59; display: flex; flex-direction: column; background: var(--a-l0); }
.lab-cl[hidden] { display: none; }
.lab-cl-bar {
  display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 8px 12px;
  background: var(--a-surface); color: var(--a-ink); border-bottom: 1px solid var(--a-line-2); max-height: 55vh; overflow-y: auto;
}
.lab-cl-bar h2 { font-size: 18px; font-weight: 600; }
.lab-cl-bar .p-btn-ink { height: 44px; padding: 0 16px; }
.lab-cl-bar .lab-equip { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; gap: 6px; }
.lab-cl-screen { position: relative; flex: 1; min-height: 0; }
.lab-cl .lab-live { inset: 0; }
.lab-cl .lab-live-frame { width: 100%; height: 100%; }
.lab-cl .lab-live-note { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.lab-cl-consent {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(28em, calc(100% - 32px));
  padding: 16px 18px; border-radius: 14px; background: var(--a-surface); border: 1px solid var(--a-line-2);
  color: var(--a-ink); font-size: 16px; line-height: 1.5; text-align: center; box-shadow: var(--a-shadow-pop);
}
.lab-cl-consent[hidden] { display: none; }

/* WhatsApp CTA card: after a live sale or fuelling, and at the end of the tour. Above the phone live overlay (61/62) */
.lab-cta {
  position: fixed; right: 16px; bottom: 16px; z-index: 63; display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; width: min(320px, calc(100vw - 32px)); padding: 18px 48px 18px 18px; border-radius: 16px;
  border: 1px solid var(--a-line-2); border-top: 4px solid var(--a-sky); background: var(--a-surface); color: var(--a-ink);
  box-shadow: var(--a-shadow-lg);
}
.lab-cta[hidden] { display: none; }
.lab-cta-h { font-size: 18px; font-weight: 600; }
.lab-cta .a-btn { height: 44px; padding: 0 18px; }
.lab-cta-x {
  position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border: 0; border-radius: 999px; background: none;
  color: var(--a-ink-2); font: 400 24px/1 var(--a-font); cursor: pointer;
}
.lab-cta-x:hover { color: var(--a-ink); background: var(--a-l0); }
.lab-cta-x:focus-visible, .lab-cl button:focus-visible, .lab-slide-live:focus-visible { outline: 3px solid var(--a-cta); outline-offset: 2px; }

@media (max-width: 1100px) {
  .lab-label span { display: none; }
  .lab-label { padding: 0 6px; }
}
@media (max-width: 720px) {
  .lab-labels { display: none; }
  .lab-nav { left: 8px; bottom: 8px; max-width: calc(100% - 16px); }
  .lab-menu { max-height: 340px; }
  .lab { padding: 28px 0 40px; }
  .lab .a-h1 { font-size: 32px; }
  .lab-stage { aspect-ratio: 4 / 5; max-height: none; }
  .lab-label { padding: 0 6px; }
  .lab-label span { display: none; }
  .lab-panel, .lab-tour { left: 8px; right: 8px; top: 8px; width: auto; padding: 12px 14px; }
  .lab-tour-p { font-size: 15px; }
  .lab-tour .a-btn { margin-top: 8px; }
  .lab-tour-btn span { display: none; } /* icon only next to "Equipamentos" on phones */
  .lab-tour-btn { padding: 0 12px; }
  .lab-start-btns .a-btn { width: 100%; }
  .lab-cta { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .lab-panel h2 { font-size: 18px; }
  .lab-panel p { font-size: 14px; }
  .lab-panel-actions { margin-top: 10px; }
  .lab-onboard { border-radius: 14px; }
  .lab-goroom { right: 8px; top: 8px; }
  /* the station panel spans the stage top on phones: the pill moves bottom-right, icon + room name */
  .lab-stage[data-state="focus"] .lab-goroom { top: auto; bottom: 8px; }
  .lab-stage[data-state="focus"] .lab-goroom-l { display: none; }
  .lab-stage[data-state="focus"] .lab-goroom-s { display: inline; }
  /* a live screen opens fullscreen (R5): the station panel is the top bar (name, equipment, Voltar), the app fills the
     rest at the phone's own width (no scaling). The page does not scroll behind it */
  .lab-live-open, .lab-live-open body { overflow: hidden; }
  .lab-live[data-full] {
    position: fixed; left: 0; right: 0; bottom: 0; top: var(--lab-live-top, 0px); width: auto; height: auto; z-index: 61;
    background: var(--a-l0);
  }
  .lab-live[data-full] .lab-live-frame { width: 100%; height: 100%; }
  .lab-live[data-full] .lab-live-note { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
  .lab-live-open .lab-panel {
    position: fixed; left: 0; right: 0; top: 0; z-index: 62; max-height: 55vh; overflow-y: auto;
    border-radius: 0; border-width: 0 0 1px; box-shadow: none;
  }
  .lab-live-open #lab-panel-p { display: none; }
  /* compact top bar: name and Voltar on one row, the equipment under them */
  .lab-live-open .lab-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 8px 12px; }
  .lab-live-open .lab-panel-actions { grid-row: 1; grid-column: 2; margin-top: 0; }
  .lab-live-open .lab-panel-actions .a-btn { height: 44px; padding: 0 16px; }
  .lab-live-open .lab-equip { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-label { transition: none; }
  .lab-track { scroll-behavior: auto; }
}
