/* Factory site chrome — scroll-to-top + sticky helpers (vertical covers) */
.back-to-top,
a.back-to-top,
#factory-back-to-top {
  position: fixed !important;
  left: auto !important;
  right: 1.25rem !important;
  bottom: 1.35rem !important;
  top: auto !important;
  z-index: 2147483000;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 !important;
  border: 0;
  border-radius: 999px;
  background: var(--primary, #4787e1);
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease,
    background-color 0.2s ease;
}
.back-to-top.show,
.back-to-top.is-visible,
a.back-to-top.show,
#factory-back-to-top.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover,
.back-to-top:focus-visible {
  color: #fff !important;
  background: var(--primary-dark, #254a7e);
  outline: 2px solid var(--primary-dark, #254a7e);
  outline-offset: 2px;
}
.back-to-top svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
}
#button.back-to-top,
a#button.show {
}

/*
  Mobile / small screens:
  Copyright stays full-width & centered.
  Extra footer padding-bottom reserves space so LiveChat (left) +
  back-to-top (right) sit BELOW the copyright text (not over it).
*/
@media (max-width: 768px) {
  .back-to-top,
  a.back-to-top,
  #factory-back-to-top {
    right: 0.85rem !important;
    bottom: 1.15rem !important;
    width: 2.75rem;
    height: 2.75rem;
  }

  .site-footer__copy,
  .footer-superchat .site-footer__copy {
    padding: 1rem 1.25rem 5.75rem !important;
  }

  .site-footer__copy .container,
  .site-footer__copy p {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Keep LiveChat bubble in the reserved strip below copyright */
  #chat-widget-container,
  #chat-widget-minimized,
  div[id^="chat-widget"] {
    bottom: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  .back-to-top,
  a.back-to-top,
  #factory-back-to-top {
    right: 0.75rem !important;
    bottom: 1rem !important;
  }

  .site-footer__copy,
  .footer-superchat .site-footer__copy {
    padding: 1rem 1rem 6rem !important;
  }
}
