.mv-back-to-top {
  --mv-back-to-top-bottom: 24px;
  position: fixed;
  inset-inline-end: max(24px, env(safe-area-inset-right, 0px));
  inset-block-end: max(
    calc(var(--mv-back-to-top-bottom) + env(safe-area-inset-bottom, 0px)),
    var(--mv-back-to-top-cookie-offset, 0px)
  );
  z-index: 500;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 17px;
  cursor: pointer;
}

.mv-back-to-top[hidden],
.mv-quick-embedded .mv-back-to-top,
.menu-open .mv-back-to-top--storefront,
.filters-open .mv-back-to-top--storefront,
.header-search-open .mv-back-to-top--storefront {
  display: none;
}

.mv-back-to-top:focus-visible {
  outline: 2px solid var(--red, #1e91cf);
  outline-offset: 3px;
}

.mv-back-to-top--storefront {
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--warm);
}

.mv-back-to-top--storefront:is(:hover, :focus-visible) {
  border-color: var(--red);
  background: var(--red);
}

.mv-back-to-top--storefront svg {
  width: 22px;
  height: 22px;
  transform: rotate(-90deg);
}

@media (max-width: 760px) {
  .mv-back-to-top {
    --mv-back-to-top-bottom: 16px;
    inset-inline-end: max(12px, env(safe-area-inset-right, 0px));
  }

  .mv-back-to-top--storefront { --mv-back-to-top-bottom: 76px; }
  .route-product-product .mv-back-to-top--storefront { --mv-back-to-top-bottom: 16px; }
}
