/*
 * COMMAND 3100_075D — Sticky CTA collision + usability clearance
 * Visual freeze: no redesign. Load LAST after 075b.
 */

:root {
  --cw-sticky-bar-height: 0px;
  --cw-sticky-clearance: 16px;
}

@media (max-width: 768px) {
  body.cw-r2 {
    padding-bottom: var(--cw-sticky-bar-height) !important;
    scroll-padding-bottom: var(--cw-sticky-bar-height);
  }

  /* Body class driven by script — deterministic sticky height */
  body.cw-r2.cw-sticky-cta-on {
    --cw-sticky-bar-height: var(--cw-sticky-bar-height-measured, 72px);
  }

  body.cw-r2:not(.cw-sticky-cta-on) {
    --cw-sticky-bar-height: 0px;
  }

  body.cw-r2 .cw-mobile-sticky-cta {
    transition: transform 0.18s ease, opacity 0.18s ease;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  body.cw-r2 .cw-mobile-sticky-cta.is-gated:not(.is-past-hero),
  body.cw-r2.cw-sticky-cta-suppressed .cw-mobile-sticky-cta {
    transform: translateY(110%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.cw-r2.cw-sticky-cta-on .cw-mobile-sticky-cta.is-gated.is-past-hero {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Contact dock: always clear sticky by measured height + gap */
  body.cw-r2 .contact-widget-container,
  body.cw-r2 .contact-widget-container.cw-g-dock,
  body.cw-r2 .cw-g-dock.contact-widget-container {
    bottom: calc(var(--cw-sticky-bar-height) + var(--cw-sticky-clearance) + env(safe-area-inset-bottom, 0px)) !important;
    right: 0.75rem !important;
  }

  body.cw-r2:not(.cw-sticky-cta-on) .contact-widget-container,
  body.cw-r2:not(.cw-sticky-cta-on) .contact-widget-container.cw-g-dock {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* When contact modal open — suppress sticky, dock returns to base */
  body.cw-r2.cw-contact-open .cw-mobile-sticky-cta {
    transform: translateY(110%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.cw-r2.cw-contact-open {
    --cw-sticky-bar-height: 0px;
  }

  body.cw-r2.cw-contact-open .contact-widget-container,
  body.cw-r2.cw-contact-open .contact-widget-container.cw-g-dock {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 899px) {
  body.cw-r2.cw-product-detail:has(.pd-sticky-cta.is-active) {
    --cw-pd-sticky-bar-height: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  body.cw-r2.cw-product-detail:has(.pd-sticky-cta.is-active) .pd-wrap {
    padding-bottom: calc(var(--cw-pd-sticky-bar-height, 64px) + 24px) !important;
  }

  body.cw-r2.cw-product-detail:has(.pd-sticky-cta.is-active) .contact-widget-container {
    bottom: calc(var(--cw-pd-sticky-bar-height, 64px) + 16px) !important;
  }
}
